diff --git a/consensus/misc/eip2935.go b/consensus/misc/eip2935.go index 887d30d4749..460c95f4b39 100644 --- a/consensus/misc/eip2935.go +++ b/consensus/misc/eip2935.go @@ -21,6 +21,7 @@ import ( "github.com/erigontech/erigon-lib/chain" libcommon "github.com/erigontech/erigon-lib/common" + "github.com/erigontech/erigon-lib/log/v3" "github.com/erigontech/erigon/consensus" "github.com/erigontech/erigon/core/state" @@ -29,6 +30,10 @@ import ( ) func StoreBlockHashesEip2935(header *types.Header, state *state.IntraBlockState, config *chain.Config, headerReader consensus.ChainHeaderReader) { + if state.GetCodeSize(params.HistoryStorageAddress) == 0 { + log.Debug("[EIP-2935] No code deployed to HistoryStorageAddress before call to store EIP-2935 history") + return + } headerNum := header.Number.Uint64() if headerNum == 0 { // Activation of fork at Genesis return