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

WIP: Increment validator and corresponding mutations #1715

Draft
wants to merge 33 commits into
base: master
Choose a base branch
from

Conversation

v0d1ch
Copy link
Contributor

@v0d1ch v0d1ch commented Oct 18, 2024


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

@v0d1ch v0d1ch self-assigned this Oct 18, 2024
@v0d1ch v0d1ch force-pushed the increment-mutations branch 14 times, most recently from fbdb64f to 81df483 Compare October 23, 2024 09:29
Copy link

github-actions bot commented Oct 24, 2024

Transaction cost differences

Script summary

Name Size (Bytes)
νInitial -
νCommit -
νHead +1070
μHead $${\color{green}-5556.00}$$
νDeposit $${\color{green}-3747.00}$$

Init transaction costs

Parties Tx size % max Mem % max CPU Min fee ₳
1 $${\color{green}-5556.00}$$ 1.29 0.34 $${\color{green}-0.23}$$
2 $${\color{green}-5556.00}$$ 1.59 0.41 $${\color{green}-0.23}$$
3 $${\color{green}-5556.00}$$ 1.88 0.48 $${\color{green}-0.23}$$
5 $${\color{green}-5556.00}$$ 2.46 0.63 $${\color{green}-0.22}$$
10 $${\color{green}-5556.00}$$ 3.91 1 $${\color{green}-0.20}$$

Commit transaction costs

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

CollectCom transaction costs

Parties UTxO (bytes) Tx size % max Mem % max CPU Min fee ₳
1 - - $${\color{green}-0.63}$$ $${\color{green}-0.15}$$ $${\color{green}-0.01}$$
2 - - +0.15 +0.03 -
3 - - +2.75 +0.65 +0.02
4 - - +2.05 +0.49 +0.02
5 - - $${\color{green}-4.40}$$ $${\color{green}-1.06}$$ $${\color{green}-0.04}$$
6 - - +7.5 +1.79 +0.07
7 - - $${\color{green}-9.04}$$ $${\color{green}-2.18}$$ $${\color{green}-0.09}$$
8 - - +4.69 +1.1 +0.05

Cost of Increment Transaction

Parties Tx size % max Mem % max CPU Min fee ₳
1 1176 +1.39 0.68 0.07
2 1144 $${\color{green}-0.10}$$ 0.35 0.05
3 1117 $${\color{green}-0.11}$$ 0.4 0.05
5 1302 +3.49 1.71 0.1
10 1117 +1.18 1.44 0.07

Cost of Decrement Transaction

Parties Tx size % max Mem % max CPU Min fee ₳
1 +9.0 $${\color{green}-1.64}$$ $${\color{green}-0.68}$$ $${\color{green}-0.02}$$
2 +27.0 $${\color{green}-0.62}$$ $${\color{green}-0.47}$$ $${\color{green}-0.01}$$
3 $${\color{green}-8.00}$$ $${\color{green}-1.25}$$ $${\color{green}-0.82}$$ $${\color{green}-0.02}$$
5 +57.0 $${\color{green}-1.70}$$ $${\color{green}-0.79}$$ $${\color{green}-0.02}$$
10 +77.0 $${\color{green}-0.85}$$ $${\color{green}-1.36}$$ $${\color{green}-0.02}$$

Close transaction costs

Parties Tx size % max Mem % max CPU Min fee ₳
1 $${\color{green}-43.00}$$ $${\color{green}-5.93}$$ $${\color{green}-1.59}$$ $${\color{green}-0.06}$$
2 $${\color{green}-17.00}$$ $${\color{green}-6.17}$$ $${\color{green}-1.64}$$ $${\color{green}-0.06}$$
3 +103.0 $${\color{green}-5.34}$$ $${\color{green}-1.17}$$ $${\color{green}-0.04}$$
5 $${\color{green}-167.00}$$ $${\color{green}-8.30}$$ $${\color{green}-2.50}$$ $${\color{green}-0.09}$$
10 $${\color{green}-67.00}$$ $${\color{green}-8.78}$$ $${\color{green}-2.36}$$ $${\color{green}-0.09}$$

Contest transaction costs

Parties Tx size % max Mem % max CPU Min fee ₳
1 $${\color{green}-10883.00}$$ +4.74 +0.9 $${\color{green}-0.43}$$
2 $${\color{green}-10897.00}$$ $${\color{green}-1.75}$$ $${\color{green}-0.72}$$ $${\color{green}-0.49}$$
3 $${\color{green}-10847.00}$$ $${\color{green}-2.84}$$ $${\color{green}-0.45}$$ $${\color{green}-0.50}$$
5 $${\color{green}-10774.00}$$ $${\color{green}-18.82}$$ $${\color{green}-4.57}$$ $${\color{green}-0.66}$$
10 $${\color{green}-10573.00}$$ $${\color{green}-47.09}$$ $${\color{green}-10.86}$$ $${\color{green}-0.92}$$

Abort transaction costs

Parties % max CPU % max Mem Min fee ₳ Tx size UTxO UTxO (bytes)

@v0d1ch v0d1ch force-pushed the increment-mutations branch 4 times, most recently from 041c291 to 966bb79 Compare October 25, 2024 10:25
Copy link

github-actions bot commented Oct 28, 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-11-13 15:55:30.24362075 UTC
Max. memory units 14000000
Max. CPU units 10000000000
Max. tx size (kB) 16384

Script summary

Name Hash Size (Bytes)
νInitial 00a6ddbc130ab92f5b7cb8d1ccd8d79eca5bfe25f6843c07b62841f0 2667
νCommit 3e5a776bcee213e3dfd15806952a10ac5590e3e97d09d62eb99266b2 690
νHead 92d05f13827a8a1abe39812ad7c64302b698b7159a2a11e78cb89527 13703
μHead 981dd39fa4b766251eed7f528520ad774e62ff402c76c52342a5a50a* 5555
νDeposit de09cec5f84eedaf64186cb52ba4ee6e74e6fc368af25b90d457f352 1118
  • 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 6144 10.15 3.23 0.53
2 6340 12.20 3.88 0.56
3 6541 14.25 4.52 0.59
5 6941 18.17 5.74 0.64
10 7947 28.89 9.15 0.80
44 14786 98.19 30.91 1.82

Commit transaction costs

This uses ada-only outputs for better comparability.

UTxO Tx size % max Mem % max CPU Min fee ₳
1 559 2.45 1.17 0.20
2 736 3.40 1.74 0.22
3 922 4.39 2.34 0.24
5 1283 6.46 3.61 0.29
10 2179 12.24 7.28 0.40
54 10058 99.20 68.72 1.89

CollectCom transaction costs

Parties UTxO (bytes) Tx size % max Mem % max CPU Min fee ₳
1 57 560 24.10 7.05 0.42
2 113 671 31.72 9.25 0.50
3 169 782 40.68 11.79 0.60
4 226 893 48.74 14.10 0.69
5 285 1004 60.25 17.28 0.81
6 339 1116 63.43 18.51 0.85
7 393 1227 77.51 22.24 0.99
8 449 1338 86.58 24.87 1.09
9 509 1453 93.36 26.96 1.16

Cost of Increment Transaction

Parties Tx size % max Mem % max CPU Min fee ₳
1 1849 23.63 7.91 0.48
2 2026 26.45 9.50 0.52
3 2121 26.48 10.16 0.53
5 2432 30.70 12.87 0.60
10 3267 41.13 19.72 0.77
41 7928 97.48 59.08 1.71

Cost of Decrement Transaction

Parties Tx size % max Mem % max CPU Min fee ₳
1 652 22.63 7.31 0.41
2 775 23.30 8.15 0.43
3 858 23.87 8.97 0.45
5 1327 32.07 12.60 0.56
10 1903 36.31 17.12 0.65
43 6915 96.04 55.91 1.63

Close transaction costs

Parties Tx size % max Mem % max CPU Min fee ₳
1 680 24.43 8.04 0.44
2 887 26.60 9.50 0.47
3 957 28.16 10.64 0.50
5 1279 31.68 13.20 0.56
10 2075 41.08 19.82 0.72
43 6786 95.68 59.82 1.65

Contest transaction costs

Parties Tx size % max Mem % max CPU Min fee ₳
1 672 30.37 9.62 0.49
2 761 31.69 10.59 0.52
3 943 34.12 12.10 0.55
5 1210 37.73 14.56 0.61
10 2010 48.64 21.57 0.79
35 5678 99.80 54.80 1.60

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 6043 26.21 8.87 0.69
2 6108 31.35 10.56 0.75
3 6173 39.06 13.09 0.83
4 6372 51.95 17.52 0.98
5 6509 58.14 19.66 1.05
6 6607 67.04 22.70 1.15
7 6651 69.22 23.32 1.17
8 6916 85.80 29.06 1.36

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 6136 18.22 6.24 0.61
10 1 57 6170 19.56 6.80 0.63
10 5 284 6306 26.65 9.69 0.71
10 10 570 6476 36.63 13.72 0.83
10 20 1139 6816 55.78 21.48 1.06
10 30 1710 7158 75.31 29.37 1.29
10 40 2279 7497 94.47 37.13 1.51
10 43 2446 7595 99.85 39.33 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 2024-11-13 15:58:02.636849599 UTC

Baseline Scenario

Number of nodes 1
Number of txs 300
Avg. Confirmation Time (ms) 4.685667343
P99 8.587239269999996ms
P95 6.478968800000004ms
P50 4.505418499999999ms
Number of Invalid txs 0

Three local nodes

Number of nodes 3
Number of txs 900
Avg. Confirmation Time (ms) 23.622641426
P99 54.55767627999954ms
P95 32.20659844999999ms
P50 21.574275ms
Number of Invalid txs 0

@v0d1ch v0d1ch force-pushed the increment-mutations branch 4 times, most recently from b566806 to f4c9aae Compare October 30, 2024 14:38
v0d1ch and others added 19 commits November 12, 2024 09:38
Currently failing because of missing script input so we need to
make sure to provide all needed UTxO when generating txs.
It still doesn't evaluate in terms of tx size but we will get there.
Seems like this redeemer is needed to cover all posible scenarios
and it is not captured in the spec so we will need to add this in.
Remove the haskell validator and connect the new aiken one. What is
outstanding is the check on Recover redeemer.
This step makes the rewrite final
Add Healthy module for contest mutations and ContestUnusedDec module for
corresponding mutations.
@v0d1ch v0d1ch force-pushed the increment-mutations branch 5 times, most recently from b72e5cb to 0c768fb Compare November 13, 2024 15:47
Copy link

Test Results

  5 files  ±0  165 suites  +3   29m 32s ⏱️ - 2m 38s
558 tests +4  552 ✅ +4  6 💤 ±0  0 ❌ ±0 
560 runs  +4  554 ✅ +4  6 💤 ±0  0 ❌ ±0 

Results for commit 06ba6d5. ± Comparison against base commit 3be7b22.

This pull request removes 5 and adds 9 tests. Note that renamed tests count towards both.
Hydra.Chain.Direct.State/decrement ‑ observes distributed outputs
Hydra.Tx.Contract.Contract/CloseUnused ‑ does not survive random adversarial mutations
Hydra.Tx.Contract.Contract/CloseUnused ‑ is healthy
Hydra.Tx.Contract.Contract/CloseUsed ‑ does not survive random adversarial mutations
Hydra.Tx.Contract.Contract/CloseUsed ‑ is healthy
Hydra.Chain.Direct.State ‑ observes distributed outputs
Hydra.Chain.Direct.State/increment ‑ transaction size is below 16kB
Hydra.Chain.Direct.State/increment ‑ validates within maxTxExecutionUnits
Hydra.Tx.Contract.Contract/CloseUnusedDec ‑ does not survive random adversarial mutations
Hydra.Tx.Contract.Contract/CloseUnusedDec ‑ is healthy
Hydra.Tx.Contract.Contract/CloseUsedDec ‑ does not survive random adversarial mutations
Hydra.Tx.Contract.Contract/CloseUsedDec ‑ is healthy
Hydra.Tx.Contract.Contract/ContestDec ‑ does not survive random adversarial mutations
Hydra.Tx.Contract.Contract/ContestDec ‑ is healthy

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