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

Align HeadLogic: Transaction pruning #740

Merged
merged 3 commits into from
Feb 24, 2023
Merged

Conversation

ch1bo
Copy link
Collaborator

@ch1bo ch1bo commented Feb 22, 2023

  • Prune transactions from seenTxs by their applicability to the new requested snapshot instead by their Equality or id.

  • [ ] CHANGELOG updated
  • [ ] Documentation updated
  • Added and/or updated haddocks
  • No new TODOs introduced or explained herafter
    • will be addressed in the next PR of this series

@github-actions
Copy link

github-actions bot commented Feb 22, 2023

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 2023-02-24 19:40:20.527128326 UTC
Max. memory units 14000000
Max. CPU units 10000000000
Max. tx size (kB) 16384

Script summary

Name Hash Size (Bytes)
μHead N/A 4600
νInitial 7bb44e248f92ae5d2c4c744244b469d59a5bfa8a5d8ce9b6b27e5750 5530
νCommit 70c545fc894ada81ad46715bac1a11fa755b3e3a1d94f03254a4d397 2473
νHead 58cef84ce7e80b1b3089a10d825da2f41ec1cb5ad923d9f39d842f3c 9998

Cost of Init Transaction

Parties Tx size % max Mem % max CPU Min fee ₳
1 5200 15.87 6.30 0.55
2 5401 18.24 7.19 0.59
3 5610 20.39 8.00 0.62
5 6016 25.05 9.76 0.69
10 7041 34.81 13.36 0.84
36 12374 97.33 37.00 1.75

Cost of Commit Transaction

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

UTxO Tx size % max Mem % max CPU Min fee ₳
1 633 21.06 8.50 0.41

Cost of CollectCom Transaction

Parties UTxO (bytes) Tx size % max Mem % max CPU Min fee ₳
1 57 13251 22.15 8.87 0.98
2 114 13604 36.71 14.84 1.15
3 171 13958 53.83 21.93 1.36
4 228 14310 74.58 30.54 1.60
5 284 14661 97.58 40.14 1.87

Cost of Close Transaction

Parties Tx size % max Mem % max CPU Min fee ₳
1 10537 14.56 6.18 0.78
2 10799 18.27 8.16 0.83
3 10930 19.13 8.55 0.85
5 11339 22.98 10.85 0.91
10 12159 30.09 14.83 1.04
49 15401 65.20 30.33 1.57

Cost of Contest Transaction

Parties Tx size % max Mem % max CPU Min fee ₳
1 10642 21.47 8.96 0.86
2 10848 23.67 10.21 0.89
3 10970 24.90 10.73 0.91
5 11368 28.88 13.05 0.98
10 12185 37.49 17.49 1.12
35 16351 81.47 40.34 1.82

Cost of Abort Transaction

Some variation because of random mixture of still initial and already committed outputs.

Parties Tx size % max Mem % max CPU Min fee ₳
1 15099 23.79 9.87 1.08
2 15811 48.08 20.83 1.38
3 16014 67.12 29.11 1.61
4 15983 81.33 35.03 1.76

Cost of FanOut Transaction

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

Parties UTxO UTxO (bytes) Tx size % max Mem % max CPU Min fee ₳
5 0 0 15183 9.70 4.01 0.93
5 1 57 15214 10.97 4.79 0.94
5 5 286 15360 17.08 8.31 1.02
5 10 569 15542 24.95 12.82 1.13
5 20 1139 15902 39.96 21.52 1.33
5 30 1706 16262 55.48 30.44 1.53
5 33 1876 16368 59.56 32.88 1.59

@ch1bo ch1bo marked this pull request as ready for review February 22, 2023 20:47
@github-actions
Copy link

github-actions bot commented Feb 22, 2023

Test Results

289 tests   283 ✔️  16m 49s ⏱️
  98 suites      6 💤
    5 files        0

Results for commit d03d659.

♻️ This comment has been updated with latest results.

hydra-node/src/Hydra/HeadLogic.hs Show resolved Hide resolved
hydra-node/src/Hydra/HeadLogic.hs Show resolved Hide resolved
@ch1bo ch1bo force-pushed the ch1bo/align-headlogic branch 2 times, most recently from c3b8845 to 42df7a6 Compare February 24, 2023 17:37
Base automatically changed from ch1bo/align-headlogic to master February 24, 2023 19:29
This seems to have the exact same semantics according to our current
behavior tests, but is more in-line to what is in the spec.
This also makes sure to update the seenUTxO, so might improve the
"getting stuck" behavior. On the other hand, this semantics seem
identical at least based in the current behavior tests.
This circumvents the "should not happen" case where a transaction
`canApply`, but then it fails when we determine the new seenUTxO'.
@ch1bo ch1bo merged commit 635462c into master Feb 24, 2023
@ch1bo ch1bo deleted the ch1bo/transaction-pruning branch February 24, 2023 20:26
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.

2 participants