- Notifications
You must be signed in to change notification settings - Fork388
On optimism swap (no errors with same code on arbitrum), two errors pop up: ValueError: {'code': -32601, 'message': 'the method eth_maxPriorityFeePerGas does not exist/is not available'} and ValueError: {'code': -32601, 'message': 'the method eth_feeHistory does not exist/is not available'} #299
Description
Describe the bug
A clear and concise description of what the bug is.
/usr/local/lib/python3.7/dist-packages/web3/eth.py:657: UserWarning: There was an issue with the method eth_maxPriorityFeePerGas. Calculating using eth_feeHistory.
"There was an issue with the method eth_maxPriorityFeePerGas. Calculating using "
Traceback (most recent call last):
File "/usr/local/lib/python3.7/dist-packages/web3/eth.py", line 654, in max_priority_fee
return self._max_priority_fee()
File "/usr/local/lib/python3.7/dist-packages/web3/module.py", line 60, in caller
null_result_formatters)
File "/usr/local/lib/python3.7/dist-packages/web3/manager.py", line 201, in request_blocking
null_result_formatters)
File "/usr/local/lib/python3.7/dist-packages/web3/manager.py", line 171, in formatted_response
raise ValueError(response["error"])
ValueError: {'code': -32601, 'message': 'the method eth_maxPriorityFeePerGas does not exist/is not available'}
Traceback (most recent call last):
File "optimismimage.py", line 442, in transactions
tx_hash = uniswap.make_trade(token_address, eth, token_balance, fee=500)
File "/usr/local/lib/python3.7/dist-packages/uniswap/decorators.py", line 37, in approved
self.approve(token)
File "/usr/local/lib/python3.7/dist-packages/uniswap/uniswap.py", line 1409, in approve
tx = self._build_and_send_tx(function)
File "/usr/local/lib/python3.7/dist-packages/uniswap/uniswap.py", line 1443, in _build_and_send_tx
transaction = function.build_transaction(tx_params)
File "/usr/local/lib/python3.7/dist-packages/web3/contract.py", line 1107, in build_transaction
**self.kwargs
File "/usr/local/lib/python3.7/dist-packages/web3/contract.py", line 1672, in build_transaction_for_function
prepared_transaction = fill_transaction_defaults(web3, prepared_transaction)
File "cytoolz/functoolz.pyx", line 249, in cytoolz.functoolz.curry.call
File "/usr/local/lib/python3.7/dist-packages/web3/_utils/transactions.py", line 114, in fill_transaction_defaults
default_val = default_getter(web3, transaction)
File "/usr/local/lib/python3.7/dist-packages/web3/_utils/transactions.py", line 64, in
web3.eth.max_priority_fee + (2 * web3.eth.get_block('latest')['baseFeePerGas'])
File "/usr/local/lib/python3.7/dist-packages/web3/eth.py", line 660, in max_priority_fee
return fee_history_priority_fee(self)
File "/usr/local/lib/python3.7/dist-packages/web3/_utils/fee_utils.py", line 45, in fee_history_priority_fee
fee_history = eth.fee_history(*PRIORITY_FEE_HISTORY_PARAMS) # type: ignore
File "/usr/local/lib/python3.7/dist-packages/web3/eth.py", line 876, in fee_history
return self._fee_history(block_count, newest_block, reward_percentiles)
File "/usr/local/lib/python3.7/dist-packages/web3/module.py", line 60, in caller
null_result_formatters)
File "/usr/local/lib/python3.7/dist-packages/web3/manager.py", line 201, in request_blocking
null_result_formatters)
File "/usr/local/lib/python3.7/dist-packages/web3/manager.py", line 171, in formatted_response
raise ValueError(response["error"])
ValueError: {'code': -32601, 'message': 'the method eth_feeHistory does not exist/is not available'}
To Reproduce
uniswap V3 (0.03%tier), optimism, USDC to ETH token swap.
Expected behavior
Swap to occur