-
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
Do allow contest only once #680
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.
|
329269a
to
bbe28c5
Compare
6cfe659
to
28da8b7
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.
We should not use Cardano-specific types in the HeadLogic
. I think we can remove it for now. Then, we don't need to regenerate golden files for HeadState
and (Timed
)ServerOutput
.
In general, the added mutation test is not worth much and I would like to see an end-to-end test specifically ensuring that "Allow contest only once" is true.
BTW I would suggest to start with such a test next time it can be specified so clearly!
52a50b3
to
d879537
Compare
241821b
to
8ec0845
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.
Left some comments
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.
Left some comments
4102087
to
e7870c6
Compare
a3f7069
to
46aaf61
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.
Left some comments
f2fe66b
to
40f3987
Compare
…is wrong in the output datum
40f3987
to
6be501b
Compare
6f38e19
to
4b877e8
Compare
Ideally though we would have used the cardano-api ScriptExecutionError, but conversion from ledger types to this is actually not exported and we want to avoid vendoring this conversion code just for identifying this case. It's a long standing TODO to switch to the cardano-api types and balancing code in the wallet anyways.
We have replaced this case with the other two, more granular cases for no fuel UTxO and not enough fuel some time ago.
4b877e8
to
3d3fff6
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.
This looks good now!
@@ -389,7 +398,7 @@ forAllFanout action = | |||
in action utxo tx | |||
& label ("Fanout size: " <> prettyLength (countAssets $ txOuts' tx)) | |||
where | |||
maxSupported = 39 | |||
maxSupported = 30 |
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.
this change was not needed and got merged by mistake.
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.
change reverted in following PR by this commit.
⚡ add
closedContesters :: [Plutus.PubKeyHash]
attribute to:Closed
on-chain state forHeadState
datum.ClosedThreadOutput
inClosedState
direct-chain state.ClosedState
off-chain state inHeadLogic
.⚡ update transactions:
closeTx
output datum to include a list of contesters to start tracking.contestTx
output datum to include the signer in the list of contesters.⚡ update
Head
script:checkClose
verifies the list of contesters is empty in the output datum.checkContest
verifies the signer ofcontestTx
did not contest in the past.⚡ update transaction observations:
observeClose
to init the list of contesters as empty.observeContest
to update the state using the new list of contesters.⚡ add mutation in
Close
andContest
to test the newHead
validator checks.⚡ update log json-schema for
ClosedState
.⚡ add orphan instances of
Plutus.PubKeyHash
for JSON and Arbitrary.