feat: live sync witness cache oracle#759
Open
0xOsiris wants to merge 16 commits into
Open
Conversation
Contributor
Benchmark ResultsCompared on the same runner in the same workflow run.
|
…com/worldcoin/world-chain into osiris/live-preimage-witness-oracle
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 3 potential issues.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 13239c3. Configure here.
…com/worldcoin/world-chain into osiris/live-preimage-witness-oracle
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.

PROTO-4718
Creates an optional live witness cache that accumulates pre-image witnesses into a fixed size in memory circular ring buffer. The witnesses can then be fetched over a range externally with enormous compute savings.
As historical witnesses require unwinding the database to the beginning of the range. Witnesses are deterministic based on execution (and the last proven state), and can be easily cached during live sync in the Block Executor minimizing both compute, and complexity of the pre-image witness collection in the proof system.
Note
Medium Risk
Touches block-import execution via an executor wrapper on the engine validation path; default-off limits blast radius, but enabled mode adds async witness assembly and a new debug RPC surface on proof nodes.
Overview
Introduces an optional live pre-image witness oracle for proof workflows: when
--witness.collectis set, the node captures witnesses during normalnewPayloadimport instead of relying on repeateddebug_executePayloadre-execution.New
world-chain-witnesscrate definesBlockWitness/RangeWitnessand a boundedWitnessCache(depth from--witness.depth, default 1024).EVM layer:
WorldChainEvmConfigis no longer a type alias—it wrapsOpEvmConfigwithWorldChainBlockExecutorFactory/WorldChainBlockExecutor, which snapshotExecutionWitnessRecordfrom the live revmStateon executorfinishand sendBlockExecutionWitnessover a channel. A background collector assembles fullBlockWitnessvalues (parent state trie, headers, RLP header/txs) into the cache. With collection off, behavior stays a passthrough (no sender). Requires#![feature(min_specialization)]for theStateDB witness hook.Wiring: CLI
WitnessArgs, node context creates channel + cache when enabled,WorldChainExecutorBuilderarms the sender, and add-ons spawn the collector and registerdebug_collectRangeWitnesson thedebugmodule when collection is on.Adds design doc
docs/proof/live-preimage-witness-oracle.md. Kona host pre-seeding (design Phase 5) is not included in this diff.Reviewed by Cursor Bugbot for commit 13239c3. Configure here.