From 7cb7653a180662d888c77b2ebdae8709d4fdf8aa Mon Sep 17 00:00:00 2001 From: Lucca Martins Date: Fri, 14 Feb 2025 15:39:02 -0300 Subject: [PATCH] try removing byzantine prefetecher to solve goroutine leak --- core/blockchain.go | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/core/blockchain.go b/core/blockchain.go index a53cb80e1..a0f282059 100644 --- a/core/blockchain.go +++ b/core/blockchain.go @@ -2340,22 +2340,22 @@ func (bc *BlockChain) insertChain(chain types.Blocks, setHead bool, makeWitness } statedb.SetLogger(bc.logger) - // If we are past Byzantium, enable prefetching to pull in trie node paths - // while processing transactions. Before Byzantium the prefetcher is mostly - // useless due to the intermediate root hashing after each transaction. - if bc.chainConfig.IsByzantium(block.Number()) { - // Generate witnesses either if we're self-testing, or if it's the - // only block being inserted. A bit crude, but witnesses are huge, - // so we refuse to make an entire chain of them. - if bc.vmConfig.StatelessSelfValidation || (makeWitness && len(chain) == 1) { - witness, err = stateless.NewWitness(block.Header(), bc) - if err != nil { - return nil, it.index, err - } - } - statedb.StartPrefetcher("chain", witness) - } - activeState = statedb + // // If we are past Byzantium, enable prefetching to pull in trie node paths + // // while processing transactions. Before Byzantium the prefetcher is mostly + // // useless due to the intermediate root hashing after each transaction. + // if bc.chainConfig.IsByzantium(block.Number()) { + // // Generate witnesses either if we're self-testing, or if it's the + // // only block being inserted. A bit crude, but witnesses are huge, + // // so we refuse to make an entire chain of them. + // if bc.vmConfig.StatelessSelfValidation || (makeWitness && len(chain) == 1) { + // witness, err = stateless.NewWitness(block.Header(), bc) + // if err != nil { + // return nil, it.index, err + // } + // } + // statedb.StartPrefetcher("chain", witness) + // } + // activeState = statedb // If we have a followup block, run that against the current state to pre-cache // transactions and probabilistically some of the account/storage trie nodes.