From e845e183af96e3a94f4c7ae4be6e8d23a8a2cabf Mon Sep 17 00:00:00 2001 From: Felix Lange Date: Tue, 4 Feb 2025 22:52:27 +0100 Subject: [PATCH] consensus/misc/eip4844: add parent header sanity check --- consensus/misc/eip4844/eip4844.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/consensus/misc/eip4844/eip4844.go b/consensus/misc/eip4844/eip4844.go index 148ea60274..088aa2d1ef 100644 --- a/consensus/misc/eip4844/eip4844.go +++ b/consensus/misc/eip4844/eip4844.go @@ -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")