Skip to content

feat: use RunAndCollectRootHashesNew#775

Draft
mpolitzer wants to merge 2 commits intonext/2.0from
feature/collect-root-hashes
Draft

feat: use RunAndCollectRootHashesNew#775
mpolitzer wants to merge 2 commits intonext/2.0from
feature/collect-root-hashes

Conversation

@mpolitzer
Copy link
Copy Markdown

Reworked RunAndCollectRootHashes to have a fixed-point hash when collecting.
This mirrors the emulator function cm_collect_mcycle_root_hashes.

Additionally we use prevMachineHash (the checkpoint) on REJECTed inputs instead of what was collected.

The logic in pseudo code becomes:

hashes := collect_mcycle_root_hashes()
if accept {
  // use hashes as is.
} else { // reject
  revert()
  hashes[#hashes-1] = REVERT_ROOT_HASH
}

Later, for state hashes:

  • Take each hash from the input with a repetition of 1, except the last one,
  • which takes whatever is left from the total.

@mpolitzer mpolitzer force-pushed the feature/bump-emulator-v0.20.0 branch 5 times, most recently from cdc2e61 to 2b0eac3 Compare May 7, 2026 16:23
Base automatically changed from feature/bump-emulator-v0.20.0 to next/2.0 May 7, 2026 18:07
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