Skip to content

Conversation

@noonio
Copy link
Contributor

@noonio noonio commented Sep 12, 2025

This change allows us to read the state file even in the presence of malformed JSON. This is a kind of "best-effort" hack; we don't ever expect malformed JSON; but if we find it, the best thing we can try to do is ignore it and see if things still work correctly. That's what we do here; when we find an invalid parse we emit a warning.

Fixes #2253

Todo

  • Maybe add a test to check that we get the expected log msg
  • Changelog

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

@noonio noonio requested a review from a team September 12, 2025 11:01
@noonio noonio force-pushed the 2253-warn-on-statefile-error branch from cab728c to 9a4afc2 Compare September 12, 2025 11:02
@github-actions
Copy link

github-actions bot commented Sep 12, 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-09-17 14:16:40.157830764 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 a1442faf26d4ec409e2f62a685c1d4893f8d6bcbaf7bcb59d6fa1340 14599
μHead fd173b993e12103cd734ca6710d364e17120a5eb37a224c64ab2b188* 5284
ν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 5836 10.19 3.22 0.51
2 6037 12.46 3.94 0.55
3 6236 14.52 4.59 0.58
5 6640 18.43 5.81 0.63
10 7646 29.14 9.19 0.79
43 14281 99.08 30.97 1.80

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 740 3.38 1.73 0.22
3 920 4.36 2.33 0.24
5 1279 6.41 3.60 0.28
10 2180 12.13 7.25 0.40
54 10061 98.61 68.52 1.88

CollectCom transaction costs

Parties UTxO (bytes) Tx size % max Mem % max CPU Min fee ₳
1 57 525 25.20 7.30 0.43
2 114 640 33.25 9.61 0.52
3 171 747 40.02 11.62 0.59
4 225 862 49.53 14.31 0.69
5 283 969 62.60 17.86 0.83
6 339 1081 73.79 20.98 0.95
7 393 1196 76.71 22.04 0.98
8 449 1303 87.78 25.14 1.10

Cost of Increment Transaction

Parties Tx size % max Mem % max CPU Min fee ₳
1 1822 24.00 7.62 0.48
2 1925 25.92 8.80 0.51
3 2017 26.32 9.58 0.52
5 2385 30.92 12.22 0.59
10 3130 40.93 18.33 0.75
40 7658 98.93 54.50 1.68

Cost of Decrement Transaction

Parties Tx size % max Mem % max CPU Min fee ₳
1 602 22.57 7.30 0.41
2 813 25.56 8.81 0.46
3 947 26.92 9.85 0.48
5 1245 30.03 12.03 0.53
10 2016 39.75 18.08 0.69
43 6526 95.08 55.46 1.61

Close transaction costs

Parties Tx size % max Mem % max CPU Min fee ₳
1 675 29.13 8.90 0.48
2 807 30.94 10.07 0.51
3 970 33.40 11.44 0.55
5 1283 35.08 13.26 0.59
10 2194 46.95 19.99 0.77
36 6004 98.21 51.68 1.58

Contest transaction costs

Parties Tx size % max Mem % max CPU Min fee ₳
1 683 33.83 10.15 0.53
2 823 35.89 11.39 0.56
3 1062 39.18 13.01 0.61
5 1383 43.99 15.69 0.68
10 2025 53.75 21.73 0.83
29 4830 98.67 46.88 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 5843 26.96 9.06 0.69
2 5992 37.05 12.48 0.80
3 6092 44.77 15.03 0.89
4 6099 49.39 16.49 0.94
5 6355 63.01 21.24 1.09
6 6527 70.38 23.79 1.18
7 6644 81.35 27.32 1.30
8 6813 91.95 30.97 1.42
9 6905 93.89 31.46 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 5834 19.19 6.41 0.61
10 1 57 5869 20.96 7.13 0.63
10 5 283 6002 28.46 10.13 0.72
10 10 570 6175 39.06 14.30 0.84
10 20 1139 6513 59.54 22.38 1.08
10 30 1708 6854 79.15 30.16 1.31
10 39 2217 7157 98.49 37.73 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-09-17 14:19:33.631312359 UTC

Baseline Scenario

Number of nodes 1
Number of txs 300
Avg. Confirmation Time (ms) 5.334490306
P99 9.187364989999994ms
P95 6.5530229ms
P50 5.084515ms
Number of Invalid txs 0

Memory data

Time Used Free
2025-09-17 14:18:12.998364166 UTC 1179M 7406M
2025-09-17 14:18:13.998323853 UTC 1180M 7404M
2025-09-17 14:18:14.998264243 UTC 1260M 7297M
2025-09-17 14:18:15.998295689 UTC 1288M 7270M
2025-09-17 14:18:16.998295224 UTC 1293M 7261M
2025-09-17 14:18:17.998348294 UTC 1299M 7250M
2025-09-17 14:18:18.998308721 UTC 1299M 7250M
2025-09-17 14:18:19.998362732 UTC 1294M 7255M
2025-09-17 14:18:20.998351093 UTC 1291M 7258M
2025-09-17 14:18:21.998421544 UTC 1291M 7257M
2025-09-17 14:18:22.998296631 UTC 1294M 7255M
2025-09-17 14:18:23.998340602 UTC 1294M 7255M
2025-09-17 14:18:24.998419007 UTC 1292M 7257M
2025-09-17 14:18:25.998397288 UTC 1290M 7259M
2025-09-17 14:18:26.998408286 UTC 1289M 7260M
2025-09-17 14:18:27.999584726 UTC 1289M 7259M
2025-09-17 14:18:28.998398676 UTC 1289M 7259M
2025-09-17 14:18:29.998335418 UTC 1290M 7259M
2025-09-17 14:18:30.998329688 UTC 1290M 7258M
2025-09-17 14:18:31.998322294 UTC 1290M 7258M
2025-09-17 14:18:32.999472521 UTC 1290M 7258M
2025-09-17 14:18:33.998351126 UTC 1291M 7257M
2025-09-17 14:18:34.998324956 UTC 1290M 7257M
2025-09-17 14:18:35.998416799 UTC 1291M 7257M
2025-09-17 14:18:36.998410177 UTC 1291M 7257M
2025-09-17 14:18:37.998405019 UTC 1290M 7257M
2025-09-17 14:18:38.998416098 UTC 1293M 7255M
2025-09-17 14:18:39.998416064 UTC 1293M 7255M

Three local nodes

Number of nodes 3
Number of txs 900
Avg. Confirmation Time (ms) 38.402181522
P99 64.99591646ms
P95 55.21862285ms
P50 36.4552215ms
Number of Invalid txs 0

Memory data

Time Used Free
2025-09-17 14:18:51.603242067 UTC 1177M 7407M
2025-09-17 14:18:52.603216011 UTC 1183M 7402M
2025-09-17 14:18:53.603115549 UTC 1199M 7385M
2025-09-17 14:18:54.603211387 UTC 1385M 7119M
2025-09-17 14:18:55.603150272 UTC 1410M 7094M
2025-09-17 14:18:56.603966841 UTC 1457M 7047M
2025-09-17 14:18:57.604212801 UTC 1464M 7036M
2025-09-17 14:18:58.603355798 UTC 1490M 6999M
2025-09-17 14:18:59.603350267 UTC 1493M 6985M
2025-09-17 14:19:00.606086805 UTC 1520M 6948M
2025-09-17 14:19:01.604416882 UTC 1521M 6937M
2025-09-17 14:19:02.607448888 UTC 1532M 6916M
2025-09-17 14:19:03.603807898 UTC 1555M 6886M
2025-09-17 14:19:04.603176045 UTC 1559M 6874M
2025-09-17 14:19:05.603196095 UTC 1561M 6864M
2025-09-17 14:19:06.605517571 UTC 1567M 6851M
2025-09-17 14:19:07.603864885 UTC 1571M 6839M
2025-09-17 14:19:08.603151759 UTC 1607M 6793M
2025-09-17 14:19:09.6032662 UTC 1605M 6793M
2025-09-17 14:19:10.603201968 UTC 1605M 6793M
2025-09-17 14:19:11.603295719 UTC 1606M 6792M
2025-09-17 14:19:12.603246737 UTC 1605M 6792M
2025-09-17 14:19:13.603246604 UTC 1605M 6792M
2025-09-17 14:19:14.603442369 UTC 1607M 6789M
2025-09-17 14:19:15.603404015 UTC 1606M 6790M
2025-09-17 14:19:16.603335712 UTC 1606M 6790M
2025-09-17 14:19:17.603239871 UTC 1606M 6790M
2025-09-17 14:19:18.603301505 UTC 1606M 6790M
2025-09-17 14:19:19.603388888 UTC 1605M 6790M
2025-09-17 14:19:20.603323225 UTC 1609M 6787M
2025-09-17 14:19:21.603255359 UTC 1609M 6787M
2025-09-17 14:19:22.603532442 UTC 1609M 6787M
2025-09-17 14:19:23.603135595 UTC 1609M 6787M
2025-09-17 14:19:24.603146003 UTC 1608M 6787M
2025-09-17 14:19:25.603318614 UTC 1610M 6785M
2025-09-17 14:19:26.60323625 UTC 1610M 6785M
2025-09-17 14:19:27.603443902 UTC 1610M 6785M
2025-09-17 14:19:28.603225456 UTC 1610M 6784M
2025-09-17 14:19:29.603366991 UTC 1610M 6784M
2025-09-17 14:19:30.603351529 UTC 1610M 6784M
2025-09-17 14:19:31.603211228 UTC 1610M 6784M
2025-09-17 14:19:32.603092521 UTC 1612M 6782M

@github-actions
Copy link

Transaction cost differences

No cost or size differences found

@noonio noonio force-pushed the 2253-warn-on-statefile-error branch from 9a4afc2 to 5da6249 Compare September 12, 2025 12:12
@ffakenz
Copy link
Contributor

ffakenz commented Sep 16, 2025

maybe: add a section about this issue in https://hydra.family/head-protocol/docs/known-issues

@noonio noonio force-pushed the 2253-warn-on-statefile-error branch from 076dc64 to ec17a84 Compare September 17, 2025 12:56
@noonio noonio requested a review from a team September 17, 2025 14:14
This change allows us to read the state file even in the presence of
malformed JSON. This is a kind of "best-effort" hack; we don't ever
_expect_ malformed JSON; but if we find it, the best thing we can try to
do is ignore it and see if things still work correctly. That's what we
do here; when we find an invalid parse we emit a warning.
@noonio noonio force-pushed the 2253-warn-on-statefile-error branch from 69d9ed8 to 81d729e Compare September 17, 2025 14:15
@noonio noonio merged commit b16b3f8 into master Sep 18, 2025
19 checks passed
@noonio noonio deleted the 2253-warn-on-statefile-error branch September 18, 2025 08:04
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.

Statefile gets corrupted and hydra-node cannot continue

3 participants