internal/ethapi/api, accounts/abi/bind: Cap highest gas limit by account balance for 1559 fee parameters#23309
Conversation
rjl493456442
left a comment
There was a problem hiding this comment.
Thanks for catching it, lgtm.
|
Do we need to duplicate this for the simulated backend too? |
|
Right, I think we need to port the change to the accounts/abi/bind/backends. |
3b26cd1 to
2309bf7
Compare
|
@rjl493456442 @karalabe I ported this to the simulated backend and added a test for it, but because the simulated backend grants the account a balance of It will, however, return a gas value even if the account can't afford it. This is different than how legacy fee estimates are evaluated -- if the account can't afford the estimated gas, the call normally returns an error Feel free to drop the last two commits as you see fit. |
|
Is this going to get in before London? Do we know what ranges might look like for small wallet balances? This could block a lot of wallets from submitting transactions if they have something like: |
|
For example, I know Argent wallet does this |
|
Pushed a minor naming nitpick so internal variables are using the Go API style and the error message used the RPC API style. Otherwise LGTM |
…balance for 1559 fee parameters (ethereum#23309) * internal/ethapi/api: cap highest gas limit by account balance for 1559 fee parameters * accounts/abi/bind: port gas limit cap for 1559 parameters to simulated backend * accounts/abi/bind: add test for 1559 gas estimates for the simulated backend * internal/ethapi/api: fix comment * accounts/abi/bind/backends, internal/ethapi: unify naming style Co-authored-by: Péter Szilágyi <peterke@gmail.com>
Currently, you can call
eth_estimateGaswith EIP-1559 fee parameters and it won't cap the gas limits it tries based on the account balance. This can cause anErrInsufficientFundsto be propagated back to the users if they can't afford the initialhi * maxFeeCapPerGas + value.Before:
After:
Note that these request are against a Gorli node.