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

Fanout: Always rely on observed utxo #1916

Open
wants to merge 8 commits into
base: master
Choose a base branch
from

Conversation

v0d1ch
Copy link
Contributor

@v0d1ch v0d1ch commented Mar 26, 2025

  • Instead of relying on the local state to display information on fanned out UTxO always display what we actually observed on-chain.

  • 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 this to the 0.20.0 milestone Mar 26, 2025
@v0d1ch v0d1ch self-assigned this Mar 26, 2025
@v0d1ch v0d1ch requested a review from a team March 26, 2025 15:29
@v0d1ch v0d1ch linked an issue Mar 26, 2025 that may be closed by this pull request
Copy link

github-actions bot commented Mar 26, 2025

Transaction cost differences

No cost or size differences found

Copy link

github-actions bot commented Mar 26, 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-03-31 14:56:52.283773468 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 0e35115a2c7c13c68ecd8d74e4987c04d4539e337643be20bb3274bd 14756
μHead 57166715eadb8d3135964325c016eea546c21e1c0aae974ca67df9a5* 5541
ν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 6094 11.38 3.55 0.54
2 6294 13.04 4.04 0.56
3 6496 15.77 4.90 0.60
5 6897 20.19 6.25 0.66
10 7903 30.97 9.53 0.82
40 13936 98.61 30.29 1.78

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 743 3.38 1.73 0.22
3 922 4.36 2.33 0.24
5 1281 6.41 3.60 0.28
10 2177 12.13 7.25 0.40
54 10071 98.61 68.52 1.88

CollectCom transaction costs

Parties UTxO (bytes) Tx size % max Mem % max CPU Min fee ₳
1 57 525 26.44 7.58 0.44
2 113 636 34.88 9.98 0.53
3 170 747 45.86 12.99 0.65
4 227 862 52.30 14.96 0.72
5 283 969 58.59 16.79 0.79
6 340 1081 79.19 22.22 1.00
7 393 1192 82.97 23.57 1.04
8 448 1303 94.34 26.64 1.16

Cost of Increment Transaction

Parties Tx size % max Mem % max CPU Min fee ₳
1 1789 25.11 8.24 0.49
2 1938 27.11 9.50 0.52
3 2076 28.22 10.55 0.55
5 2486 35.17 14.19 0.65
10 3139 42.02 19.67 0.77
39 7357 97.95 56.85 1.68

Cost of Decrement Transaction

Parties Tx size % max Mem % max CPU Min fee ₳
1 595 23.95 7.60 0.42
2 753 25.31 8.65 0.45
3 881 26.86 9.75 0.48
5 1218 31.95 12.47 0.55
10 1956 40.90 18.25 0.70
37 6275 99.96 52.56 1.61

Close transaction costs

Parties Tx size % max Mem % max CPU Min fee ₳
1 674 29.15 9.20 0.48
2 794 32.89 10.93 0.53
3 902 32.11 11.35 0.53
5 1281 37.10 14.41 0.61
10 2033 47.70 21.17 0.78
35 5942 99.43 54.76 1.61

Contest transaction costs

Parties Tx size % max Mem % max CPU Min fee ₳
1 628 35.25 10.69 0.54
2 807 38.19 12.33 0.58
3 947 40.25 13.62 0.62
5 1212 44.63 16.26 0.68
10 2066 57.48 23.76 0.88
27 4646 98.34 48.03 1.50

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 6005 28.16 9.30 0.71
2 6094 37.39 12.32 0.81
3 6253 47.64 15.74 0.92
4 6355 53.87 17.76 0.99
5 6610 68.70 22.73 1.16
6 6602 73.22 24.12 1.21
7 6859 89.42 29.65 1.39
8 6897 93.90 31.03 1.44

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 6091 20.12 6.62 0.63
10 5 285 6262 30.31 10.59 0.75
10 37 2104 7347 99.86 37.50 1.55

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-03-31 14:59:48.507724257 UTC

Baseline Scenario

Number of nodes 1
Number of txs 300
Avg. Confirmation Time (ms) 4.723542080
P99 6.932494079999972ms
P95 5.60676005ms
P50 4.3301134999999995ms
Number of Invalid txs 0

Memory data

Time Used Free
2025-03-31 14:58:31.687885483 UTC 930M 6160M
2025-03-31 14:58:36.687927082 UTC 1052M 6006M
2025-03-31 14:58:41.68788876 UTC 1051M 6006M
2025-03-31 14:58:46.687892163 UTC 1050M 6006M
2025-03-31 14:58:51.687876735 UTC 1050M 6006M
2025-03-31 14:58:56.687892952 UTC 1050M 6006M

Three local nodes

Number of nodes 3
Number of txs 900
Avg. Confirmation Time (ms) 28.594796971
P99 43.88593244ms
P95 37.94730695ms
P50 27.474826999999998ms
Number of Invalid txs 0

Memory data

Time Used Free
2025-03-31 14:59:10.597720305 UTC 942M 6123M
2025-03-31 14:59:15.597799566 UTC 1200M 5864M
2025-03-31 14:59:20.598309971 UTC 1267M 5742M
2025-03-31 14:59:25.597737731 UTC 1279M 5674M
2025-03-31 14:59:30.597744055 UTC 1282M 5671M
2025-03-31 14:59:35.597707961 UTC 1280M 5672M
2025-03-31 14:59:40.597810655 UTC 1280M 5671M
2025-03-31 14:59:45.597756493 UTC 1280M 5671M

@v0d1ch v0d1ch force-pushed the fanout-utxo-is-correct-after-incrementing branch 2 times, most recently from da9da66 to 3a746b2 Compare March 27, 2025 13:54
@noonio noonio modified the milestones: 0.20.0, 0.21.0 Mar 27, 2025
@v0d1ch v0d1ch force-pushed the fanout-utxo-is-correct-after-incrementing branch from 4140a4e to 11ee657 Compare March 31, 2025 08:27
@v0d1ch v0d1ch requested a review from ch1bo March 31, 2025 13:09
@noonio noonio force-pushed the fanout-utxo-is-correct-after-incrementing branch from 11ee657 to 5715167 Compare March 31, 2025 14:42
v0d1ch added 8 commits March 31, 2025 15:52
Signed-off-by: Sasha Bogicevic <[email protected]>
We need to be able to assert only participant outputs
but we also get a change output.

Signed-off-by: Sasha Bogicevic <[email protected]>
We need to grab all pub key outputs and then alter the tests
since we don't have exact match because of the extra change output

Also fix DirectChainSpec and Model tests.

Signed-off-by: Sasha Bogicevic <[email protected]>
Signed-off-by: Sasha Bogicevic <[email protected]>
Signed-off-by: Sasha Bogicevic <[email protected]>
@noonio noonio force-pushed the fanout-utxo-is-correct-after-incrementing branch from 5715167 to c587e77 Compare March 31, 2025 14:52
Head.Fanout{} -> pure FanoutObservation{headId}
Head.Fanout{numberOfFanoutOutputs, numberOfCommitOutputs, numberOfDecommitOutputs} -> do
let allOutputs = fromIntegral $ numberOfFanoutOutputs + numberOfCommitOutputs + numberOfDecommitOutputs
let fanoutUTxO = UTxO.fromPairs $ take allOutputs $ UTxO.pairs txOutputs
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice catch 👏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: In progress 🕐
Development

Successfully merging this pull request may close these issues.

HeadIsFinalised event not reporting the UTxOS as observed on L1
4 participants