ApeWorX / ape-bsc

Binance Smart Chain (BSC) ecosystem plugin for the Ape Framework
https://www.apeworx.io/
Apache License 2.0
0 stars 6 forks source link

`eth_feeHistory does not exist` when deploying a token with BSC #8

Open merc1er opened 2 years ago

merc1er commented 2 years ago

Environment information

$ ape --version
0.5.1

$ ape plugins list
Installed Plugins:
  bsc         0.5.0a1
  vyper       0.5.0
  optimism    0.5.0a1

What went wrong?

When trying to deploy an ERC 20 token, I am getting:

ValueError: {'code': -32601, 'message': 'the method eth_feeHistory does not exist/is not available'}

I am using the default script provided by the ERC 20 token template provided by Ape Academy. I am able to deploy the token fine on Ethereum mainnet and testnets as well as optimism.

I tried with two different RPC providers, Ankr (https://rpc.ankr.com/bsc) and Quicknode (requires API key).

Full traceback ⬇️ ``` INFO: Connecting to existing Geth node at 'https://proportionate-delicate-brook.bsc.discover.quiknode.pro/xxxx/'. 0. wallet-with-bnb Select an account: 0 /Users/cloudfloat/.pyenv/versions/ape/lib/python3.10/site-packages/web3/eth.py:661: UserWarning: There was an issue with the method eth_maxPriorityFeePerGas. Calculating using eth_feeHistory. warnings.warn( Traceback (most recent call last): File "/Users/cloudfloat/.pyenv/versions/ape/lib/python3.10/site-packages/web3/eth.py", line 659, in max_priority_fee return self._max_priority_fee() File "/Users/cloudfloat/.pyenv/versions/ape/lib/python3.10/site-packages/web3/module.py", line 64, in caller result = w3.manager.request_blocking( File "/Users/cloudfloat/.pyenv/versions/ape/lib/python3.10/site-packages/web3/manager.py", line 199, in request_blocking return self.formatted_response( File "/Users/cloudfloat/.pyenv/versions/ape/lib/python3.10/site-packages/web3/manager.py", line 172, in formatted_response raise ValueError(response["error"]) ValueError: {'code': -32601, 'message': 'the method eth_maxPriorityFeePerGas does not exist/is not available'} During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/Users/cloudfloat/.pyenv/versions/ape/bin/ape", line 8, in sys.exit(cli()) File "/Users/cloudfloat/.pyenv/versions/ape/lib/python3.10/site-packages/click/core.py", line 1130, in __call__ return self.main(*args, **kwargs) File "/Users/cloudfloat/.pyenv/versions/ape/lib/python3.10/site-packages/click/core.py", line 1055, in main rv = self.invoke(ctx) File "/Users/cloudfloat/.pyenv/versions/ape/lib/python3.10/site-packages/ape/_cli.py", line 40, in invoke return super().invoke(ctx) File "/Users/cloudfloat/.pyenv/versions/ape/lib/python3.10/site-packages/click/core.py", line 1657, in invoke return _process_result(sub_ctx.command.invoke(sub_ctx)) File "/Users/cloudfloat/.pyenv/versions/ape/lib/python3.10/site-packages/ape_run/_cli.py", line 23, in invoke return super().invoke(ctx) File "/Users/cloudfloat/.pyenv/versions/ape/lib/python3.10/site-packages/click/core.py", line 1657, in invoke return _process_result(sub_ctx.command.invoke(sub_ctx)) File "/Users/cloudfloat/.pyenv/versions/ape/lib/python3.10/site-packages/ape/cli/commands.py", line 18, in invoke super().invoke(ctx) File "/Users/cloudfloat/.pyenv/versions/ape/lib/python3.10/site-packages/click/core.py", line 1404, in invoke return ctx.invoke(self.callback, **ctx.params) File "/Users/cloudfloat/.pyenv/versions/ape/lib/python3.10/site-packages/click/core.py", line 760, in invoke return __callback(*args, **kwargs) File "/Users/cloudfloat/.pyenv/versions/ape/lib/python3.10/site-packages/ape_run/_cli.py", line 73, in call ns["main"]() # Execute the script File "/Users/cloudfloat/Documents/cloud-aud/scripts/deploy.py", line 14, in main account.deploy(project.Token) File "/Users/cloudfloat/.pyenv/versions/ape/lib/python3.10/site-packages/ape/api/accounts.py", line 174, in deploy receipt = self.call(txn) File "/Users/cloudfloat/.pyenv/versions/ape/lib/python3.10/site-packages/ape/api/accounts.py", line 94, in call txn = self.prepare_transaction(txn) File "/Users/cloudfloat/.pyenv/versions/ape/lib/python3.10/site-packages/ape/api/accounts.py", line 244, in prepare_transaction txn = self.provider.prepare_transaction(txn) File "/Users/cloudfloat/.pyenv/versions/ape/lib/python3.10/site-packages/ape/api/providers.py", line 478, in prepare_transaction txn.max_priority_fee = self.priority_fee # type: ignore File "/Users/cloudfloat/.pyenv/versions/ape/lib/python3.10/site-packages/ape/api/providers.py", line 704, in priority_fee return self.web3.eth.max_priority_fee File "/Users/cloudfloat/.pyenv/versions/ape/lib/python3.10/site-packages/web3/eth.py", line 665, in max_priority_fee return fee_history_priority_fee(self) File "/Users/cloudfloat/.pyenv/versions/ape/lib/python3.10/site-packages/web3/_utils/fee_utils.py", line 48, in fee_history_priority_fee fee_history = eth.fee_history(*PRIORITY_FEE_HISTORY_PARAMS) # type: ignore File "/Users/cloudfloat/.pyenv/versions/ape/lib/python3.10/site-packages/web3/eth.py", line 907, in fee_history return self._fee_history(block_count, newest_block, reward_percentiles) File "/Users/cloudfloat/.pyenv/versions/ape/lib/python3.10/site-packages/web3/module.py", line 64, in caller result = w3.manager.request_blocking( File "/Users/cloudfloat/.pyenv/versions/ape/lib/python3.10/site-packages/web3/manager.py", line 199, in request_blocking return self.formatted_response( File "/Users/cloudfloat/.pyenv/versions/ape/lib/python3.10/site-packages/web3/manager.py", line 172, in formatted_response raise ValueError(response["error"]) ValueError: {'code': -32601, 'message': 'the method eth_feeHistory does not exist/is not available'} ```