-
Notifications
You must be signed in to change notification settings - Fork 87
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
Snapshot number and utxo hash need not be in the redeemer on close/contest #677
Snapshot number and utxo hash need not be in the redeemer on close/contest #677
Conversation
Transactions CostsSizes and execution budgets for Hydra protocol transactions. Note that unlisted parameters are currently using
Script summary
Cost of Init Transaction
Cost of Commit TransactionCurrently only one UTxO per commit allowed (this is about to change soon)
Cost of CollectCom Transaction
Cost of Close Transaction
Cost of Contest Transaction
Cost of Abort TransactionSome variation because of random mixture of still initial and already committed outputs.
Cost of FanOut TransactionInvolves spending head output and burning head tokens. Uses ada-only UTxO for better comparability.
|
172a1bc
to
2f0b7e2
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As @v0d1ch mentioned, the on-chain code can and should be simplified before we merge this.
9f1d99a
to
a3174f0
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code duplication when fetching datum from the tx in close and contest. See proposed code change to remove duplication.
Side note: I'm having trouble with naming this function. Maybe you can find a better or, maybe, this is a smell that something's odd here and could be improved but I can't find it.
Some tests are failing since what looks like the first commits of the branch.
This build make me believe this commit introduced the issue. I'm moving this P.R. back to in progress to investigate and fix. |
92ba27c
to
ef28398
Compare
5910e4a
to
2f235fc
Compare
ff00dec
to
3f9add4
Compare
fb80c1e
to
ed4b111
Compare
7eae215
to
ef08385
Compare
Extract mutateClosedContestationDeadline to use in both close and closeInitial mutations
We introduce replaceSomething to ease the mutation of a head state. This functions are exposed by Mutation.hs as it seems to be the better place to me right now but maybe we can do better? Also, we replace some functions which did that and failed when the state was not an expected one. Now we just return the state unchanged if the field we want to change does not exist for this state. It may be a good idea... it also may introduce difficulties in diagnostic test errors. That is not clear at this point. If ist becomes a problem, we can sill introduce the errors back easily in the code.
fcea1e7
to
d511963
Compare
ae00b16
to
8dd1029
Compare
The removed test used to check that the validator would fail for a snapshot with a negative value. But due to recent changes, it is now OK to have a negative snapshot number. Although it should fail if we try to use a negative snaphot number with a non-intiail snapshot. So we amend the previous test we checked for 0 value with a generated negative or 0 value.
The 0 case can be captured by ensuring the deadline generator covers this as well.
There is a problem with the way we test validity bounds mutations. Most of the arbitrarily generated values will make the validator fail but there are no reason to not generate valid transaction with what we had. To fix that, we distinguish between 3 situations: 1. The lower bound is infinite 2. The upper bound is infinite 3. The upper bound is too high given the contestation deadline
No need to call this "healthy" as it cannot be used outside of the healthyCloseInitialTx context.
One could have tried to change the head parameters during a close, like change the headId or the parties.
51d1c66
to
d8250d6
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Only a very minor thing left and the tests seem to not agree on the maxSupported
assets as it fails with 45
utxos on the fanout.
Feel free to merge after fixing this so I approve.
⛰️ Remove snapshot number and utxo hash from Contest and Close redeemers
⛰️ BTW this improves the coverage for the case where we close with the initialSnapshot
To check before merging: