Skip to content

fix: deserialize LastBlockUtxoRootHash (0xa6) — the bare context-root op form#901

Open
mwaddip wants to merge 1 commit into
ergoplatform:developfrom
mwaddip:fix/lastblockutxoroothash-opform
Open

fix: deserialize LastBlockUtxoRootHash (0xa6) — the bare context-root op form#901
mwaddip wants to merge 1 commit into
ergoplatform:developfrom
mwaddip:fix/lastblockutxoroothash-opform

Conversation

@mwaddip

@mwaddip mwaddip commented Jun 10, 2026

Copy link
Copy Markdown

The JVM serializes LastBlockUtxoRootHash as a dedicated case-object op code (OpCodes.LastBlockUtxoRootHashCode = 54 = 0xa6, registered in ValueSerializer.scala), but the Expr deserializer had no arm for it — a consensus-legal tree carrying the bare op form (1000a6) failed to parse where the JVM evaluates. The sibling context globals (e.g. MinerPubkey, 0xac) already dispatch.

New GlobalVars::LastBlockUtxoRootHash mirrors that wiring (op code, parse arm, SAvlTree); the serialize side was already generic over op_code(). Eval matches the existing CONTEXT.LastBlockUtxoRootHash PropertyCall eval (values.scala:1490) so the two wire forms agree.

Tests: bare-0xa6 round-trip byte pin + e2e parsing the blessed 1000a6 tree, asserting op form ≡ PropertyCall form.

… op form

The JVM serializes `LastBlockUtxoRootHash` as a dedicated case-object op
code (`OpCodes.LastBlockUtxoRootHashCode` = 54, registered in
`ValueSerializer.scala`); the Expr deserializer had no arm for it, so a
consensus-legal tree carrying the op form failed to parse where the JVM
evaluates (the sibling context globals — e.g. MinerPubkey, 0xac — already
dispatch). The new `GlobalVars::LastBlockUtxoRootHash` mirrors the wiring
of the other context globals; its eval matches the existing
`CONTEXT.LastBlockUtxoRootHash` PropertyCall eval (`values.scala:1490`,
`E.context.LastBlockUtxoRootHash`) so the two wire forms of the property
agree.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.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