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

Replace ToJSON/FromJSON Tx with cbor encoding #1240

Merged
merged 27 commits into from
Jan 24, 2024
Merged

Replace ToJSON/FromJSON Tx with cbor encoding #1240

merged 27 commits into from
Jan 24, 2024

Conversation

locallycompact
Copy link
Contributor

@locallycompact locallycompact commented Jan 8, 2024

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

@locallycompact locallycompact force-pushed the lc/cbor branch 3 times, most recently from 00219f4 to ad6089a Compare January 9, 2024 09:53
@ch1bo ch1bo marked this pull request as draft January 9, 2024 10:35
@locallycompact locallycompact force-pushed the lc/cbor branch 7 times, most recently from 87dbbe6 to f5b7a28 Compare January 10, 2024 07:54
@ch1bo ch1bo force-pushed the lc/cbor branch 3 times, most recently from 271214e to 353b1a5 Compare January 10, 2024 14:34
@locallycompact locallycompact force-pushed the lc/cbor branch 2 times, most recently from 0f98cab to 2c18728 Compare January 15, 2024 18:16
Copy link

github-actions bot commented Jan 15, 2024

Test Results

405 tests   398 ✅  15m 42s ⏱️
136 suites    7 💤
  5 files      0 ❌

Results for commit a682340.

♻️ This comment has been updated with latest results.

@locallycompact locallycompact force-pushed the lc/cbor branch 2 times, most recently from 4c36724 to 145aca7 Compare January 15, 2024 23:41
Copy link

github-actions bot commented Jan 15, 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-01-24 13:55:42.178509682 UTC
Max. memory units 14000000
Max. CPU units 10000000000
Max. tx size (kB) 16384

Script summary

Name Hash Size (Bytes)
νInitial 985245919fcc6c0c5cd116023cd2c947c43e80dcbb5075fe12433fbb 4072
νCommit 7cb20fa71eb4c563ca283566ebe0aa65859d96c3f8cba35c52c181fd 2043
νHead 7a36661f5c15e9f1783aeaab890812c59b7286cbbc6de762d3110772 8816
μHead 8b111ac12274e46314769295a1c5dcab1d260096fc469fd698065463* 3851
  • 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 4374 10.25 3.95 0.45
2 4575 12.76 4.92 0.49
3 4776 14.79 5.67 0.52
5 5183 19.22 7.35 0.59
10 6182 30.41 11.60 0.75
41 12418 99.02 37.59 1.77

Cost of Commit Transaction

This is using ada-only outputs for better comparability.

UTxO Tx size % max Mem % max CPU Min fee ₳
1 534 11.37 4.44 0.30
2 721 15.04 6.07 0.35
3 909 18.85 7.75 0.40
5 1279 26.90 11.27 0.51
10 2222 49.55 20.97 0.80
19 3905 99.43 41.75 1.43

Cost of CollectCom Transaction

Parties UTxO (bytes) Tx size % max Mem % max CPU Min fee ₳
1 57 480 21.12 8.27 0.40
2 113 594 33.21 13.10 0.54
3 169 700 45.16 18.01 0.68
4 226 810 64.38 25.66 0.89
5 282 920 79.55 31.97 1.06
6 339 1031 92.92 37.70 1.22

Cost of Close Transaction

Parties Tx size % max Mem % max CPU Min fee ₳
1 491 16.23 7.33 0.36
2 633 16.64 7.29 0.37
3 913 20.26 10.95 0.43
5 1279 23.72 14.18 0.50
10 2201 32.21 22.07 0.67
50 8878 97.84 83.35 1.93

Cost of Contest Transaction

Parties Tx size % max Mem % max CPU Min fee ₳
1 586 20.23 8.97 0.40
2 743 22.30 10.69 0.44
3 981 24.32 12.46 0.48
5 1350 28.24 15.84 0.55
10 2129 37.46 23.80 0.72
43 7889 99.82 77.75 1.86

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 4316 18.89 8.13 0.55
2 4471 31.78 13.85 0.70
3 4654 47.48 20.84 0.89
4 4837 66.47 29.25 1.11
5 4985 86.98 38.40 1.35

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 4205 8.26 3.46 0.43
5 1 57 4239 9.36 4.17 0.44
5 5 285 4375 14.19 7.18 0.51
5 10 569 4544 20.55 11.08 0.60
5 20 1137 4882 32.64 18.62 0.76
5 30 1709 5226 45.03 26.28 0.93
5 40 2278 5565 57.46 33.97 1.10
5 50 2845 5903 69.14 41.34 1.27
5 74 4207 6713 99.13 59.87 1.68

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-01-24 13:58:47.039124335 UTC

Baseline Scenario

Number of nodes 3
Number of txs 9000
Avg. Confirmation Time (ms) 20.689288124
P99 49.04382955000003ms
P95 29.412308149999994ms
P50 18.582133ms
Number of Invalid txs 0

Baseline Scenario

Number of nodes 1
Number of txs 3000
Avg. Confirmation Time (ms) 3.547279257
P99 4.6828317599999965ms
P95 4.1265509ms
P50 3.4611785ms
Number of Invalid txs 0

@locallycompact locallycompact requested a review from ch1bo January 16, 2024 09:45
@locallycompact locallycompact changed the title WIP; Replace ToJSON/FromJSON Tx with cbor encoding Replace ToJSON/FromJSON Tx with cbor encoding Jan 16, 2024
@locallycompact locallycompact marked this pull request as ready for review January 16, 2024 09:45
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.

Sorry for the late review.

While this roundtrips, I do think that this currently breaks our integration with cardano-cli (see tutorial) and is missing some updates to documentation + some testing.

@locallycompact locallycompact force-pushed the lc/cbor branch 2 times, most recently from ba43ac4 to 1b9840b Compare January 17, 2024 19:54
@ch1bo ch1bo force-pushed the master branch 2 times, most recently from 46a4f1a to aa19397 Compare January 18, 2024 15:56
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.

Several things we still could do, but this will fulfill the requirements of changing the hydra-node.

As we merge this, all clients must be updated.

@@ -9,6 +9,10 @@ As a minor extension, we also keep a semantic version for the `UNRELEASED`
changes.


## [0.16.0] - UNRELEASED

- **BREAKING** Transaction serialization on hydra-node api and persisted data changed.
Copy link
Member

Choose a reason for hiding this comment

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

Should: bump the hydra-node binary (in the cabal file) to this version.

@locallycompact locallycompact merged commit 560a7bf into master Jan 24, 2024
@locallycompact locallycompact deleted the lc/cbor branch January 24, 2024 14:58
@ch1bo ch1bo linked an issue Jan 26, 2024 that may be closed by this pull request
8 tasks
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.

Drop support for JSON encoded transactions
4 participants