perf(stateless): avoid eager witness bytecode analysis - #31
Merged
Conversation
figtracer
marked this pull request as ready for review
July 9, 2026 06:48
figtracer
marked this pull request as draft
July 9, 2026 06:52
figtracer
force-pushed
the
fig/compact-ancestor-hashes
branch
from
July 9, 2026 10:21
9880eeb to
88e6f14
Compare
figtracer
marked this pull request as ready for review
July 9, 2026 11:12
mattsse
approved these changes
Jul 9, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Keeps witness bytecode as raw
Bytesduring trie construction and converts it toBytecodeonly whenWitnessDatabase::code_by_hashis called.The trie constructors now consume
ExecutionWitness, so witness state/code entries can be moved into their hash-indexed maps instead of cloned. This avoids eager bytecode construction for witness code that execution never requests.Benchmark
Full SP1 cycle benchmark for
zkevm-fixtures-10m-osaka-full(Osaka 10M), using the Reth guest with public-key verification enabled,reth-v2.1.0,sp1-v6.1.0, andRAYON_NUM_THREADS=4. The run used the same fixture set as the clean Reth baseline and completed with0output mismatches and0crashes after serially repairing the parallel crash records in the same output folder.This PR reduces the clean Reth full-run total by
57,694,594cycles.