input-output-hk / hydra

Implementation of the Hydra Head protocol
https://hydra.family/head-protocol/
Apache License 2.0
264 stars 86 forks source link

Learn section: revised copy, adjusted contents #1454

Closed olgahryniuk closed 3 weeks ago

olgahryniuk commented 1 month ago

This pull request proposes renaming the 'Core concepts' section to 'Learn'. This change will allow us to consolidate more overviews in this section, such as the protocol overview and the specification, as suggested by the team in the documentation questionnaire. The 'Learn' section will cater to general users interested in core concepts, the Hydra overview, and related information.

github-actions[bot] commented 1 month ago

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-06-06 09:20:29.68001942 UTC
Max. memory units 14000000
Max. CPU units 10000000000
Max. tx size (kB) 16384

Script summary

Name Hash Size (Bytes)
νInitial baafeb5dc37bbe6e068784746bda0a3b1bb1d034fa0c55270f6079c1 4082
νCommit fe7af84822bcba542fae377ae7311fc5fd20152f925ccd980f73ecdc 2061
νHead 93c08c55e804d7f82ca545a01883b5fda6a6d3623cb78885625800ae 9366
μHead 5e65c73722b4bb3f0cbfcc8433e1dcdfea099eaf0a43060f1731a65b* 4237
Parties Tx size % max Mem % max CPU Min fee ₳
1 4818 6.17 2.43 0.43
2 5019 7.19 2.82 0.45
3 5221 8.93 3.52 0.48
5 5621 11.60 4.57 0.52
10 6629 18.40 7.24 0.64
58 16278 86.00 33.91 1.81

Cost of Commit Transaction

This is using ada-only outputs for better comparability.

UTxO Tx size % max Mem % max CPU Min fee ₳
1 559 9.69 3.82 0.28
2 746 12.48 5.10 0.32
3 933 15.33 6.40 0.36
5 1310 21.26 9.09 0.45
10 2246 37.35 16.27 0.67
25 5058 96.42 41.75 1.45

Cost of CollectCom Transaction

Parties UTxO (bytes) Tx size % max Mem % max CPU Min fee ₳
1 57 544 14.83 5.92 0.34
2 114 654 23.06 9.32 0.43
3 170 764 33.35 13.60 0.55
4 227 874 46.21 18.95 0.70
5 284 984 56.16 23.30 0.82
6 337 1095 73.07 30.38 1.01
7 394 1205 91.10 37.91 1.21

Cost of Close Transaction

Parties Tx size % max Mem % max CPU Min fee ₳
1 599 8.31 4.60 0.28
2 740 9.01 5.66 0.30
3 893 9.54 6.68 0.31
5 1153 11.07 8.85 0.35
10 1280 13.93 7.48 0.37
50 8264 51.55 63.93 1.39

Cost of Contest Transaction

Parties Tx size % max Mem % max CPU Min fee ₳
1 627 8.64 4.73 0.28
2 774 9.37 5.82 0.30
3 889 10.01 6.84 0.32
5 1110 10.89 8.58 0.35
10 2130 17.05 16.04 0.50
50 8162 52.30 64.13 1.39

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 4692 17.04 7.37 0.55
2 4820 27.83 12.13 0.67
3 5021 41.85 18.42 0.84
4 5096 58.20 25.57 1.03
5 5179 74.57 32.74 1.22

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 4651 7.61 3.18 0.44
5 1 56 4685 9.18 4.07 0.46
5 5 284 4820 13.58 6.83 0.52
5 10 570 4991 19.34 10.39 0.60
5 20 1139 5330 30.87 17.52 0.76
5 30 1708 5672 42.40 24.66 0.92
5 40 2274 6008 53.72 31.71 1.08
5 50 2844 6348 65.89 39.12 1.24
5 79 4495 7331 98.97 59.67 1.70

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-06-06 09:22:37.18421592 UTC

Baseline Scenario

Number of nodes 1
Number of txs 3000
Avg. Confirmation Time (ms) 4.283818817
P99 6.843435429999991ms
P95 5.58772045ms
P50 4.0851144999999995ms
Number of Invalid txs 0

Three local nodes

Number of nodes 3
Number of txs 9000
Avg. Confirmation Time (ms) 21.111660074
P99 51.64600599000007ms
P95 29.114773449999984ms
P50 19.010876500000002ms
Number of Invalid txs 0
github-actions[bot] commented 1 month ago

Test Results

436 tests  ±0   424 :white_check_mark: ±0   13m 50s :stopwatch: - 2m 0s 143 suites ±0    12 :zzz: ±0    5 files   ±0     0 :x: ±0 

Results for commit 34c1408b. ± Comparison against base commit 66f20ae4.

:recycle: This comment has been updated with latest results.

olgahryniuk commented 1 month ago

Note, if the team is happy with this suggestion, we'll also need to replace a link to the specification from this page: https://hydra.family/head-protocol/docs/dev/