-
Notifications
You must be signed in to change notification settings - Fork 84
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
Align HeadLogic: require snapshot not too far in the future #733
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.
|
Test Results289 tests +11 283 ✔️ +11 14m 59s ⏱️ - 1m 26s Results for commit 42df7a6. ± Comparison against base commit 130301c. This pull request removes 2 and adds 13 tests. Note that renamed tests count towards both.
♻️ This comment has been updated with latest results. |
161683c
to
7fa7d89
Compare
d7d2eed
to
5adb5e0
Compare
7fa7d89
to
925f8c6
Compare
5adb5e0
to
44b4a96
Compare
925f8c6
to
9a261d4
Compare
44b4a96
to
4204bad
Compare
07930df
to
f6dc69e
Compare
6ed2ddb
to
f6ff062
Compare
f6ff062
to
297afdf
Compare
297afdf
to
5ac4960
Compare
5ac4960
to
7bef68a
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.
I appreciate:
- the link in the comments with the names used in the spec
- meaningful and focused commits which make the PR easier to read
To make it perfect I would:
- add a breaking change entry about the API to the changelog
- revert the Refactor onOpenNEtworkReqSn as I don't see more meaning expressed after than before
- amend Refactor onOpenNetworkAckSn to checks like in spec to remove
requireAckSn
which is introduced but not tested
I was doubting it's a breaking change and indeed,
I would have preferred a comment in that commit. I disagree, I think it aligns much better with the spec and should make it even clear to non-haskellers that it's a similar control flow.
It is tested. Not unit tested, but indirectly via |
151fb49
to
913d27d
Compare
@@ -255,30 +255,29 @@ spec = parallel $ do | |||
|
|||
it "sending two conflicting transactions should lead one being confirmed and one expired" $ | |||
shouldRunInSim $ | |||
failAfter 2 $ do |
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.
why did we remove this?
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.
It was the only failAfter and the other tests would block until veryLong
happens (in simulated time). I also changed veryLong
to be oneMonth
in another PR IIRC.
d630877
to
c3b8845
Compare
This should indicate which and how a 'require' statement from the protocol logic spec was invalidated.
As this affects how the coordinated head state is serialized, this also requires to regenerate the golden HeadState.
This changes the behavior of the Head protocol to be more restrictive. It only allows snapshot requests for the next-in-line snapshot.
No semantic change expected and tests also indicate this. The require constraint is not unit tested right now.
It was not used in the API and hence it can be defined in the logs schema only to make sure it's not part of the user facing API.
Using language which is understandable in isoluation, but also similar to the protocol flow from the specification.
c3b8845
to
42df7a6
Compare
The first of multiple PRs about aligning the HeadLogic with the spec.
Changes the off-chain protocol logic to be more strict in allowed snapshot numbers on ReqSn and AckSn as specified. Some of our HeadLogic tests were allowing these "too far in the future" snapshots, but the BehaviorSpec seems unimpacted by this change.
Introduces
LastSeenSnapshot
to cover for an intermediate state where we have completed a snapshot, but not yet received or sent a new ReqSn.Adds an explicit
RequireFailed
logic outcome error to identify the "detect cheating" cases. These are currently just logged like other non progress updates of HeadLogic, but we could handle these by closing the head or so.Refactors more of the off-chain protocol into CPS-style to align better with the spec.
[ ] CHANGELOG updated[ ] Documentation updated