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

Implement Claim redeemer branch for the deposit validator + relevant mutations #1710

Merged
merged 7 commits into from
Oct 15, 2024

Conversation

v0d1ch
Copy link
Contributor

@v0d1ch v0d1ch commented Oct 15, 2024

Subtask of #199

  • Implement the Claim redeemer branch of the deposit validator.

  • Add head currency symbol to the Claim redeemer in order to check it against the datum value.

  • Add upper validity bound for increment in order to be able to check if the deposit deadline has not been reached.

  • Double the amount of contestation period value when setting the deposit deadline in order to give enough room for increment
    to be valid (before the deadline).

  • Add appropriate deposit mutations.

  • Left a FIXME to not forget to fix the specification in terms of changes in the Claim redeemer


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

We need more time in order to do the increment since when
posting the increment we re-use the contestation period to
calculate the upper validity slot.
Add head currency symbol in the Claim redeemer and
appropriate mutations.
@v0d1ch v0d1ch self-assigned this Oct 15, 2024
Copy link

github-actions bot commented Oct 15, 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-10-15 12:22:35.717611998 UTC
Max. memory units 14000000
Max. CPU units 10000000000
Max. tx size (kB) 16384

Script summary

Name Hash Size (Bytes)
νInitial b512161ccb0652d7e9a0b540e4a3c808f73d6558a4bcabf374d85880 3969
νCommit ea444d37d226e71eef73ac78d149750da977feb588900135bf9e8221 692
νHead 2253ddd95837c7aacc8635a971caaea743434152dd8dd2849bdf4162 10797
μHead 4d648ca239040b0e87901835aa11423e7aa3bd947ce6befe7db1bae8* 4508
νDeposit 703883df80fe589a8f64a4127057f28c9100ea9ebbb3e726c05e89ca 3096
  • 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.88 2.33 0.44
2 5298 7.09 2.80 0.46
3 5499 8.46 3.34 0.48
5 5903 11.22 4.43 0.53
10 6906 18.16 7.18 0.65
57 16356 82.91 32.79 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.84 4.26 0.29
2 758 14.31 5.80 0.34
3 947 17.92 7.39 0.39
5 1323 25.56 10.73 0.49
10 2251 47.11 19.97 0.77
19 3943 94.71 39.81 1.38

CollectCom transaction costs

Parties UTxO (bytes) Tx size % max Mem % max CPU Min fee ₳
1 57 560 20.58 7.85 0.40
2 114 675 27.03 10.31 0.47
3 168 782 34.02 12.97 0.55
4 227 893 46.86 17.78 0.70
5 283 1009 56.63 21.48 0.81
6 339 1120 66.51 25.21 0.92
7 394 1231 76.33 28.96 1.03
8 449 1338 71.02 27.08 0.98
9 505 1449 80.47 30.72 1.09
10 560 1560 96.62 36.70 1.26

Cost of Decrement Transaction

Parties Tx size % max Mem % max CPU Min fee ₳
1 640 18.68 8.18 0.39
2 834 20.70 9.73 0.42
3 946 21.47 10.74 0.44
5 1235 25.28 13.83 0.51
10 2170 35.09 21.40 0.68
48 7677 96.89 74.92 1.81

Close transaction costs

Parties Tx size % max Mem % max CPU Min fee ₳
1 652 20.79 9.29 0.41
2 807 22.30 10.78 0.44
3 919 23.70 12.17 0.47
5 1225 26.98 15.38 0.53
10 1946 34.86 23.01 0.68
50 8023 99.27 86.01 1.93

Contest transaction costs

Parties Tx size % max Mem % max CPU Min fee ₳
1 684 26.81 11.48 0.48
2 836 28.57 13.05 0.51
3 951 30.35 14.59 0.54
5 1249 34.15 17.97 0.61
10 2159 44.96 27.40 0.81
39 6475 99.57 75.42 1.78

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 4999 15.51 6.64 0.54
2 5116 21.89 9.42 0.62
3 5189 25.88 11.03 0.67
4 5500 36.86 16.17 0.81
5 5526 42.06 18.30 0.87
6 5677 49.69 21.68 0.96
7 5840 54.17 23.69 1.02
8 5942 60.85 26.50 1.09
9 6027 71.86 31.26 1.22
10 6236 79.08 34.48 1.31
11 6382 83.30 36.38 1.37
12 6630 90.62 39.75 1.46
13 6727 94.77 41.45 1.51

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 5090 9.79 4.09 0.48
10 1 57 5124 11.55 5.07 0.51
10 5 285 5259 15.83 7.79 0.57
10 10 570 5429 22.26 11.66 0.65
10 20 1140 5770 33.35 18.64 0.81
10 30 1708 6109 44.85 25.79 0.97
10 40 2275 6446 56.54 33.03 1.13
10 50 2842 6783 68.63 40.45 1.29
10 76 4328 7671 99.08 59.31 1.72

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-10-15 12:24:47.4464208 UTC

Baseline Scenario

Number of nodes 1
Number of txs 300
Avg. Confirmation Time (ms) 4.795165946
P99 8.747272369999994ms
P95 6.0441263ms
P50 4.604065ms
Number of Invalid txs 0

Three local nodes

Number of nodes 3
Number of txs 900
Avg. Confirmation Time (ms) 23.269487645
P99 116.20740669ms
P95 30.413760099999998ms
P50 20.7320475ms
Number of Invalid txs 0

Copy link

github-actions bot commented Oct 15, 2024

Transaction cost differences

Script summary

Name Size (Bytes)
νInitial -
νCommit -
νHead -
μHead -
νDeposit +103

Init transaction costs

Parties Tx size % max Mem % max CPU Min fee ₳
1 +4 +0.27 +0.12 -
2 - $${\color{green}-0.11}$$ $${\color{green}-0.05}$$ -
3 +1 $${\color{green}-0.08}$$ $${\color{green}-0.04}$$ -
5 $${\color{green}-4.00}$$ - - -
10 - +0.27 +0.11 +0.01
57 +3 $${\color{green}-0.37}$$ $${\color{green}-0.16}$$ -

Commit transaction costs

UTxO Tx size % max Mem % max CPU Min fee ₳
1 +3 - - -
2 +2 - - -
3 $${\color{green}-3.00}$$ - - -
5 $${\color{green}-6.00}$$ - - -
10 $${\color{green}-3.00}$$ - - -
19 $${\color{green}-6.00}$$ - - -

CollectCom transaction costs

Parties UTxO (bytes) Tx size % max Mem % max CPU Min fee ₳
1 - $${\color{green}-4.00}$$ +0.74 +0.27 +0.01
2 - - +0.91 +0.33 +0.01
3 $${\color{green}-1.00}$$ - +2.8 +1.04 +0.03
4 - - +4.36 +1.61 +0.04
5 $${\color{green}-1.00}$$ - $${\color{green}-1.76}$$ $${\color{green}-0.65}$$ $${\color{green}-0.02}$$
6 - - $${\color{green}-0.30}$$ $${\color{green}-0.11}$$ -
7 $${\color{green}-1.00}$$ $${\color{green}-4.00}$$ $${\color{green}-3.90}$$ $${\color{green}-1.42}$$ $${\color{green}-0.04}$$
8 - - +12.15 +4.5 +0.13
9 $${\color{green}-2.00}$$ - $${\color{green}-5.64}$$ $${\color{green}-2.16}$$ $${\color{green}-0.06}$$

Cost of Decrement Transaction

Parties Tx size % max Mem % max CPU Min fee ₳
1 $${\color{green}-14.00}$$ - $${\color{green}-0.01}$$ -
2 $${\color{green}-49.00}$$ $${\color{green}-0.81}$$ $${\color{green}-0.29}$$ $${\color{green}-0.01}$$
3 $${\color{green}-25.00}$$ $${\color{green}-0.85}$$ $${\color{green}-0.31}$$ $${\color{green}-0.01}$$
5 $${\color{green}-51.00}$$ $${\color{green}-0.65}$$ $${\color{green}-0.24}$$ $${\color{green}-0.01}$$
10 $${\color{green}-40.00}$$ $${\color{green}-2.73}$$ $${\color{green}-1.10}$$ $${\color{green}-0.03}$$

Close transaction costs

Parties Tx size % max Mem % max CPU Min fee ₳
1 +21.0 $${\color{green}-0.04}$$ - +0.01
2 $${\color{green}-2.00}$$ $${\color{green}-0.04}$$ $${\color{green}-0.02}$$ -
3 $${\color{green}-16.00}$$ +0.08 +0.02 -
5 +60.0 +0.48 +0.39 -
10 +302.0 +2.01 +1.72 +0.04

Contest transaction costs

Parties Tx size % max Mem % max CPU Min fee ₳
1 $${\color{green}-25.00}$$ - $${\color{green}-0.02}$$ -
2 +15.0 +0.04 +0.03 -
3 +127.0 +0.86 +0.72 +0.02
5 +103.0 +0.46 +0.48 +0.01
10 $${\color{green}-82.00}$$ $${\color{green}-0.87}$$ $${\color{green}-0.68}$$ $${\color{green}-0.01}$$

Abort transaction costs

Parties Tx size % max Mem % max CPU Min fee ₳
1 +9.0 $${\color{green}-0.08}$$ $${\color{green}-0.03}$$ -
2 +8.0 $${\color{green}-0.09}$$ $${\color{green}-0.02}$$ -
3 +30.0 +2.57 +1.25 +0.03
4 +101.0 +3.63 +1.77 +0.05
5 $${\color{green}-196.00}$$ $${\color{green}-4.83}$$ $${\color{green}-2.47}$$ $${\color{green}-0.07}$$
6 +29.0 $${\color{green}-0.20}$$ $${\color{green}-0.06}$$ $${\color{green}-0.01}$$
7 +103.0 +2.49 +1.25 +0.03
8 $${\color{green}-27.00}$$ +3.29 +1.43 +0.03
9 +311.0 +9.3 +4.61 +0.12
10 $${\color{green}-108.00}$$ $${\color{green}-3.30}$$ $${\color{green}-1.65}$$ $${\color{green}-0.05}$$
11 $${\color{green}-219.00}$$ $${\color{green}-4.07}$$ $${\color{green}-2.14}$$ $${\color{green}-0.06}$$
12 +36.0 $${\color{green}-1.36}$$ $${\color{green}-0.53}$$ $${\color{green}-0.01}$$
13 $${\color{green}-101.00}$$ +2.02 +0.7 +0.01

FanOut transaction costs

Parties UTxO UTxO (bytes) Tx size % max Mem % max CPU Min fee ₳
10 - - +1 +0.59 +0.26 +0.01
10 - - +1 +1.18 +0.51 +0.02
10 - - - $${\color{green}-0.20}$$ $${\color{green}-0.08}$$ $${\color{green}-0.01}$$
10 - $${\color{green}-2.00}$$ $${\color{green}-2.00}$$ +0.2 +0.08 -
10 - +1 +1 - - -
10 - +1 +2 $${\color{green}-0.29}$$ $${\color{green}-0.12}$$ -
10 - $${\color{green}-2.00}$$ $${\color{green}-3.00}$$ $${\color{green}-0.48}$$ $${\color{green}-0.21}$$ -
10 - $${\color{green}-3.00}$$ $${\color{green}-3.00}$$ - - -
10 - $${\color{green}-5.00}$$ $${\color{green}-5.00}$$ $${\color{green}-0.39}$$ $${\color{green}-0.17}$$ $${\color{green}-0.01}$$

Copy link

Test Results

  7 files  ±0  164 suites  ±0   27m 55s ⏱️ + 1m 13s
558 tests +1  552 ✅ +1  6 💤 ±0  0 ❌ ±0 
560 runs  +1  554 ✅ +1  6 💤 ±0  0 ❌ ±0 

Results for commit 362f9cd. ± Comparison against base commit 34c9916.

@locallycompact locallycompact added this pull request to the merge queue Oct 15, 2024
Merged via the queue into master with commit e30fc24 Oct 15, 2024
29 checks passed
@locallycompact locallycompact deleted the deposit-mutations branch October 15, 2024 13:11
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