From f27902e05c6e7892e16a305d8baba1b6f2d57814 Mon Sep 17 00:00:00 2001 From: Felix Lange Date: Tue, 8 Oct 2024 13:22:04 +0200 Subject: [PATCH] core: add check for requests before prague --- core/block_validator.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/core/block_validator.go b/core/block_validator.go index 35a815b6a1..35695d34d8 100644 --- a/core/block_validator.go +++ b/core/block_validator.go @@ -147,8 +147,10 @@ func (v *BlockValidator) ValidateState(block *types.Block, statedb *state.StateD if header.RequestsHash != nil { reqhash := types.CalcRequestsHash(res.Requests) if reqhash != *header.RequestsHash { - return fmt.Errorf("invalid deposit root hash (remote: %x local: %x)", *header.RequestsHash, reqhash) + return fmt.Errorf("invalid requests hash (remote: %x local: %x)", *header.RequestsHash, reqhash) } + } else if res.Requests != nil { + return fmt.Errorf("block has requests before prague fork") } // Validate the state root against the received state root and throw // an error if they don't match.