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

Restarting the node with different parameters #767

Merged
merged 14 commits into from
Mar 17, 2023

Conversation

v0d1ch
Copy link
Contributor

@v0d1ch v0d1ch commented Mar 8, 2023

Fix #764

NOTE: This is initial work on this item as I wanted to gather reviews. This PR only checks the contestation period and the parties. If the approach is good I will add more checks to complete our objective.

Why

We want our hydra-node to behave well with respect to the provided arguments. In the presence of existing state it can happen that the arguments are not in line with what we have already in our state. For these cases we want to prevent the hydra-node from operating further until either state is cleared or node arguments match the state.

What

Check node state (if any) against the provided arguments, log and fail if we discover misconfiguration.

  • CHANGELOG updated
  • Documentation updated
  • Added and/or updated haddocks
  • No new TODOs introduced or explained herafter

@v0d1ch v0d1ch self-assigned this Mar 8, 2023
@v0d1ch v0d1ch force-pushed the restarting-the-node-with-different-parameters branch 3 times, most recently from f083c53 to bfeea14 Compare March 8, 2023 15:14
@github-actions
Copy link

github-actions bot commented Mar 8, 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-03-17 19:47:46.606664228 UTC
Max. memory units 14000000
Max. CPU units 10000000000
Max. tx size (kB) 16384

Script summary

Name Hash Size (Bytes)
νInitial 9492414f8f96e8483a0b8ee268fc06a954641cb2cbaa9a8b093c2c9b 4621
νCommit 5d3f107aaa56d06188cf231941cf8163e777236a9cfdc48fd4bbfa23 2422
νHead 82f16b51e2d81c6f4d42dd7398b4713a445464902f63dfd86ffe754e 8954
μHead 4083fa7081a0f4b4092fb02867c9ac594bb0e8bab8110ab242ba5a72* 4458
  • 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 5056 13.49 5.31 0.52
2 5257 16.34 6.41 0.56
3 5464 20.21 7.92 0.61
5 5872 24.25 9.42 0.67
10 6897 37.26 14.37 0.86
36 12231 99.27 37.80 1.76

Cost of Commit Transaction

Currently only one UTxO per commit allowed (this is about to change soon)

UTxO Tx size % max Mem % max CPU Min fee ₳
1 603 15.83 6.22 0.35

Cost of CollectCom Transaction

Parties UTxO (bytes) Tx size % max Mem % max CPU Min fee ₳
1 57 816 24.42 9.92 0.45
2 114 1137 40.75 16.66 0.65
3 171 1462 59.33 24.41 0.87
4 227 1784 81.13 33.50 1.13

Cost of Close Transaction

Parties Tx size % max Mem % max CPU Min fee ₳
1 672 17.74 7.77 0.38
2 805 18.73 8.21 0.40
3 965 20.08 8.96 0.42
5 1307 22.70 10.43 0.47
10 1471 24.26 10.67 0.49
50 8725 85.93 45.27 1.55

Cost of Contest Transaction

Parties Tx size % max Mem % max CPU Min fee ₳
1 676 21.73 9.11 0.42
2 832 23.88 10.16 0.45
3 1005 25.16 10.88 0.48
5 1337 28.72 12.69 0.53
10 2160 37.37 17.14 0.67
46 8109 99.36 49.05 1.66

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 5171 29.49 12.60 0.71
2 5491 48.17 20.80 0.93
3 5817 70.08 30.47 1.19
4 6138 95.38 41.62 1.49

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 5077 10.59 4.43 0.49
5 1 57 5113 12.12 5.31 0.51
5 5 283 5255 18.22 8.83 0.59
5 10 569 5436 25.85 13.24 0.69
5 20 1140 5797 41.11 22.05 0.90
5 30 1707 6156 56.37 30.86 1.10
5 40 2277 6516 71.64 39.68 1.30
5 50 2849 6879 86.92 48.50 1.50
5 58 3305 7170 99.14 55.56 1.67

@v0d1ch v0d1ch marked this pull request as ready for review March 9, 2023 11:48
@v0d1ch v0d1ch requested review from ch1bo, pgrange, a user and ffakenz March 9, 2023 11:51
@github-actions
Copy link

github-actions bot commented Mar 9, 2023

Test Results

307 tests  +12   301 ✔️ +12   24m 49s ⏱️ + 4m 45s
104 suites +  4       6 💤 ±  0 
    6 files   +  1       0 ±  0 

Results for commit b1b3e15. ± Comparison against base commit 2c34d91.

♻️ This comment has been updated with latest results.

@v0d1ch v0d1ch force-pushed the restarting-the-node-with-different-parameters branch from db868ec to 297f3f7 Compare March 11, 2023 17:47
Copy link
Contributor

@pgrange pgrange left a comment

Choose a reason for hiding this comment

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

I understand that, for now, you're not looking for a P.R. per se but for preliminary comments. So here are mine.

Cheers,

hydra-node/exe/hydra-node/Main.hs Outdated Show resolved Hide resolved
hydra-node/exe/hydra-node/Main.hs Outdated Show resolved Hide resolved
@v0d1ch v0d1ch force-pushed the restarting-the-node-with-different-parameters branch 5 times, most recently from 2383409 to 6592698 Compare March 14, 2023 14:47
Copy link
Member

@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.

I think we can reduce the complexity of this also by not being too strict on the level of detail required. IMO it is sufficient to say, that the loaded state is not matching what was configured. Maybe with another message to indicate check state in --persistence-dir against provided command line options

hydra-cluster/test/Test/EndToEndSpec.hs Outdated Show resolved Hide resolved
hydra-cluster/test/Test/EndToEndSpec.hs Outdated Show resolved Hide resolved
hydra-cluster/test/Test/EndToEndSpec.hs Outdated Show resolved Hide resolved
hydra-cluster/test/Test/EndToEndSpec.hs Outdated Show resolved Hide resolved
hydra-node/exe/hydra-node/Main.hs Outdated Show resolved Hide resolved
hydra-node/exe/hydra-node/Main.hs Outdated Show resolved Hide resolved
hydra-node/exe/hydra-node/Main.hs Outdated Show resolved Hide resolved
@v0d1ch v0d1ch force-pushed the restarting-the-node-with-different-parameters branch 3 times, most recently from b22eb8b to 0b2c0c2 Compare March 15, 2023 15:32
@v0d1ch v0d1ch requested a review from ch1bo March 15, 2023 15:36
@v0d1ch v0d1ch force-pushed the restarting-the-node-with-different-parameters branch 2 times, most recently from fe2fcf4 to 5907d57 Compare March 15, 2023 17:31
hydra-node/exe/hydra-node/Main.hs Outdated Show resolved Hide resolved
hydra-node/exe/hydra-node/Main.hs Outdated Show resolved Hide resolved
hydra-node/exe/hydra-node/Main.hs Outdated Show resolved Hide resolved
hydra-node/src/Hydra/Logging/Messages.hs Outdated Show resolved Hide resolved
hydra-node/exe/hydra-node/Main.hs Outdated Show resolved Hide resolved
@v0d1ch v0d1ch force-pushed the restarting-the-node-with-different-parameters branch from 5907d57 to dc8028f Compare March 16, 2023 09:36
@v0d1ch v0d1ch requested a review from ch1bo March 16, 2023 09:38
@v0d1ch v0d1ch force-pushed the restarting-the-node-with-different-parameters branch from dc8028f to 83faa98 Compare March 17, 2023 08:48
Copy link
Member

@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.

Some inconsistencies still, but I can approve even without these changes.

hydra-cluster/test/Test/EndToEndSpec.hs Show resolved Hide resolved
hydra-node/src/Hydra/Options.hs Show resolved Hide resolved
@v0d1ch v0d1ch force-pushed the restarting-the-node-with-different-parameters branch from 83faa98 to 1c687ac Compare March 17, 2023 09:20
@ch1bo ch1bo force-pushed the restarting-the-node-with-different-parameters branch from 1c687ac to 3d1c988 Compare March 17, 2023 09:29
@v0d1ch v0d1ch force-pushed the restarting-the-node-with-different-parameters branch from 62cca01 to 58e6415 Compare March 17, 2023 12:53
@v0d1ch v0d1ch force-pushed the restarting-the-node-with-different-parameters branch from 58e6415 to bbe90bf Compare March 17, 2023 13:46
@ch1bo ch1bo force-pushed the restarting-the-node-with-different-parameters branch from 7e53b56 to a2295a6 Compare March 17, 2023 15:41
@ch1bo ch1bo force-pushed the restarting-the-node-with-different-parameters branch from a2295a6 to 5f7efd9 Compare March 17, 2023 16:58
@v0d1ch v0d1ch merged commit 8b9539f into master Mar 17, 2023
@v0d1ch v0d1ch deleted the restarting-the-node-with-different-parameters branch March 17, 2023 19:56
@pgrange pgrange added this to the 0.10.0 milestone May 11, 2023
@ch1bo ch1bo removed this from the 0.10.0 milestone May 11, 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.

Restarting a node with different parameters than the persisted ones
4 participants