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

Babbage backward compatibility #1608

Merged
merged 7 commits into from
Sep 10, 2024
Merged

Conversation

ch1bo
Copy link
Collaborator

@ch1bo ch1bo commented Sep 9, 2024

Ensures that transactions decoded from JSON are backwards compatibility with Babbage.

  • Moves tests to hydra-tx as it contains the instance definitions.
  • Adds tests for backward compatibility with explicitly Babbage.
  • Drops the check of type in the "Transaction envelope".

  • CHANGELOG updated
  • Documentation update not needed
  • Haddocks updated
  • No new TODOs introduced

@ch1bo ch1bo self-assigned this Sep 9, 2024
@ch1bo ch1bo added this to the 0.19.0 milestone Sep 9, 2024
@ch1bo ch1bo force-pushed the babbage-backward-compatibility branch from 2d07ab6 to bb22f4b Compare September 9, 2024 09:59
Copy link

github-actions bot commented Sep 9, 2024

Transaction 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-09-10 15:06:26.004614198 UTC
Max. memory units 14000000
Max. CPU units 10000000000
Max. tx size (kB) 16384

Script summary

Name Hash Size (Bytes)
νInitial 2fac819a1f4f14e29639d1414220d2a18b6abd6b8e444d88d0dda8ff 3799
νCommit 2043a9f1a685bcf491413a5f139ee42e335157c8c6bc8d9e4018669d 1743
νHead 2ee477c60839936be49a50030690865b5bed4db8cd2f05bf255ac680 10068
μHead a1610f6e64843161f4a88229c0286176f5325de3e2f773eec2b1d818* 4508
νDeposit c2117fd9ebdee3e96b81fd67ff7092d638926415c10f1f7e5a267ad0 2791
  • The minting policy hash is only usable for comparison. As the script is parameterized, the actual script is unique per head.

Init transaction costs

Parties Tx size % max Mem % max CPU Min fee ₳
1 5094 5.75 2.27 0.44
2 5298 7.18 2.84 0.46
3 5503 8.56 3.39 0.49
5 5902 11.31 4.47 0.53
10 6904 18.21 7.20 0.65
57 16355 83.18 32.91 1.78

Commit transaction costs

This uses ada-only outputs for better comparability.

UTxO Tx size % max Mem % max CPU Min fee ₳
1 569 10.52 4.15 0.29
2 759 13.86 5.65 0.34
3 943 17.33 7.20 0.38
5 1323 24.65 10.44 0.48
10 2249 45.22 19.36 0.75
20 4117 95.99 40.76 1.40

CollectCom transaction costs

Parties UTxO (bytes) Tx size % max Mem % max CPU Min fee ₳
1 57 560 22.14 8.66 0.42
2 114 671 32.14 12.75 0.53
3 169 782 43.98 17.64 0.67
4 225 893 62.55 25.16 0.88
5 283 1004 77.85 31.56 1.05
6 337 1116 92.93 38.00 1.22

Cost of Decrement Transaction

Parties Tx size % max Mem % max CPU Min fee ₳
1 646 17.95 7.89 0.38
2 786 18.59 8.80 0.40
3 908 19.86 10.03 0.42
5 1286 25.35 13.66 0.51
10 2064 33.33 20.43 0.66
49 7876 97.00 73.59 1.81

Close transaction costs

Parties Tx size % max Mem % max CPU Min fee ₳
1 652 20.07 9.01 0.41
2 742 21.15 10.09 0.43
3 971 23.41 12.15 0.47
5 1241 26.30 14.95 0.53
10 1976 34.04 22.46 0.67
49 8014 98.23 83.08 1.90

Contest transaction costs

Parties Tx size % max Mem % max CPU Min fee ₳
1 698 25.93 11.17 0.47
2 818 27.65 12.64 0.50
3 905 29.07 13.83 0.52
5 1275 33.36 17.52 0.60
10 2049 43.03 25.75 0.77
40 6359 98.71 73.48 1.76

Abort transaction costs

There is some variation due to the random mixture of initial and already committed outputs.

Parties Tx size % max Mem % max CPU Min fee ₳
1 4972 17.51 7.61 0.57
2 5167 29.46 12.99 0.71
3 5236 38.86 17.06 0.82
4 5369 57.85 25.67 1.04
5 5626 78.70 35.11 1.29
6 5625 94.82 42.23 1.47

FanOut transaction costs

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 4934 7.50 3.17 0.45
5 1 57 4968 8.63 3.88 0.47
5 5 284 5104 13.35 6.81 0.53
5 10 570 5275 18.81 10.28 0.61
5 20 1137 5610 30.33 17.48 0.77
5 30 1709 5955 42.04 24.77 0.93
5 40 2276 6292 53.17 31.82 1.09
5 50 2845 6631 64.51 38.94 1.24
5 81 4608 7681 99.47 60.99 1.73

End-to-end benchmark results

This page is intended to collect the latest end-to-end benchmark results produced by Hydra's continuous integration (CI) system from the latest master code.

Please note that these results are approximate as they are currently produced from limited cloud VMs and not controlled hardware. Rather than focusing on the absolute results, the emphasis should be on relative results, such as how the timings for a scenario evolve as the code changes.

Generated at 2024-09-10 15:07:32.555099417 UTC

Baseline Scenario

Number of nodes 1
Number of txs 3000
Avg. Confirmation Time (ms) 4.238575307
P99 10.52491246999999ms
P95 5.015322299999999ms
P50 3.9970619999999997ms
Number of Invalid txs 0

Three local nodes

Number of nodes 3
Number of txs 9000
Avg. Confirmation Time (ms) 23.445975669
P99 107.86131532000095ms
P95 32.29527824999999ms
P50 21.0160025ms
Number of Invalid txs 0

@ch1bo ch1bo force-pushed the babbage-backward-compatibility branch from db37458 to f9ecd62 Compare September 9, 2024 12:29
@ch1bo ch1bo force-pushed the babbage-backward-compatibility branch 4 times, most recently from 66e39b3 to a271ad5 Compare September 9, 2024 13:55
Copy link
Contributor

@noonio noonio left a comment

Choose a reason for hiding this comment

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

Looks reasonable! Just a few questions.

These are tests that were made to cover our orphan instances of
To/FromJSON and To/FromCBOR for cardano-api Tx and UTxO types.
This also re-uses now the envelope serialisation from cardano-api (again)
Notablye certificates and protocol parameter updates are done
differently now.
This makes our JSON representation also backward compatible the way the
CBOR format is backward compatible.
Using the upstream serialization from cardano-api includes a
description. Also left a note why we are using a deprecated function
here now (they'll fix it in cardano-api).

See IntersectMBO/cardano-api#630
@ch1bo ch1bo force-pushed the babbage-backward-compatibility branch from a271ad5 to 7231701 Compare September 10, 2024 11:57
@ch1bo ch1bo requested a review from noonio September 10, 2024 11:57
@ch1bo ch1bo disabled auto-merge September 10, 2024 12:07
@ch1bo
Copy link
Collaborator Author

ch1bo commented Sep 10, 2024

Whoever clicks merge, please DO NOT SQUASH. The commits contain information I would like to keep on the code they change.

Copy link

github-actions bot commented Sep 10, 2024

Test Results

490 tests  +2   485 ✅ +2   20m 53s ⏱️ - 1m 9s
155 suites +2     5 💤 ±0 
  6 files   ±0     0 ❌ ±0 

Results for commit cfd24ec. ± Comparison against base commit 382512c.

This pull request removes 9 and adds 11 tests. Note that renamed tests count towards both.
Hydra.Ledger.Cardano/Tx ‑ Roundtrip CBOR encoding
Hydra.Ledger.Cardano/Tx ‑ Roundtrip to and from Ledger
Hydra.Ledger.Cardano/Tx ‑ Same TxId as TxBody after JSON decoding
Hydra.Ledger.Cardano/Tx ‑ Same TxId before/after JSON encoding
Hydra.Ledger.Cardano/Tx/JSON encoding of (ReasonablySized (Tx ConwayEra)) ‑ allows to encode values with aeson and read them back
Hydra.Ledger.Cardano/Tx/JSON encoding of (ReasonablySized (Tx ConwayEra)) ‑ produces the same JSON as is found in golden/ReasonablySized (Tx ConwayEra).json
Hydra.Ledger.Cardano/UTxO ‑ Roundtrip to and from Api
Hydra.Ledger.Cardano/UTxO/JSON encoding of (UTxO' (TxOut CtxUTxO ConwayEra)) ‑ allows to encode values with aeson and read them back
Hydra.Ledger.Cardano/UTxO/JSON encoding of (UTxO' (TxOut CtxUTxO ConwayEra)) ‑ produces the same JSON as is found in golden/UTxO' (TxOut CtxUTxO ConwayEra).json
Hydra.Tx.IsTx/Tx ‑ CBOR decode Babbage era transactions
Hydra.Tx.IsTx/Tx ‑ JSON decode Babbage era transactions
Hydra.Tx.IsTx/Tx ‑ Roundtrip CBOR encoding
Hydra.Tx.IsTx/Tx ‑ Roundtrip to and from Ledger
Hydra.Tx.IsTx/Tx ‑ Same TxId as TxBody after JSON decoding
Hydra.Tx.IsTx/Tx ‑ Same TxId before/after JSON encoding
Hydra.Tx.IsTx/Tx/JSON encoding of (ReasonablySized (Tx ConwayEra)) ‑ allows to encode values with aeson and read them back
Hydra.Tx.IsTx/Tx/JSON encoding of (ReasonablySized (Tx ConwayEra)) ‑ produces the same JSON as is found in golden/ReasonablySized (Tx ConwayEra).json
Hydra.Tx.IsTx/UTxO ‑ Roundtrip to and from Api
Hydra.Tx.IsTx/UTxO/JSON encoding of (UTxO' (TxOut CtxUTxO ConwayEra)) ‑ allows to encode values with aeson and read them back
…

♻️ This comment has been updated with latest results.

@noonio noonio merged commit d4b3cbc into master Sep 10, 2024
38 checks passed
@noonio noonio deleted the babbage-backward-compatibility branch September 10, 2024 16:05
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