@ -26,6 +26,7 @@ import (
"github.com/ethereum/go-ethereum/consensus/misc"
"github.com/ethereum/go-ethereum/consensus/misc"
"github.com/ethereum/go-ethereum/core/state"
"github.com/ethereum/go-ethereum/core/state"
"github.com/ethereum/go-ethereum/core/types"
"github.com/ethereum/go-ethereum/core/types"
"github.com/ethereum/go-ethereum/params"
"github.com/ethereum/go-ethereum/rpc"
"github.com/ethereum/go-ethereum/rpc"
"github.com/ethereum/go-ethereum/trie"
"github.com/ethereum/go-ethereum/trie"
)
)
@ -196,9 +197,8 @@ func (beacon *Beacon) verifyHeader(chain consensus.ChainHeaderReader, header, pa
return fmt . Errorf ( "invalid difficulty: have %v, want %v" , header . Difficulty , beaconDifficulty )
return fmt . Errorf ( "invalid difficulty: have %v, want %v" , header . Difficulty , beaconDifficulty )
}
}
// Verify that the gas limit is <= 2^63-1
// Verify that the gas limit is <= 2^63-1
cap := uint64 ( 0x7fffffffffffffff )
if header . GasLimit > params . MaxGasLimit {
if header . GasLimit > cap {
return fmt . Errorf ( "invalid gasLimit: have %v, max %v" , header . GasLimit , params . MaxGasLimit )
return fmt . Errorf ( "invalid gasLimit: have %v, max %v" , header . GasLimit , cap )
}
}
// Verify that the gasUsed is <= gasLimit
// Verify that the gasUsed is <= gasLimit
if header . GasUsed > header . GasLimit {
if header . GasUsed > header . GasLimit {