consensus/misc/eip4844: add parent header sanity check

This commit is contained in:
Felix Lange 2025-02-04 22:52:27 +01:00
parent c4ad459bd2
commit e845e183af

View file

@ -34,6 +34,9 @@ var (
// if the current block contains no transactions, the excessBlobGas is updated
// accordingly.
func VerifyEIP4844Header(config *params.ChainConfig, parent, header *types.Header) error {
if header.Number.Uint64() != parent.Number.Uint64()+1 {
panic("bad header pair")
}
// Verify the header is not malformed
if header.ExcessBlobGas == nil {
return errors.New("header is missing excessBlobGas")