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
eth: sending full ETH balance isn't resilient to small gas price changes #2186
Comments
This is a default recommended max fee in various eth wallet software (actually And the "dust" is unavoidable regardless of how lucky we get with the current base fee. Just try to "sweep" a metamask wallet. I always end up with lots of dust trying to send the max amount. If the eth community has solved this, I'm not aware of the solution. |
We have some tough problems with ETH and tokens to solve since we've decided to present the user with these "max send amounts". Personally I think it's a shame we have to get distracted by this when we want to focus on the swap aspects, but I'll try to be constructive... we should spend some time to make sure these errors are not so common, I agree. Not sure what numbers we need to tweak to get estimates that don't go stale quite so easily. |
Probably for ETH we just need to use a larger gas price for the max send estimate than we use for the actual send. Yeah, that will lead to dust, but same issue we will always have with dynamic/eip1559 txns. |
True, that's certainly not DEX value proposition, still ... it kinda feeds into it (at least until Ethereum alternatives are present on DEX; high ETH fees are a pain and keeping many retail users out of Ethereum, I personnally use it only rarely for that reason and prefer to take higher risk of Binance Smart Chain or other L1s / ETH L2s) just to document the shortcomings of this
I don't think it's fully solvable, but 1) broadcasting txn with conservative fee (say,
Anyway, that's how I see it, it's certainly not a priority any time soon, just merely a possible way to improve what's currently there. |
Meanwhile urgent swap transactions with higher nonces cannot execute. No. We've lost the plot if we think this kind of footgun is ok. UX considerations in DEX must consider the swaps before all else. The weakest link in a sequence of transactions holds them all up. This is how the ETH wizards have decided it should work. Let's address this max send estimate issue, but we're not making it even easier to clobber their active swaps... especially not if our best mitigation is replacement txns. |
The max send logic here has been changing a bit recently and maybe isn't optimised for eth. It failing like that can probably be fixed. But having funds left over is unavoidable currently unless eth implements a way to pay fee from transaction. If you are comparing the experience to a traditional exchange it's different of course because they have all the funds in one account and show you numbers from a database. |
This ETH send issue is pretty bad. Unless gas is presently trending down, and monotonically, you have to lower the send amount to actually send. @JoeGruffins can you remind what recent max send logic would be messing this up? For 0.6 I think we should just have the max send estimate use a buffered max fee cap so that the max fee cap that actually gets used in the transaction is adequate. On a related note, one of the most fundamental functions of almost all gui wallets is the ability to specify fee rates. The problem exists because the backend figures this value on submission of the send request. |
I will fix this. |
Noticed that trying to send out all ETH funds often errors like this for me on testnet, latest master (either send attempt itself is rejected, or a warning about fee estimation pops up):
sending-eth-issues.webm
a couple of related points/questions on this to discuss:
maxFee
set to 2x ofbaseFee
- which effectively (very often) means we are leaving roughly same amount of ETH as we spend on transaction in the wallet as dust for the use-case when user just wants his funds out (maybe never touching wallet again); any reason to usemaxFee
that high here instead of letting user to rebroadcast instead (if necessary) for sending out of his wallet (when trades are processing settingmaxFee
high is probably a warranted safety margin, no questions there) ?The text was updated successfully, but these errors were encountered: