mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-19 02:12:23 +00:00
core: add check for requests before prague
This commit is contained in:
parent
cb08ea9638
commit
f27902e05c
1 changed files with 3 additions and 1 deletions
|
|
@ -147,8 +147,10 @@ func (v *BlockValidator) ValidateState(block *types.Block, statedb *state.StateD
|
||||||
if header.RequestsHash != nil {
|
if header.RequestsHash != nil {
|
||||||
reqhash := types.CalcRequestsHash(res.Requests)
|
reqhash := types.CalcRequestsHash(res.Requests)
|
||||||
if reqhash != *header.RequestsHash {
|
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
|
// Validate the state root against the received state root and throw
|
||||||
// an error if they don't match.
|
// an error if they don't match.
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue