@@ -1796,9 +1796,9 @@ func (bc *BlockChain) insertChain(chain types.Blocks, verifySeals bool) (int, er
17961796 lastCanon = block
17971797 continue
17981798 }
1799+
17991800 // Retrieve the parent block and it's state to execute on top
18001801 start := time .Now ()
1801-
18021802 parent := it .previous ()
18031803 if parent == nil {
18041804 parent = bc .GetHeader (block .ParentHash (), block .NumberU64 ()- 1 )
@@ -1807,6 +1807,7 @@ func (bc *BlockChain) insertChain(chain types.Blocks, verifySeals bool) (int, er
18071807 if err != nil {
18081808 return it .index , err
18091809 }
1810+
18101811 // Enable prefetching to pull in trie node paths while processing transactions
18111812 statedb .StartPrefetcher ("chain" )
18121813 activeState = statedb
@@ -1828,6 +1829,7 @@ func (bc *BlockChain) insertChain(chain types.Blocks, verifySeals bool) (int, er
18281829 }(time .Now (), followup , throwaway , & followupInterrupt )
18291830 }
18301831 }
1832+
18311833 // Process block using the parent state as reference point
18321834 substart := time .Now ()
18331835 receipts , logs , usedGas , err := bc .processor .Process (block , statedb , bc .vmConfig )
@@ -1836,6 +1838,7 @@ func (bc *BlockChain) insertChain(chain types.Blocks, verifySeals bool) (int, er
18361838 atomic .StoreUint32 (& followupInterrupt , 1 )
18371839 return it .index , err
18381840 }
1841+
18391842 // Update the metrics touched during block processing
18401843 accountReadTimer .Update (statedb .AccountReads ) // Account reads are complete, we can mark them
18411844 storageReadTimer .Update (statedb .StorageReads ) // Storage reads are complete, we can mark them
@@ -1911,6 +1914,7 @@ func (bc *BlockChain) insertChain(chain types.Blocks, verifySeals bool) (int, er
19111914 dirty , _ := bc .stateCache .TrieDB ().Size ()
19121915 stats .report (chain , it .index , dirty )
19131916 }
1917+
19141918 // Any blocks remaining here? The only ones we care about are the future ones
19151919 if block != nil && errors .Is (err , consensus .ErrFutureBlock ) {
19161920 if err := bc .addFutureBlock (block ); err != nil {
0 commit comments