ape: configured foundry `base_fee` causes tx to fail when setting `max_priority_fee`

Environment information

  • OS: linux
  • Python Version: Python 3.9.18
  • ape and plugin versions:
$ ape --version
# ...copy and paste result of above command here...
0.7.4

$ ape plugins list
ape-alchemy==0.7.0
ape-foundry==0.7.3
ape-optimism==0.7.0
  • Contents of your ape-config.yaml (NOTE: do not post anything private like RPC urls or secrets!):
$ cat ape-config.yaml
default_ecosystem: optimism

plugins:
  - name: ape-foundry
  - name: ape-optimism
  - name: ape-alchemy

optimism:
  mainnet:
    default_provider: alchemy

foundry:
  base_fee: 1000000
  priority-fee: 1
  host: auto
  fork:
    ethereum:
      mainnet:
        upstream_provider: alchemy
    optimism:
      mainnet:
        upstream_provider: alchemy

What went wrong?

Please include information like:

  • what command you ran I am impersonating an account and trying to run a contract call with the impersonated account
  • the code that caused the failure (see this link for help with formatting code) Note that the below is run providing the function with a) impersonated account b) a ape worx contract c) function name d) args It should make it easier to run any arbitrary impersonation on any contract.
    def apply_with_impersonation(self,impersonatedAddress,contract,funcName,args):
        with accounts.use_sender(impersonatedAddress):        
            func = getattr(contract,funcName)
            if args:
                return func(*args,base_fee="10 gwei",max_priority_fee=0)
            else:
                return func(base_fee="10 gwei",max_priority_fee=0)
  • full output of the error you received
*** ape.exceptions.VirtualMachineError: max fee per gas less than block base fee

How can it be fixed?

Fill this in if you have ideas on how the bug could be fixed. Following the logic seems like it is arriving to send_transaction function under provider.py and giving the transaction 0 gasPrice before sending it

tx_params
Out  [15]: {'chainId': 10, 'to': 'SOME_ACCOUNT', 'from': 'SOME_ACCOUNT', 'gas': 30000000, 'nonce': 3550, 'value': 0, 'data': 'SOME_DATA', 'gasPrice': 0}

Manually overriding gasPrice 0 makes the transaction suceed.

About this issue

  • Original URL
  • State: closed
  • Created 5 months ago
  • Comments: 20 (9 by maintainers)

Most upvoted comments

let me try and add type 2 to the args, 1 second, yeah that worked!

A clue! something must be wrong somewhere I am not just not sure what to do

I am not using cli, maybe should mention this 🤔

Ape uses the CLI under the hood