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

Fix incremental commit/decommit state events #1894

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

Conversation

ch1bo
Copy link
Member

@ch1bo ch1bo commented Mar 12, 2025

These have not been carrying and updating the 'chainState' in our 'HeadState' aggregate. This would result in the chain layer not restarting from these last known chain points and we saw the hydra-node re-observing deposits, incrementas and (likely) decrements.


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

@ch1bo ch1bo requested a review from a team March 12, 2025 22:16
@ch1bo ch1bo force-pushed the fix-inc-dec-state-events branch from 83d17b7 to ae4b80d Compare March 12, 2025 22:19
@ch1bo
Copy link
Member Author

ch1bo commented Mar 13, 2025

We confirmed this working by being able to close and fanout a head we could not before!

These have not been carrying and updating the 'chainState' in our
'HeadState' aggregate. This would result in the chain layer not
restarting from these last known chain points and we saw the hydra-node
re-observing deposits, incrementas and (likely) decrements.

Thi also re-order cases in aggregate/aggregateHistory to see better that
we ought to use chainState in some of them.
@ch1bo ch1bo force-pushed the fix-inc-dec-state-events branch from c6d9e83 to 6c260b1 Compare March 13, 2025 12:52
@ch1bo ch1bo enabled auto-merge March 13, 2025 12:56
Copy link

Transaction cost differences

Script summary

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

Init transaction costs

Parties Tx size % max Mem % max CPU Min fee ₳
1 - - - -
2 - - - -
3 - - - -
5 - - - -
10 - - - -
40 - - - -

Commit transaction costs

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

CollectCom transaction costs

Parties UTxO (bytes) Tx size % max Mem % max CPU Min fee ₳
1 - - - - -
2 - - - - -
3 - - - - -
4 - - - - -
5 - - - - -
6 - - - - -
7 - - - - -
8 - - - - -

Cost of Increment Transaction

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

Cost of Decrement Transaction

Parties Tx size % max Mem % max CPU Min fee ₳
1 - - - -
2 - - - -
3 - - - -
5 - - - -
10 - - - -
40 - - - -

Close transaction costs

Parties Tx size % max Mem % max CPU Min fee ₳
1 - - - -
2 - - - -
3 - - - -
5 - - - -
10 - - - -
34 - - - -

Contest transaction costs

Parties Tx size % max Mem % max CPU Min fee ₳
1 - - - -
2 - - - -
3 - - - -
5 - - - -
10 - - - -
27 - - - -

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) - - - - -
(37, 10) - - - - -

Copy link

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-13 12:57:25.421956957 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.02 3.43 0.53
2 6294 13.47 4.19 0.57
3 6493 15.71 4.88 0.60
5 6898 19.76 6.10 0.66
10 7901 31.40 9.68 0.82
40 13935 98.97 30.42 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 739 3.38 1.73 0.22
3 922 4.36 2.33 0.24
5 1280 6.41 3.60 0.28
10 2183 12.13 7.25 0.40
54 10066 98.61 68.52 1.88

CollectCom transaction costs

Parties UTxO (bytes) Tx size % max Mem % max CPU Min fee ₳
1 57 525 25.64 7.39 0.43
2 114 636 33.84 9.73 0.52
3 171 747 45.75 12.96 0.65
4 224 858 53.47 15.21 0.73
5 282 969 59.06 16.94 0.79
6 340 1081 69.73 19.92 0.90
7 395 1192 76.12 21.84 0.98
8 450 1303 98.98 27.80 1.21

Cost of Increment Transaction

Parties Tx size % max Mem % max CPU Min fee ₳
1 1753 24.01 7.84 0.48
2 1936 27.07 9.49 0.52
3 2078 28.43 10.60 0.55
5 2452 33.95 13.76 0.63
10 3338 46.09 21.14 0.82
38 7357 98.16 56.41 1.67

Cost of Decrement Transaction

Parties Tx size % max Mem % max CPU Min fee ₳
1 609 23.71 7.54 0.42
2 798 26.94 9.08 0.47
3 925 28.54 10.19 0.50
5 1277 33.54 12.92 0.57
10 2066 44.57 19.27 0.74
40 6268 96.19 53.52 1.59

Close transaction costs

Parties Tx size % max Mem % max CPU Min fee ₳
1 644 30.91 9.67 0.50
2 809 31.02 10.44 0.51
3 957 32.77 11.65 0.54
5 1257 37.02 14.37 0.61
10 2068 47.92 21.35 0.78
32 5270 97.38 51.49 1.54

Contest transaction costs

Parties Tx size % max Mem % max CPU Min fee ₳
1 670 35.99 11.01 0.55
2 830 38.15 12.33 0.58
3 999 41.03 13.95 0.63
5 1353 45.87 16.86 0.70
10 2020 57.36 23.71 0.87
27 4519 97.51 47.55 1.48

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 5982 28.16 9.29 0.71
2 6055 36.31 11.92 0.80
3 6324 48.87 16.19 0.94
4 6326 56.20 18.50 1.02
5 6560 68.24 22.52 1.15
6 6642 73.56 24.29 1.21
7 6765 83.01 27.40 1.32
8 6832 91.47 30.22 1.41

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 6092 20.12 6.62 0.63
10 1 56 6125 22.25 7.44 0.65
10 5 284 6260 30.77 10.75 0.75
10 10 569 6430 41.42 14.88 0.88
10 20 1140 6772 61.80 22.83 1.11
10 30 1710 7113 83.96 31.38 1.37
10 37 2102 7344 97.56 36.72 1.53

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-13 13:00:46.60527032 UTC

Baseline Scenario

Number of nodes 1
Number of txs 300
Avg. Confirmation Time (ms) 4.509546590
P99 9.803153989999984ms
P95 5.550554300000003ms
P50 4.23365ms
Number of Invalid txs 0

Memory data

Time Used Free
2025-03-13 12:59:30.083376867 UTC 866M 3745M
2025-03-13 12:59:35.083176376 UTC 988M 3591M
2025-03-13 12:59:40.083179149 UTC 989M 3589M
2025-03-13 12:59:45.083144089 UTC 993M 3585M
2025-03-13 12:59:50.083174548 UTC 992M 3585M
2025-03-13 12:59:55.083119611 UTC 994M 3583M

Three local nodes

Number of nodes 3
Number of txs 900
Avg. Confirmation Time (ms) 32.831722002
P99 74.02353878ms
P95 57.30759395ms
P50 29.15069ms
Number of Invalid txs 0

Memory data

Time Used Free
2025-03-13 13:00:08.59451124 UTC 909M 3678M
2025-03-13 13:00:13.594464783 UTC 1158M 3428M
2025-03-13 13:00:18.594893183 UTC 1212M 3316M
2025-03-13 13:00:23.60025317 UTC 1230M 3249M
2025-03-13 13:00:28.594449379 UTC 1230M 3242M
2025-03-13 13:00:33.594482687 UTC 1242M 3229M
2025-03-13 13:00:38.594605673 UTC 1242M 3229M
2025-03-13 13:00:43.594478643 UTC 1244M 3227M

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

Successfully merging this pull request may close these issues.

2 participants