Skip to content

Fix ProRegTx / ProUpServTx payload handling and version compatibility#47

Merged
pshenmic merged 2 commits intopshenmic:developfrom
LexxXell:fixProRegTx2
Feb 10, 2026
Merged

Fix ProRegTx / ProUpServTx payload handling and version compatibility#47
pshenmic merged 2 commits intopshenmic:developfrom
LexxXell:fixProRegTx2

Conversation

@LexxXell
Copy link
Copy Markdown

This PR fixes multiple serialization and deserialization issues in DIP3 special transactions, primarily affecting ProRegTx and ProUpServTx.

Key fixes

ProRegTx

  • Fixed payloadSig handling to always use CompactSize-prefixed varbytes, in accordance with the current Dash Core documentation.
  • Removed incorrect assumptions about fixed-length BLS signatures for ProRegTx, which caused deserialization failures (e.g. 1, 66 bytes remaining).
  • Added forward compatibility for version >= 3 by correctly consuming the netInfo field as varbytes, ensuring proper stream alignment even without full netInfo parsing.
  • Prevented invalid cursor positioning that previously caused Unexpected payloadSig size errors when parsing real network transactions.

ProUpServTx

  • Fixed payload version handling:

    • v1 uses CompactSize-prefixed legacy BLS signatures
    • v2+ uses raw Basic BLS signatures without size prefix
  • Corrected handling of optional Platform fields (platformNodeID, platformP2PPort, platformHTTPPort) for masternode type 1.

  • Documented and preserved the real-world endianness behavior of platform ports (LE on wire despite BE in docs), matching Dash Core behavior.

  • Fixed uninitialized variables during deserialization that could lead to UnboundLocalError.

Additional improvements

  • Improved __str__ output for DIP3 transactions to provide consistent, readable diagnostics without affecting GUI expectations.
  • Added stricter sanity checks while preserving backward compatibility with existing wallets and historical transactions.

Motivation

These fixes were driven by real deserialization failures observed when parsing mainnet and testnet transactions after recent Dash Core protocol changes (v19+ and v24+).
The previous implementation mixed rules from different protocol versions, leading to invalid cursor alignment and broken transaction parsing.

Scope

  • No behavioral changes outside DIP3 special transactions
  • No GUI or wallet logic changes
  • Fully backward compatible with legacy transactions

@pshenmic pshenmic merged commit 0d9bf55 into pshenmic:develop Feb 10, 2026
1 check passed
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.

2 participants