Repository navigation
feat(dash)!: decode unknown special transaction types as raw payloads - #1136
Conversation
A transaction whose special type this crate does not know failed to decode with `UnknownSpecialTransactionType`, which failed the whole block. Such transactions now decode as `TransactionType::Unknown` with a raw `TransactionPayload::UnknownPayloadType`, read through the payload length prefix and written back verbatim, so they re-encode to the same bytes and txid. Unknown types are treated as non-segwit like the other special types, and the key-wallet router classifies them by shape like a classic transaction, so they are checked across every fund-bearing account. The router now matches on `tx.tx_type()` instead of the payload variant. Closes #1130 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configuration
📒 Files selected for processing (4)
Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review. 📝 WalkthroughWalkthroughUnknown special transaction types now retain their raw type and payload through encoding and decoding. Transactions with unknown types use non-SegWit framing. The wallet transaction router classifies unknown types by transaction shape. ChangesUnknown transaction support
Priority: ➖ Normal Estimated code review effort: 3 (Moderate) | ~20 minutes Change: Bug fix · Severity of issue fixed: Medium Merge Risk: ⚪ Minimal · up to No actionable issue was established in the reviewed unknown-transaction codec, wire framing, or wallet classification changes; no identified risk blocks merging. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 Generate unit tests (beta)
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. Comment |
|
Bots are done — your move: post |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## dev #1136 +/- ##
==========================================
+ Coverage 77.92% 78.09% +0.16%
==========================================
Files 302 302
Lines 79108 79315 +207
==========================================
+ Hits 61644 61938 +294
+ Misses 17464 17377 -87
|
|
Two test issues before this can merge:
|
The test only round-tripped the transaction, which also passes with the BIP144 marker the encoder and decoder agree on. Assert that the output value follows the counts directly and that the length matches `size()`. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Type 10 is ProDisTx in Core develop, so the tests would stop exercising the unknown-type path once types 10-12 are parsed. Use `0xffff` through a shared `UNASSIGNED_SPECIAL_TX_TYPE` test constant and drop the TODO about a real ProDisTx vector. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Done |
|
Waiting for bot review — coderabbitai not yet. Wait for the missing reviews, or a writer can post |
|
Bots are done — your move: post |
Closes #1130. Part of #1047.
A transaction with a special type we don't know failed to decode (
UnknownSpecialTransactionType), and with it the whole block, so a new Core tx type would stall SPV sync andget_blockconsumers.Changes
TransactionType::Unknown(u16)andTransactionPayload::UnknownPayloadType(u16, Vec<u8>): the payload is read through its length prefix and written back verbatim, so the tx re-encodes to the same bytes and txid.tx.tx_type()instead of the payload variant (same result). Unknown types are classified by shape like classic txs, so every fund-bearing account is checked.Breaking: new enum variants on public, exhaustive enums.
Out of scope
Testing
cargo test -p dashcore -p key-wallet,cargo test -p dash-spvwith dashd integration tests, clippy-D warnings.🤖 Generated with Claude Code
Summary by CodeRabbit
PR Hygiene ·
249ef12/self-revieweddash/src/blockdata/transaction/mod.rs,dash/src/blockdata/transaction/special_transaction/mod.rs,dash/src/test_utils/mod.rsand 1 more) — QuantumExplorer or xdustinfacekey-wallet(key-wallet/src/transaction_checking/transaction_router/mod.rs,key-wallet/src/transaction_checking/transaction_router/tests/classification.rs) — QuantumExplorer 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.