fix(kona): use configurable message expiry window in MessageGraph#19765
fix(kona): use configurable message expiry window in MessageGraph#19765
Conversation
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>
|
Just a note: while working on this fix, I noticed two constants defining "default message expiry window" with different values: Constant: 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 cc @ajsutton |
Apply nightly-specific binop_separator and import grouping rules. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Codecov Report❌ Patch coverage is 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
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
ajsutton
left a comment
There was a problem hiding this comment.
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.
| // 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)? | ||
| }; |
There was a problem hiding this comment.
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).
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
|
@ajsutton Added your suggestion, but I'll keep the removal of the 1-hour hardcoded config in a follow-up PR. Removing |
…fix/kona-message-expiry-window
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Wiz Scan Summary
To detect these findings earlier in the dev lifecycle, try using Wiz Code VS Code Extension. |
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>
Summary
message_expiry_window: u64parameter toMessageGraph::derive()instead of using hardcodedMESSAGE_EXPIRY_WINDOWconstantDependencySetfrom preimage oracle local key 8 inBootInfoBootInfothroughSuperchainConsolidatortoMessageGraphMotivation
MessageGraph::check_single_dependency()was using the hardcodedMESSAGE_EXPIRY_WINDOWconstant (7 days) instead of the configurable value from theDependencySet. The Go FPP host already serves aDependencySet(with configurableoverrideMessageExpiryWindow) via the preimage oracle at local key 8, but Kona'sBootInfodidn'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
MessageGraphtests updated to passMESSAGE_EXPIRY_WINDOWexplicitly — behavior identical to beforetest_derive_and_resolve_graph_message_expired_custom_window— proves custom 10s window triggers expirytest_derive_and_resolve_graph_message_not_expired_within_custom_window— proves boundary correctnesscargo test --package kona-interop --all-features— 31 tests passcargo test --package kona-proof-interop— 30 tests passDependencySet::get_message_expiry_window()falls back toMESSAGE_EXPIRY_WINDOWwhen no override is set🤖 Generated with Claude Code
Co-Authored-By: Claude Opus 4.6 noreply@anthropic.com