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

Cleanup incremental decommit - Part 1 #1491

Merged
merged 29 commits into from
Jul 15, 2024

Conversation

ch1bo
Copy link
Collaborator

@ch1bo ch1bo commented Jul 9, 2024

A first round of things which stood out to me when reviewing #1344:

  • Removed unnecessary changes of cardano-configurations, incrementTx figure from spec, a renaming in the spec and moved sequence diagram in the docs

  • Renamed the tx benchmark to decrement

  • Added missing version checks validators

  • Major refactor of close/contest with the new redeemer classes (to align with the spec)

  • Removed redundant snapshot number checks

  • Made deltaUTxOHash a Maybe Hash

  • Some further refactor of on-chain types into sub-types (to be more type-safe.. but could have been another PR).

  • ReqDec handling similar to ReqTx handling (DecommitInvalid similar to TxInvalid behavior).

  • Align signable representation with spec (order or arguments in tuple)

This does target #1344 and should resolve many conversations (my notes I left).

Copy link

github-actions bot commented Jul 9, 2024

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 2024-07-11 08:29:58.636396535 UTC
Max. memory units 14000000
Max. CPU units 10000000000
Max. tx size (kB) 16384

Script summary

Name Hash Size (Bytes)
νInitial f6b6793759765aa482bafb328294fa4881c88fa61883c5873081ea9d 3799
νCommit ecb1dda1e2e7575b01ad665ab360426826ddfe61b596fd2dad483072 1743
νHead 21da1b80ab0549af09f2f426c8f4272888b575f9b9902b0c3912294a 9923
μHead 9ceb039df8ede9028e7af462d03a3a0deaf2c7dd51b0776836ca2a6c* 4439
  • The minting policy hash is only usable for comparison. As the script is parameterized, the actual script is unique per Head.

Cost of Init Transaction

Parties Tx size % max Mem % max CPU Min fee ₳
1 5022 5.89 2.31 0.44
2 5221 7.19 2.82 0.46
3 5422 8.59 3.37 0.48
5 5825 11.39 4.48 0.53
10 6831 18.51 7.29 0.65
57 16280 84.51 33.32 1.79

Cost of Commit Transaction

This is using ada-only outputs for better comparability.

UTxO Tx size % max Mem % max CPU Min fee ₳
1 559 10.97 4.30 0.29
2 748 14.40 5.83 0.34
3 937 17.97 7.41 0.39
5 1309 25.48 10.70 0.49
10 2241 46.52 19.78 0.77
20 4122 98.23 41.48 1.42

Cost of CollectCom Transaction

Parties UTxO (bytes) Tx size % max Mem % max CPU Min fee ₳
1 57 546 25.02 9.67 0.45
2 114 660 35.33 13.86 0.56
3 170 766 47.87 19.00 0.71
4 226 876 67.20 26.76 0.92
5 281 986 81.94 32.96 1.09

Cost of Decrement Transaction

Parties Tx size % max Mem % max CPU Min fee ₳
1 606 20.17 8.63 0.40
2 815 23.13 10.49 0.45
3 888 23.61 11.42 0.46
5 1261 27.47 14.28 0.53
10 1936 36.11 21.34 0.68
42 6932 99.29 68.95 1.75

Cost of Close Transaction

Parties Tx size % max Mem % max CPU Min fee ₳
1 665 21.00 9.32 0.42
2 780 22.55 10.74 0.44
3 922 24.15 12.20 0.47
5 1237 27.58 15.37 0.54
10 1876 35.40 22.54 0.68
47 7503 98.37 80.22 1.85

Cost of Contest Transaction

Parties Tx size % max Mem % max CPU Min fee ₳
1 686 25.09 10.80 0.46
2 797 26.78 12.26 0.49
3 954 28.47 13.76 0.52
5 1346 32.96 17.53 0.60
10 2197 42.94 26.08 0.78
39 6552 97.25 73.06 1.75

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 4899 17.84 7.71 0.57
2 5038 29.23 12.73 0.70
3 5135 42.66 18.67 0.86
4 5199 57.30 25.09 1.02
5 5470 79.72 35.22 1.29
6 5589 99.68 44.10 1.52

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 4854 7.78 3.28 0.45
5 1 57 4888 9.15 4.08 0.47
5 5 285 5025 13.37 6.79 0.53
5 10 568 5193 19.60 10.57 0.61
5 20 1137 5531 31.30 17.82 0.78
5 30 1707 5874 42.63 24.92 0.93
5 40 2277 6214 54.05 32.05 1.09
5 50 2852 6558 65.89 39.37 1.25
5 79 4497 7536 99.65 60.34 1.72

End-To-End Benchmark Results

This page is intended to collect the latest end-to-end benchmarks results produced by Hydra's Continuous Integration system from the latest master code.

Please take those results with a grain of salt as they are currently produced from very limited cloud VMs and not controlled hardware. Instead of focusing on the absolute results, the emphasis should be on relative results, eg. how the timings for a scenario evolve as the code changes.

Generated at 2024-07-11 08:33:13.158636611 UTC

Baseline Scenario

Number of nodes 1
Number of txs 3000
Avg. Confirmation Time (ms) 5.076512651
P99 9.486974549999987ms
P95 7.517269549999999ms
P50 4.680261ms
Number of Invalid txs 0

Three local nodes

Number of nodes 3
Number of txs 9000
Avg. Confirmation Time (ms) 23.471590857
P99 53.93019515000019ms
P95 32.88365354999999ms
P50 21.382448500000002ms
Number of Invalid txs 0

@ch1bo ch1bo force-pushed the cleanup-incremental-decommit branch from bc3aebd to 7d0f1e9 Compare July 9, 2024 16:23
@ch1bo ch1bo linked an issue Jul 10, 2024 that may be closed by this pull request
@ch1bo ch1bo force-pushed the cleanup-incremental-decommit branch from e1038aa to ec8f37d Compare July 10, 2024 08:14
@ch1bo ch1bo force-pushed the cleanup-incremental-decommit branch from 363bd2a to 8053d19 Compare July 11, 2024 08:21
This further aligns implementation with the spec and makes for a clearer
case separation.
The healthy case of close "outdated" mutations was also not correctly
setting up the versions.
Seems like the previous practice of incrementing version in HeadLogic
was prone to race conditions.
@ch1bo ch1bo force-pushed the cleanup-incremental-decommit branch 2 times, most recently from e214114 to ea14c48 Compare July 11, 2024 12:56
This allows us to align the HeadLogic part about clearing pending
decommits more faithfully.

Required to add a new method `outputsOfUTxO` to `IsTx` which feels to
become a bit "too big" for a type class.
@ch1bo ch1bo force-pushed the cleanup-incremental-decommit branch from ea14c48 to 4d0bf40 Compare July 11, 2024 15:33
@ch1bo ch1bo force-pushed the cleanup-incremental-decommit branch from adcf1a9 to 2ea5ae2 Compare July 11, 2024 16:56
@ch1bo ch1bo force-pushed the cleanup-incremental-decommit branch from 2ea5ae2 to 48a2e62 Compare July 11, 2024 17:00
@ch1bo ch1bo changed the base branch from master to feature/incremental-decommit July 11, 2024 19:29
@ch1bo ch1bo changed the title DRAFT: Cleanup incremental decommit Cleanup incremental decommit - Part 1 Jul 11, 2024
@ch1bo ch1bo requested a review from a team July 11, 2024 19:39
@ch1bo ch1bo marked this pull request as ready for review July 11, 2024 19:39
@ch1bo ch1bo force-pushed the cleanup-incremental-decommit branch from 38823d1 to 704ff0f Compare July 12, 2024 15:24
@ch1bo ch1bo force-pushed the cleanup-incremental-decommit branch 3 times, most recently from 63bce1b to 7f0c9b0 Compare July 15, 2024 09:46
@ch1bo ch1bo force-pushed the cleanup-incremental-decommit branch from 47def10 to e79dfed Compare July 15, 2024 10:37
@ch1bo ch1bo merged commit aa928f5 into feature/incremental-decommit Jul 15, 2024
4 checks passed
@ch1bo ch1bo deleted the cleanup-incremental-decommit branch July 15, 2024 10:37
@ch1bo ch1bo mentioned this pull request Jul 17, 2024
4 tasks
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.

Close incremental decommit spec/impl gaps
3 participants