Skip to content

fix(kona): use configurable message expiry window in MessageGraph#19765

Open
digorithm wants to merge 8 commits intodevelopfrom
fix/kona-message-expiry-window
Open

fix(kona): use configurable message expiry window in MessageGraph#19765
digorithm wants to merge 8 commits intodevelopfrom
fix/kona-message-expiry-window

Conversation

@digorithm
Copy link
Copy Markdown
Contributor

Summary

  • Add message_expiry_window: u64 parameter to MessageGraph::derive() instead of using hardcoded MESSAGE_EXPIRY_WINDOW constant
  • Load DependencySet from preimage oracle local key 8 in BootInfo
  • Thread expiry window from BootInfo through SuperchainConsolidator to MessageGraph
  • Add tests verifying custom expiry window behavior (expired and within-window cases)

Motivation

MessageGraph::check_single_dependency() was using the hardcoded MESSAGE_EXPIRY_WINDOW constant (7 days) instead of the configurable value from the DependencySet. The Go FPP host already serves a DependencySet (with configurable overrideMessageExpiryWindow) via the preimage oracle at local key 8, but Kona's BootInfo didn't load it. This prevented acceptance tests that configure custom expiry windows (e.g., TestInteropFaultProofs_MessageExpiry) from working correctly with Kona's fault proof program.

Closes #19636

Test plan

  • All 11 existing MessageGraph tests updated to pass MESSAGE_EXPIRY_WINDOW explicitly — behavior identical to before
  • New test test_derive_and_resolve_graph_message_expired_custom_window — proves custom 10s window triggers expiry
  • New test test_derive_and_resolve_graph_message_not_expired_within_custom_window — proves boundary correctness
  • cargo test --package kona-interop --all-features — 31 tests pass
  • cargo test --package kona-proof-interop — 30 tests pass
  • Default behavior preserved: DependencySet::get_message_expiry_window() falls back to MESSAGE_EXPIRY_WINDOW when no override is set

🤖 Generated with Claude Code

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

digorithm and others added 2 commits March 26, 2026 11:08
MessageGraph::check_single_dependency() was using the hardcoded
MESSAGE_EXPIRY_WINDOW constant (7 days) instead of the configurable
value from the DependencySet. This prevented acceptance tests that
configure custom expiry windows from working correctly with Kona's
fault proof program.

Changes:
- Add message_expiry_window parameter to MessageGraph::derive()
- Load DependencySet from preimage oracle key 8 in BootInfo
- Thread expiry window from BootInfo through SuperchainConsolidator
- Add tests for custom expiry window behavior

Closes #19636

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@digorithm digorithm self-assigned this Mar 26, 2026
@digorithm
Copy link
Copy Markdown
Contributor Author

Just a note: while working on this fix, I noticed two constants defining "default message expiry window" with different values:

Constant: MESSAGE_EXPIRY_WINDOW
Location: interop/src/constants.rs
Value: 604,800s (7 days)
Used by: DependencySet::get_message_expiry_window() fallback; matches Go's params.MessageExpiryTimeSecondsInterop
────────────────────────────────────────
Constant: DEFAULT_INTEROP_MESSAGE_EXPIRY_WINDOW
Location: genesis/src/rollup.rs
Value: 3,600s (1 hour)
Used by: Default for RollupConfig.interop_message_expiry_window; used in registry test configs; no Go equivalent

These seem to represent the same concept, but the values don't match. Feels like the 7-day value matches the ecosystem's default. The 1-hour value may be an error or an unfinished migration, correct me if I'm wrong though.

The RollupConfig.interop_message_expiry_window field may also be dead code because it's never read by any production logic. If this makes sense and we all agree, then this should be investigated and reconciled in a follow-up.

cc @ajsutton

Apply nightly-specific binop_separator and import grouping rules.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@digorithm digorithm marked this pull request as ready for review March 26, 2026 14:29
@digorithm digorithm requested review from a team as code owners March 26, 2026 14:29
@digorithm digorithm requested review from ajsutton and geoknee March 26, 2026 14:29
@codecov
Copy link
Copy Markdown

codecov bot commented Mar 26, 2026

Codecov Report

❌ Patch coverage is 74.73684% with 24 lines in your changes missing coverage. Please review.
✅ Project coverage is 75.8%. Comparing base (a645419) to head (effa8d4).
⚠️ Report is 5 commits behind head on develop.

Files with missing lines Patch % Lines
rust/kona/bin/host/src/interop/local_kv.rs 0.0% 8 Missing ⚠️
rust/kona/bin/host/src/interop/cfg.rs 0.0% 7 Missing ⚠️
rust/kona/crates/proof/proof-interop/src/boot.rs 0.0% 7 Missing ⚠️
...na/crates/proof/proof-interop/src/consolidation.rs 0.0% 1 Missing ⚠️
rust/kona/crates/protocol/interop/src/graph.rs 98.5% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop   #19765      +/-   ##
===========================================
+ Coverage     75.5%    75.8%    +0.3%     
===========================================
  Files          194      486     +292     
  Lines        11272    61341   +50069     
===========================================
+ Hits          8512    46547   +38035     
- Misses        2616    14794   +12178     
+ Partials       144        0     -144     
Flag Coverage Δ
cannon-go-tests-64 ?
contracts-bedrock-tests ?
unit 75.8% <74.7%> (?)

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

Files with missing lines Coverage Δ
...st/kona/crates/proof/proof-interop/src/provider.rs 68.2% <100.0%> (ø)
...na/crates/proof/proof-interop/src/consolidation.rs 0.0% <0.0%> (ø)
rust/kona/crates/protocol/interop/src/graph.rs 94.3% <98.5%> (ø)
rust/kona/bin/host/src/interop/cfg.rs 29.8% <0.0%> (ø)
rust/kona/crates/proof/proof-interop/src/boot.rs 2.5% <0.0%> (ø)
rust/kona/bin/host/src/interop/local_kv.rs 0.0% <0.0%> (ø)

... and 674 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.

Historically kona has tried to put all the config in the rollup config - this is not a great choice but I think it's why the old 1 hour timeout was around. We should just remove that - it should be 7 days by default and come from the dependency set config.

I think to get things passing you'll need to update kona-host to be able to return the dependency set - it doesn't currently have anything that handles the new DEPENDENCY_SET local key. that's causing the tests to hang forever.

Claude says:

The relevant files that would need updates:

  • rust/kona/bin/host/src/interop/cfg.rs — add dependency_set field + CLI arg to InteropHost
  • rust/kona/bin/host/src/interop/local_kv.rs — add key 8 handling in InteropLocalInputs

Without those changes, requesting key 8 from kona-host will fail, and BootInfo::load() will return an error at the new deserialization step.

Comment on lines +148 to +155
// Load the dependency set configuration from the preimage oracle.
let dependency_set: DependencySet = {
let ser_cfg = oracle
.get(PreimageKey::new_local(DEPENDENCY_SET_KEY.to()))
.await
.map_err(OracleProviderError::Preimage)?;
serde_json::from_slice(&ser_cfg).map_err(OracleProviderError::Serde)?
};
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

hmm, there's a definite chance that kona-host doesn't support this yet which is why we're hitting a 2 hour timeout on tests (loading from the preimage oracle just retries forever because there is no good way out if you can't get a preimage you need).

@digorithm
Copy link
Copy Markdown
Contributor Author

Historically kona has tried to put all the config in the rollup config - this is not a great choice but I think it's why the old 1 hour timeout was around. We should just remove that - it should be 7 days by default and come from the dependency set config.

I think to get things passing you'll need to update kona-host to be able to return the dependency set - it doesn't currently have anything that handles the new DEPENDENCY_SET local key. that's causing the tests to hang forever.

Claude says:

The relevant files that would need updates:

  • rust/kona/bin/host/src/interop/cfg.rs — add dependency_set field + CLI arg to InteropHost
  • rust/kona/bin/host/src/interop/local_kv.rs — add key 8 handling in InteropLocalInputs

Without those changes, requesting key 8 from kona-host will fail, and BootInfo::load() will return an error at the new deserialization step.

Oh, that makes sense. Let me look into that.

The `kona-host` interop binary didn't handle local key 8
(`DEPENDENCY_SET_KEY`), so `BootInfo::load()` would hang forever waiting
for the preimage oracle to return the `DependencySet`.

Changes:
- Add --dependency-set-path CLI arg to InteropHost
- Add read_dependency_set() method to InteropHost
- Handle DEPENDENCY_SET_KEY in InteropLocalInputs::get()
- Add kona-interop dependency to kona-host Cargo.toml
@digorithm
Copy link
Copy Markdown
Contributor Author

@ajsutton Added your suggestion, but I'll keep the removal of the 1-hour hardcoded config in a follow-up PR. Removing DEFAULT_INTEROP_MESSAGE_EXPIRY_WINDOW and the RollupConfig.interop_message_expiry_window field touches the genesis/rollup config types, which could affect serialization compatibility and registry test configs. That's a different scope from this fix, imo (should be a short and quick separate PR).

digorithm and others added 2 commits March 27, 2026 10:46
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@wiz-inc-a178a98b5d
Copy link
Copy Markdown

wiz-inc-a178a98b5d bot commented Mar 27, 2026

Wiz Scan Summary

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

View scan details in Wiz

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

digorithm and others added 2 commits March 27, 2026 15:47
When --dependency-set-path is not provided, InteropLocalInputs now
returns a default DependencySet instead of None. This prevents
BootInfo::load() from hanging forever waiting for the preimage oracle
to return data for DEPENDENCY_SET_KEY.

The default DependencySet has no override, so get_message_expiry_window()
returns MESSAGE_EXPIRY_WINDOW (7 days), preserving existing behavior.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@digorithm digorithm requested a review from ajsutton March 27, 2026 21:28
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.

kona: MessageGraph uses hardcoded MESSAGE_EXPIRY_WINDOW instead of dependency set config

2 participants