core: add check for requests before prague

This commit is contained in:
Felix Lange 2024-10-08 13:22:04 +02:00
parent cb08ea9638
commit f27902e05c

View file

@ -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.