namada
namada copied to clipboard
Avoid submitting masp transactions close to an epoch boundary
Depends on #4094.
Instead of retrying shielding transactions on failures when encountering an epoch change we could try to check how far we are from the next masp epoch: if we find ourselves close to the boundary (let's say under a fixed value that we consider necessary to produce, submit and see the masp transaction included in a block), the client could notify the user and quit without processing the request (unless --force
is provided). This would save the user the gas fees for the first failing tx.
This logic could be optionally applied to shielded and unshielding transactions too: these do not fail in case of an epoch switch but if a token producing rewards is involved the user might will leave some of those rewards on the table (especially for shielded transactions since for unshielding transactions we can expect the change to g back to the sender).