From f215c44b451c65e2db662218e7d3cbb66c4c259a Mon Sep 17 00:00:00 2001 From: NathanBSC Date: Wed, 31 Jul 2024 10:57:07 +0800 Subject: [PATCH] core: not record `zero hash` beacon block root --- core/state_processor.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/core/state_processor.go b/core/state_processor.go index 2af0d514fe..33de936e0d 100644 --- a/core/state_processor.go +++ b/core/state_processor.go @@ -231,6 +231,11 @@ func ApplyTransaction(config *params.ChainConfig, bc ChainContext, author *commo // ProcessBeaconBlockRoot applies the EIP-4788 system call to the beacon block root // contract. This method is exported to be used in tests. func ProcessBeaconBlockRoot(beaconRoot common.Hash, vmenv *vm.EVM, statedb *state.StateDB) { + // Return immediately if beaconRoot is equal to the zero hash. + if beaconRoot == (common.Hash{}) { + return + } + // If EIP-4788 is enabled, we need to invoke the beaconroot storage contract with // the new root msg := &Message{