Repository navigation
fix(dash)!: use Dash Core's compact block inventory type and service flags - #1255
Conversation
|
No actionable comments were generated in the recent review.
|
| Layer / File(s) | Summary |
|---|---|
Service flag definitions and usage dash/src/network/constants.rs, dash/src/network/address.rs, dash/src/network/message.rs, CHANGELOG.md |
ServiceFlags adds P2P_V2 and removes GETUTXO and WITNESS. Formatting and related address and message tests use the updated flags. |
Inventory variants and wire types dash/src/network/message_blockdata.rs, CHANGELOG.md |
CompactBlock uses inventory type 20. The removed witness inventory variants are no longer decoded; types 4, 5, 0x40000001, and 0x40000002 decode as Unknown and re-encode with their original type and hash. |
Estimated code review effort: 2 (Simple) | ~10 minutes
Change: Bug fix
Merge Risk: 
Minimal · up to 43029
-
The protocol changes appear consistent across inventory and service-flag handling. No actionable merge-blocking risk remains after normal checks.
Pre-merge checks: 
4 · 
1
-
Failed checks: 1 warning Passed checks: 4 passed-
Full details: Title check
-
Explanation
The title names the two main changes: Dash Core's compact block inventory type and service flags. The changeset matches this. The compact block inventory type moves from 4 to 20, Bitcoin-only inventory variants are removed, and ServiceFlags drops GETUTXO and WITNESS while adding P2P_V2 at bit 12. The title is specific and accurate. The conventional-commit prefix and the breaking-change marker match the breaking removals of public variants and constants.
-
Full details: Docstring Coverage
-
Explanation
Docstring coverage is 12.50% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 8 functions across 4 files. (1 skipped: 1 unsupported.)
Resolution
Write docstrings for the functions missing them to satisfy the coverage threshold.
-
Finishing Touches
-
Generate unit tests (beta)
-
- Commit to this branch
- Create a new PR
-
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
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.
|
Waiting for bot review — coderabbitai not yet. Wait for the missing reviews, or a writer can post |
|
Bots are done — your move: post |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## dev #1255 +/- ##
=======================================
Coverage 80.56% 80.56%
=======================================
Files 291 291
Lines 77520 77538 +18
=======================================
+ Hits 62454 62469 +15
- Misses 15066 15069 +3
|
|
/self-reviewed |
|
Ready for review — files with no dedicated owner: QuantumExplorer or ZocoLini or xdustinface. |
|
This PR has merge conflicts with the base branch. Please rebase or merge the base branch into your branch to resolve them. |
12f2b7f to
71dcd81
Compare
|
Waiting for bot review — coderabbitai not yet. Wait for the missing reviews, or a writer can post |
|
/self-reviewed |
|
This PR has merge conflicts with the base branch. Please rebase or merge the base branch into your branch to resolve them. |
|
Ready for review — files with no dedicated owner: QuantumExplorer or ZocoLini or xdustinface. |
…flags Inventory::CompactBlock went on the wire as Bitcoin's type 4; Dash Core's MSG_CMPCT_BLOCK is 20. Drop the inventory types and service flags Dash Core doesn't define (wtxid, BIP144 witness types, GETUTXO, WITNESS) and add NODE_P2P_V2 (bit 12). Co-Authored-By: Claude Opus 5.5 <[email protected]>
71dcd81 to
430298d
Compare
|
Waiting for bot review — coderabbitai not yet. Wait for the missing reviews, or a writer can post |
|
@coderabbitai review 🤖 Posted autonomously by Claude on behalf of pasta. |
Action performed
|
|
Bots are done — your move: post |
|
/self-reviewed |
|
Ready for review — files with no dedicated owner: QuantumExplorer or ZocoLini or xdustinface. |
Inventory::CompactBlockgoes on the wire as type 4, Bitcoin'sMSG_CMPCT_BLOCK. Dash Core's is 20 (src/protocol.h,GetDataMsg), and 4 is a retired type Dash Core skips, so agetdatafor a compact block built with this crate asks for nothing, and a real one from a Dash peer decodes asUnknown { inv_type: 20 }.ServiceFlagshas the same Bitcoin leftovers in the other direction: it namesGETUTXO(bit 1) andWITNESS(bit 3), which Dash Core doesn't define, and it has no constant for Dash Core'sNODE_P2P_V2(bit 12, the BIP324 transport), which peers advertise.This PR uses Dash Core's numbers:
Inventory::CompactBlockencodes and decodes as 20.Inventory::WTx,WitnessTransactionandWitnessBlockare removed, because Dash has no BIP144 or BIP339. Types 4, 5,0x40000001and0x40000002decode asInventory::Unknownand re-encode unchanged.ServiceFlags::GETUTXOandServiceFlags::WITNESSare removed andServiceFlags::P2P_V2(bit 12) is added, including inDisplay.The service flags now match Dash Core's
ServiceFlagsfrom v22.0.0 through v24, and every inventory number the crate encodes is the one in Dash Core'sGetDataMsg(types the crate has no variant for, such as sporks or governance objects, still decode asUnknown). Breaking, because public variants and constants go away.Testing: new tests cover type 20 round-tripping and the non-Dash numbers decoding as unknown, and
P2P_V2and the dropped bits rendering. They fail ondevand pass here. Existing tests that usedWITNESSkeep the same bit throughServiceFlags::from(1 << 3)where they decode real bytes.cargo test -p dashcore,cargo clippy --workspace --all-features --all-targets -- -D warningsandcargo fmt --checkpass.🤖 Generated with Claude Code
PR Hygiene ·
430298dCHANGELOG.md,dash/src/network/address.rs,dash/src/network/constants.rsand 2 more) — QuantumExplorer or ZocoLini or xdustinfaceWhen every merge requirement is met, the
PR Hygienecheck passes. Reviewer limits do not block merging; other required GitHub checks and protections still apply.Summary by CodeRabbit
GETUTXOandWITNESSservice flags are no longer supported. Inventory types 4, 5,0x40000001, and0x40000002are treated as unknown, with their original type and hash preserved when re-encoded.