Add reactive runtime + cold-start sync (the state-engine substrate the ecosystem consumes)#14
Merged
Conversation
Adds a cold-start sync mechanism gated under the existing `reactive` feature:
a consumer declares the storage to warm on startup (verify / probe / accounts /
discover) and drives a bounded multi-round loop via a pure `ColdStartPlanner`.
Surfaces a per-slot `SlotFetch` (Value / Zero / FetchFailed / NotAttempted)
that closes the archive-miss gap — distinguishing a genuine on-chain zero from
a fetch failure, which `verify_slots` could not express.
- src/cold_start/: ColdStartPlan/Call/Results/CallResult/RoundOutcome,
ColdStartPlanner/Step, ColdStartConfig/Pin/RunReport, ColdStartError, and the
driver methods EvmCache::{execute_cold_start_round, run_cold_start}.
- src/freshness.rs: SlotOutcome / SlotFetch (ungated, beside SlotChange).
- src/cache/mod.rs: verify_slots_core extraction (verify_slots / reconcile_slots
behaviour unchanged), verify_slots_with_outcomes, ensure_account_blocking;
classify and block_in_place_handle widened to pub(crate).
- 19 offline acceptance tests (tests/cold_start.rs) + setup_cache_with_asserter.
Composes existing primitives (verify_slots_inner, inject_storage_batch_fresh,
call_raw_with_access_list, ensure_account, StorageBatchFetchFn). No AMM concepts
enter evm-fork-cache. `cargo test --no-default-features` stays green.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
- ColdStartRunReport / run_cold_start: clarify the report is returned only on the Ok path; on error it is dropped (use execute_cold_start_round to observe a failed round's partial outcomes). - discovered_accounts / discovered_slots: drop "distinct" — they are sums across calls and rounds, not de-duplicated. - ColdStartResults: document that fetched/probed order is unspecified (look up by (address, slot)). Doc-only; no behavior change. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This was referenced Jun 26, 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.
Lands the reactive runtime and cold-start modules onto
main. These are the substrate thatevm-amm-stateandevm-oracle-stateare built on — both currently pin this branch by git rev (903af3df) because the API does not exist onmain, which blocks publishing the whole ecosystem to crates.io. They are core shipping features, not optional add-ons.What this adds
src/cold_start/— protocol-neutral cold-start: declaratively warm a working set of accounts/storage slots into the cache in one batched pass (config,driver,plan,planner,results,error), driven viaEvmCache::run_cold_start. This is how a consumer adopts a working set of pools/feeds into the fork without hand-wiring fetches.src/reactive/mod.rs(+488) — the reactive runtime:ReactiveRuntime/ReactiveHandler/ReactiveHook/HookSignal, with the reorg-detection core (journaled heads,ParentMismatchdetection,ChainStatus,reorg_torecovery,RemovedLoghandling) andingest_batch. This is the event→state control plane the domain crates decode into.Supporting changes to
src/cache/mod.rs(+98) andsrc/freshness.rs(+47), plustests/cold_start.rs(1,051 lines) andtests/reactive_reorg.rs(612 lines).Why now
The ecosystem (
evm-amm-state,evm-oracle-state) compiles against this surface today via a pinned git rev. Until it lands onmainand publishes, an outside developer cannot assemble the stack from crates.io.Sequencing note
The open release-readiness PR (#13) hardened the older
events-API line and predates these modules. Per plan, once this merges, the release-readiness pass will be re-run on the combinedmain(covering the reactive + cold-start surface too), superseding #13.🤖 Generated with Claude Code