Repository navigation
fix: assemble genesis with the canonical Genesis type - #433
Merged
Merged
Conversation
The `genesis` binary defined its own `GenesisConfig` — a partial copy of
`summit_types::Genesis` that predated the staking fields. With no
`deny_unknown_fields`, deserializing the template into it silently dropped
`validator_minimum_stake` / `validator_maximum_stake`, so the emitted
genesis.toml was missing fields the node's runtime loader requires and
`summit run` panicked at startup ("missing field `validator_minimum_stake`").
Load and serialize the template as `summit_types::Genesis` directly and drop
the local struct, so there is a single genesis schema the binary can't drift
from.
Context: this surfaced in the Seismic deploy flow, whose operator CLI shells
out to this `genesis` binary to build a network's genesis. A few rough edges
there: it has to be built and installed via cargo; it's named just `genesis`,
which collides easily on PATH and doesn't read as part of summit; and (as
above) it's a separately-built, independently-versioned copy of the node's
genesis logic, with nothing guaranteeing it matches the summit running on the
node.
Proposed directions (just ideas, not part of this change):
- Move assembly into the node: have `sendGenesis` take the template +
validator set rather than a pre-built genesis.toml, and let each node
build its own genesis with its own `Genesis` type and sort — e.g. a
shared `assemble_genesis(template, validators)` backing both this binary
and the RPC handler. The node could also fill `eth_genesis_hash` from its
own reth, which would remove the external binary and the version-skew
question altogether.
- Or, if a standalone tool is preferred, fold this into the `summit` binary
as a `summit genesis` subcommand (alongside `run`/`keys`), so it shares
the genesis types and isn't a stray `genesis` on PATH.
samlaf
force-pushed
the
fix-genesis-canonical-type
branch
from
July 7, 2026 13:51
9a054eb to
ee7a117
Compare
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.
The
genesisbinary defined its ownGenesisConfig— a partial copy ofsummit_types::Genesisthat predated the staking fields. With nodeny_unknown_fields, deserializing the template into it silently droppedvalidator_minimum_stake/validator_maximum_stake, so the emitted genesis.toml was missing fields the node's runtime loader requires andsummit runpanicked at startup ("missing fieldvalidator_minimum_stake").Load and serialize the template as
summit_types::Genesisdirectly and drop the local struct, so there is a single genesis schema the binary can't drift from.Context: this surfaced in the Seismic deploy flow, whose operator CLI shells out to this
genesisbinary to build a network's genesis. A few rough edges there: it has to be built and installed via cargo; it's named justgenesis, which collides easily on PATH and doesn't read as part of summit; and (as above) it's a separately-built, independently-versioned copy of the node's genesis logic, with nothing guaranteeing it matches the summit running on the node.Proposed alternative designs
sendGenesistake the template + validator set rather than a pre-built genesis.toml, and let each node build its own genesis with its ownGenesistype and sort — e.g. a sharedassemble_genesis(template, validators)backing both this binary and the RPC handler. The node could also filleth_genesis_hashfrom its own reth, which would remove the external binary and the version-skew question altogether.summitbinary as asummit genesissubcommand (alongsiderun/keys), so it shares the genesis types and isn't a straygenesison PATH.