Skip to content

build: update rust-dashcore crates to v0.42-dev (542a617) #3104

Merged
lklimek merged 10 commits into
v3.1-devfrom
chore/update-rust-dashcore-v042-dev
Feb 20, 2026
Merged

build: update rust-dashcore crates to v0.42-dev (542a617) #3104
lklimek merged 10 commits into
v3.1-devfrom
chore/update-rust-dashcore-v042-dev

Conversation

@lklimek

@lklimek lklimek commented Feb 18, 2026

Copy link
Copy Markdown
Contributor

Issue being fixed or feature implemented

Update all rust-dashcore workspace dependency crates to the latest v0.42-dev commit (542a617843d1689217e386a678945caf461665c4).

What was done?

  • Updated rev for all 6 workspace rust-dashcore dependencies (dashcore, dash-spv, dash-spv-ffi, key-wallet, key-wallet-manager, dashcore-rpc) from 53d699c to 542a617, bumping 11 transitive crates from v0.41.0 to v0.42.0
  • Adapted rs-platform-wallet to upstream API changes:
    • WalletBalanceWalletCoreBalance
    • check_transactioncheck_core_transaction in WalletTransactionChecker
    • immature_transactions() now returns Vec<Transaction> (removed ImmatureTransactionCollection)
    • Removed update_chain_height, add_immature_transaction, immature_balance, process_matured_transactions from WalletInfoInterface
    • Added synced_height and update_synced_height to WalletInfoInterface
  • Inlined extract_pubkey_hash and outpoint_to_bytes in rs-dapi bloom module after dash_spv::bloom was removed upstream

How Has This Been Tested?

  • cargo check --workspace passes successfully
  • cargo fmt --all applied

Breaking Changes

None — all changes are internal adaptations to upstream API changes.

Checklist:

  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have added or updated relevant unit/integration/functional/e2e tests
  • I have added "!" to the title and described breaking changes in the corresponding section if my code contains any
  • I have made corresponding changes to the documentation if needed

Summary by CodeRabbit

  • Refactor

    • Wallet interfaces redesigned: transaction-checking, balance, immature-transaction and sync-related APIs updated to new core types and clearer synchronization flow.
    • Bloom-filter matching adjusted for more consistent transaction/UTXO detection.
  • Chores

    • Updated several workspace dependencies to newer revisions.
  • Tests

    • Updated tests to align with internal representation changes.

Update all 6 workspace dependency entries from rust-dashcore to the
latest v0.42-dev commit (542a617843d1689217e386a678945caf461665c4),
bumping 11 transitive crates from v0.41.0 to v0.42.0.

Breaking changes addressed:
- WalletBalance renamed to WalletCoreBalance
- check_transaction renamed to check_core_transaction
- ImmatureTransactionCollection removed; immature_transactions() now
  returns Vec<Transaction>
- update_chain_height/add_immature_transaction/immature_balance/
  process_matured_transactions removed from WalletInfoInterface
- synced_height/update_synced_height added to WalletInfoInterface
- dash_spv::bloom module removed; utility functions inlined in rs-dapi

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Feb 18, 2026

Copy link
Copy Markdown
Contributor

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

Updated workspace git revisions for several dash crates; replaced external bloom utilities with internal script/outpoint handling in the DAPI streaming service; refactored platform-wallet public API, renaming transaction-check methods and changing balance, immature-transaction, and sync-height accessors.

Changes

Cohort / File(s) Summary
Dependency Updates
Cargo.toml
Updated git revisions for dashcore, dash-spv, dash-spv-ffi, key-wallet, key-wallet-manager, and dashcore-rpc to a05d256f59743c69df912462dd77dd487e1ff5b2. No other manifest edits.
Bloom filter / streaming service
packages/rs-dapi/src/services/streaming_service/bloom.rs
Removed imports of dash_spv::bloom::utils::{extract_pubkey_hash, outpoint_to_bytes}; switched to script.as_script().p2pkh_public_key_hash_bytes() / is_p2pkh() and OutPoint.into() for outpoint bytes; renamed txid_to_be_bytestxid_to_internal_bytes and updated matching logic and tests to use internal (non-reversed) txid/outpoint representations.
Platform wallet public API
packages/rs-platform-wallet/src/lib.rs
Renamed check_transaction(...)check_core_transaction(...) and updated delegation; balance() now returns WalletCoreBalance; immature_transactions() now returns Vec<Transaction>; update_chain_height(...) replaced by synced_height() -> CoreBlockHeight and update_synced_height(...) added; removed add_immature_transaction and immature_balance(); implementations adjusted to match new signatures and types.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Poem

🐇 I hopped through revisions, teeth on tidy trees,
Swapped out old petals for internal keys,
Wallet names wiggled, heights learned to align,
Bloom checks now nibble bytes in straight line,
A rabbit applauds these changes, neat and fine.

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 31.58% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main change: updating rust-dashcore crates to a new version. It directly relates to the primary objective of bumping dependency versions from v0.41.0 to v0.42.0.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch chore/update-rust-dashcore-v042-dev

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@lklimek lklimek changed the title deps: update rust-dashcore crates to v0.42-dev (542a617) build: update rust-dashcore crates to v0.42-dev (542a617) Feb 18, 2026

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🧹 Nitpick comments (2)
packages/rs-dapi/src/services/streaming_service/bloom.rs (2)

7-23: Consider named constants for P2PKH opcode bytes.

The raw byte literals are correct but opaque; replacing them with constants improves readability and signals intent to future readers.

♻️ Proposed refactor
+const OP_DUP: u8          = 0x76;
+const OP_HASH160: u8      = 0xa9;
+const OP_PUSH_20: u8      = 0x14; // push 20 bytes
+const OP_EQUALVERIFY: u8  = 0x88;
+const OP_CHECKSIG: u8     = 0xac;

 fn extract_pubkey_hash(script: &Script) -> Option<Vec<u8>> {
     let bytes = script.as_bytes();
     // P2PKH: OP_DUP OP_HASH160 <20 bytes> OP_EQUALVERIFY OP_CHECKSIG
     if bytes.len() == 25
-        && bytes[0] == 0x76  // OP_DUP
-        && bytes[1] == 0xa9  // OP_HASH160
-        && bytes[2] == 0x14  // Push 20 bytes
-        && bytes[23] == 0x88 // OP_EQUALVERIFY
-        && bytes[24] == 0xac
+        && bytes[0] == OP_DUP
+        && bytes[1] == OP_HASH160
+        && bytes[2] == OP_PUSH_20
+        && bytes[23] == OP_EQUALVERIFY
+        && bytes[24] == OP_CHECKSIG
     {
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@packages/rs-dapi/src/services/streaming_service/bloom.rs` around lines 7 -
23, Replace the opaque raw byte literals in extract_pubkey_hash with named u8
constants (e.g., OP_DUP, OP_HASH160, OP_EQUALVERIFY, OP_CHECKSIG, PUSH20)
declared at module scope and use those constants in the bytes[] comparisons
inside extract_pubkey_hash to make intent clear; define the constants near the
top of the file (or reuse existing opcode definitions if available) and update
the comment to reference the named constants instead of raw hex values.

25-31: Prefer .to_byte_array() over [..] indexing for stylistic consistency.

txid_to_be_bytes (line 51) uses txid.to_byte_array(). Using the same idiom in outpoint_to_bytes keeps both helpers uniform; both expressions produce identical internal-LE bytes so there is no behavioral difference.

♻️ Proposed refactor
 fn outpoint_to_bytes(outpoint: &OutPoint) -> Vec<u8> {
     let mut bytes = Vec::with_capacity(36);
-    bytes.extend_from_slice(&outpoint.txid[..]);
+    bytes.extend_from_slice(&outpoint.txid.to_byte_array());
     bytes.extend_from_slice(&outpoint.vout.to_le_bytes());
     bytes
 }
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@packages/rs-dapi/src/services/streaming_service/bloom.rs` around lines 25 -
31, The outpoint_to_bytes helper uses &outpoint.txid[..] while txid_to_be_bytes
uses txid.to_byte_array(); change outpoint_to_bytes to call
outpoint.txid.to_byte_array() and extend_from_slice with that result to keep
style consistent (still reserve capacity 36 and extend vout.to_le_bytes() as
before), i.e., replace the slice indexing with a call to to_byte_array() inside
outpoint_to_bytes.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@packages/rs-dapi/src/services/streaming_service/bloom.rs`:
- Around line 7-23: Replace the opaque raw byte literals in extract_pubkey_hash
with named u8 constants (e.g., OP_DUP, OP_HASH160, OP_EQUALVERIFY, OP_CHECKSIG,
PUSH20) declared at module scope and use those constants in the bytes[]
comparisons inside extract_pubkey_hash to make intent clear; define the
constants near the top of the file (or reuse existing opcode definitions if
available) and update the comment to reference the named constants instead of
raw hex values.
- Around line 25-31: The outpoint_to_bytes helper uses &outpoint.txid[..] while
txid_to_be_bytes uses txid.to_byte_array(); change outpoint_to_bytes to call
outpoint.txid.to_byte_array() and extend_from_slice with that result to keep
style consistent (still reserve capacity 36 and extend vout.to_le_bytes() as
before), i.e., replace the slice indexing with a call to to_byte_array() inside
outpoint_to_bytes.

…of custom extract_pubkey_hash

Replace hand-rolled `extract_pubkey_hash()` with `Script::p2pkh_public_key_hash_bytes()` and
`Script::is_p2pkh()` from dashcore v0.42. This eliminates code duplication and avoids an
unnecessary Vec allocation (the library method returns `&[u8]`).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@lklimek

lklimek commented Feb 19, 2026

Copy link
Copy Markdown
Contributor Author

Failing Rust security audit test also fails on v3.1-dev

@lklimek

lklimek commented Feb 19, 2026

Copy link
Copy Markdown
Contributor Author

Issues are pre-existing

@lklimek

lklimek commented Feb 19, 2026

Copy link
Copy Markdown
Contributor Author

@copilot update this branch to use rust-dashcore a05d256f59743c69df912462dd77dd487e1ff5b2

Copilot AI commented Feb 19, 2026

Copy link
Copy Markdown
Contributor

@lklimek I've opened a new pull request, #3113, to work on those changes. Once the pull request is ready, I'll request review from you.

use dashcore_rpc::dashcore::{OutPoint, ScriptBuf, Transaction as CoreTx, Txid};

/// Convert outpoint to bytes for bloom filter
fn outpoint_to_bytes(outpoint: &OutPoint) -> Vec<u8> {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

OutPoint doesn't have method to get bytes?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

good point, removed in favor of into()

Copilot AI and others added 2 commits February 19, 2026 16:30
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: lklimek <842586+lklimek@users.noreply.github.com>
…tom outpoint_to_bytes

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@lklimek lklimek requested a review from shumkov February 19, 2026 16:19

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@packages/rs-dapi/src/services/streaming_service/bloom.rs`:
- Around line 75-79: The txid byte-order is reversed incorrectly: update the
txid_to_be_bytes function to return the Txid in internal/wire (consensus) byte
order (i.e., use txid.to_byte_array().to_vec() and remove the arr.reverse()
step) so it matches OutPoint::into::<[u8;36]>() serialization and BIP37
expectations; also rename txid_to_be_bytes to a clearer name like
txid_to_internal_bytes (or txid_to_wire_bytes) and update the related unit test
that expected display/be (hex-reversed) bytes to expect the internal byte order
instead.

Comment thread packages/rs-dapi/src/services/streaming_service/bloom.rs
thepastaclaw and others added 2 commits February 19, 2026 18:18

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Duplicate comments:
In `@packages/rs-dapi/src/services/streaming_service/bloom.rs`:
- Around line 25-27: The txid byte-order bug was fixed by returning the
wire/internal order bytes in txid_to_internal_bytes; ensure the function
txid_to_internal_bytes returns txid.to_byte_array().to_vec() (no reversing) so
it matches BIP37 bloom expectations and OutPoint consensus encoding, and keep
that implementation as-is (add/update unit tests if needed to prevent
regressions).

@lklimek lklimek merged commit af31258 into v3.1-dev Feb 20, 2026
15 of 17 checks passed
@lklimek lklimek deleted the chore/update-rust-dashcore-v042-dev branch February 20, 2026 12:29
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.

5 participants