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

Refactor: Use PlutusScript instead of SerialisedScript where possible #1779

Merged
merged 3 commits into from
Jan 9, 2025

Conversation

ch1bo
Copy link
Collaborator

@ch1bo ch1bo commented Jan 8, 2025

The PlutusScript type is more specific as it carries the plutus version (fixed to V3 in hydra-cardano-api).

This also drops the unused Initial plutus-tx validator.


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

The PlutusScript type is more specific as it carries the plutus
version (fixed to V3 in hydra-cardano-api).
@ch1bo ch1bo requested a review from a team January 8, 2025 16:38
Copy link

github-actions bot commented Jan 8, 2025

Transaction cost differences

Script summary

Name Size (Bytes)
νInitial $${\color{green}-3.00}$$
νCommit $${\color{green}-3.00}$$
νHead $${\color{green}-3.00}$$
μHead $${\color{green}-3.00}$$
νDeposit $${\color{green}-3.00}$$

Init transaction costs

Parties Tx size % max Mem % max CPU Min fee ₳
1 - - - -
2 - - - -
3 - - - -
5 - - - -
10 - - - -
44 - - - -

Commit transaction costs

UTxO Tx size % max Mem % max CPU Min fee ₳
1 - - - -
2 - - - -
3 - - - -
5 - - - -
10 - - - -
54 - - - -

CollectCom transaction costs

Parties UTxO (bytes) Tx size % max Mem % max CPU Min fee ₳
1 - - - - -
2 - - - - -
3 - - - - -
4 - - - - -
5 - - - - -
6 - - - - -
7 - - - - -
8 - - - - -
9 - - - - -
10 - - - - -

Cost of Increment Transaction

Parties Tx size % max Mem % max CPU Min fee ₳
1 - +0.39 +0.09 -
2 - - - -
3 - +0.38 +0.09 -
5 - +0.39 +0.09 -
10 - +0.38 +0.1 -
43 - - - -

Cost of Decrement Transaction

Parties Tx size % max Mem % max CPU Min fee ₳
1 - - - -
2 - - - -
3 - - - -
5 - - - -
10 - - - -
45 - - - -

Close transaction costs

Parties Tx size % max Mem % max CPU Min fee ₳
1 - - - -
2 - - - -
3 - - - -
5 - - - -
10 - - - -
41 - - - -

Contest transaction costs

Parties Tx size % max Mem % max CPU Min fee ₳
1 - - - -
2 - - - -
3 - - - -
5 - - - -
10 - - - -
33 - - - -

FanOut transaction costs

UTxO, Parties UTxO (bytes) Tx size % max Mem % max CPU Min fee ₳
(0, 10) - - - - -
(1, 10) - - - - -
(5, 10) - - - - -
(10, 10) - - - - -
(20, 10) - - - - -
(40, 10) - - - - -
(41, 10) - - - - -

Copy link

github-actions bot commented Jan 8, 2025

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 2025-01-09 07:54:46.66025101 UTC
Max. memory units 14000000
Max. CPU units 10000000000
Max. tx size (kB) 16384

Script summary

Name Hash Size (Bytes)
νInitial c8a101a5c8ac4816b0dceb59ce31fc2258e387de828f02961d2f2045 2652
νCommit 61458bc2f297fff3cc5df6ac7ab57cefd87763b0b7bd722146a1035c 685
νHead 5350e9d521552ebfd9e846fd70c3b801f716fc14296134ec0fb71e97 14492
μHead 6b49dc4e571207d615dba01996548cb610b0caa85c30423d169d0091* 5612
νDeposit ae01dade3a9c346d5c93ae3ce339412b90a0b8f83f94ec6baa24e30c 1102
  • 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 6164 10.33 3.30 0.53
2 6367 12.38 3.94 0.56
3 6566 14.09 4.46 0.59
5 6973 18.36 5.81 0.65
10 7975 28.59 9.03 0.80
44 14811 98.21 30.92 1.82

Commit transaction costs

This uses ada-only outputs for better comparability.

UTxO Tx size % max Mem % max CPU Min fee ₳
1 558 2.44 1.16 0.20
2 739 3.38 1.73 0.22
3 920 4.36 2.33 0.24
5 1279 6.41 3.60 0.28
10 2177 12.13 7.25 0.40
54 10059 98.61 68.52 1.88

CollectCom transaction costs

Parties UTxO (bytes) Tx size % max Mem % max CPU Min fee ₳
1 57 525 24.20 7.07 0.42
2 113 636 31.90 9.29 0.50
3 171 747 39.64 11.53 0.59
4 226 858 52.26 14.99 0.72
5 284 969 58.28 16.76 0.78
6 339 1081 73.78 20.98 0.95
7 394 1192 86.75 24.45 1.08
8 451 1303 82.79 23.96 1.05

Cost of Increment Transaction

Parties Tx size % max Mem % max CPU Min fee ₳
1 1817 24.13 8.03 0.48
2 1943 25.60 9.16 0.51
3 2119 27.91 10.64 0.55
5 2440 31.00 13.02 0.60
10 3135 40.19 19.33 0.75
42 7831 96.57 59.25 1.70

Cost of Decrement Transaction

Parties Tx size % max Mem % max CPU Min fee ₳
1 593 22.44 7.26 0.41
2 693 22.39 7.88 0.42
3 828 23.88 8.97 0.44
5 1263 29.87 11.98 0.53
10 2010 39.04 17.89 0.68
43 6977 99.48 56.85 1.67

Close transaction costs

Parties Tx size % max Mem % max CPU Min fee ₳
1 671 28.60 9.16 0.48
2 852 30.84 10.63 0.51
3 943 32.09 11.58 0.53
5 1242 33.56 13.46 0.57
10 1921 42.23 19.62 0.72
38 6433 96.53 56.98 1.62

Contest transaction costs

Parties Tx size % max Mem % max CPU Min fee ₳
1 671 33.35 10.42 0.52
2 824 35.38 11.71 0.56
3 999 37.94 13.26 0.60
5 1331 42.22 16.03 0.67
10 2236 54.68 23.66 0.86
31 5220 97.92 51.35 1.54

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 5966 22.41 7.45 0.65
2 6190 34.69 11.73 0.79
3 6323 43.84 14.89 0.89
4 6456 53.07 17.99 0.99
5 6561 58.20 19.65 1.05
6 6685 70.87 23.99 1.19
7 6875 80.51 27.26 1.30
8 7225 93.74 31.94 1.46

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 ₳
10 1 57 6196 20.35 7.07 0.64
10 5 285 6332 28.18 10.22 0.73
10 10 569 6501 37.61 14.03 0.84
10 20 1138 6840 57.56 22.04 1.08
10 30 1707 7181 76.42 29.65 1.30
10 40 2279 7523 95.29 37.26 1.52
10 41 2336 7558 99.03 38.70 1.56

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 2025-01-09 07:57:13.646431873 UTC

Baseline Scenario

Number of nodes 1
Number of txs 300
Avg. Confirmation Time (ms) 3.891676393
P99 9.990541989999981ms
P95 4.4889379499999995ms
P50 3.7295175ms
Number of Invalid txs 0

Three local nodes

Number of nodes 3
Number of txs 900
Avg. Confirmation Time (ms) 23.938743636
P99 120.52692504000001ms
P95 32.107490499999976ms
P50 19.596757ms
Number of Invalid txs 0

Copy link

github-actions bot commented Jan 8, 2025

Test Results

  5 files  ±0  165 suites  ±0   32m 35s ⏱️ +59s
561 tests ±0  555 ✅ ±0  6 💤 ±0  0 ❌ ±0 
563 runs  ±0  557 ✅ ±0  6 💤 ±0  0 ❌ ±0 

Results for commit f7e2bbe. ± Comparison against base commit dd7634b.

♻️ This comment has been updated with latest results.

@ch1bo ch1bo enabled auto-merge January 9, 2025 07:47
@ch1bo ch1bo added this pull request to the merge queue Jan 9, 2025
Merged via the queue into master with commit c56cbfd Jan 9, 2025
25 of 27 checks passed
@ch1bo ch1bo deleted the script-cleanup branch January 9, 2025 08:27
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.

2 participants