From 9e343669b5224758a32d6001652829fc45eaba14 Mon Sep 17 00:00:00 2001 From: Nathan Date: Wed, 31 Jul 2024 16:39:24 +0800 Subject: [PATCH] core: not record `zero hash` beacon block root with Parlia engine (#2621) --- core/state_processor.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/core/state_processor.go b/core/state_processor.go index 2af0d514f..9ef227ccc 100644 --- a/core/state_processor.go +++ b/core/state_processor.go @@ -231,6 +231,13 @@ 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 equals the zero hash when using the Parlia engine. + if beaconRoot == (common.Hash{}) { + if chainConfig := vmenv.ChainConfig(); chainConfig != nil && chainConfig.Parlia != nil { + return + } + } + // If EIP-4788 is enabled, we need to invoke the beaconroot storage contract with // the new root msg := &Message{