Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

STR-936: Support Addresses and OP_RETURNs as withdrawal destinations #600

Merged
merged 37 commits into from
Jan 28, 2025

Conversation

storopoli
Copy link
Member

@storopoli storopoli commented Jan 8, 2025

Description

Right now the bridge supports withdraws only to P2TR. The user passes an X-only PK to the bridge withdrawal precompile address.

However we need to support any arbitrary address, along with OP_RETURNs as valid withdrawal destinations.

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature/Enhancement (non-breaking change which adds functionality or enhances an existing one)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update
  • Refactor
  • New or updated tests
  • Dependency Update

Notes to Reviewers

We are not thoroughly testing that the OP_RETURN payload is actually being published on-chain (bitcoin). See https://alpenlabs.atlassian.net/browse/STR-919 for context. But the withdraw would fail otherwise, so it's tested-ish.

Checklist

  • I have performed a self-review of my code.
  • I have commented my code where necessary.
  • I have updated the documentation if needed.
  • My changes do not introduce new warnings.
  • I have added tests that prove my changes are effective or that my feature works.
  • New and existing tests pass with my changes.

Related Issues

STR-936

Copy link

codecov bot commented Jan 8, 2025

Codecov Report

Attention: Patch coverage is 63.23529% with 75 lines in your changes missing coverage. Please review.

Project coverage is 55.91%. Comparing base (bae4d8d) to head (b3d5f6b).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
crates/util/python-utils/src/utils.rs 59.32% 24 Missing ⚠️
crates/util/python-utils/src/error.rs 0.00% 12 Missing ⚠️
crates/primitives/src/l1/btc.rs 67.74% 10 Missing ⚠️
crates/state/src/bridge_ops.rs 0.00% 6 Missing ⚠️
bin/strata-cli/src/cmd/withdraw.rs 0.00% 5 Missing ⚠️
crates/util/python-utils/src/lib.rs 0.00% 5 Missing ⚠️
bin/strata-client/src/rpc_server.rs 0.00% 3 Missing ⚠️
crates/reth/evm/src/precompiles/bridge.rs 80.00% 3 Missing ⚠️
crates/bridge-tx-builder/src/withdrawal.rs 93.75% 2 Missing ⚠️
crates/evmexec/src/engine.rs 0.00% 2 Missing ⚠️
... and 2 more
@@            Coverage Diff             @@
##             main     #600      +/-   ##
==========================================
- Coverage   55.97%   55.91%   -0.07%     
==========================================
  Files         315      316       +1     
  Lines       33428    33534     +106     
==========================================
+ Hits        18712    18751      +39     
- Misses      14716    14783      +67     
Files with missing lines Coverage Δ
bin/strata-client/src/extractor.rs 94.70% <100.00%> (+0.13%) ⬆️
crates/eectl/src/messages.rs 62.74% <ø> (ø)
crates/proof-impl/evm-ee-stf/src/lib.rs 98.79% <100.00%> (ø)
crates/reth/evm/src/utils.rs 88.46% <100.00%> (+2.09%) ⬆️
crates/state/src/bridge_state.rs 56.96% <100.00%> (ø)
crates/test-utils/src/lib.rs 87.50% <ø> (ø)
crates/chaintsn/src/transition.rs 82.86% <0.00%> (ø)
crates/bridge-tx-builder/src/withdrawal.rs 89.25% <93.75%> (-0.16%) ⬇️
crates/evmexec/src/engine.rs 66.31% <0.00%> (ø)
crates/proof-impl/evm-ee-stf/src/utils.rs 67.44% <0.00%> (-1.61%) ⬇️
... and 8 more

... and 7 files with indirect coverage changes

Copy link
Contributor

github-actions bot commented Jan 8, 2025

Commit: 12d5b59

SP1 Performance Test Results

program cycles success
BTC_BLOCKSPACE 30,357,421
EL_BLOCK 101,655
CL_BLOCK 57,537
L1_BATCH 30,387,328
L2_BATCH 5,473
CHECKPOINT 15,895

@storopoli storopoli force-pushed the STR-754 branch 2 times, most recently from a9e7fce to 5471b8f Compare January 13, 2025 16:15
delbonis

This comment was marked as resolved.

@storopoli storopoli force-pushed the STR-754 branch 9 times, most recently from 111d0ee to 03309d9 Compare January 15, 2025 20:13
@storopoli

This comment was marked as resolved.

@storopoli storopoli force-pushed the STR-754 branch 5 times, most recently from 07e9af6 to 2590cd7 Compare January 17, 2025 15:24
@storopoli storopoli requested a review from delbonis January 17, 2025 15:58
@storopoli storopoli marked this pull request as ready for review January 17, 2025 15:58
@storopoli storopoli requested review from a team as code owners January 17, 2025 15:59
@storopoli storopoli merged commit 0a0aabe into main Jan 28, 2025
19 checks passed
@storopoli storopoli deleted the STR-754 branch January 28, 2025 18:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants