Skip to content

docs(dash): state the version gate of the legacy asset lock decoder - #1170

Merged
ZocoLini merged 1 commit into
devfrom
shumkov/legacy-asset-lock-decoder-doc
Oct 14, 2026
Merged

ZocoLini merged 1 commit into
devfrom
shumkov/legacy-asset-lock-decoder-doc

Conversation

@shumkov

@shumkov shumkov commented Oct 14, 2026 •

Copy link
Copy Markdown
Collaborator

Doc-only follow-up to #1167. It makes the doc of Transaction::deserialize_with_legacy_asset_lock_framing match what the function does.

The problem

The doc said the function is for callers that must keep accepting "the asset locks that earlier releases of this crate accepted". That overstates it:

  • Releases up to v0.44.0 read a type 8 payload below version 3 too. v0.44.0 reads one at any version but 0; v0.40.0 at any version. fix(dash): only decode a special payload from transaction version 3 #1155 came after v0.44.0.
  • This decoder treats a transaction as an asset lock only at type 8 and a version of at least 3, read as an i16, which is where Dash Core reads a payload. Type 8 below version 3 goes to deserialize.

A maintainer told that the framing must never change could read the old sentence as a reason to restore version != 0.

The change

In dash/src/blockdata/transaction/legacy_asset_lock.rs, comments only:

  • the version gate is stated, and type 8 below version 3 is named as going to deserialize;
  • the function keeps the payload framing of earlier releases, not everything they accepted;
  • it is not deprecated, because its callers have nothing to move to;
  • "signature" becomes "state transition signature", so it is not read as the InstantSend lock's own;
  • the doc says which shared decoders it still relies on (inputs, outputs, witnesses, lock times, CompactSizes), so a change there reaches it;
  • the module doc's first sentence is reworded so it reads on the first pass.

The version 1/2 gap

This doc only describes the gap; it changes nothing about it. Platform binaries on pins before #1155 read type 8 at version 1 or 2 as an asset lock, and this decoder does not. The independent review of dashpay/platform#5403, which uses the same gate, covered this case: Dash Core never ChainLocks or InstantSend-locks such a transaction, so every pin refuses such a proof unpaid.

Testing

No code change. cargo fmt --all -- --check, RUSTDOCFLAGS=-D warnings cargo doc -p dashcore --all-features --no-deps and the 46 tests in dash/tests/legacy_asset_lock.rs pass.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Documentation
    • Clarified how legacy asset-lock transaction decoding preserves compatibility with Dash Platform and which transactions use legacy handling versus standard deserialization.
    • Documented that asset-lock decoding is separate from standard transaction and payload decoding, while shared decoding behavior can still affect it. Also clarified that callers relying on this decoder have no replacement.

PR Hygiene · 6ab586e

  • Bots — coderabbitai ✓
  • Self-review — post /self-reviewed
  • Build green
  • Approvals
    • files with no dedicated owner (dash/src/blockdata/transaction/legacy_asset_lock.rs) — QuantumExplorer or ZocoLini 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.

The doc of `Transaction::deserialize_with_legacy_asset_lock_framing` said
it is for callers that must keep accepting "the asset locks that earlier
releases of this crate accepted". That overstates it. Releases up to
v0.44.0 also read a type 8 payload below version 3, and this decoder
sends type 8 below version 3 to `deserialize`, as Dash Core reads no
payload there. A maintainer told that the framing must never change
could read the old sentence as a reason to restore that.

The doc now states the gate (type 8 at a version of at least 3 as an
`i16`, and type 8 below it goes to `deserialize`), says it keeps the
payload framing of earlier releases, says it is not deprecated because
its callers have nothing to move to, names the state transition
signature, and says which shared decoders it still relies on.

No code change.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Oct 14, 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: 6f3f78dd-c2c2-4dbf-ad77-4bb9d12dc4c6
📥 Commits

Reviewing files that changed from the base of the PR and between 4d074fa and 6ab586e.

📒 Files selected for processing: 1
  • dash/src/blockdata/transaction/legacy_asset_lock.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

The module and method documentation now describe the legacy asset-lock framing rules, the transactions to which they apply, and how this path relates to standard transaction and payload decoders.

Changes: Legacy asset-lock decoder documentation

Layer / File(s) Summary
Document legacy framing rules
dash/src/blockdata/transaction/legacy_asset_lock.rs
The documentation explains that legacy framing remains for Dash Platform compatibility. It specifies the transaction type and version conditions, identifies which transactions use deserialize, and notes that shared decoder changes also affect this path.

Priority: ⬇️ Low

Estimated code review effort: 1 (Trivial) | ~3 minutes

Change: Other

Merge Risk: ⚪ Minimal · up to 6ab58

This change clarifies the legacy decoder’s behavior without changing runtime code. No concrete merge-blocking impact is identified.

Pre-merge checks: Passed 5
Passed Passed checks: 5 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 documentation change that states the version gate for the legacy asset lock decoder.
Docstring Coverage Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 1 functions across 1 files.
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • 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

github-actions Bot commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

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

@github-actions github-actions Bot added the waiting-self-review Waiting for the author to post /self-reviewed label Oct 14, 2026
@codecov

codecov Bot commented Oct 14, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 78.98%. Comparing base (4d074fa) to head (6ab586e).

Additional details and impacted files
@@            Coverage Diff             @@
##              dev    #1170      +/-   ##
==========================================
- Coverage   79.01%   78.98%   -0.03%     
==========================================
  Files         303      303              
  Lines       81293    81293              
==========================================
- Hits        64233    64213      -20     
- Misses      17060    17080      +20     
Flag Coverage Δ
core 77.55% <ø> (ø)
ffi 52.13% <ø> (+<0.01%) ⬆️
rpc 51.61% <ø> (ø)
spv 92.66% <ø> (-0.09%) ⬇️
wallet 82.19% <ø> (ø)
Files with missing lines Coverage Δ
...ash/src/blockdata/transaction/legacy_asset_lock.rs 100.00% <ø> (ø)

... and 9 files with indirect coverage changes

@ZocoLini
ZocoLini merged commit afbe551 into dev Oct 14, 2026
39 of 41 checks passed
@ZocoLini
ZocoLini deleted the shumkov/legacy-asset-lock-decoder-doc branch October 14, 2026 10:50
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.

2 participants