Skip to content

Commit 25a70e8

Browse files
authored
consensus: skip gas limit verification for genesis block (#1646)
1 parent 22edaac commit 25a70e8

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

consensus/XDPoS/engines/engine_v2/verifyHeader.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,8 @@ func (x *XDPoS_v2) verifyHeader(chain consensus.ChainReader, header *types.Heade
6464
}
6565

6666
// Ensure gas limit is consistent with parent
67-
if err := misc.VerifyGaslimit(parent.GasLimit, header.GasLimit); err != nil {
67+
err := misc.VerifyGaslimit(parent.GasLimit, header.GasLimit)
68+
if err != nil && parent.Number.Uint64() != 0 { // skip genesis block
6869
return err
6970
}
7071
// Ensure gas used is less than or equal to gas limit

0 commit comments

Comments
 (0)