Closed TalDerei closed 2 months ago
This is only an issue if the user is trying to spend their max amount of UM and they have no other token right?
This is only an issue if the user is trying to spend their max amount of UM
Not just UM, but other tokens as well if used as an alternative fee token
and they have no other token
It doesn't matter, if the user has UM, then the alternative fee token will not be used
We want to avoid a situation where a user has to manually decrease the amount slightly to leave a bit left over for gas, like on ethereum, we have the technology to deliver a better UX here so we should try to do so. It will require tracking some extra state in the send dialog (since we effectively want to secretly track an isSendingMax
bool and branch on it).
The related Planner changes in https://github.com/penumbra-zone/penumbra/pull/4615 shipped as part of v0.77.4
, so this work should now be unblocked.
@hdevalence does https://github.com/penumbra-zone/web/pull/1151#issuecomment-2128525826 hold for other action types like swaps and delegations as well? it seems tricky
References https://github.com/penumbra-zone/web/pull/1268#issuecomment-2164609477. Currently, the "max" functionality implemented in https://github.com/penumbra-zone/web/pull/1151 is broken in the context of non-zero gas fees. During transaction creation, the planner specifies outputs and fills in spends to balance the transaction, subtracting fees from the input. If the user attempts to spend their entire balance, they don't have any additional funds to pay for fees. Instead, we want to modify the planner request to spend all the available notes, and instead subtract fees from the output.
https://github.com/penumbra-zone/penumbra/pull/4615 was a necessary proto change towards that.
cc @grod220