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

Authenticate network messages #965

Merged
28 commits merged into from
Jul 6, 2023
Merged

Authenticate network messages #965

28 commits merged into from
Jul 6, 2023

Conversation

pgrange
Copy link
Contributor

@pgrange pgrange commented Jul 3, 2023

Fixes #727


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

@github-actions
Copy link

github-actions bot commented Jul 3, 2023

Test Results

322 tests   - 7   316 ✔️  - 7   21m 34s ⏱️ +27s
109 suites  - 2       6 💤 ±0 
    5 files    - 1       0 ±0 

Results for commit 71cf9ef. ± Comparison against base commit a1fe608.

This pull request removes 14 and adds 7 tests. Note that renamed tests count towards both.
Hydra.SnapshotStrategy/New Snapshot Decision ‑ there's always a leader for every snapsnot number
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.Network.Authenticate ‑ authenticate the message to broadcast
Hydra.Network.Authenticate ‑ drop message coming from party with wrong signature
Hydra.Network.Authenticate ‑ drop message coming from unknown party
Hydra.Network.Authenticate ‑ logs dropped messages
Hydra.Network.Authenticate ‑ pass the authenticated messages around
Hydra.Network.Authenticate/Serialization ‑ can roundtrip CBOR encoding/decoding of Signed Hydra Message
Hydra.SnapshotStrategy/New Snapshot Decision ‑ there's always a leader for every snapshot number

♻️ This comment has been updated with latest results.

@github-actions
Copy link

github-actions bot commented Jul 3, 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-07-06 17:00:27.981230137 UTC
Max. memory units 14000000
Max. CPU units 10000000000
Max. tx size (kB) 16384

Script summary

Name Hash Size (Bytes)
νInitial 2212a4ee618434b9b2f366d7c330dbdfb5c7072e793a850fd0de6ddd 4294
νCommit 69e1ccf9ad73dc6d37a5bc8de5aec86f3c4c1710fe5fd334e0e16b18 2124
νHead 8ae095dca4d14a1b8edffb37faa6c84ec60340fbf389a62f027e0b76 9355
μHead 33642a45c7fbb955ce1704ef09229bb211bf9af9980530db28c6aafe* 4148
  • 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 4741 12.30 4.80 0.49
2 4946 15.24 5.93 0.53
3 5151 16.75 6.47 0.56
5 5562 21.87 8.42 0.63
10 6587 34.17 13.07 0.81
37 12123 98.61 37.39 1.75

Cost of Commit Transaction

This is using ada-only outputs for better comparability.

UTxO Tx size % max Mem % max CPU Min fee ₳
1 599 14.98 5.74 0.34
2 784 19.57 7.70 0.40
3 975 24.75 9.88 0.46
5 1351 36.15 14.59 0.61
10 2280 71.73 28.85 1.04
13 2844 98.03 39.15 1.35

Cost of CollectCom Transaction

Parties UTxO (bytes) Tx size % max Mem % max CPU Min fee ₳
1 56 814 27.59 10.72 0.49
2 114 1135 43.16 16.89 0.67
3 171 1456 61.50 24.22 0.89
4 226 1774 81.95 32.43 1.12

Cost of Close Transaction

Parties Tx size % max Mem % max CPU Min fee ₳
1 639 18.88 8.42 0.39
2 804 20.27 9.68 0.42
3 969 21.67 10.94 0.45
5 1299 24.46 13.45 0.50
10 2124 31.12 19.62 0.64
50 8725 87.17 69.99 1.74

Cost of Contest Transaction

Parties Tx size % max Mem % max CPU Min fee ₳
1 667 24.77 10.63 0.46
2 840 26.49 12.01 0.49
3 1006 27.77 13.21 0.51
5 1337 31.20 15.95 0.58
10 2169 39.77 22.80 0.73
44 7771 98.46 69.53 1.79

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 4855 22.40 9.38 0.61
2 5033 32.61 13.61 0.73
3 5355 49.09 20.77 0.93
4 5820 73.46 31.59 1.23
5 6138 95.91 41.41 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 4765 8.66 3.57 0.46
5 1 56 4799 10.06 4.39 0.47
5 5 285 4945 15.64 7.69 0.55
5 10 568 5119 22.61 11.82 0.64
5 20 1138 5478 36.56 20.07 0.83
5 30 1710 5847 50.52 28.33 1.02
5 40 2276 6203 64.49 36.60 1.21
5 50 2844 6564 78.46 44.87 1.40
5 65 3695 7097 99.42 57.28 1.68

@ffakenz ffakenz force-pushed the authenticate-network-messages branch from 130f774 to ed7d675 Compare July 4, 2023 07:32
@v0d1ch v0d1ch force-pushed the authenticate-network-messages branch from 857cb8b to 3849e20 Compare July 4, 2023 08:52
@ghost
Copy link

ghost commented Jul 4, 2023

Ran some quick benchmarks

For authenticated messages:

Confirmed txs: 900
Average confirmation time (ms): 172.994095922
P99: 254.08549761ms
P95: 239.86288929999995ms
P50: 165.64742ms
Invalid txs: 0

On master

Confirmed txs: 900
Average confirmation time (ms): 172.274292194
P99: 252.98727588999998ms
P95: 240.6767249ms
P50: 166.4720585ms
Invalid txs: 0

@v0d1ch v0d1ch force-pushed the authenticate-network-messages branch 2 times, most recently from 05b5088 to 2e25720 Compare July 5, 2023 15:59
@ghost ghost force-pushed the authenticate-network-messages branch from 2e25720 to 12bf6e2 Compare July 5, 2023 20:05
@pgrange pgrange force-pushed the authenticate-network-messages branch from ca28cbd to 751f092 Compare July 6, 2023 08:27
This ensure that one can not forge a message from another party
and signed it with it's own key. There is no party in a message
so the party is always the signer of the Authenticated message.
@pgrange pgrange force-pushed the authenticate-network-messages branch from 751f092 to 4c8dac0 Compare July 6, 2023 08:33
@v0d1ch v0d1ch force-pushed the authenticate-network-messages branch from 5000ee0 to e6d78d1 Compare July 6, 2023 12:39
@pgrange pgrange force-pushed the authenticate-network-messages branch from e6d78d1 to b3c76f0 Compare July 6, 2023 12:53
@ffakenz ffakenz force-pushed the authenticate-network-messages branch from b3c76f0 to 69356f1 Compare July 6, 2023 13:49
@pgrange pgrange force-pushed the authenticate-network-messages branch from 69356f1 to bed3f92 Compare July 6, 2023 13:56
@v0d1ch v0d1ch marked this pull request as ready for review July 6, 2023 14:30
@ghost ghost merged commit 14db869 into master Jul 6, 2023
@ghost ghost deleted the authenticate-network-messages branch July 6, 2023 19:42
This pull request was closed.
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.

Authenticate network messages
4 participants