feat: state_actor_params — pre-populate EL databases with state-actor - #1455
Open
qu0b wants to merge 2 commits into
Open
feat: state_actor_params — pre-populate EL databases with state-actor#1455qu0b wants to merge 2 commits into
qu0b wants to merge 2 commits into
Conversation
Adds an opt-in pre-launch step that runs state-actor (--genesis mode) against the network's own genesis.json per unique el_type, stores the produced client-native datadir as a files artifact (state-actor-<el_type>-data), and registers it in extra_files_artifacts so participants mount it via el_extra_mounts. Alloc-verbatim generation keeps the genesis hash identical to what CL genesis was built against, so no CL-side changes are needed. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01TJoWPhxuJVSwvzpZr494X1
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01TJoWPhxuJVSwvzpZr494X1
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.
Summary
Adds an opt-in
state_actor_paramspackage arg that pre-populates EL client databases with state-actor before the EL clients launch.When enabled, one state-actor generation run happens per unique
el_typeamong the participants — after genesis generation, driven by the network's owngenesis.json(state-actor --genesis) — so the produced database's genesis hash matches the hash the CL genesis was built against, and no CL-side changes are needed. Each run's output datadir is stored as a files artifact namedstate-actor-<el_type>-dataand registered so participants can opt in by mounting it at their execution data dir:This follows the shadowfork pattern (pre-launch step fills the EL data location before the client starts), but generates state instead of downloading a snapshot.
Why
state-actor writes client-native databases (Pebble for geth, MDBX/RocksDB for reth, Bonsai RocksDB for besu, flat-state for nethermind, RocksDB for ethrex, Erigon v3 snapshots) without going through each client's init path — useful for state-bloat experiments and cross-client determinism testing. This PR wires its output into participant startup. Alloc-verbatim mode (no
target_size) is fully supported today; bloated-state mode additionally requires anchoring the CL genesis to the state-actor genesis hash, which is left for a follow-up (state-actor exports aneth_getBlockByNumber-shapedgenesis_block.jsonfor exactly that purpose).Changes
src/state_actor/state_actor_launcher.star(new): runs the per-el_type generation viaplan.run_sh, stores + registers the datadir artifactssrc/participant_network.star: invoke the launcher afterel_cl_datais generated, before EL launchsrc/package_io/input_parser.star,src/package_io/sanity_check.star:state_actor_paramsplumbing (enabled,seed,target_size,images)README.md: config reference entryTesting
Tested with one single-node enclave per supported EL (geth, reth, besu, nethermind, ethrex, erigon), each paired with lighthouse, using state-actor images built from ethereum/state-actor compare: qu0b/ethereum-package-integration (adds the
--genesisflag; not yet upstream — until it merges,state_actor_params.imagesmust point at images built from that branch):eth_getBlockByNumber(0x0)hash equals the hash state-actor exported, so the existing CL genesis stayed validPer-client notes surfaced by testing (documented in the README entry): nethermind participants need
--Init.BaseDbPath=<datadir>+--FlatDb.Enabled=true; erigon's pre-launcherigon initcoexists cleanly with the pre-seeded datadir.🤖 Generated with Claude Code
https://claude.ai/code/session_01TJoWPhxuJVSwvzpZr494X1