From 5763314b0d44dc49f6b3cde3de0abef52e20df51 Mon Sep 17 00:00:00 2001 From: Matthieu Vachon Date: Tue, 29 Aug 2023 16:12:59 -0400 Subject: [PATCH] Removed tracer support when doing `genesis.Flush(...)` The genesis flush do set the logger, but we receive the genesis block allocs via `OnGenesisBlock` meaning it's not necessary to have the logger in the flush. --- core/genesis.go | 1 - eth/tracers/firehose.go | 9 ++++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/core/genesis.go b/core/genesis.go index 54ec15cba4..b70c88b908 100644 --- a/core/genesis.go +++ b/core/genesis.go @@ -145,7 +145,6 @@ func (ga *GenesisAlloc) deriveHash() (common.Hash, error) { // Also, the genesis state specification will be flushed as well. func (ga *GenesisAlloc) flush(db ethdb.Database, triedb *trie.Database, blockhash common.Hash, bcLogger BlockchainLogger) error { statedb, err := state.New(types.EmptyRootHash, state.NewDatabaseWithNodeDB(db, triedb), nil) - statedb.SetLogger(bcLogger) if err != nil { return err } diff --git a/eth/tracers/firehose.go b/eth/tracers/firehose.go index fc0211ef68..f1decd30cb 100644 --- a/eth/tracers/firehose.go +++ b/eth/tracers/firehose.go @@ -732,7 +732,14 @@ func (f *Firehose) OnLog(l *types.Log) { } func (f *Firehose) OnNewAccount(a common.Address) { - f.ensureInBlockAndInTrxAndInCall() + f.ensureInBlockOrTrx() + if f.transaction == nil { + // We receive OnNewAccount on finalization of the block which means there is no + // transaction active. In that case, we do not track the account creation because + // the "old" Firehose didn't but mainly because we don't have `AccountCreation` at + // the block level so what can we do... + return + } if f.isPrecompiledAddr(a) { return