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

Don't keep deposit script utxo in local state #1692

Merged
merged 12 commits into from
Oct 10, 2024

Conversation

v0d1ch
Copy link
Contributor

@v0d1ch v0d1ch commented Oct 8, 2024

Why

This is a leftover from off-chain changes needed to implement #199

We kept in the local state a map of UTxO we already observed so this simplifies the code around that since the observed UTxO is already to be found in the chain state UTxO. Now we keep a list of [(TxId, UTxO)] where UTxO is just there to check off-chain if the next snapshot is snapshotting exactly what we saw already as (utxoToCommit).

What

Remove the local map and fields in the observations for increment/recover and rely completely on observed UTxO (spendableUTxO)


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

@v0d1ch v0d1ch added the follow-up Leftover work from a bigger item, ideally done in short succession. label Oct 8, 2024
@v0d1ch v0d1ch self-assigned this Oct 8, 2024
@v0d1ch v0d1ch force-pushed the no-deposit-utxo-in-local-state branch from f18f2a3 to f24954d Compare October 8, 2024 15:10
Copy link

github-actions bot commented Oct 8, 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-10 10:24:50.090002522 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 1a011f23b139a6426767026bde10319546485d553219a5848cdac4e5 2993
  • 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 5096 5.61 2.21 0.44
2 5302 7.40 2.93 0.46
3 5498 8.41 3.32 0.48
5 5901 11.12 4.39 0.53
10 6906 18.11 7.16 0.65
57 16359 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 944 17.92 7.39 0.39
5 1319 25.56 10.73 0.49
10 2253 47.11 19.97 0.77
19 3937 94.71 39.81 1.38

CollectCom transaction costs

Parties UTxO (bytes) Tx size % max Mem % max CPU Min fee ₳
1 57 560 19.87 7.59 0.39
2 114 671 28.85 10.97 0.49
3 171 782 37.75 14.35 0.59
4 227 893 43.68 16.61 0.66
5 283 1004 48.66 18.55 0.72
6 337 1116 58.69 22.36 0.83
7 393 1227 71.34 27.08 0.98
8 448 1338 83.83 31.78 1.12
9 504 1449 80.85 30.80 1.09

Cost of Decrement Transaction

Parties Tx size % max Mem % max CPU Min fee ₳
1 644 18.68 8.17 0.39
2 727 18.46 8.82 0.40
3 952 22.35 11.14 0.45
5 1233 24.21 13.36 0.50
10 2047 34.44 21.25 0.67
49 7902 99.38 76.57 1.85

Close transaction costs

Parties Tx size % max Mem % max CPU Min fee ₳
1 643 20.83 9.31 0.41
2 847 22.68 11.10 0.45
3 910 23.70 12.18 0.47
5 1226 26.89 15.34 0.53
10 1984 35.00 23.25 0.69
49 7848 96.89 83.94 1.88

Contest transaction costs

Parties Tx size % max Mem % max CPU Min fee ₳
1 705 26.76 11.48 0.48
2 806 28.53 13.02 0.51
3 945 30.35 14.59 0.54
5 1250 34.20 17.99 0.61
10 1933 43.08 25.79 0.77
39 6109 96.94 73.19 1.73

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 4894 12.53 5.11 0.50
2 5049 21.33 9.09 0.61
3 5208 28.48 12.29 0.70
4 5448 36.26 15.83 0.80
5 5485 42.60 18.49 0.87
6 5597 48.98 21.28 0.95
7 5817 55.48 24.24 1.03
8 5914 58.28 25.26 1.06
9 6181 72.72 31.88 1.24
10 6137 75.12 32.65 1.26
11 6188 82.96 35.94 1.35
12 6344 85.98 37.24 1.39
13 6625 97.87 42.68 1.54

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 5089 9.79 4.09 0.48
10 1 56 5122 11.75 5.15 0.51
10 5 285 5259 15.83 7.79 0.57
10 10 569 5428 21.87 11.49 0.65
10 20 1138 5768 33.16 18.55 0.81
10 30 1710 6112 45.04 25.88 0.97
10 40 2278 6450 56.74 33.12 1.13
10 50 2845 6786 68.44 40.36 1.29
10 77 4386 7707 99.46 59.69 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-10 10:28:47.72750292 UTC

Baseline Scenario

Number of nodes 1
Number of txs 3000
Avg. Confirmation Time (ms) 4.699305991
P99 9.231895039999998ms
P95 5.954034199999999ms
P50 4.447392499999999ms
Number of Invalid txs 0

Three local nodes

Number of nodes 3
Number of txs 9000
Avg. Confirmation Time (ms) 25.201241084
P99 71.64419447000175ms
P95 34.662336349999975ms
P50 22.7915835ms
Number of Invalid txs 0

@v0d1ch v0d1ch force-pushed the no-deposit-utxo-in-local-state branch from 860231f to f5e5309 Compare October 9, 2024 07:33
@v0d1ch v0d1ch requested a review from a team October 9, 2024 07:38
Copy link

github-actions bot commented Oct 9, 2024

Test Results

544 tests  ±0   538 ✅ ±0   26m 48s ⏱️ +18s
162 suites ±0     6 💤 ±0 
  7 files   ±0     0 ❌ ±0 

Results for commit e06b36b. ± Comparison against base commit dff6655.

♻️ This comment has been updated with latest results.

@v0d1ch v0d1ch force-pushed the no-deposit-utxo-in-local-state branch 2 times, most recently from 7bd5743 to 0a36f5b Compare October 9, 2024 11:20
@ch1bo ch1bo linked an issue Oct 10, 2024 that may be closed by this pull request
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 great!

@v0d1ch v0d1ch force-pushed the no-deposit-utxo-in-local-state branch from 463fd6f to 2943ad0 Compare October 10, 2024 09:20
@v0d1ch v0d1ch added this pull request to the merge queue Oct 10, 2024
Merged via the queue into master with commit 285de0c Oct 10, 2024
28 checks passed
@v0d1ch v0d1ch deleted the no-deposit-utxo-in-local-state branch October 10, 2024 11:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
follow-up Leftover work from a bigger item, ideally done in short succession.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Remove deposit script UTxO from the local state
2 participants