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

Understand and standardize adjustUnbalancedTx. #46

Closed
VictorCMiraldo opened this issue Dec 11, 2021 · 2 comments
Closed

Understand and standardize adjustUnbalancedTx. #46

VictorCMiraldo opened this issue Dec 11, 2021 · 2 comments

Comments

@VictorCMiraldo
Copy link
Contributor

I believe there is a bug in adjustUnbalancedTx. It shouldn't filter the outputs that contain zero value, otherwise, when running a transaction generated by:

PaysToScript scriptAddr (someDatum, mzero)

the output that actually pays to the script will be silently filtered out, the transaction will be send and it might actually succeed; even though the transaction that was send DOES NOT satisfy the constraints it was generated from.

Another aspect to keep in mind is the fee and keep track of this issue: IntersectMBO/plutus-apps#143

@VictorCMiraldo
Copy link
Contributor Author

VictorCMiraldo commented Dec 11, 2021

As it turns out, this is more messy than I expected, really. This feature is, in fact, very messy.

Take our PMultiSigStateful contract. Now, the creation of the proposal has to have enough funds on it. If it happens to have less funds on it but we call adjustUnbalancedTx, we can't use the paymentValue when issuing the payment because we'll get a ValueNotPreserved.

Moreover, every Sign UTxO has to have 2 ada on them. Alright! But what happens to these ada when the payment is issued? Do we return them to their owners? How about users that created an additional Sign datum? In this case, that will stay locked forever. In order to speed up merging of #42, I went the easy road and decided that all these collected minAda will be given to the receiver of the payment, so we don't have to keep nearly as much information around.

@VictorCMiraldo
Copy link
Contributor Author

This has been closed. adjustUnbalancedTx is not called by default and the function has been fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant