BaseFee is nil prior to London hard fork (#5213)

This commit is contained in:
Andrew Ashikhmin 2022-08-29 15:12:31 +02:00 committed by GitHub
parent 4c4baf4bbf
commit 94d14dd248
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -390,12 +390,12 @@ func filterBadTransactions(tx kv.Tx, transactions []types.Transaction, config pa
continue
}
if config.IsLondon(blockNumber) {
baseFee256 := uint256.NewInt(0)
if baseFee256.SetFromBig(baseFee) {
return nil, fmt.Errorf("bad baseFee")
if overflow := baseFee256.SetFromBig(baseFee); overflow {
return nil, fmt.Errorf("bad baseFee %s", baseFee)
}
// Make sure the transaction gasFeeCap is greater than the block's baseFee.
if config.IsLondon(blockNumber) {
if !transaction.GetFeeCap().IsZero() || !transaction.GetTip().IsZero() {
if err := core.CheckEip1559TxGasFeeCap(sender, transaction.GetFeeCap(), transaction.GetTip(), baseFee256); err != nil {
transactions = transactions[1:]