mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-02 01:53:48 +00:00
Fixed BlockchainLogger.OnBlockEnd called too much times (#19)
The `processBlock` is already doing the work to call `OnBlockEnd`, no need to call it anymore afterwards.
This commit is contained in:
parent
8610f8f68c
commit
72410c399d
3 changed files with 2 additions and 8 deletions
|
|
@ -187,7 +187,7 @@ func (pre *Prestate) Apply(vmConfig vm.Config, chainConfig *params.ChainConfig,
|
|||
}
|
||||
if beaconRoot := pre.Env.ParentBeaconBlockRoot; beaconRoot != nil {
|
||||
evm := vm.NewEVM(vmContext, vm.TxContext{}, statedb, chainConfig, vmConfig)
|
||||
core.ProcessBeaconBlockRoot(*beaconRoot, evm, statedb)
|
||||
core.ProcessBeaconBlockRoot(*beaconRoot, evm, statedb, nil)
|
||||
}
|
||||
var blobGasUsed uint64
|
||||
|
||||
|
|
|
|||
|
|
@ -1870,9 +1870,6 @@ func (bc *BlockChain) insertChain(chain types.Blocks, setHead bool) (int, error)
|
|||
// After merge we expect few side chains. Simply count
|
||||
// all blocks the CL gives us for GC processing time
|
||||
bc.gcproc += res.procTime
|
||||
if bc.logger != nil {
|
||||
bc.logger.OnBlockEnd(nil)
|
||||
}
|
||||
return it.index, nil // Direct block insertion of a single block
|
||||
}
|
||||
switch res.status {
|
||||
|
|
@ -1901,9 +1898,6 @@ func (bc *BlockChain) insertChain(chain types.Blocks, setHead bool) (int, error)
|
|||
"txs", len(block.Transactions()), "gas", block.GasUsed(), "uncles", len(block.Uncles()),
|
||||
"root", block.Root())
|
||||
}
|
||||
if bc.logger != nil {
|
||||
bc.logger.OnBlockEnd(nil)
|
||||
}
|
||||
}
|
||||
|
||||
// Any blocks remaining here? The only ones we care about are the future ones
|
||||
|
|
|
|||
|
|
@ -36,7 +36,7 @@ func FuzzPrecompiledContracts(f *testing.F) {
|
|||
return
|
||||
}
|
||||
inWant := string(input)
|
||||
RunPrecompiledContract(p, input, gas)
|
||||
RunPrecompiledContract(p, input, gas, nil)
|
||||
if inHave := string(input); inWant != inHave {
|
||||
t.Errorf("Precompiled %v modified input data", a)
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue