Skip to content

perf(kona): reduce reset walk proof reads#4

Open
fakedev9999 wants to merge 4 commits into
fakedev9999/kona-client-v1.6.0-basefrom
fakedev9999/l2-block-info-first-tx
Open

perf(kona): reduce reset walk proof reads#4
fakedev9999 wants to merge 4 commits into
fakedev9999/kona-client-v1.6.0-basefrom
fakedev9999/l2-block-info-first-tx

Conversation

@fakedev9999

@fakedev9999 fakedev9999 commented Jul 2, 2026

Copy link
Copy Markdown
Owner

Summary

Optimizes kona's proof reset path without reverting the v1.6.0 initial_reset correctness fix.

This PR has three pieces:

  • l2_block_info_by_number reads the L2 header plus the transaction-0 Merkle path needed to decode L1BlockInfoTx, instead of hydrating the full transaction trie.
  • system_config_by_number uses the same header-plus-tx0 path before calling the existing to_system_config logic.
  • DerivationPipeline::initial_reset still computes the walked-back reset point, but uses L2BlockInfo.seq_num to 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: 31703ba851 documents 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 counts 1,1,1,1,1,1).

side total preimages total bytes pipeline-construction bytes
base before op-succinct PR ethereum-optimism#928 27,674 18,479,023 0
kona v1.6.0 head 30,946 20,120,288 1,651,074
first fork patch (17af43b1) 30,406 19,243,741 774,527
final fork patch (654eb009) 27,934 18,558,882 89,668

Final patch removes 1,561,406 witness preimage bytes, or 95.13% of the measured head-vs-base byte regression on this range. Remaining delta vs pre-ethereum-optimism#928 base is +79,859 bytes (+0.43%).

Safety

  • Preserves DerivationPipeline::initial_reset and walked-back system config semantics.
  • Does not trust host-supplied reset origin/config.
  • Keeps tx0 membership tied to the transactions root via the Merkle path.
  • Uses existing L1BlockInfoTx decoding and to_system_config logic.
  • Adds/keeps unit coverage for tx0-only proof reads, tx0-only system config reads, and sequence-number same-origin reset skipping.

Verification

  • cargo +1.94.0 test --manifest-path rust/kona/crates/protocol/derive/Cargo.toml initial_reset -- --nocapture
  • cargo +1.94.0 check --manifest-path rust/kona/crates/proof/proof/Cargo.toml --lib
  • cargo +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 -- --nocapture
  • cargo +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 -- --nocapture
  • op-succinct host witness measurement with fakedev9999/optimism@654eb009 pinned on Katana range 36207424~36207429

@fakedev9999 fakedev9999 changed the title Optimize L2 block info proof reads perf(kona): reduce reset walk proof reads Jul 2, 2026
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