Skip to content

Commit

Permalink
Fixed genesis on database bootstrap being emitted while it should not
Browse files Browse the repository at this point in the history
  • Loading branch information
maoueh committed Sep 20, 2023
1 parent cd02d85 commit f2f6b51
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion core/genesis.go
Original file line number Diff line number Diff line change
Expand Up @@ -260,9 +260,13 @@ func (g *Genesis) ToBlock(db ethdb.Database) *types.Block {
if db == nil {
db = rawdb.NewMemoryDatabase()
}

// Firehose: We do not log those as we are going to trace the genesis block on Blockchain start, so there is no
// need to log the genesis block creation.

statedb, _ := state.New(common.Hash{}, state.NewDatabase(db), nil)
for addr, account := range g.Alloc {
statedb.AddBalance(addr, account.Balance, false, firehose.NoOpContext, firehose.BalanceChangeReason("genesis_balance"))
statedb.AddBalance(addr, account.Balance, false, firehose.NoOpContext, firehose.IgnoredBalanceChangeReason)
statedb.SetCode(addr, account.Code, firehose.NoOpContext)
statedb.SetNonce(addr, account.Nonce, firehose.NoOpContext)
for key, value := range account.Storage {
Expand Down

0 comments on commit f2f6b51

Please sign in to comment.