perf(kona): reduce reset walk proof reads#4
Open
fakedev9999 wants to merge 4 commits into
Open
Conversation
This was referenced Jul 2, 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
Optimizes kona's proof reset path without reverting the v1.6.0
initial_resetcorrectness fix.This PR has three pieces:
l2_block_info_by_numberreads the L2 header plus the transaction-0 Merkle path needed to decodeL1BlockInfoTx, instead of hydrating the full transaction trie.system_config_by_numberuses the same header-plus-tx0 path before calling the existingto_system_configlogic.DerivationPipeline::initial_resetstill computes the walked-back reset point, but usesL2BlockInfo.seq_numto skip same-L1-origin L2 blocks. Blocks with the same L1 origin have the same channel-timeout stop predicate, so this preserves the walked-back reset semantics while avoiding per-L2-block tx0 reads.It deliberately does not restore the old precomputed reset shortcut:
31703ba851documents that using safe-head system config can diverge from op-node when the batcher address changes inside the channel-timeout window.Measurement
op-succinct validation range: Katana
36207424~36207429(6 blocks, tx counts1,1,1,1,1,1).17af43b1)654eb009)Final patch removes
1,561,406witness preimage bytes, or95.13%of the measured head-vs-base byte regression on this range. Remaining delta vs pre-ethereum-optimism#928 base is+79,859bytes (+0.43%).Safety
DerivationPipeline::initial_resetand walked-back system config semantics.L1BlockInfoTxdecoding andto_system_configlogic.Verification
cargo +1.94.0 test --manifest-path rust/kona/crates/protocol/derive/Cargo.toml initial_reset -- --nocapturecargo +1.94.0 check --manifest-path rust/kona/crates/proof/proof/Cargo.toml --libcargo +1.94.0 test --manifest-path rust/kona/crates/proof/proof/Cargo.toml --features alloy-eips/kzg,rand/thread_rng l2_block_info_by_number_reads_only_first_transaction_path -- --nocapturecargo +1.94.0 test --manifest-path rust/kona/crates/proof/proof/Cargo.toml --features alloy-eips/kzg,rand/thread_rng system_config_by_number_reads_only_first_transaction_path -- --nocapturefakedev9999/optimism@654eb009pinned on Katana range36207424~36207429