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

Model-based Testing With Quickcheck-Dynamic #391

Merged
merged 75 commits into from
Jun 28, 2022
Merged

Model-based Testing With Quickcheck-Dynamic #391

merged 75 commits into from
Jun 28, 2022

Conversation

KtorZ
Copy link
Collaborator

@KtorZ KtorZ commented Jun 9, 2022

No description provided.

@KtorZ KtorZ requested review from ch1bo and abailly-iohk June 9, 2022 10:20
@github-actions
Copy link

github-actions bot commented Jun 9, 2022

Transactions Costs

Sizes and execution budgets for Hydra protocol transactions. Note that unlisted parameters are currently using arbitrary values and results are not fully deterministic and comparable to previous runs.

Metadata
Generated at 2022-06-28 07:40:59.361073594 UTC
Max. memory units 14000000.00
Max. CPU units 10000000000.00
Max. tx size (kB) 16384

Cost of Init Transaction

Parties Tx size % max Mem % max CPU
1 4737 11.58 6.31
2 4937 13.71 7.41
3 5138 13.06 6.80
5 5538 18.44 9.66
10 6537 27.15 13.92
30 10539 65.48 33.11
47 13938 98.36 49.61

Cost of Commit Transaction

Currently only one UTxO per commit allowed (this is about to change soon)

UTxO Tx size % max Mem % max CPU
1 6233 19.55 9.67

Cost of CollectCom Transaction

Parties Tx size % max Mem % max CPU
1 14181 21.09 11.41
2 14482 37.00 20.23
3 14697 53.86 29.50
4 14995 75.40 41.48

Cost of Close Transaction

Parties Tx size % max Mem % max CPU
1 9827 7.77 4.11
2 9992 8.69 4.61
3 10157 9.59 5.09
5 10520 11.80 6.27
10 11345 16.19 8.60
30 14710 34.77 18.48
62 15899 36.41 18.36

Cost of Contest Transaction

Parties Tx size % max Mem % max CPU
1 9859 8.18 4.33
2 9991 8.66 4.59
3 10187 9.91 5.25
5 10517 11.73 6.22
10 11342 16.17 8.58
30 14712 35.28 18.79
40 16359 43.61 23.19

Cost of Abort Transaction

Parties Tx size % max Mem % max CPU

Cost of FanOut Transaction

Involves spending head output and burning head tokens. Uses ada-only UTxO for better comparability.

UTxO Tx size % max Mem % max CPU
10 14133 22.13 12.72
50 15585 82.94 47.64
496 14032 12.46 7.16

abailly-iohk and others added 26 commits June 22, 2022 14:31
and spawns a thread to run the nodes
Also distinct ctors for each action type and increase success to
increase coverage
also provide correct Eq and Show instances for Actions
  Question: how do we get a handle on the test nodes from within the property execution?
Need to accumulate observed outputs
Also adapt generators to reduce the number of discarded actions
* Use tabulate instead of label for better classification
* Improve generators to reduce the number of discards
* Tweak frequencies to increase the number of Initial -> Open
  transitions which are more interesting
Implementing actionName allows us to provide sensible names for
actions and remove the need for dedicated constructors.
  So far, we only send to addresses owned by participants of the head. We may want to change that later, but that is tricky because, if there's no longer any utxo owned by participants, they can't spend anything.
We realise we need to make our model more abstract as we don't have
access to the details of the snapshots easily.
  We model payments, and only within the inner-circle of the head participants. This is analogous to an account-based system. Kind of.
@github-actions
Copy link

github-actions bot commented Jun 23, 2022

Unit Test Results

229 tests  +4   227 ✔️ +4   7m 50s ⏱️ +21s
  83 suites +1       2 💤 ±0 
    5 files   ±0       0 ±0 

Results for commit 1161107. ± Comparison against base commit 68024d5.

♻️ This comment has been updated with latest results.

@abailly-iohk
Copy link
Contributor

Fix #375

@abailly-iohk
Copy link
Contributor

@ch1bo @KtorZ If you are happy with my latest changes, I think we can merge this and move on.

Copy link
Collaborator

@ch1bo ch1bo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These things need addressing:

  • api changed -> update api.yaml and changelog (why are we seeing no CI errors?)
  • Take a Proxy log instead of a Proxy tx in printTrace

hydra-node/src/Hydra/Crypto.hs Outdated Show resolved Hide resolved
hydra-node/src/Hydra/ServerOutput.hs Show resolved Hide resolved
hydra-node/test/Hydra/Model.hs Outdated Show resolved Hide resolved
hydra-node/test/Hydra/Model.hs Show resolved Hide resolved
hydra-node/test/Test/Util.hs Outdated Show resolved Hide resolved
printTrace _ tr =
unlines . map (decodeUtf8 . Aeson.encode) $
selectTraceEventsDynamic' @_ @(HydraNodeLog tx) tr
selectTraceEventsDynamic' @_ @log tr
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@abailly-iohk abailly-iohk requested a review from ch1bo June 24, 2022 06:46
@abailly-iohk
Copy link
Contributor

This is a first shot of MBT approach using Quviq's framework, I think we should merge it as-is. We have a follow-up meeting with Quviq end of the week which will provide some insights on what to do next.

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

Successfully merging this pull request may close these issues.

4 participants