From e680441df5d3f886a29e8987c2f546977849462b Mon Sep 17 00:00:00 2001 From: protolambda Date: Sun, 12 Jan 2025 00:09:08 -0600 Subject: [PATCH] core: do not hash header if header is still changing --- core/state_processor.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/core/state_processor.go b/core/state_processor.go index a1042cf868..207dbc3b09 100644 --- a/core/state_processor.go +++ b/core/state_processor.go @@ -229,7 +229,11 @@ func ApplyTransactionExtended(config *params.ChainConfig, bc ChainContext, autho blockContext := NewEVMBlockContext(header, bc, author, config, statedb) txContext := NewEVMTxContext(msg) vmenv := vm.NewEVM(blockContext, txContext, statedb, config, cfg) - return ApplyTransactionWithEVM(msg, config, gp, statedb, header.Number, header.Hash(), tx, usedGas, vmenv) + blockHash := common.Hash{} + if header.Root != (common.Hash{}) { // if the header is sealed, then hydrate the receipt with it. If not, then blockhash is still changing, not worth computing. + blockHash = header.Hash() + } + return ApplyTransactionWithEVM(msg, config, gp, statedb, header.Number, blockHash, tx, usedGas, vmenv) } // ProcessBeaconBlockRoot applies the EIP-4788 system call to the beacon block root