Skip to content
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

Allow constructing change output from _any_ input #2484

Merged
merged 1 commit into from
Feb 2, 2021

Commits on Feb 2, 2021

  1. 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:
    
      - From a given set of input, try to construct valid change output to cover for the transaction need
      - If impossible, select another input and try again.
    
      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.
    KtorZ committed Feb 2, 2021
    Configuration menu
    Copy the full SHA
    63ce689 View commit details
    Browse the repository at this point in the history