New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
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
Comments
I tried all same code via alchemy api: get slightly different error, maybe it will help debug. Thanks Approving 0x7F5c764cBc14f9669B88837ca1490cCa17c31607... |
I have the same problem as you |
Is there a way to force a legacy tx for networks like this @shanefontaine / @ErikBjare ? |
@Alkhara I'm not 100% certain, but it's possible you can work around this by providing a custom gas price strategy, since it's the automatic/default gas pricing strategy that fails (see the Web3py docs for how to do that). Not sure you can force it to do a legacy tx that way, but otherwise you'll prob have to edit the source. |
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
The text was updated successfully, but these errors were encountered: