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

Save 10seconds when running NetworkSpec #651

Merged
merged 3 commits into from
Dec 13, 2022
Merged

Conversation

pgrange
Copy link
Contributor

@pgrange pgrange commented Dec 12, 2022

Depending on how the different Ouroboros servers are instantiated during the tests, the tests can take 0.3 seconds or 10.3 seconds. This is due to ipRetryDelay .

We add a threadDelay before trying to connect to other peer so that we give our own listen thread to be already listening... which seems fair.

To check before merging:

  • CHANGELOG is up to date
  • Up to date with master

@pgrange pgrange requested review from ch1bo and v0d1ch December 12, 2022 10:00
@github-actions
Copy link

github-actions bot commented Dec 12, 2022

Test Results

266 tests   - 11   260 ✔️  - 11   14m 4s ⏱️ -59s
  92 suites  -   4       6 💤 ±  0 
    4 files    -   1       0 ±  0 

Results for commit 80ba588. ± Comparison against base commit 11b2b16.

This pull request removes 11 tests.
Hydra.TUI.Options ‑ parses --cardano-signing-key option
Hydra.TUI.Options ‑ parses --connect option
Hydra.TUI.Options ‑ parses --network-id option
Hydra.TUI.Options ‑ parses --node-socket 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.TUI/end-to-end smoke tests ‑ supports the init & abort Head life cycle
Hydra.TUI/text rendering errors ‑ should show not enough fuel message and suggestion
…

♻️ This comment has been updated with latest results.

@github-actions
Copy link

github-actions bot commented Dec 12, 2022

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 2022-12-13 15:43:41.522524105 UTC
Max. memory units 14000000
Max. CPU units 10000000000
Max. tx size (kB) 16384

Cost of Init Transaction

Parties Tx size % max Mem % max CPU Min fee ₳
1 4831 8.93 3.51 0.46
2 5037 12.43 4.90 0.51
3 5241 13.46 5.28 0.53
5 5653 19.33 7.59 0.61
10 6681 27.65 10.75 0.75
46 14060 98.94 38.22 1.84

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 5771 19.76 7.97 0.62

Cost of CollectCom Transaction

Parties Tx size % max Mem % max CPU Min fee ₳
1 13058 20.68 8.29 0.95
2 13272 34.66 14.03 1.12
3 13702 55.20 22.52 1.36
4 13988 75.90 31.13 1.60

Cost of Close Transaction

Parties Tx size % max Mem % max CPU Min fee ₳
1 9260 7.59 2.99 0.64
2 9526 9.36 3.97 0.67
3 9655 9.75 4.27 0.68
5 9987 11.31 5.17 0.72
10 10882 16.18 7.80 0.82
30 14227 32.77 17.22 1.17
71 16308 42.18 15.97 1.32

Cost of Contest Transaction

Parties Tx size % max Mem % max CPU Min fee ₳
1 9328 8.16 3.34 0.65
2 9487 8.94 3.79 0.67
3 9652 9.72 4.24 0.68
5 10024 11.72 5.32 0.72
10 10889 16.34 7.85 0.82
30 14227 32.74 17.20 1.16
43 16371 42.92 23.08 1.38

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 13495 22.50 9.35 0.99
2 13817 38.29 16.29 1.18
3 14350 64.78 29.24 1.52
4 14327 77.65 33.97 1.65

Cost of FanOut Transaction

Involves spending head output and burning head tokens. Uses ada-only UTxO for better comparability.

UTxO Tx size % max Mem % max CPU Min fee ₳
1 13550 10.64 4.61 0.87
2 13520 12.03 5.44 0.88
3 13492 12.92 6.07 0.89
5 13562 15.96 7.83 0.93
10 13809 23.95 12.37 1.04
50 15179 84.80 47.57 1.85
59 15575 98.60 55.53 2.03

@v0d1ch v0d1ch changed the title Save 10seconds when running NetwrokSpec Save 10seconds when running NetworkSpec Dec 12, 2022
hydra-node/src/Hydra/Network/Ouroboros.hs Outdated Show resolved Hide resolved
@pgrange pgrange force-pushed the ensemble/network_spec_perf branch from d966fda to ef2d634 Compare December 13, 2022 08:52
withServerNode last param is a callabck called when the server is
listening. We use it to control when we want to start connecting to
other nodes. Because we are good citizen and start by listening to
connection before trying to connect to peers ourselves.
By explicilitly waiting for the serverAsync we ensure that, in
cas this thread crashes for any reason, we acknowledge it and stop
our process.
@pgrange pgrange force-pushed the ensemble/network_spec_perf branch from cd327c8 to 80ba588 Compare December 13, 2022 14:27
@pgrange pgrange requested a review from a user December 13, 2022 14:30
Copy link

@ghost ghost left a comment

Choose a reason for hiding this comment

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

Top!

hydra-node/src/Hydra/Network/Ouroboros.hs Outdated Show resolved Hide resolved
@pgrange pgrange merged commit 226e1bf into master Dec 13, 2022
@pgrange pgrange deleted the ensemble/network_spec_perf branch December 13, 2022 16:50
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.

3 participants