From b73809289b12003f903dbc0032cb90a3c62017fa Mon Sep 17 00:00:00 2001 From: Ignacio Hagopian Date: Fri, 25 Oct 2024 10:46:33 -0300 Subject: [PATCH] fix --- core/block_validator.go | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/core/block_validator.go b/core/block_validator.go index de5a7eaedfdf..e45c6e3134af 100644 --- a/core/block_validator.go +++ b/core/block_validator.go @@ -133,22 +133,19 @@ func (v *BlockValidator) ValidateState(block *types.Block, statedb *state.StateD return fmt.Errorf("invalid merkle root (remote: %x local: %x) dberr: %w", header.Root, root, statedb.Error()) } - // TODO(verkle): the right-hand side of the && is a workaround for an existing bug in EIP68000Transition - // test filling. When running these tests, geth decides when inserting some blocks that it is a side chain - // and the execution witness is lost. This is a workaround to avoid failing the tests until fixed. - if v.bc.Config().IsVerkle(header.Number, header.Time) && block.ExecutionWitness() != nil { + if v.bc.Config().IsVerkle(header.Number, header.Time) { parent := v.bc.GetHeaderByNumber(header.Number.Uint64() - 1) if parent == nil { return fmt.Errorf("nil parent header for block %d", header.Number) } - proot, stateDiff, proof, err := beacon.BuildVerkleProof(header, statedb, parent.Root) + stateDiff, proof, err := beacon.BuildVerkleProof(header, statedb, parent.Root) if err != nil { return fmt.Errorf("error building verkle proof: %w", err) } ew := types.ExecutionWitness{ StateDiff: stateDiff, VerkleProof: proof, - ParentStateRoot: proot, + ParentStateRoot: parent.Root, } if err := ew.Equal(block.ExecutionWitness()); err != nil { return fmt.Errorf("invalid execution witness: %v", err)