From 3533e049e7b4bfa91b157482226ac600603d5eda Mon Sep 17 00:00:00 2001 From: blxdyx <125243069+blxdyx@users.noreply.github.com> Date: Wed, 20 Dec 2023 21:02:03 +0800 Subject: [PATCH] unwind read genesis (#272) --- core/genesis_write.go | 2 -- eth/backend.go | 1 + 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/core/genesis_write.go b/core/genesis_write.go index 6602f8ce8f6..07559a7b68f 100644 --- a/core/genesis_write.go +++ b/core/genesis_write.go @@ -38,7 +38,6 @@ import ( "github.com/ledgerwatch/erigon/consensus/serenity" "github.com/ledgerwatch/erigon/core/rawdb" "github.com/ledgerwatch/erigon/core/state" - "github.com/ledgerwatch/erigon/core/systemcontracts" "github.com/ledgerwatch/erigon/core/types" "github.com/ledgerwatch/erigon/crypto" "github.com/ledgerwatch/erigon/eth/ethconfig" @@ -98,7 +97,6 @@ func WriteGenesisBlock(tx kv.RwTx, genesis *types.Genesis, overrideShanghaiTime config.ShanghaiTime = overrideShanghaiTime } } - systemcontracts.GenesisHash = storedHash if (storedHash == libcommon.Hash{}) { custom := true if genesis == nil { diff --git a/eth/backend.go b/eth/backend.go index 6315f6c0f08..43ff0434dad 100644 --- a/eth/backend.go +++ b/eth/backend.go @@ -220,6 +220,7 @@ func New(stack *node.Node, config *ethconfig.Config) (*Ethereum, error) { genesisSpec := config.Genesis if h != (libcommon.Hash{}) { // fallback to db content chainConfig = genesisSpec.Config + systemcontracts.GenesisHash = h genesis = rawdb.ReadBlock(tx, h, 0) } else { var genesisErr error