Skip to content

perf(stateless): avoid eager witness bytecode analysis - #31

Merged
mattsse merged 1 commit into
mainfrom
fig/compact-ancestor-hashes
Jul 9, 2026
Merged

perf(stateless): avoid eager witness bytecode analysis#31
mattsse merged 1 commit into
mainfrom
fig/compact-ancestor-hashes

Conversation

@figtracer

@figtracer figtracer commented Jul 8, 2026

Copy link
Copy Markdown
Collaborator

Summary

Keeps witness bytecode as raw Bytes during trie construction and converts it to Bytecode only when WitnessDatabase::code_by_hash is 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, and RAYON_NUM_THREADS=4. The run used the same fixture set as the clean Reth baseline and completed with 0 output mismatches and 0 crashes after serially repairing the parallel crash records in the same output folder.

This PR reduces the clean Reth full-run total by 57,694,594 cycles.

@figtracer
figtracer marked this pull request as ready for review July 9, 2026 06:48
@figtracer
figtracer marked this pull request as draft July 9, 2026 06:52
@figtracer
figtracer force-pushed the fig/compact-ancestor-hashes branch from 9880eeb to 88e6f14 Compare July 9, 2026 10:21
@figtracer figtracer changed the title perf(stateless): compact ancestor hash lookups perf(stateless): avoid eager witness bytecode analysis Jul 9, 2026
@figtracer
figtracer marked this pull request as ready for review July 9, 2026 11:12
@figtracer
figtracer requested a review from mattsse July 9, 2026 11:12
@mattsse
mattsse merged commit 3d2fc17 into main Jul 9, 2026
4 checks passed
@mattsse
mattsse deleted the fig/compact-ancestor-hashes branch July 9, 2026 11:55
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.

2 participants