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

Add full NixOS-based machine specification to run a Hydra Head node #1506

Merged
merged 9 commits into from
Jul 24, 2024

Conversation

noonio
Copy link
Contributor

@noonio noonio commented Jul 16, 2024

This is a NixOS-based Hyda Head setup allowing for:

  • Deployment to GCP* ( by producing a GCE-compatible image; see https://wiki.nixos.org/wiki/Install_NixOS_on_GCE )
  • Local-spin-up via qemu (for testing)
  • A nixosConfiguration for re-building and redeploying via nixos-rebuild --target-host ... switch --flake .#noon-hydra

It uses the nixos-generators ( thanks @locallycompact !) project to achieve this.

The setup here is hard-coded for me, but is complete (aside from the keys! which need to be generated or otherwise placed on the machine, once deployed.)

More information can be found in the README.

*Note: There is no terraform or the like here; i.e. you are on your own to create a GCP compute instance for the VM once you have uploaded it.

Todo:

  • Work out how to reploy the nixos-configuration
  • Add note about keys
  • Deploy to gcp
  • Update the team config with my own public key (from the deployed server)
  • Pin commit of hydra-team-config
  • Don't generate cardano keys on startup
  • De-dupe env vars
  • Move hydra-team-config to var, make it higher up
  • ? Authorised keys for ssh access? ( https://wiki.nixos.org/wiki/Install_NixOS_on_GCE )
  • Specify a folder for the parties
  • Document how to get the relevant keys yourself
  • systemd services running on startup
  • Check that all files in the team config - https://github.com/cardano-scaling/hydra-team-config - are correct (protocol params, tx id)
  • Add hydra-tui
  • Use 9.0.0
  • Only do some downloads if the relevant files don't exist

Nice to have:

  • Hydraw?
  • Ensure logs come through to GCP
  • Document how to deploy on GCP
  • Structure so it can be used to emit any nixos-generation format

  • CHANGELOG updated or not needed
  • Documentation updated or not needed
  • Haddocks updated or not needed
  • No new TODOs introduced or explained herafter

Copy link

github-actions bot commented Jul 16, 2024

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 2024-07-23 13:19:38.937963797 UTC
Max. memory units 14000000
Max. CPU units 10000000000
Max. tx size (kB) 16384

Script summary

Name Hash Size (Bytes)
νInitial 2fac819a1f4f14e29639d1414220d2a18b6abd6b8e444d88d0dda8ff 3799
νCommit 2043a9f1a685bcf491413a5f139ee42e335157c8c6bc8d9e4018669d 1743
νHead 7ae23bc9f0833a5689b9fc812dd92fbe9dac881a632f14b28e8eb8db 10193
μHead 3ebfb5b268e0c94200e2c8a8eeebf704aabf303a769af602edb3603a* 4607
  • 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 5188 5.61 2.21 0.44
2 5393 7.03 2.77 0.46
3 5588 8.46 3.34 0.49
5 5994 11.12 4.39 0.54
10 6996 18.11 7.16 0.66
56 16244 81.43 32.21 1.76

Commit transaction costs

This uses ada-only outputs for better comparability.

UTxO Tx size % max Mem % max CPU Min fee ₳
1 557 10.52 4.15 0.29
2 744 13.86 5.65 0.34
3 937 17.33 7.20 0.38
5 1307 24.65 10.44 0.48
10 2249 45.22 19.36 0.75
20 4117 95.99 40.76 1.40

CollectCom transaction costs

Parties UTxO (bytes) Tx size % max Mem % max CPU Min fee ₳
1 57 549 21.46 8.41 0.41
2 113 659 32.09 12.73 0.53
3 170 769 47.60 19.01 0.71
4 226 879 61.40 24.74 0.86
5 283 989 75.38 30.66 1.02
6 337 1100 91.52 37.47 1.21

Cost of Decrement Transaction

Parties Tx size % max Mem % max CPU Min fee ₳
1 615 17.71 7.79 0.38
2 718 17.84 8.52 0.39
3 974 21.62 10.77 0.45
5 1220 23.41 12.86 0.49
10 2059 34.17 20.72 0.67
50 7992 99.33 75.15 1.85

Close transaction costs

Parties Tx size % max Mem % max CPU Min fee ₳
1 655 20.98 9.42 0.42
2 802 22.41 10.80 0.44
3 954 24.26 12.50 0.48
5 1212 27.06 15.19 0.53
10 2134 36.40 23.95 0.71
50 8028 99.50 84.34 1.92

Contest transaction costs

Parties Tx size % max Mem % max CPU Min fee ₳
1 658 27.14 11.66 0.48
2 820 28.98 13.20 0.52
3 1073 31.59 15.42 0.56
5 1254 34.63 18.04 0.62
10 2014 44.52 26.43 0.79
38 6096 95.28 70.45 1.70

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 5092 17.47 7.61 0.57
2 5054 20.92 8.80 0.61
3 5293 41.65 18.36 0.85
4 5545 59.60 26.50 1.07
5 5594 75.39 33.52 1.25
6 5780 98.35 43.91 1.52

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 ₳
5 0 0 5022 7.75 3.28 0.46
5 1 57 5056 9.08 4.08 0.48
5 5 285 5193 13.60 6.92 0.54
5 10 569 5361 19.46 10.56 0.62
5 20 1138 5700 30.38 17.51 0.77
5 30 1710 6045 41.70 24.63 0.93
5 40 2279 6383 53.03 31.76 1.09
5 50 2846 6720 64.76 39.06 1.25
5 81 4610 7771 99.33 60.93 1.73

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 2024-07-23 13:22:23.167882594 UTC

Baseline Scenario

Number of nodes 1
Number of txs 3000
Avg. Confirmation Time (ms) 4.401888432
P99 8.395662629999999ms
P95 5.7342458ms
P50 4.1871115ms
Number of Invalid txs 0

Three local nodes

Number of nodes 3
Number of txs 9000
Avg. Confirmation Time (ms) 23.722301807
P99 116.02309178000002ms
P95 32.36410899999999ms
P50 21.036572ms
Number of Invalid txs 0

Copy link

github-actions bot commented Jul 17, 2024

Test Results

464 tests  ±0   452 ✅ ±0   16m 28s ⏱️ - 1m 1s
148 suites ±0    12 💤 ±0 
  5 files   ±0     0 ❌ ±0 

Results for commit 6fdfa3e. ± Comparison against base commit 54eb328.

♻️ This comment has been updated with latest results.

@noonio noonio force-pushed the noon/another-nixos branch 2 times, most recently from 4fb3130 to f8b0b3e Compare July 18, 2024 07:44
@noonio noonio changed the title initial nixos-generators + modules nixos setup Full NixOS-based machine specification to run a Hydra Head node Jul 18, 2024
@noonio noonio changed the title Full NixOS-based machine specification to run a Hydra Head node Add full NixOS-based machine specification to run a Hydra Head node Jul 19, 2024
@noonio noonio force-pushed the noon/another-nixos branch 3 times, most recently from 0ceca0b to 5a5c0d8 Compare July 19, 2024 13:59
@noonio noonio requested a review from a team July 19, 2024 14:00
@noonio noonio marked this pull request as ready for review July 19, 2024 14:00
@noonio noonio force-pushed the noon/another-nixos branch 2 times, most recently from bb543fb to 78329c2 Compare July 22, 2024 08:30
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.

Head a skim through and looks usable, but did not re-use myself.

sample-node-config/another-nixos/README.md Outdated Show resolved Hide resolved
sample-node-config/another-nixos/configuration.nix Outdated Show resolved Hide resolved
Copy link

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 2024-07-23 10:45:22.625425612 UTC
Max. memory units 14000000
Max. CPU units 10000000000
Max. tx size (kB) 16384

Script summary

Name Hash Size (Bytes)
νInitial 2fac819a1f4f14e29639d1414220d2a18b6abd6b8e444d88d0dda8ff 3799
νCommit 2043a9f1a685bcf491413a5f139ee42e335157c8c6bc8d9e4018669d 1743
νHead 7ae23bc9f0833a5689b9fc812dd92fbe9dac881a632f14b28e8eb8db 10193
μHead 3ebfb5b268e0c94200e2c8a8eeebf704aabf303a769af602edb3603a* 4607
  • 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 5186 5.71 2.25 0.44
2 5387 7.18 2.84 0.47
3 5591 8.37 3.30 0.49
5 5997 11.35 4.49 0.54
10 6996 18.34 7.26 0.66
56 16246 81.43 32.21 1.76

Commit transaction costs

This uses ada-only outputs for better comparability.

UTxO Tx size % max Mem % max CPU Min fee ₳
1 559 10.52 4.15 0.29
2 745 13.86 5.65 0.34
3 936 17.33 7.20 0.38
5 1309 24.65 10.44 0.48
10 2236 45.22 19.36 0.75
20 4116 95.99 40.76 1.40

CollectCom transaction costs

Parties UTxO (bytes) Tx size % max Mem % max CPU Min fee ₳
1 57 549 21.46 8.41 0.41
2 114 659 33.11 13.12 0.54
3 170 769 47.23 18.85 0.70
4 227 883 56.94 23.06 0.82
5 283 989 79.31 32.10 1.07
6 340 1100 90.54 37.13 1.20

Cost of Decrement Transaction

Parties Tx size % max Mem % max CPU Min fee ₳
1 636 17.96 7.89 0.38
2 788 19.03 9.05 0.40
3 892 20.76 10.44 0.43
5 1152 22.81 12.64 0.48
10 2219 36.64 21.65 0.70
49 7672 94.20 72.50 1.77

Close transaction costs

Parties Tx size % max Mem % max CPU Min fee ₳
1 656 20.98 9.40 0.42
2 869 22.90 11.19 0.45
3 896 23.88 12.18 0.47
5 1290 27.62 15.67 0.54
10 2058 35.49 23.25 0.70
50 7884 97.44 82.67 1.88

Contest transaction costs

Parties Tx size % max Mem % max CPU Min fee ₳
1 680 27.16 11.67 0.48
2 847 29.40 13.53 0.52
3 974 31.10 15.01 0.55
5 1307 34.99 18.37 0.62
10 2082 44.74 26.64 0.80
39 6418 98.92 73.39 1.76

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 5076 17.32 7.55 0.57
2 5132 27.55 12.00 0.69
3 5336 42.78 18.92 0.87
4 5481 58.35 25.87 1.05
5 5608 77.75 34.58 1.27
6 5654 90.66 40.21 1.42

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 ₳
5 0 0 5022 7.75 3.28 0.46
5 1 57 5056 8.69 3.91 0.47
5 5 284 5191 13.60 6.92 0.54
5 10 569 5361 18.67 10.22 0.61
5 20 1140 5702 30.58 17.60 0.78
5 30 1708 6043 41.51 24.55 0.93
5 40 2277 6382 52.84 31.67 1.09
5 50 2845 6719 64.56 38.97 1.25
5 80 4557 7741 98.59 60.38 1.72

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 2024-07-23 10:47:20.164806057 UTC

Baseline Scenario

Number of nodes 1
Number of txs 3000
Avg. Confirmation Time (ms) 5.180183430
P99 12.203664439999969ms
P95 7.0607161000000005ms
P50 4.890499500000001ms
Number of Invalid txs 0

Three local nodes

Number of nodes 3
Number of txs 9000
Avg. Confirmation Time (ms) 24.471028149
P99 53.029982120000405ms
P95 33.7176663ms
P50 22.321351ms
Number of Invalid txs 0

Copy link

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

Script summary

Name Hash Size (Bytes)
νInitial 2fac819a1f4f14e29639d1414220d2a18b6abd6b8e444d88d0dda8ff 3799
νCommit 2043a9f1a685bcf491413a5f139ee42e335157c8c6bc8d9e4018669d 1743
νHead 7ae23bc9f0833a5689b9fc812dd92fbe9dac881a632f14b28e8eb8db 10193
μHead 3ebfb5b268e0c94200e2c8a8eeebf704aabf303a769af602edb3603a* 4607
  • 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 5186 5.61 2.21 0.44
2 5389 7.36 2.91 0.47
3 5590 8.55 3.38 0.49
5 5998 11.22 4.43 0.54
10 6999 18.11 7.16 0.66
56 16244 81.53 32.25 1.76

Commit transaction costs

This uses ada-only outputs for better comparability.

UTxO Tx size % max Mem % max CPU Min fee ₳
1 556 10.52 4.15 0.29
2 746 13.86 5.65 0.34
3 931 17.33 7.20 0.38
5 1312 24.65 10.44 0.48
10 2247 45.22 19.36 0.75
20 4113 95.99 40.76 1.40

CollectCom transaction costs

Parties UTxO (bytes) Tx size % max Mem % max CPU Min fee ₳
1 58 550 21.46 8.41 0.41
2 114 663 33.90 13.40 0.55
3 170 769 46.00 18.39 0.69
4 227 879 62.75 25.23 0.88
5 281 989 77.06 31.28 1.04
6 337 1100 93.33 38.15 1.23

Cost of Decrement Transaction

Parties Tx size % max Mem % max CPU Min fee ₳
1 618 17.67 7.77 0.38
2 717 17.77 8.49 0.39
3 913 19.93 10.05 0.42
5 1221 24.58 13.38 0.50
10 1875 30.99 19.55 0.62
48 7737 96.14 72.46 1.79

Close transaction costs

Parties Tx size % max Mem % max CPU Min fee ₳
1 672 21.02 9.43 0.42
2 824 22.83 11.12 0.45
3 939 23.88 12.21 0.47
5 1288 27.66 15.69 0.54
10 1973 34.97 22.71 0.68
50 8076 99.51 84.19 1.92

Contest transaction costs

Parties Tx size % max Mem % max CPU Min fee ₳
1 674 27.18 11.67 0.48
2 801 28.94 13.18 0.51
3 944 30.70 14.69 0.55
5 1304 34.72 18.11 0.62
10 2174 45.34 27.23 0.81
38 6366 99.76 73.41 1.77

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 5079 17.47 7.61 0.57
2 5256 29.31 12.94 0.71
3 5245 40.49 17.78 0.84
4 5410 56.97 25.18 1.03
5 5561 70.88 31.38 1.19
6 5551 87.09 38.52 1.38

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 ₳
5 0 0 5022 7.75 3.28 0.46
5 1 57 5056 9.28 4.16 0.48
5 5 284 5191 13.41 6.84 0.54
5 10 569 5361 19.26 10.48 0.62
5 20 1140 5703 30.19 17.43 0.77
5 30 1708 6043 41.90 24.72 0.93
5 40 2279 6384 52.84 31.67 1.09
5 50 2845 6720 64.56 38.97 1.25
5 81 4606 7767 99.53 61.01 1.74

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 2024-07-23 11:50:17.157866015 UTC

Baseline Scenario

Number of nodes 1
Number of txs 3000
Avg. Confirmation Time (ms) 4.748619171
P99 9.636897419999999ms
P95 6.568914499999998ms
P50 4.296995ms
Number of Invalid txs 0

Three local nodes

Number of nodes 3
Number of txs 9000
Avg. Confirmation Time (ms) 23.412450687
P99 45.37331211000013ms
P95 31.89183595ms
P50 21.3516245ms
Number of Invalid txs 0

@ch1bo ch1bo merged commit cf97366 into master Jul 24, 2024
21 checks passed
@ch1bo ch1bo deleted the noon/another-nixos branch July 24, 2024 08:04
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