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

Multi party, networked offline heads #1851

Merged
merged 12 commits into from
Feb 17, 2025
Merged

Multi party, networked offline heads #1851

merged 12 commits into from
Feb 17, 2025

Conversation

ch1bo
Copy link
Member

@ch1bo ch1bo commented Feb 12, 2025

This is a change I encountered when rebasing raft-network for #1720 and was useful back in the spike, but would have also been valuable in the hydra-doom use case.

Anyways, this is adding a --offline-head-seed argument to offline mode and fixes the "simulation" opened head to be deterministic across multiple instances, resulting that the nodes can and do talk to each other and consequently sign snapshots.


  • CHANGELOG updated
  • Documentation updated
  • Haddocks updated
  • No new TODOs introduced

@ch1bo ch1bo changed the title Multi party offline head Multi party, networked offline heads Feb 12, 2025
@ch1bo ch1bo requested a review from a team February 12, 2025 10:59
@ch1bo ch1bo force-pushed the multi-party-offline-head branch from 87ade0b to e21c830 Compare February 12, 2025 11:00
@ch1bo ch1bo self-assigned this Feb 12, 2025
Copy link

github-actions bot commented Feb 12, 2025

Transaction cost differences

Script summary

Name Size (Bytes)
νInitial -
νCommit -
νHead -
μHead -
νDeposit -

Init transaction costs

Parties Tx size % max Mem % max CPU Min fee ₳
1 - - - -
2 - - - -
3 - - - -
5 - - - -
10 - - - -
40 - - - -

Commit transaction costs

UTxO Tx size % max Mem % max CPU Min fee ₳
1 - - - -
2 - - - -
3 - - - -
5 - - - -
10 - - - -
54 - - - -

CollectCom transaction costs

Parties UTxO (bytes) Tx size % max Mem % max CPU Min fee ₳
1 - - - - -
2 - - - - -
3 - - - - -
4 - - - - -
5 - - - - -
6 - - - - -
7 - - - - -
8 - - - - -

Cost of Increment Transaction

Parties Tx size % max Mem % max CPU Min fee ₳
1 - +0.39 +0.09 -
2 - - - -
3 - - - -
5 - - - -
10 - - - -
37 - - - -

Cost of Decrement Transaction

Parties Tx size % max Mem % max CPU Min fee ₳
1 - - - -
2 - - - -
3 - - - -
5 - - - -
10 - - - -
40 - - - -

Close transaction costs

Parties Tx size % max Mem % max CPU Min fee ₳
1 - - - -
2 - - - -
3 - - - -
5 - - - -
10 - - - -
34 - - - -

Contest transaction costs

Parties Tx size % max Mem % max CPU Min fee ₳
1 - - - -
2 - - - -
3 - - - -
5 - - - -
10 - - - -
27 - - - -

FanOut transaction costs

UTxO, Parties UTxO (bytes) Tx size % max Mem % max CPU Min fee ₳
(0, 10) - - - - -
(1, 10) - - - - -
(5, 10) - - - - -
(10, 10) - - - - -
(20, 10) - - - - -
(37, 10) - - - - -

Copy link

github-actions bot commented Feb 12, 2025

Transaction 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 2025-02-17 10:16:38.872512039 UTC
Max. memory units 14000000
Max. CPU units 10000000000
Max. tx size (kB) 16384

Script summary

Name Hash Size (Bytes)
νInitial c8a101a5c8ac4816b0dceb59ce31fc2258e387de828f02961d2f2045 2652
νCommit 61458bc2f297fff3cc5df6ac7ab57cefd87763b0b7bd722146a1035c 685
νHead 0e35115a2c7c13c68ecd8d74e4987c04d4539e337643be20bb3274bd 14756
μHead 57166715eadb8d3135964325c016eea546c21e1c0aae974ca67df9a5* 5541
νDeposit ae01dade3a9c346d5c93ae3ce339412b90a0b8f83f94ec6baa24e30c 1102
  • The minting policy hash is only usable for comparison. As the script is parameterized, the actual script is unique per head.

Init transaction costs

Parties Tx size % max Mem % max CPU Min fee ₳
1 6093 11.32 3.53 0.54
2 6298 13.56 4.22 0.57
3 6493 15.68 4.86 0.60
5 6898 19.98 6.17 0.66
10 7904 31.18 9.61 0.82
40 13936 98.61 30.29 1.78

Commit transaction costs

This uses ada-only outputs for better comparability.

UTxO Tx size % max Mem % max CPU Min fee ₳
1 561 2.44 1.16 0.20
2 743 3.38 1.73 0.22
3 923 4.36 2.33 0.24
5 1278 6.41 3.60 0.28
10 2176 12.13 7.25 0.40
54 10057 98.61 68.52 1.88

CollectCom transaction costs

Parties UTxO (bytes) Tx size % max Mem % max CPU Min fee ₳
1 57 525 26.47 7.60 0.44
2 113 636 34.96 10.01 0.53
3 171 747 45.83 12.98 0.65
4 226 862 50.58 14.52 0.70
5 283 969 64.15 18.22 0.84
6 341 1081 77.09 21.64 0.98
7 395 1192 86.42 24.26 1.08
8 450 1303 89.35 25.35 1.11

Cost of Increment Transaction

Parties Tx size % max Mem % max CPU Min fee ₳
1 1806 25.42 8.31 0.49
2 1886 26.01 9.09 0.51
3 2064 28.27 10.55 0.55
5 2391 32.58 13.29 0.61
10 3067 41.13 19.25 0.76
39 7429 98.59 57.10 1.69

Cost of Decrement Transaction

Parties Tx size % max Mem % max CPU Min fee ₳
1 593 23.99 7.61 0.43
2 801 26.54 8.99 0.46
3 824 25.31 9.28 0.46
5 1185 31.64 12.38 0.55
10 1907 41.04 18.30 0.70
38 6072 96.08 52.15 1.57

Close transaction costs

Parties Tx size % max Mem % max CPU Min fee ₳
1 698 29.15 9.21 0.48
2 789 32.89 10.93 0.53
3 1025 33.52 11.98 0.55
5 1296 39.83 15.25 0.64
10 2166 52.10 22.66 0.83
34 5627 96.54 52.96 1.56

Contest transaction costs

Parties Tx size % max Mem % max CPU Min fee ₳
1 688 35.95 11.01 0.55
2 819 38.11 12.31 0.58
3 1014 41.03 13.96 0.63
5 1261 45.29 16.56 0.69
10 2032 57.60 23.77 0.88
27 4551 98.05 47.75 1.49

Abort transaction costs

There is some variation due to the random mixture of initial and already committed outputs.

Parties Tx size % max Mem % max CPU Min fee ₳
1 5972 28.23 9.31 0.71
2 6183 38.73 12.81 0.83
3 6255 44.20 14.57 0.89
4 6354 53.55 17.66 0.99
5 6447 66.27 21.81 1.13
6 6505 67.59 22.18 1.14
7 6765 84.70 27.97 1.33
8 6855 85.88 28.31 1.35

FanOut transaction costs

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 ₳
10 0 0 6091 18.75 6.15 0.61
10 5 284 6261 31.23 10.90 0.76
10 10 570 6432 40.50 14.57 0.87
10 30 1708 7112 83.04 31.07 1.36
10 37 2105 7347 97.56 36.72 1.53

End-to-end benchmark results

This page is intended to collect the latest end-to-end benchmark results produced by Hydra's continuous integration (CI) system from the latest master code.

Please note that these results are approximate as they are currently produced from limited cloud VMs and not controlled hardware. Rather than focusing on the absolute results, the emphasis should be on relative results, such as how the timings for a scenario evolve as the code changes.

Generated at 2025-02-17 10:19:37.652582387 UTC

Baseline Scenario

Number of nodes 1
Number of txs 300
Avg. Confirmation Time (ms) 4.168704500
P99 10.003814869999959ms
P95 4.86708535ms
P50 3.9635179999999997ms
Number of Invalid txs 0

Memory data

Time Used Free
2025-02-17 10:18:14.416211708 UTC 927M 2234M
2025-02-17 10:18:19.416137444 UTC 1000M 2140M
2025-02-17 10:18:24.416049725 UTC 1000M 2140M
2025-02-17 10:18:29.416116955 UTC 1003M 2136M
2025-02-17 10:18:34.416114005 UTC 1014M 2125M
2025-02-17 10:18:39.416025186 UTC 1014M 2124M

Three local nodes

Number of nodes 3
Number of txs 900
Avg. Confirmation Time (ms) 22.726207555
P99 45.01031833999936ms
P95 30.30747325ms
P50 20.872570000000003ms
Number of Invalid txs 0

Memory data

Time Used Free
2025-02-17 10:18:51.484123731 UTC 932M 2219M
2025-02-17 10:18:56.484179894 UTC 1094M 2055M
2025-02-17 10:19:01.48427395 UTC 1104M 2045M
2025-02-17 10:19:06.484143667 UTC 1144M 2005M
2025-02-17 10:19:11.484246188 UTC 1168M 1892M
2025-02-17 10:19:16.484241755 UTC 1193M 1806M
2025-02-17 10:19:21.484219385 UTC 1193M 1805M
2025-02-17 10:19:26.484222927 UTC 1209M 1789M
2025-02-17 10:19:31.484245257 UTC 1209M 1788M
2025-02-17 10:19:36.484181723 UTC 1214M 1782M

@ch1bo ch1bo force-pushed the multi-party-offline-head branch from 713dc79 to 090113c Compare February 13, 2025 11:41
Copy link
Contributor

@noonio noonio left a comment

Choose a reason for hiding this comment

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

Seems great; aside from minor clarification around whether or not the head-seed actually must be hexadecimals :)

Seems like it's better if it's just an arbitrary string.

@ch1bo ch1bo force-pushed the multi-party-offline-head branch from 090113c to 53bcb5b Compare February 17, 2025 08:42
@noonio noonio self-requested a review February 17, 2025 09:56
The testnet is phased out and we should also consider dropping it from KnownNetworks
hydra-node/test/Hydra/OptionsSpec.hs Show resolved Hide resolved
hydra-node/src/Hydra/Options.hs Show resolved Hide resolved
hydra-cluster/test/Test/CardanoNodeSpec.hs Show resolved Hide resolved
@ch1bo ch1bo enabled auto-merge February 17, 2025 13:12
@ch1bo ch1bo added this pull request to the merge queue Feb 17, 2025
Merged via the queue into master with commit 7c3c3cb Feb 17, 2025
25 checks passed
@ch1bo ch1bo deleted the multi-party-offline-head branch February 17, 2025 13:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done ✔
Development

Successfully merging this pull request may close these issues.

3 participants