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

Ouroboros: Switch to versioned protocol #1381

Merged
merged 1 commit into from
May 8, 2024

Conversation

locallycompact
Copy link
Contributor

@locallycompact locallycompact commented Apr 3, 2024

Hydra now uses a versioned protocol for handshaking. In the event of a node attempting to connect using a different version of the networking protocol, a HandshakeFailure event will be recorded in the logs.

@locallycompact locallycompact marked this pull request as draft April 3, 2024 08:57
@locallycompact locallycompact force-pushed the lc/ouroboros-versioned branch 2 times, most recently from e5d8826 to c23ff6c Compare April 3, 2024 08:59
Copy link

github-actions bot commented Apr 3, 2024

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 2024-05-08 12:13:40.614464676 UTC
Max. memory units 14000000
Max. CPU units 10000000000
Max. tx size (kB) 16384

Script summary

Name Hash Size (Bytes)
νInitial bccf2a430c016bc960fbf31b02694011cd399d20da8882aac9d33611 4110
νCommit 56b0f0b597150e619c76bed60683f3b1e42d7bc0685ed951b882bfc5 1975
νHead 86bff95ba20e9d1d1b34899a56d86bbacc9fed999260b27dcc92d128 9351
μHead 88f533cf67cd0fc93d7d9ccf0a8b1d69ffd1208a825efbebbc1d36ba* 4213
  • 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 4795 9.06 3.47 0.46
2 5000 10.61 4.05 0.49
3 5200 12.76 4.89 0.52
5 5599 16.43 6.29 0.57
10 6608 26.22 10.05 0.73
48 14242 99.96 38.36 1.86

Cost of Commit Transaction

This is using ada-only outputs for better comparability.

UTxO Tx size % max Mem % max CPU Min fee ₳
1 556 10.24 4.04 0.29
2 749 13.88 5.64 0.34
3 934 17.66 7.29 0.39
5 1312 25.66 10.74 0.49
10 2241 48.19 20.30 0.78
19 3932 97.83 40.79 1.41

Cost of CollectCom Transaction

Parties UTxO (bytes) Tx size % max Mem % max CPU Min fee ₳
1 56 543 16.93 6.68 0.36
2 114 654 27.38 10.90 0.48
3 171 764 39.59 15.88 0.62
4 225 874 53.25 21.49 0.77
5 284 984 67.75 27.56 0.94
6 338 1095 84.19 34.40 1.13

Cost of Close Transaction

Parties Tx size % max Mem % max CPU Min fee ₳
1 604 8.29 4.59 0.28
2 773 9.49 6.03 0.30
3 704 9.48 4.73 0.29
5 1078 10.58 8.45 0.34
10 2036 16.63 15.81 0.49
50 7902 47.67 61.43 1.33

Cost of Contest Transaction

Parties Tx size % max Mem % max CPU Min fee ₳
1 576 8.24 4.39 0.27
2 715 8.97 5.47 0.29
3 942 10.47 7.18 0.33
5 1210 11.97 9.36 0.37
10 2128 16.85 15.95 0.50
50 8155 51.72 63.74 1.39

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 4685 17.00 7.36 0.55
2 4785 27.71 12.08 0.67
3 5005 43.61 19.21 0.86
4 5092 57.96 25.47 1.03
5 5298 78.77 34.78 1.27
6 5257 92.12 40.36 1.42

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 4627 7.85 3.28 0.44
5 1 57 4661 9.42 4.17 0.46
5 5 285 4798 13.61 6.84 0.52
5 10 567 4965 19.58 10.49 0.60
5 20 1138 5305 30.90 17.53 0.76
5 30 1706 5646 42.43 24.67 0.92
5 40 2276 5986 53.75 31.72 1.08
5 50 2844 6324 65.29 38.86 1.24
5 79 4497 7309 99.21 59.77 1.70

End-To-End Benchmark Results

This page is intended to collect the latest end-to-end benchmarks results produced by Hydra's Continuous Integration system from the latest master code.

Please take those results with a grain of salt as they are currently produced from very limited cloud VMs and not controlled hardware. Instead of focusing on the absolute results, the emphasis should be on relative results, eg. how the timings for a scenario evolve as the code changes.

Generated at 2024-05-08 12:15:50.133673732 UTC

Baseline Scenario

Number of nodes 3
Number of txs 9000
Avg. Confirmation Time (ms) 21.938869901
P99 115.55955170000006ms
P95 31.2048563ms
P50 18.8443835ms
Number of Invalid txs 0

Baseline Scenario

Number of nodes 1
Number of txs 3000
Avg. Confirmation Time (ms) 3.590680726
P99 4.810858489999997ms
P95 4.146265549999999ms
P50 3.502166ms
Number of Invalid txs 0

@locallycompact locallycompact linked an issue Apr 3, 2024 that may be closed by this pull request
@locallycompact locallycompact force-pushed the lc/ouroboros-versioned branch 3 times, most recently from b5981c3 to d5fb8a4 Compare April 3, 2024 11:20
Copy link

github-actions bot commented Apr 3, 2024

Test Results

426 tests   416 ✅  14m 24s ⏱️
138 suites   10 💤
  2 files      0 ❌

Results for commit 8801617.

♻️ This comment has been updated with latest results.

@locallycompact locallycompact force-pushed the lc/ouroboros-versioned branch from 4d3ea53 to f5e080d Compare April 5, 2024 09:09
@locallycompact locallycompact changed the title WIP: Ouroboros: Switch to versioned protocol Ouroboros: Switch to versioned protocol Apr 5, 2024
@locallycompact locallycompact force-pushed the lc/ouroboros-versioned branch 6 times, most recently from 739d80e to 756fd78 Compare April 10, 2024 05:30
@locallycompact locallycompact force-pushed the lc/ouroboros-versioned branch 4 times, most recently from d920ee5 to 462da64 Compare April 29, 2024 14:14
@locallycompact locallycompact marked this pull request as ready for review April 29, 2024 14:14
@locallycompact locallycompact force-pushed the lc/ouroboros-versioned branch 5 times, most recently from 96653db to 7018e2a Compare April 29, 2024 15:04
@locallycompact locallycompact requested a review from ch1bo April 29, 2024 15:05
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.

This seems to be still missing the actual API integration.

Please don't make the same mistake which we just refactored from.

This being said, we could demonstrate this state already.

CHANGELOG.md Outdated Show resolved Hide resolved
CHANGELOG.md Outdated Show resolved Hide resolved
hydra-node/json-schemas/api.yaml Show resolved Hide resolved
hydra-node/src/Hydra/Network/Ouroboros.hs Show resolved Hide resolved
hydra-node/src/Hydra/Node/Network.hs Outdated Show resolved Hide resolved
hydra-node/src/Hydra/Node/Network.hs Outdated Show resolved Hide resolved
hydra-node/src/Hydra/Node/Run.hs Outdated Show resolved Hide resolved
@ffakenz ffakenz force-pushed the lc/ouroboros-versioned branch 2 times, most recently from 62064f4 to 048dfba Compare April 30, 2024 08:51
@ffakenz ffakenz requested a review from ch1bo April 30, 2024 09:07
@ffakenz ffakenz force-pushed the lc/ouroboros-versioned branch from 158cca5 to 099366e Compare April 30, 2024 16:44
@locallycompact locallycompact force-pushed the lc/ouroboros-versioned branch 2 times, most recently from f5f8fce to e47cc5b Compare May 1, 2024 10:58
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.

I think this is correct now and could be merged. Some minor comments on how the API is shaped (I like the simple numbers as versions, but also dislike that it looks different between api and logs)

hydra-node/json-schemas/api.yaml Show resolved Hide resolved
hydra-node/json-schemas/api.yaml Show resolved Hide resolved
hydra-node/json-schemas/api.yaml Show resolved Hide resolved
hydra-node/src/Hydra/API/ServerOutput.hs Show resolved Hide resolved
@locallycompact locallycompact force-pushed the lc/ouroboros-versioned branch 3 times, most recently from b8b83e8 to 8aacb1b Compare May 2, 2024 14:08
@locallycompact locallycompact enabled auto-merge May 2, 2024 14:08
@ch1bo ch1bo force-pushed the lc/ouroboros-versioned branch from 8aacb1b to 8801617 Compare May 3, 2024 13:20
@ch1bo
Copy link
Collaborator

ch1bo commented May 8, 2024

@locallycompact FYI the single commit here now does not follow our coding standards (it has a very long first line)

@locallycompact locallycompact force-pushed the lc/ouroboros-versioned branch from 8801617 to e5bec4f Compare May 8, 2024 12:01
Hydra now uses a versioned protocol for handshaking. In the event of a node attempting to connect using a different version of the networking protocol, a `HandshakeFailure` event will be recorded in the logs and sent as a server output on the API.
@locallycompact locallycompact force-pushed the lc/ouroboros-versioned branch from e5bec4f to 79daa18 Compare May 8, 2024 12:10
@locallycompact
Copy link
Contributor Author

I would like to fix the inconsistencies between the schemas after attempting to break up the schema files a bit, so they are more manageable.

@locallycompact locallycompact merged commit 7d66414 into master May 8, 2024
19 checks passed
@locallycompact locallycompact deleted the lc/ouroboros-versioned branch May 8, 2024 12:18
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.

Use versioned handshake when connecting hydra-nodes
2 participants