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

Improve hydra-node command line gen-hydra-key error handling #1077

Merged
merged 3 commits into from
Sep 20, 2023

Conversation

pgrange
Copy link
Contributor

@pgrange pgrange commented Sep 19, 2023

hydra-node gen-hydra-key --output-file credentials/alice-hydra will silently fail if credentials directory does not exist. This PR introduces an error message output and an error code so that user or scripts can figure out that the command failed.


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

@pgrange pgrange self-assigned this Sep 19, 2023
@pgrange pgrange marked this pull request as ready for review September 19, 2023 07:08
Node module contains what's needed to run a Hydra node.

Utils module contains what's needed to run the hydra utils commands,
the first one being generateHydraKeys.
@pgrange pgrange changed the title Ensemble/fix options gen-hydra-key error handling Sep 19, 2023
@github-actions
Copy link

github-actions bot commented Sep 19, 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-09-19 19:21:48.794969055 UTC
Max. memory units 14000000
Max. CPU units 10000000000
Max. tx size (kB) 16384

Script summary

Name Hash Size (Bytes)
νInitial 3ffaf6b87df35cb01a52eb23032b8f0b1a2a3ad3acf0930abc9c833a 4150
νCommit e4c32d6dc83b2917aa7805571f30437ad98b6d20d821d34d45943755 2093
νHead 8a43c1c4d5cb60c212e7aa540932f311cb914a1b6104f0f36a2aaaf0 8845
μHead efd460b736e8155861e909d6507760b24a5c28717591c6e98c26b104* 4187
  • 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 4781 11.77 4.63 0.49
2 4985 14.54 5.70 0.53
3 5191 16.74 6.53 0.56
5 5601 21.48 8.33 0.63
10 6625 33.37 12.86 0.80
37 12160 97.15 37.10 1.74

Cost of Commit Transaction

This is using ada-only outputs for better comparability.

UTxO Tx size % max Mem % max CPU Min fee ₳
1 599 12.67 4.97 0.31
2 787 16.49 6.69 0.37
3 975 20.37 8.42 0.42
5 1345 28.46 12.01 0.53
10 2273 51.44 21.99 0.82
18 3779 95.35 40.55 1.38

Cost of CollectCom Transaction

Parties UTxO (bytes) Tx size % max Mem % max CPU Min fee ₳
1 57 815 24.07 9.57 0.45
2 113 1134 36.89 14.81 0.60
3 169 1453 54.57 21.96 0.81
4 225 1773 68.53 27.90 0.98
5 284 2097 92.61 37.66 1.26

Cost of Close Transaction

Parties Tx size % max Mem % max CPU Min fee ₳
1 623 17.15 7.39 0.37
2 917 20.70 10.32 0.43
3 1145 22.51 11.92 0.47
5 1236 23.33 10.81 0.47
10 2585 34.66 22.76 0.71
50 10632 99.95 82.26 2.02

Cost of Contest Transaction

Parties Tx size % max Mem % max CPU Min fee ₳
1 723 23.22 10.34 0.44
2 941 25.18 12.00 0.48
3 1144 27.09 13.63 0.52
5 1620 30.50 16.78 0.59
10 2668 40.82 25.24 0.78
43 9330 97.89 75.20 1.89

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 5012 21.67 9.31 0.61
2 5192 31.50 13.44 0.73
3 5967 54.43 23.84 1.02
4 6468 75.89 33.33 1.29
5 6281 85.94 37.29 1.39

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 4803 9.06 3.81 0.46
5 1 57 4836 10.21 4.54 0.48
5 5 284 4982 14.84 7.48 0.54
5 10 570 5165 22.18 11.79 0.64
5 20 1140 5528 35.30 19.78 0.82
5 30 1707 5882 48.43 27.77 1.00
5 40 2275 6237 61.57 35.77 1.18
5 50 2848 6608 74.28 43.60 1.36
5 69 3927 7289 99.69 58.99 1.70

@v0d1ch v0d1ch force-pushed the ensemble/fix_options branch 2 times, most recently from cdb591e to 992d0f3 Compare September 19, 2023 08:49
@github-actions
Copy link

github-actions bot commented Sep 19, 2023

Test Results

346 tests   - 12   341 ✔️  - 12   21m 49s ⏱️ - 5m 2s
118 suites  -   3       5 💤 ±  0 
    5 files    -   1       0 ±  0 

Results for commit e3a692a. ± Comparison against base commit b9864ac.

This pull request removes 13 and adds 1 tests. Note that renamed tests count towards both.
Hydra.TUI.Options ‑ no arguments yield default options
Hydra.TUI.Options ‑ parses --cardano-signing-key option
Hydra.TUI.Options ‑ parses --connect option
Hydra.TUI.Options ‑ parses --node-socket option
Hydra.TUI.Options ‑ parses --testnet-magic option
Hydra.TUI.Options ‑ parses --version option
Hydra.TUI/end-to-end smoke tests ‑ display feedback long enough
Hydra.TUI/end-to-end smoke tests ‑ doesn't allow multiple initializations
Hydra.TUI/end-to-end smoke tests ‑ starts & renders
Hydra.TUI/end-to-end smoke tests ‑ supports the full Head life cycle
…
Hydra.Utils ‑ Should throw if it can't write on disk

♻️ This comment has been updated with latest results.

@ch1bo ch1bo changed the title gen-hydra-key error handling Improve hydra-node command line gen-hydra-key error handling Sep 19, 2023
@ch1bo ch1bo assigned locallycompact and ffakenz and unassigned pgrange Sep 19, 2023
Copy link
Contributor

@locallycompact locallycompact left a comment

Choose a reason for hiding this comment

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

+1

- Simplify call site for genHydraKeys
@v0d1ch v0d1ch merged commit c9e323e into master Sep 20, 2023
18 checks passed
@v0d1ch v0d1ch deleted the ensemble/fix_options branch September 20, 2023 08:48
@ch1bo ch1bo added this to the 0.13.0 milestone Sep 20, 2023
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.

None yet

5 participants