Skip to content

feat(kona): implement L2PayloadWitness hint for interop to support op-reth#19408

Merged
pauldowman merged 27 commits intodevelopfrom
pd/kona-interop-execute-payload
Mar 13, 2026
Merged

feat(kona): implement L2PayloadWitness hint for interop to support op-reth#19408
pauldowman merged 27 commits intodevelopfrom
pd/kona-interop-execute-payload

Conversation

@pauldowman
Copy link
Copy Markdown
Contributor

@pauldowman pauldowman commented Mar 5, 2026

Implements the L2PayloadWitness hint in kona's interop host, which calls debug_executePayload on the L2 execution client to pre-fetch execution witnesses.

This provides op-reth support because otherwise debug_dbGet is used which is not supported b op-reth.

Also wires up the op-reth proof-history entrypoint that was previously defined but never called, and switches all interop acceptance tests to use op-reth (with proof history enabled) as the L2 EL.

Changes:

  • kona interop host: implement L2PayloadWitness hint handler; add --enable-experimental-witness-endpoint flag to opt in
  • op-reth: wire launch_node_with_proof_history into the main entrypoint so --proofs-history actually takes effect; generalize over DB type
  • op-challenger: add --cannon-kona-experimental-witness-endpoint flag; pass it through to kona host
  • op-devstack: always use --proofs-history flag for op-reth, also add WithRethL2EL() preset and WithL2ELKind() option; enable witness endpoint for all kona challengers (cherry-picked from experiment: use op-reth for all interop acceptance tests #19416)
  • Interop acceptance tests: switch all suites to op-reth with proof history

NOTE this is going to need some conflicts fixed after #19252 merges (it's in the merge queue already).

Description

Tests

Additional context

Metadata

Fixes #19407

@codecov
Copy link
Copy Markdown

codecov bot commented Mar 5, 2026

Codecov Report

❌ Patch coverage is 85.96491% with 16 lines in your changes missing coverage. Please review.
✅ Project coverage is 75.5%. Comparing base (aadf0fc) to head (53d1ba1).
⚠️ Report is 2 commits behind head on develop.

Files with missing lines Patch % Lines
rust/op-reth/crates/node/src/node.rs 55.0% 9 Missing ⚠️
rust/op-reth/crates/node/src/proof_history.rs 0.0% 4 Missing ⚠️
rust/kona/bin/host/src/interop/cfg.rs 0.0% 2 Missing ⚠️
rust/op-reth/bin/src/main.rs 0.0% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop   #19408      +/-   ##
===========================================
+ Coverage     75.3%    75.5%    +0.2%     
===========================================
  Files          194      481     +287     
  Lines        11285    60238   +48953     
===========================================
+ Hits          8502    45512   +37010     
- Misses        2639    14726   +12087     
+ Partials       144        0     -144     
Flag Coverage Δ
cannon-go-tests-64 ?
contracts-bedrock-tests ?
unit 75.5% <85.9%> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
rust/kona/bin/host/src/interop/handler.rs 38.1% <100.0%> (ø)
rust/kona/bin/host/src/single/handler.rs 63.3% <100.0%> (ø)
rust/op-reth/crates/node/src/args.rs 100.0% <100.0%> (ø)
rust/op-reth/bin/src/main.rs 0.0% <0.0%> (ø)
rust/kona/bin/host/src/interop/cfg.rs 31.1% <0.0%> (ø)
rust/op-reth/crates/node/src/proof_history.rs 0.0% <0.0%> (ø)
rust/op-reth/crates/node/src/node.rs 65.7% <55.0%> (ø)

... and 668 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Copy Markdown
Contributor

@ajsutton ajsutton left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Otherwise this looks pretty much right and Claude was mostly happy with it, just a few snarky comments about having too many comments and suggesting writing more tests.

@pauldowman pauldowman force-pushed the pd/kona-interop-execute-payload branch from 9c86f41 to 01364ac Compare March 10, 2026 23:38
@pauldowman pauldowman changed the title feat(kona): implement L2PayloadWitness hint for interop feat(kona): implement L2PayloadWitness hint for interop to support op-reth Mar 10, 2026
@wiz-inc-a178a98b5d
Copy link
Copy Markdown

wiz-inc-a178a98b5d bot commented Mar 12, 2026

Wiz Scan Summary

Scanner Findings
Vulnerability Finding Vulnerabilities 4 High 1 Medium 2 Low
Data Finding Sensitive Data -
Secret Finding Secrets -
IaC Misconfiguration IaC Misconfigurations -
SAST Finding SAST Findings 1 Medium
Software Management Finding Software Management Findings -
Total 4 High 2 Medium 2 Low

View scan details in Wiz

To detect these findings earlier in the dev lifecycle, try using Wiz Code VS Code Extension.

@pauldowman pauldowman force-pushed the pd/kona-interop-execute-payload branch from 252442c to 9f902bf Compare March 12, 2026 03:58
@pauldowman pauldowman marked this pull request as ready for review March 12, 2026 23:35
@pauldowman pauldowman requested a review from a team as a code owner March 12, 2026 23:35
@pauldowman pauldowman requested a review from theochap March 12, 2026 23:36
Copy link
Copy Markdown
Contributor

@ajsutton ajsutton left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. I don't think this was part of the change set but while you're here apparently:

  1. op-challenger/flags/flags.go:114 (non-blocking)
    Typo: "Requires op-reth or execution client with started with" — extra "with".

If you could remove the extra with that would be great.

Copy link
Copy Markdown
Contributor

@wwared wwared left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Everything looks good to me, I have a small clarifying question below

pauldowman and others added 17 commits March 13, 2026 09:14
Adds support for the L2PayloadWitness hint in kona interop mode, enabling
execution witness pre-fetching via debug_executePayload RPC.

Changes:
- Add enable_experimental_witness_endpoint flag to InteropHost config
- Add ExecutionWitness and OpPayloadAttributes imports
- Implement L2PayloadWitness handler with chain_id routing
  - Extracts chain_id from last 8 bytes (variable-length pattern)
  - Routes to correct L2 provider via providers.l2(&chain_id)
  - Calls debug_executePayload RPC with silent failure for unsupported clients
  - Stores witness preimages (state, codes, keys) with keccak256 keys
- Add unit tests for hint data parsing and validation

Follows the same pattern as single-chain implementation with multi-chain
routing added for interop. All tests pass.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…flag

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Register L2PayloadWitness as a proactive hint in interop cfg.rs to
  match single-chain behavior
- Extract parse_l2_payload_witness_hint() helper and update tests to
  call it directly rather than reimplementing the parsing logic

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…d tests

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…rypoint

main.rs was calling launch_with_debug_capabilities directly, bypassing
launch_node_with_proof_history entirely, so the proofs-history exex and
eth_getProof/debug_executePayload RPC overrides were never installed.
Made launch_node_with_proof_history generic over DB to work with the bare
DatabaseEnv the CLI provides. Removed --rpc.eth-proof-window from devstack
since the exex override now handles all eth_getProof requests.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…n when not set

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Ports the proof history always-on change to mixed_runtime.go (the new
location after develop's devstack refactoring). Removes the ELProofHistory
toggle — proof history is now unconditionally enabled for all op-reth nodes
with a 10000-block window.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…roofs-history

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…able

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@pauldowman pauldowman force-pushed the pd/kona-interop-execute-payload branch from e3438eb to 5407555 Compare March 13, 2026 18:40
pauldowman and others added 4 commits March 13, 2026 12:47
startMixedOpRethNode was hardcoded so memory-all-opn-op-geth CI job
(which sets DEVSTACK_L2EL_KIND=op-geth) was still running op-reth.
Add startSupernodeEL helper that reads the env var and falls back to
op-reth when not set.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@pauldowman
Copy link
Copy Markdown
Contributor Author

This was rebased yet again due to more conflicts and has changed slightly from the reviewed version but I'm going to merge it to avoid more rounds of conflict changes again. There needs to be more cleanup around this as we make op-reth the only option.

@pauldowman pauldowman added this pull request to the merge queue Mar 13, 2026
Merged via the queue into develop with commit d1b8d53 Mar 13, 2026
281 checks passed
@pauldowman pauldowman deleted the pd/kona-interop-execute-payload branch March 13, 2026 23:40
ClaytonNorthey92 pushed a commit to hemilabs/optimism that referenced this pull request Mar 19, 2026
…-reth (ethereum-optimism#19408)

* feat(kona): implement L2PayloadWitness hint for interop

Adds support for the L2PayloadWitness hint in kona interop mode, enabling
execution witness pre-fetching via debug_executePayload RPC.

Changes:
- Add enable_experimental_witness_endpoint flag to InteropHost config
- Add ExecutionWitness and OpPayloadAttributes imports
- Implement L2PayloadWitness handler with chain_id routing
  - Extracts chain_id from last 8 bytes (variable-length pattern)
  - Routes to correct L2 provider via providers.l2(&chain_id)
  - Calls debug_executePayload RPC with silent failure for unsupported clients
  - Stores witness preimages (state, codes, keys) with keccak256 keys
- Add unit tests for hint data parsing and validation

Follows the same pattern as single-chain implementation with multi-chain
routing added for interop. All tests pass.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* Fix package reference in interop acceptance tests

* feat(op-challenger): add --cannon-kona-experimental-witness-endpoint flag

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* remove redundant witness endpoint acceptance test

* fix(kona): add L2PayloadWitness proactive hint and improve interop tests

- Register L2PayloadWitness as a proactive hint in interop cfg.rs to
  match single-chain behavior
- Extract parse_l2_payload_witness_hint() helper and update tests to
  call it directly rather than reimplementing the parsing logic

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* fix(kona): extract preimages iterator before kv lock, add WithL2ELKind tests

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* fix(op-reth): wire proof-history exex and RPC overrides into main entrypoint

main.rs was calling launch_with_debug_capabilities directly, bypassing
launch_node_with_proof_history entirely, so the proofs-history exex and
eth_getProof/debug_executePayload RPC overrides were never installed.
Made launch_node_with_proof_history generic over DB to work with the bare
DatabaseEnv the CLI provides. Removed --rpc.eth-proof-window from devstack
since the exex override now handles all eth_getProof requests.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* Lint fix

* fix(op-reth): make supervisor URL optional, disable interop validation when not set

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* chore(rust): apply nightly rustfmt to op-reth changes

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* Lint fixes

* fix(op-devstack): always enable proof history for op-reth, window=10000

Ports the proof history always-on change to mixed_runtime.go (the new
location after develop's devstack refactoring). Removes the ELProofHistory
toggle — proof history is now unconditionally enabled for all op-reth nodes
with a 10000-block window.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* feat(op-devstack): use op-reth for all interop tests, always enable proofs-history

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* fix(op-devstack): remove supervisor RPC from op-reth node startup

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* feat(op-devstack): use op-reth for supernode interop tests

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* fix(op-node): handle reorged super authority safe head gracefully

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* fix(op-devstack): skip op-reth tests gracefully when binary not available

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* fix(op-devstack): revert startL2ELNodeWithSupervisor to op-geth

* fix(op-challenger): clarify --proofs-history requirement in flag usage

* fix(op-reth): fix imports and Cargo.toml after rebase conflict resolution

* review: fail on missing op-reth binary, clarify supervisor deprecation

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* Revert "fix(op-node): handle reorged super authority safe head gracefully"

This reverts commit c054e41004b3e9d61850e1e1bf63d246ba4df87d.

* fix(kona): log info when debug_executePayload is unavailable, add tests

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* chore(kona): fix import ordering from nightly rustfmt

* Lint fix

* fix(kona): make is_rpc_method_not_found const to satisfy clippy

* fix(op-devstack): respect DEVSTACK_L2EL_KIND in supernode runtime

startMixedOpRethNode was hardcoded so memory-all-opn-op-geth CI job
(which sets DEVSTACK_L2EL_KIND=op-geth) was still running op-reth.
Add startSupernodeEL helper that reads the env var and falls back to
op-reth when not set.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
ClaytonNorthey92 pushed a commit to hemilabs/optimism that referenced this pull request Mar 23, 2026
…-reth (ethereum-optimism#19408)

* feat(kona): implement L2PayloadWitness hint for interop

Adds support for the L2PayloadWitness hint in kona interop mode, enabling
execution witness pre-fetching via debug_executePayload RPC.

Changes:
- Add enable_experimental_witness_endpoint flag to InteropHost config
- Add ExecutionWitness and OpPayloadAttributes imports
- Implement L2PayloadWitness handler with chain_id routing
  - Extracts chain_id from last 8 bytes (variable-length pattern)
  - Routes to correct L2 provider via providers.l2(&chain_id)
  - Calls debug_executePayload RPC with silent failure for unsupported clients
  - Stores witness preimages (state, codes, keys) with keccak256 keys
- Add unit tests for hint data parsing and validation

Follows the same pattern as single-chain implementation with multi-chain
routing added for interop. All tests pass.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* Fix package reference in interop acceptance tests

* feat(op-challenger): add --cannon-kona-experimental-witness-endpoint flag

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* remove redundant witness endpoint acceptance test

* fix(kona): add L2PayloadWitness proactive hint and improve interop tests

- Register L2PayloadWitness as a proactive hint in interop cfg.rs to
  match single-chain behavior
- Extract parse_l2_payload_witness_hint() helper and update tests to
  call it directly rather than reimplementing the parsing logic

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* fix(kona): extract preimages iterator before kv lock, add WithL2ELKind tests

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* fix(op-reth): wire proof-history exex and RPC overrides into main entrypoint

main.rs was calling launch_with_debug_capabilities directly, bypassing
launch_node_with_proof_history entirely, so the proofs-history exex and
eth_getProof/debug_executePayload RPC overrides were never installed.
Made launch_node_with_proof_history generic over DB to work with the bare
DatabaseEnv the CLI provides. Removed --rpc.eth-proof-window from devstack
since the exex override now handles all eth_getProof requests.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* Lint fix

* fix(op-reth): make supervisor URL optional, disable interop validation when not set

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* chore(rust): apply nightly rustfmt to op-reth changes

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* Lint fixes

* fix(op-devstack): always enable proof history for op-reth, window=10000

Ports the proof history always-on change to mixed_runtime.go (the new
location after develop's devstack refactoring). Removes the ELProofHistory
toggle — proof history is now unconditionally enabled for all op-reth nodes
with a 10000-block window.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* feat(op-devstack): use op-reth for all interop tests, always enable proofs-history

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* fix(op-devstack): remove supervisor RPC from op-reth node startup

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* feat(op-devstack): use op-reth for supernode interop tests

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* fix(op-node): handle reorged super authority safe head gracefully

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* fix(op-devstack): skip op-reth tests gracefully when binary not available

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* fix(op-devstack): revert startL2ELNodeWithSupervisor to op-geth

* fix(op-challenger): clarify --proofs-history requirement in flag usage

* fix(op-reth): fix imports and Cargo.toml after rebase conflict resolution

* review: fail on missing op-reth binary, clarify supervisor deprecation

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* Revert "fix(op-node): handle reorged super authority safe head gracefully"

This reverts commit c054e41004b3e9d61850e1e1bf63d246ba4df87d.

* fix(kona): log info when debug_executePayload is unavailable, add tests

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* chore(kona): fix import ordering from nightly rustfmt

* Lint fix

* fix(kona): make is_rpc_method_not_found const to satisfy clippy

* fix(op-devstack): respect DEVSTACK_L2EL_KIND in supernode runtime

startMixedOpRethNode was hardcoded so memory-all-opn-op-geth CI job
(which sets DEVSTACK_L2EL_KIND=op-geth) was still running op-reth.
Add startSupernodeEL helper that reads the env var and falls back to
op-reth when not set.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
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.

Implement L2PayloadWitness hint for interop

3 participants