|
|
|
@ -263,11 +263,19 @@ func (beacon *Beacon) verifyHeader(chain consensus.ChainHeaderReader, header, pa |
|
|
|
|
// Verify existence / non-existence of withdrawalsHash.
|
|
|
|
|
shanghai := chain.Config().IsShanghai(header.Time) |
|
|
|
|
if shanghai && header.WithdrawalsHash == nil { |
|
|
|
|
return fmt.Errorf("missing withdrawalsHash") |
|
|
|
|
return errors.New("missing withdrawalsHash") |
|
|
|
|
} |
|
|
|
|
if !shanghai && header.WithdrawalsHash != nil { |
|
|
|
|
return fmt.Errorf("invalid withdrawalsHash: have %x, expected nil", header.WithdrawalsHash) |
|
|
|
|
} |
|
|
|
|
// Verify the existence / non-existence of excessDataGas
|
|
|
|
|
cancun := chain.Config().IsCancun(header.Time) |
|
|
|
|
if cancun && header.ExcessDataGas == nil { |
|
|
|
|
return errors.New("missing excessDataGas") |
|
|
|
|
} |
|
|
|
|
if !cancun && header.ExcessDataGas != nil { |
|
|
|
|
return fmt.Errorf("invalid excessDataGas: have %d, expected nil", header.ExcessDataGas) |
|
|
|
|
} |
|
|
|
|
return nil |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|