Skip to content

Accept DynamicRecord encoding version 2 on decode - #3382

Open
vicsn wants to merge 1 commit into
testnetfrom
patch_dynamic_record_serialization
Open

Accept DynamicRecord encoding version 2 on decode#3382
vicsn wants to merge 1 commit into
testnetfrom
patch_dynamic_record_serialization

Conversation

@vicsn

@vicsn vicsn commented Aug 18, 2026

Copy link
Copy Markdown
Collaborator

Partially fixes ProvableHQ/sdk#1393

Summary

  • DynamicRecord::read_le now accepts encoding version 2. Version 2 includes the plaintext entry map. Version 1 still omits the map.
  • The decoder checks the Merkle root against the recovered entries. It rejects a payload when the root does not match.
  • write_le still writes version 1. Current clients do not change their output.

This change is not a consensus change. Ledger objects store only a dynamic-record ID. Circuit bit encodings stay fixed-size.

A follow-up PR will switch write_le to version 2. Wait until delegated provers run this decoder. Then merge the writer change.

CC @iamalwaysuncomfortable @Roee-87 @niklaslong

Test plan

  • cargo test -p snarkvm-console-program -- test_read_le_version
  • Confirm a version-1 DynamicRecord still decodes with data: None
  • Confirm a version-2 payload recovers entries when the Merkle root matches
  • Confirm a version-2 payload with a wrong root fails

Made with Cursor

Delegated provers must accept a later encoding that carries record entries, while current writers still emit the compact form.

Co-authored-by: Cursor <cursoragent@cursor.com>
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.

1 participant