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

Pinned aiken version and test to check plutus.json #1777

Merged
merged 5 commits into from
Jan 8, 2025
Merged

Conversation

ch1bo
Copy link
Collaborator

@ch1bo ch1bo commented Jan 7, 2025

I noticed the aiken version used to generate the plutus.json is different than the one provided through our flake. Consequently, the re-built scripts would result in different hashes.

This PR pins to a specific aiken version in the flake and also adds a test that ensures the serialized scripts in plutus.json are deterministically created using this version.

Following this, I realized that the validators in the plutus.json were even the result of manually invoking aiken blueprint apply and interactively filling the commit script hash parameter on the initial validator.

Instead of this error prone manual step, the Hydra.Plutus module now applies parameters when providing the initialValidatorScript.


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

Copy link

github-actions bot commented Jan 7, 2025

Transaction cost differences

Script summary

Name Size (Bytes)
νInitial $${\color{green}-12.00}$$
νCommit $${\color{green}-2.00}$$
νHead -
μHead -
νDeposit $${\color{green}-13.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 - $${\color{green}-0.01}$$ $${\color{green}-0.01}$$ -
2 - $${\color{green}-0.02}$$ $${\color{green}-0.01}$$ -
3 - $${\color{green}-0.03}$$ $${\color{green}-0.01}$$ -
5 - $${\color{green}-0.05}$$ $${\color{green}-0.01}$$ -
10 - $${\color{green}-0.11}$$ $${\color{green}-0.03}$$ -
54 +1 $${\color{green}-0.59}$$ $${\color{green}-0.20}$$ $${\color{green}-0.01}$$

CollectCom transaction costs

Parties UTxO (bytes) Tx size % max Mem % max CPU Min fee ₳
1 - - $${\color{green}-0.80}$$ $${\color{green}-0.19}$$ $${\color{green}-0.01}$$
2 - - +2.06 +0.5 +0.02
3 - - $${\color{green}-2.49}$$ $${\color{green}-0.60}$$ $${\color{green}-0.03}$$
4 - - $${\color{green}-3.55}$$ $${\color{green}-0.86}$$ $${\color{green}-0.03}$$
5 - - +8.36 +2.0 +0.08
6 - - +1.59 +0.38 +0.02
7 - - $${\color{green}-10.75}$$ $${\color{green}-2.57}$$ $${\color{green}-0.10}$$
8 - - $${\color{green}-1.90}$$ $${\color{green}-0.45}$$ $${\color{green}-0.02}$$
10 - - +0.63 +0.16 -

Cost of Increment Transaction

Parties Tx size % max Mem % max CPU Min fee ₳
1 $${\color{green}-13.00}$$ $${\color{green}-0.08}$$ $${\color{green}-0.02}$$ -
2 $${\color{green}-13.00}$$ $${\color{green}-0.39}$$ $${\color{green}-0.09}$$ $${\color{green}-0.01}$$
3 $${\color{green}-13.00}$$ +0.38 +0.09 -
5 $${\color{green}-13.00}$$ $${\color{green}-0.17}$$ $${\color{green}-0.04}$$ -
10 $${\color{green}-13.00}$$ +0.26 +0.06 -
43 $${\color{green}-13.00}$$ +0.3 +0.07 -

Cost of Decrement Transaction

Parties Tx size % max Mem % max CPU Min fee ₳
1 - - - -
2 - - - -
3 - - - -
5 - +0.27 +0.06 -
10 - - - -
45 - +0.05 +0.01 -

Close transaction costs

Parties Tx size % max Mem % max CPU Min fee ₳
1 - - - -
2 - - - -
3 - - - -
5 - - - -
10 - $${\color{green}-0.09}$$ $${\color{green}-0.02}$$ -
41 - $${\color{green}-0.05}$$ $${\color{green}-0.01}$$ -

Contest transaction costs

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

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) - - - - -

@ch1bo ch1bo requested review from v0d1ch, locallycompact, ffakenz and noonio and removed request for v0d1ch and locallycompact January 8, 2025 11:29
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-08 13:54:25.028915326 UTC
Max. memory units 14000000
Max. CPU units 10000000000
Max. tx size (kB) 16384

Script summary

Name Hash Size (Bytes)
νInitial c8a101a5c8ac4816b0dceb59ce31fc2258e387de828f02961d2f2045 2655
νCommit 61458bc2f297fff3cc5df6ac7ab57cefd87763b0b7bd722146a1035c 688
νHead 5350e9d521552ebfd9e846fd70c3b801f716fc14296134ec0fb71e97 14495
μHead 6b49dc4e571207d615dba01996548cb610b0caa85c30423d169d0091* 5615
νDeposit ae01dade3a9c346d5c93ae3ce339412b90a0b8f83f94ec6baa24e30c 1105
  • 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 6165 10.33 3.30 0.53
2 6365 12.38 3.94 0.56
3 6566 14.79 4.73 0.59
5 6969 18.57 5.89 0.65
10 7975 28.50 8.99 0.80
44 14810 98.04 30.85 1.82

Commit transaction costs

This uses ada-only outputs for better comparability.

UTxO Tx size % max Mem % max CPU Min fee ₳
1 561 2.44 1.16 0.20
2 740 3.38 1.73 0.22
3 923 4.36 2.33 0.24
5 1277 6.41 3.60 0.28
10 2179 12.13 7.25 0.40
54 10047 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 114 636 34.00 9.80 0.52
3 169 747 39.74 11.56 0.59
4 225 858 49.16 14.20 0.69
5 284 969 59.25 17.04 0.79
6 338 1081 73.48 20.87 0.94
7 394 1192 84.30 23.82 1.06
8 450 1303 92.09 26.18 1.14

Cost of Increment Transaction

Parties Tx size % max Mem % max CPU Min fee ₳
1 1818 23.74 7.94 0.48
2 1918 25.26 9.07 0.50
3 2091 27.04 10.29 0.53
5 2451 31.60 13.24 0.61
10 3134 39.64 19.20 0.75
45 8176 99.90 62.31 1.77

Cost of Decrement Transaction

Parties Tx size % max Mem % max CPU Min fee ₳
1 607 22.68 7.32 0.41
2 758 23.89 8.34 0.44
3 959 27.81 10.08 0.49
5 1147 27.87 11.42 0.51
10 1955 38.09 17.62 0.67
42 6902 98.41 55.93 1.65

Close transaction costs

Parties Tx size % max Mem % max CPU Min fee ₳
1 665 28.57 9.15 0.48
2 813 28.68 9.91 0.49
3 991 32.74 11.88 0.54
5 1329 34.74 14.03 0.59
10 2073 47.09 21.42 0.78
37 6066 93.79 55.07 1.57

Contest transaction costs

Parties Tx size % max Mem % max CPU Min fee ₳
1 691 33.35 10.43 0.53
2 768 34.73 11.40 0.55
3 1014 37.86 13.25 0.60
5 1368 43.07 16.38 0.68
10 2003 52.62 22.64 0.83
31 5111 96.85 50.87 1.52

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 6069 26.17 8.85 0.69
2 6117 33.79 11.36 0.77
3 6296 43.23 14.60 0.88
4 6414 49.11 16.62 0.95
5 6635 61.95 21.08 1.09
6 6865 73.16 24.94 1.22
7 6980 81.44 27.73 1.32
8 6971 83.77 28.37 1.34
9 7144 96.35 32.67 1.48

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 0 0 6162 16.93 5.75 0.60
10 1 56 6196 20.35 7.07 0.64
10 10 569 6502 36.52 13.62 0.83
10 20 1137 6839 56.62 21.69 1.07
10 30 1708 7182 76.42 29.65 1.30
10 40 2276 7520 96.75 37.80 1.54
10 42 2391 7589 99.73 39.03 1.57

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-08 13:57:46.644243871 UTC

Baseline Scenario

Number of nodes 1
Number of txs 300
Avg. Confirmation Time (ms) 4.589003753
P99 8.882057319999992ms
P95 5.917668600000001ms
P50 4.409644999999999ms
Number of Invalid txs 0

Three local nodes

Number of nodes 3
Number of txs 900
Avg. Confirmation Time (ms) 23.356864754
P99 37.14719702999998ms
P95 30.249352699999996ms
P50 21.5309465ms
Number of Invalid txs 0

Copy link

github-actions bot commented Jan 8, 2025

Test Results

  5 files  ±0  165 suites  ±0   30m 18s ⏱️ -23s
561 tests  - 2  555 ✅  - 2  6 💤 ±0  0 ❌ ±0 
563 runs   - 2  557 ✅  - 2  6 💤 ±0  0 ❌ ±0 

Results for commit 14f92f4. ± Comparison against base commit 2039d7c.

This pull request removes 3 and adds 1 tests. Note that renamed tests count towards both.
Hydra.Plutus.Golden ‑ Commit validator script
Hydra.Plutus.Golden ‑ Deposit validator script
Hydra.Plutus.Golden ‑ Initial validator script
Hydra.Plutus.Golden ‑ Plutus blueprint is up-to-date

♻️ This comment has been updated with latest results.

hydra-plutus/src/Hydra/Plutus.hs Show resolved Hide resolved
hydra-plutus/src/Hydra/Plutus.hs Show resolved Hide resolved
ch1bo added 5 commits January 8, 2025 14:46
This ensures the plutus blueprint in plutus.json is up-to-date.
Those are redundant and the plutus.json is the ground-truth for aiken scripts.
This allows to keep aiken script parameterized in the plutus.json
@ch1bo ch1bo enabled auto-merge January 8, 2025 15:46
@ch1bo ch1bo added this pull request to the merge queue Jan 8, 2025
Merged via the queue into master with commit dd7634b Jan 8, 2025
27 checks passed
@ch1bo ch1bo deleted the aiken-contracts branch January 8, 2025 16:03
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