Skip to content

feat(dash)!: decode and encode special transaction types 10, 11 and 12 - #1156

Merged
xdustinface merged 1 commit into
devfrom
feat/provider-dissolve-share-types
Oct 12, 2026
Merged

xdustinface merged 1 commit into
devfrom
feat/provider-dissolve-share-types

Conversation

@ZocoLini

@ZocoLini ZocoLini commented Oct 12, 2026 •

Copy link
Copy Markdown
Collaborator

Closes #1131. Part of #1047.

Types 10, 11 and 12 now decode to typed payloads instead of Unknown, with the layouts of Core's src/evo/providertx.h (dashpay/dips#187):

  • ProviderDissolvePayload (ProDisTx, 10): version, pro_tx_hash, actor_index, signatures (u8 count + 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 SpecialTransactionBasePayloadEncodable without their signatures, as Core's SER_GETHASH. ProDisTx signs over the transaction (MakeSignHash), so it doesn't.

Breaking: new TransactionType and TransactionPayload variants. JoinSignature (unreleased, #1152) is renamed to CompactSignature, 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

  • Bots — coderabbitai ✓
  • Self-review — post /self-reviewed
  • Build failed
  • Approvals
    • files with no dedicated owner (dash/src/blockdata/transaction/mod.rs, dash/src/blockdata/transaction/special_transaction/mod.rs, dash/src/blockdata/transaction/special_transaction/provider_dissolve.rs and 3 more) — QuantumExplorer or xdustinface
    • key-wallet (key-wallet/src/transaction_checking/transaction_router/mod.rs) — QuantumExplorer or xdustinface

When every merge requirement is met, the PR Hygiene check passes. Reviewer limits do not block merging; other required GitHub checks and protections still apply.

Summary by CodeRabbit

  • New Features
    • Added support for provider dissolution, share updates, and shared registrar updates in transaction processing.
    • These transactions can now be serialized, deserialized, and recognized by transaction classification, including as standard, coinbase, or CoinJoin transactions where applicable.

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>
@coderabbitai

coderabbitai Bot commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Repository: dashpay/rust-dashcore/.coderabbit.yaml
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: dcf0a654-e16a-4ae0-aeb3-28869a23a4c0

📥 Commits

Reviewing files that changed from the base of the PR and between d036d84 and 2b272aa.


📒 Files selected for processing (7)
  • dash/src/blockdata/transaction/mod.rs
  • dash/src/blockdata/transaction/special_transaction/mod.rs
  • dash/src/blockdata/transaction/special_transaction/provider_dissolve.rs
  • dash/src/blockdata/transaction/special_transaction/provider_registration.rs
  • dash/src/blockdata/transaction/special_transaction/provider_update_share.rs
  • dash/src/blockdata/transaction/special_transaction/provider_update_shared_registrar.rs
  • key-wallet/src/transaction_checking/transaction_router/mod.rs

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.



📝 Walkthrough

Walkthrough

Adds payloads and consensus encoding for Provider Dissolve, Provider Update Share, and Provider Update Shared Registrar transactions. Integrates transaction types 10–12 into transaction encoding and decoding, round-trip tests, and wallet transaction classification.

Changes

Provider special transactions

Layer / File(s) Summary
Payload formats and signatures
dash/src/blockdata/transaction/special_transaction/provider_registration.rs, dash/src/blockdata/transaction/special_transaction/provider_dissolve.rs, dash/src/blockdata/transaction/special_transaction/provider_update_share.rs, dash/src/blockdata/transaction/special_transaction/provider_update_shared_registrar.rs
Adds payload structures, size calculations, and consensus encoding and decoding for the three transaction types. Replaces JoinSignature with CompactSignature in shared collateral and adds helpers for encoding and decoding signature lists.
Transaction type integration
dash/src/blockdata/transaction/special_transaction/mod.rs, dash/src/blockdata/transaction/mod.rs
Adds payload and transaction-type variants, wire values 10–12, and encoding and decoding mappings. Adds round-trip cases that check each type byte, decoded transaction, and serialized size.
Wallet transaction classification
key-wallet/src/transaction_checking/transaction_router/mod.rs
Adds the three provider transaction types to shape-based classification using the existing Coinbase, CoinJoin, and Standard checks.

Priority: ➖ Normal

Estimated code review effort: 3 (Moderate) | ~25 minutes

Change: Feature


Merge Risk: ⚪ Minimal · up to 2b272

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 | Passed 4 | Failed 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 51.43% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 35 functions across 7 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title clearly and concisely describes the main change: adding encoding and decoding for special transaction types 10, 11, and 12.
Linked Issues check Passed Issue #1131 requires payload structs and consensus encoding for transaction types 10, 11, and 12. The PR adds ProviderDissolvePayload, ProviderUpdateSharePayload, and `ProviderUpdateSharedRegistra…
Out of Scope Changes check Passed The changes stay connected to issue #1131. The enum mappings integrate the new payloads into transaction decoding. The CompactSignature rename supports the signature fields required by the new paylo…

  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 2
📝 Generate docstrings 💡
  • Commit to this branch
  • Create a new PR

🛠️ Fix failing CI checks 💡
  • Commit to this branch
  • Create a new PR

🧪 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.

❤️ Share

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

@github-actions

Copy link
Copy Markdown
Contributor

Waiting for bot review — coderabbitai not yet. Wait for the missing reviews, or a writer can post /skip-bots to proceed without them; blocking findings still need addressing.
Full checklist in the description.

@github-actions github-actions Bot added the waiting-bots Waiting for the review bots to report on this head label Oct 12, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Bots are done — your move: post /self-reviewed.
Full checklist in the description.

@github-actions github-actions Bot added waiting-self-review Waiting for the author to post /self-reviewed and removed waiting-bots Waiting for the review bots to report on this head labels Oct 12, 2026
@codecov

codecov Bot commented Oct 12, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 90.59406% with 19 lines in your changes missing coverage. Please review.
✅ Project coverage is 78.49%. Comparing base (d036d84) to head (2b272aa).

Files with missing lines Patch % Lines
...c/blockdata/transaction/special_transaction/mod.rs 75.00% 6 Missing ⚠️
...ction/special_transaction/provider_update_share.rs 89.47% 6 Missing ⚠️
...al_transaction/provider_update_shared_registrar.rs 88.46% 6 Missing ⚠️
...ansaction/special_transaction/provider_dissolve.rs 97.29% 1 Missing ⚠️
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     
Flag Coverage Δ
core 76.80% <90.59%> (+0.13%) ⬆️
ffi 51.10% <ø> (-0.06%) ⬇️
rpc 49.36% <ø> (ø)
spv 92.55% <ø> (-0.08%) ⬇️
wallet 82.12% <ø> (ø)
Files with missing lines Coverage Δ
dash/src/blockdata/transaction/mod.rs 88.40% <100.00%> (+0.18%) ⬆️
...ction/special_transaction/provider_registration.rs 81.48% <100.00%> (+0.31%) ⬆️
...src/transaction_checking/transaction_router/mod.rs 91.45% <ø> (ø)
...ansaction/special_transaction/provider_dissolve.rs 97.29% <97.29%> (ø)
...c/blockdata/transaction/special_transaction/mod.rs 44.93% <75.00%> (+3.23%) ⬆️
...ction/special_transaction/provider_update_share.rs 89.47% <89.47%> (ø)
...al_transaction/provider_update_shared_registrar.rs 88.46% <88.46%> (ø)

... and 6 files with indirect coverage changes

@xdustinface
xdustinface merged commit 2102cac into dev Oct 12, 2026
40 of 45 checks passed
@xdustinface
xdustinface deleted the feat/provider-dissolve-share-types branch October 12, 2026 14:40
@shumkov

shumkov commented Oct 12, 2026

Copy link
Copy Markdown
Collaborator

Persisted-format regression: this inserts the three new variants before ClassicalWithNonStandardVersionTypeBytesPayloadType and UnknownPayloadType. TransactionPayload derives serde and bincode, and both encode a variant by its index, so those two move from 9 to 12 and from 10 to 13.

Transactions persisted before this (key-wallet TransactionRecord, dash-spv storage, Platform's wallet blobs stored through bincode::serde) then fail to decode, or decode as another variant. For example, [9, 42] and [10, 10, 2, de, ad] decode before this commit and fail after it, in both native bincode and binary serde. JSON is unaffected.

Suggested fix: move the three new variants after UnknownPayloadType and add a test that pins every variant's index. No Platform pin includes this commit yet, so reordering now breaks no stored data.

ZocoLini pushed a commit that referenced this pull request Oct 15, 2026
…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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

waiting-self-review Waiting for the author to post /self-reviewed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

dash: add payloads for special tx types 10-12 (ProDisTx, ProUpShareTx, ProUpSharedRegTx)

3 participants