From eb7f934f260c0202b604d86aa85c76c6ca9d0352 Mon Sep 17 00:00:00 2001 From: Jared Wasinger Date: Mon, 13 Oct 2025 15:03:01 +0800 Subject: [PATCH] minor cleanups --- core/blockchain.go | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/core/blockchain.go b/core/blockchain.go index 57b39b9f57..f1b77d45b9 100644 --- a/core/blockchain.go +++ b/core/blockchain.go @@ -203,9 +203,9 @@ type BlockChainConfig struct { // If the value is -1, indexing is disabled. TxLookupLimit int64 - // If EnableBALForTesting is enabled, block access lists will be created as part of - // block processing and embedded in the block body. The block access list hash will - // not be set in the header. + // If EnableBALForTesting is enabled, block access lists will be created + // from block execution and embedded in the body. The block access list + // hash will not be set in the header. EnableBALForTesting bool // StateSizeTracking indicates whether the state size tracking is enabled. @@ -1922,17 +1922,15 @@ func (bc *BlockChain) insertChain(chain types.Blocks, setHead bool, makeWitness if parent == nil { parent = bc.GetHeader(block.ParentHash(), block.NumberU64()-1) } - // The traced section of block import. start := time.Now() - // construct or verify block access lists if BALs are enabled and - // we are post-selfdestruct removal fork. + enableBAL := (bc.cfg.EnableBALForTesting && bc.chainConfig.IsCancun(block.Number(), block.Time())) || bc.chainConfig.IsAmsterdam(block.Number(), block.Time()) blockHasAccessList := block.Body().AccessList != nil - makeBAL := enableBAL && !blockHasAccessList + constructBAL := enableBAL && !blockHasAccessList validateBAL := enableBAL && blockHasAccessList - res, err := bc.ProcessBlock(parent.Root, block, setHead, makeWitness && len(chain) == 1, makeBAL, validateBAL) + res, err := bc.ProcessBlock(parent.Root, block, setHead, makeWitness && len(chain) == 1, constructBAL, validateBAL) if err != nil { return nil, it.index, err }