-
Notifications
You must be signed in to change notification settings - Fork 21.6k
Description
System information
Geth version: current master (also happens in releases)
Commit hash : cf03784
Expected behaviour
eth_createAccessList to succeed when given a block hash (that wasn't pruned) and a basic transaction (only to and input) that does not revert.
Actual behaviour
Returns the following error:
code: -32000
message: "failed to apply transaction: 0x3e983326c3827cf62805f3dab45de2d23ce3c839310d823feac120f538a1a286 err: max fee per gas less than block base fee: address 0x0000000000000000000000000000000000000000, maxFeePerGas: 27907986728, baseFee: 28235336045", data: None
Note that this does not always happen:
Relevant files
- The call to
set_defaultsthat doesn't get the block that was requested:go-ethereum/internal/ethapi/api.go
Lines 1506 to 1515 in bcaf374
// Retrieve the execution context db, header, err := b.StateAndHeaderByNumberOrHash(ctx, blockNrOrHash) if db == nil || err != nil { return nil, 0, nil, err } // Ensure any missing fields are filled, extract the recipient and input data if err := args.setDefaults(ctx, b, true); err != nil { return nil, 0, nil, err } - The part of the implementation that sets this:
go-ethereum/internal/ethapi/transaction_args.go
Lines 186 to 187 in bcaf374
func (args *TransactionArgs) setFeeDefaults(ctx context.Context, b Backend) error { head := b.CurrentHeader() - Where the field is set:
go-ethereum/internal/ethapi/transaction_args.go
Lines 268 to 272 in bcaf374
tip, err := b.SuggestGasTipCap(ctx) if err != nil { return err } args.MaxPriorityFeePerGas = (*hexutil.Big)(tip)
The cause of this bug:
When requesting the access list for anything but the most recent block and not specifying fee details, Go-Ethereum automatically adds the fee values using the most recent block (rather than the specified one). When the block base-fee changed durin gthat time the resulting maxFeePerGas can (and does often enough to be a problem) be below the baseFee of the block we're actually executing against, thus causing this error.
Additional Information
Potentially related (but I think it's a different issue/cause): #25319