diff --git a/commits b/commits index f548b44009..26db13d001 100644 --- a/commits +++ b/commits @@ -1,4 +1,15 @@ I found 50 commits containing the keyword "XFN" in the last 200 commits. Here they are with dates: November 2025: + +845137849 - Wanwiset Peerapatanapokin - consensus: change os.Exit to return error (#1653) +b49f6cb0f - Wanwiset Peerapatanapokin - consensus: verify header hash is same as input hash in getEpochSwitchInfo (#1627) +e0c987f45 - Wanwiset Peerapatanapokin - impose size limit for DecodeBytesExtraFields (#1637) +53f6a8d6d - Wanwiset Peerapatanapokin - consensus: optimize CompareSignersLists +6abb4f88d - Wanwiset Peerapatanapokin - consensus: Verify gaslimit bounds when accepting blocks (#1619) +c95d25805 - Wanwiset Peerapatanapokin - separate fullVerifies array into v1fullVerifies and v2fullVerifies (#1618) +25a70e877 - Wanwiset Peerapatanapokin - consensus: skip gas limit verification for genesis block (#1646) +da92ad7cc - Wanwiset Peerapatanapokin - update package version: (#1612) + + 2025-11-12 - 4bb925258 - params: fix type V2 not equal bug, close XFN-45 (#1737) 2025-11-10 - 366c99ece - consensus: use signer pubkey to check for unique signatures, close XFN-03 (#1643) 2025-11-10 - 7aaa541db - consensus: implement DeepCopy() in PoolObj, close XFN-04 (#1723) diff --git a/consensus/XDPoS/engines/engine_v2/verifyHeader.go b/consensus/XDPoS/engines/engine_v2/verifyHeader.go index 03216610fc..a0907f6a46 100644 --- a/consensus/XDPoS/engines/engine_v2/verifyHeader.go +++ b/consensus/XDPoS/engines/engine_v2/verifyHeader.go @@ -65,6 +65,16 @@ func (x *XDPoS_v2) verifyHeader(chain consensus.ChainReader, header *types.Heade return consensus.ErrUnknownAncestor } + // Ensure gas limit is consistent with parent + 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 + if header.GasUsed > header.GasLimit { + return fmt.Errorf("gas used exceeded gaslimit, gas used: %d, gas limit: %d", header.GasUsed, header.GasLimit) + } + // Verify this is truely a v2 block first quorumCert, round, _, err := x.getExtraFields(header) if err != nil {