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-953: btcio backport (and some new) strata-bridge RPCs #616

Merged
merged 12 commits into from
Jan 23, 2025
Merged

Conversation

storopoli
Copy link
Member

@storopoli storopoli commented Jan 17, 2025

Description

Backports strata-bridge::btcio RPCs to strata::btcio.
Needed to remove strata-bridge's btcio and use the strata::btcio instead.

  • get_current_timestamp
  • test_mempool_accept
  • get_tx_out
  • submit_package

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

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-953

@storopoli storopoli requested a review from a team as a code owner January 17, 2025 17:52
@storopoli storopoli requested a review from Rajil1213 January 17, 2025 17:54
@storopoli
Copy link
Member Author

storopoli commented Jan 17, 2025

@Rajil1213 these are the only ones missing here apart from the superblocks that we're not backporting.

@storopoli storopoli changed the title feat(btcio): backport strata-bridge RPCs STR 876: backport strata-bridge RPCs Jan 17, 2025
@storopoli storopoli changed the title STR 876: backport strata-bridge RPCs STR 876: btcio backport strata-bridge RPCs Jan 17, 2025
Copy link
Contributor

github-actions bot commented Jan 17, 2025

Commit: 87297c0

SP1 Performance Test Results

program cycles success
BTC_BLOCKSPACE 30,357,421
EL_BLOCK 98,789
CL_BLOCK 57,378
L1_BATCH 30,387,324
L2_BATCH 5,473
CHECKPOINT 15,895

Copy link

codecov bot commented Jan 17, 2025

Codecov Report

Attention: Patch coverage is 69.46779% with 109 lines in your changes missing coverage. Please review.

Project coverage is 56.50%. Comparing base (78aa39f) to head (198ba41).
Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
crates/btcio/src/rpc/client.rs 81.81% 52 Missing ⚠️
crates/btcio/src/test_utils.rs 0.00% 51 Missing ⚠️
crates/btcio/src/rpc/types.rs 68.42% 6 Missing ⚠️
@@            Coverage Diff             @@
##             main     #616      +/-   ##
==========================================
+ Coverage   56.37%   56.50%   +0.12%     
==========================================
  Files         316      316              
  Lines       32754    33106     +352     
==========================================
+ Hits        18466    18705     +239     
- Misses      14288    14401     +113     
Files with missing lines Coverage Δ
crates/btcio/src/writer/signer.rs 100.00% <100.00%> (ø)
crates/btcio/src/rpc/types.rs 51.49% <68.42%> (+2.17%) ⬆️
crates/btcio/src/test_utils.rs 56.27% <0.00%> (-14.65%) ⬇️
crates/btcio/src/rpc/client.rs 85.53% <81.81%> (-2.66%) ⬇️

... and 2 files with indirect coverage changes

delbonis
delbonis previously approved these changes Jan 17, 2025
Copy link
Contributor

@Rajil1213 Rajil1213 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. But since we're at it, we might want to add a few more RPCs that are relevant to the bridge for the Testnet I impl:

  • submit_package (for CPFP in core 28.0)
  • gettxout(to check if a particular utxo exists)

This is not too urgent at the moment though so feel free to create separate tickets for these if there are other tasks of higher priority that you might want to be doing instead.

bewakes
bewakes previously approved these changes Jan 21, 2025
@storopoli
Copy link
Member Author

storopoli commented Jan 21, 2025

@bibek thanks for the review. I also added the submit_package RPC.

EDIT: this PR is really easy to review if you check the commits, they do follow a very a good logic and are atomic in a sense.

@storopoli storopoli requested review from bewakes and delbonis January 21, 2025 14:47
@storopoli storopoli changed the title STR 876: btcio backport strata-bridge RPCs STR 876: btcio backport (and some new) strata-bridge RPCs Jan 21, 2025
Copy link
Contributor

@bewakes bewakes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, minor query. And a very nice commit history indeed !

crates/btcio/src/rpc/types.rs Outdated Show resolved Hide resolved
@storopoli storopoli requested a review from bewakes January 21, 2025 18:00
bewakes
bewakes previously approved these changes Jan 21, 2025
@storopoli storopoli enabled auto-merge January 21, 2025 18:03
Copy link
Contributor

@Rajil1213 Rajil1213 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work! Requesting a few additional test cases though.

crates/btcio/src/rpc/client.rs Outdated Show resolved Hide resolved
crates/btcio/src/rpc/client.rs Outdated Show resolved Hide resolved
delbonis
delbonis previously approved these changes Jan 21, 2025
crates/btcio/src/rpc/client.rs Outdated Show resolved Hide resolved
@john-light john-light changed the title STR 876: btcio backport (and some new) strata-bridge RPCs STR-953: btcio backport (and some new) strata-bridge RPCs Jan 22, 2025
@storopoli storopoli disabled auto-merge January 22, 2025 19:10
@storopoli
Copy link
Member Author

@bewakes and @delbonis just look at the last two commits.
These changes were needed to support One Parent One Child Relay (1P1C), see the first example in https://bitcoinops.org/en/bitcoin-core-28-wallet-integration-guide/

@storopoli storopoli enabled auto-merge January 22, 2025 19:11
@storopoli storopoli added this pull request to the merge queue Jan 23, 2025
Merged via the queue into main with commit 906ed23 Jan 23, 2025
18 checks passed
@storopoli storopoli deleted the STR-896 branch January 23, 2025 11:15
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