From 04e7aa09f430d86c5655d7919285978dab019136 Mon Sep 17 00:00:00 2001 From: Ignacio Hagopian Date: Wed, 28 Feb 2024 10:14:44 -0300 Subject: [PATCH] fix wierd block with MPT state Signed-off-by: Ignacio Hagopian --- core/blockchain.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/core/blockchain.go b/core/blockchain.go index e4d5f40b3cbc..befbe53eb922 100644 --- a/core/blockchain.go +++ b/core/blockchain.go @@ -1738,8 +1738,9 @@ func (bc *BlockChain) insertChain(chain types.Blocks, setHead bool) (int, error) } } rootz := parent.Root - if count > 0 { - rootz = state.LastCommittedRoot + if count == 1 { + // Force first block to fallback to the tree. + rootz = common.HexToHash("0x00") } count++ statedb, err := state.New(rootz, bc.stateCache, bc.snaps)