Allow constructing change output from _any_ input #2484
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Issue Number
ADP-345
Overview
312b0b1
📍 allow constructing change output from any input
In only a few days, this has proven to be a quite major issue users have been running into. The thing is that we can't really control how the shape of the UTxO evolves. Quite easily, a user can end up with large quantity of Ada bound to a particular asset. Before this commit, when transacting on other assets, these Ada would've been locked and the user will be granted with a 'cannot_cover_fee' error, despite having plenty of Ada in his/her wallet. However, because of the way we construct change outputs, it is rather safe and easy to also select from any inputs and construct change outputs accordingly.
As a matter of fact, the change construction is an iterative trial-and-error process. That is, it works in the following steps:
Selecting an extra input which contains some potentially new assets will result in a completely different change output. However, since we are re-construct the entire change output sets on each iteration, it doesn't matter much. This processus is still imperfect in the sense that there may be some valid subset of the selection which can result in a valid transaction, whereas some other path may not. Yet, such cases should be rare and "edgy" in practice.
Comments