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.
This commit is contained in:
Matthieu Vachon 2023-08-29 16:12:59 -04:00
parent d0dbbaf6a5
commit 5763314b0d
2 changed files with 8 additions and 2 deletions

View file

@ -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
}

View file

@ -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