Skip to content

Commit

Permalink
record preimages in genesis commit
Browse files Browse the repository at this point in the history
Signed-off-by: Ignacio Hagopian <[email protected]>
  • Loading branch information
jsign committed Aug 22, 2024
1 parent f3ff46e commit b640d33
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions core/genesis.go
Original file line number Diff line number Diff line change
Expand Up @@ -333,7 +333,7 @@ func SetupGenesisBlockWithOverride(db ethdb.Database, triedb *trie.Database, gen
// TODO: remove `true`. The problem is that for test consumption, the genesis block is stored
// in the db and is unaware of preimage recording. This means that we won't enter this if and
// save the genesis block state with preimages enabled, thus missing the genesis preimages.
if true || (stored == common.Hash{}) {
if (stored == common.Hash{}) {
if genesis == nil {
log.Info("Writing default main-net genesis block")
genesis = DefaultGenesisBlock()
Expand Down Expand Up @@ -563,7 +563,7 @@ func (g *Genesis) Commit(db ethdb.Database, triedb *trie.Database) (*types.Block
// Note the state changes will be committed in hash-based scheme, use Commit
// if path-scheme is preferred.
func (g *Genesis) MustCommit(db ethdb.Database) *types.Block {
triedb := trie.NewDatabaseWithConfig(db, &trie.Config{Verkle: g.Config != nil && g.Config.IsVerkle(big.NewInt(int64(g.Number)), g.Timestamp)})
triedb := trie.NewDatabaseWithConfig(db, &trie.Config{Preimages: true, Verkle: g.Config != nil && g.Config.IsVerkle(big.NewInt(int64(g.Number)), g.Timestamp)})
block, err := g.Commit(db, triedb)
if err != nil {
panic(err)
Expand Down

0 comments on commit b640d33

Please sign in to comment.