Skip to content

eth_createAccessList fails when using block_hash and not setting txn fees #30145

@DragonDev1906

Description

@DragonDev1906

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_defaults that doesn't get the block that was requested:
    // 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:
    func (args *TransactionArgs) setFeeDefaults(ctx context.Context, b Backend) error {
    head := b.CurrentHeader()
  • Where the field is set:
    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

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions