Repository navigation
feat(dash)!: decode and encode special transaction types 10, 11 and 12 - #1156
Conversation
Adds ProviderDissolvePayload (ProDisTx), ProviderUpdateSharePayload (ProUpShareTx) and ProviderUpdateSharedRegistrarPayload (ProUpSharedRegTx), following Core's providertx.h. JoinSignature is renamed to CompactSignature, Core's name, since the new payloads use it too. Closes #1131 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Merge Risk: ⚪ Minimal · up to This change adds decoding and encoding for three Dash provider special transaction types and classifies them in the wallet. No concrete merge-blocking defect was identified. The public API changes (new enum variants and the JoinSignature to CompactSignature rename) are breaking but intentional. Pre-merge checks |
|
|
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❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## dev #1156 +/- ##
========================================
Coverage 78.49% 78.49%
========================================
Files 299 302 +3
Lines 80213 80412 +199
========================================
+ Hits 62960 63117 +157
- Misses 17253 17295 +42
|
|
Persisted-format regression: this inserts the three new variants before Transactions persisted before this (key-wallet Suggested fix: move the three new variants after |
…ariant (#1175) * fix(dash): keep the stored serde index of every transaction payload variant #1156 added the ProDisTx, ProUpShareTx and ProUpSharedRegTx payloads to `TransactionPayload` before `ClassicalWithNonStandardVersionTypeBytesPayloadType` and `RawPayloadType`. `serde` and `bincode` encode an enum variant by its index, so those two moved from 9 and 10 to 12 and 13. Hosts persist transactions in those encodings: Dash Platform's wallet store keeps key-wallet `TransactionRecord`s with `bincode::serde`, and one stored row with either payload fails the whole wallet load. The three new variants now come after `RawPayloadType`, so every variant that existed before #1156 is stored under its old index again. The enum doc says new variants go at the end. Consensus encoding and txids don't change; only the variant order (and so the derived `Ord`) does. Tests: - every variant's index under `bincode::serde` and `bincode`, pinned by an exhaustive match, so a new variant has to be given its index; - 23 transactions encoded before #1156 at 90359ed, covering all 11 payload variants that existed then, decode to what their consensus bytes hold and re-encode to the same bytes under both encodings. Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> * test(dash): drop the persisted transactions fixture test Keep the PR to the variant reorder and its doc note. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Closes #1131. Part of #1047.
Types 10, 11 and 12 now decode to typed payloads instead of
Unknown, with the layouts of Core'ssrc/evo/providertx.h(dashpay/dips#187):ProviderDissolvePayload(ProDisTx, 10):version,pro_tx_hash,actor_index,signatures(u8count + 65-byte compact signatures).ProviderUpdateSharePayload(ProUpShareTx, 11):version,pro_tx_hash,share_index,script_reward,inputs_hash,payload_sig(var bytes).ProviderUpdateSharedRegistrarPayload(ProUpSharedRegTx, 12):version,pro_tx_hash,operator_public_key(basic BLS),voting_key_hash,inputs_hash,signatures.ProUpShareTx and ProUpSharedRegTx implement
SpecialTransactionBasePayloadEncodablewithout their signatures, as Core'sSER_GETHASH. ProDisTx signs over the transaction (MakeSignHash), so it doesn't.Breaking: new
TransactionTypeandTransactionPayloadvariants.JoinSignature(unreleased, #1152) is renamed toCompactSignature, Core's name, since the new payloads use it too.key-wallet classifies the three types by shape, as it did while they were
Unknown.🤖 Generated with Claude Code
PR Hygiene ·
2b272aa/self-revieweddash/src/blockdata/transaction/mod.rs,dash/src/blockdata/transaction/special_transaction/mod.rs,dash/src/blockdata/transaction/special_transaction/provider_dissolve.rsand 3 more) — QuantumExplorer or xdustinfacekey-wallet(key-wallet/src/transaction_checking/transaction_router/mod.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.Summary by CodeRabbit