-
Notifications
You must be signed in to change notification settings - Fork 20.2k
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
internal/ethapi/api, accounts/abi/bind: Cap highest gas limit by account balance for 1559 fee parameters #23309
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
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 <[email protected]>
Currently, you can call
eth_estimateGas
with EIP-1559 fee parameters and it won't cap the gas limits it tries based on the account balance. This can cause anErrInsufficientFunds
to 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.