consensus: skip gas limit verification for genesis block (#1646)

This commit is contained in:
Wanwiset Peerapatanapokin 2025-10-28 08:30:36 +07:00 committed by GitHub
parent 22edaacf0d
commit 25a70e8770
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -64,7 +64,8 @@ func (x *XDPoS_v2) verifyHeader(chain consensus.ChainReader, header *types.Heade
}
// Ensure gas limit is consistent with parent
if err := misc.VerifyGaslimit(parent.GasLimit, header.GasLimit); err != nil {
err := misc.VerifyGaslimit(parent.GasLimit, header.GasLimit)
if err != nil && parent.Number.Uint64() != 0 { // skip genesis block
return err
}
// Ensure gas used is less than or equal to gas limit