Genesis::validate (types/src/genesis.rs) checks every other genesis field but never eth_genesis_hash. Genesis::genesis_hash reads it with a double expect and documents it as "validated at load time", so a genesis with, for example, eth_genesis_hash = "0xdead" loads cleanly and the node panics at startup (bad eth_genesis_hash).
This contradicts three contracts the repo states:
sendGenesis validates and atomically installs the file so startup does not risk "a crash loop", yet it installs this one and the node crash-loops on it.
summit genesis digest says "anything this accepts a validator accepts", yet it prints a digest for this file.
summit genesis set-validators re-parses its output to avoid "emitting a genesis no node can load", but copies the hash through unchecked.
Repro: load example_genesis.toml, set eth_genesis_hash = "0xdead", call validate(): it returns Ok, and genesis_hash() then panics.
Fix: reject a non-hex or non-32-byte value in validate, next to the existing treasury_address check. I have this ready with regression tests: they fail on main and pass with the fix, and summit-types (479), summit-rpc (22) and summit --lib (83) are green. Since external contributors can keep one PR open at a time, I'll open it once one of #458 / #460 / #461 is resolved, or sooner if you'd prefer.
Genesis::validate(types/src/genesis.rs) checks every other genesis field but nevereth_genesis_hash.Genesis::genesis_hashreads it with a doubleexpectand documents it as "validated at load time", so a genesis with, for example,eth_genesis_hash = "0xdead"loads cleanly and the node panics at startup (bad eth_genesis_hash).This contradicts three contracts the repo states:
sendGenesisvalidates and atomically installs the file so startup does not risk "a crash loop", yet it installs this one and the node crash-loops on it.summit genesis digestsays "anything this accepts a validator accepts", yet it prints a digest for this file.summit genesis set-validatorsre-parses its output to avoid "emitting a genesis no node can load", but copies the hash through unchecked.Repro: load
example_genesis.toml, seteth_genesis_hash = "0xdead", callvalidate(): it returnsOk, andgenesis_hash()then panics.Fix: reject a non-hex or non-32-byte value in
validate, next to the existingtreasury_addresscheck. I have this ready with regression tests: they fail onmainand pass with the fix, andsummit-types(479),summit-rpc(22) andsummit --lib(83) are green. Since external contributors can keep one PR open at a time, I'll open it once one of #458 / #460 / #461 is resolved, or sooner if you'd prefer.