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

Clear pending txs #1840

Closed
wants to merge 13 commits into from
Closed

Clear pending txs #1840

wants to merge 13 commits into from

Conversation

ffakenz
Copy link
Contributor

@ffakenz ffakenz commented Feb 10, 2025

Closes #1284

Summary

🐧 introduce new ClearPendingTxs ClientInput

🐧 introduce new endpoint DELETE txs/pending

  • calls new ClientInput

🐧 introduce new endpoint GET txs/pending

  • return pending txs in local state

🐧 introduce new ServerOutput PendingTxsRemoved

  • to signal when ClearPendingTxs has been performed
  • this is require to support the new endpoint projection

🐧 introduce new ServerOutput PendingTxsUpdated

  • to signal when localTxs get pruned on ReqSn
  • this is require to support the new endpoint projection

🐧 HeadLogic now handles ClearPendingTxs

  • persists PendingTxsPruned event
  • produce PendingTxsRemoved server output

🐧 HeadLogic handles event PendingTxsPruned

  • localTxs are pruned
  • localUTxO gets assigned to latest confirmed snapshot utxo
  • allTxs get assigned to latest confirmed snapshot txs

TBD

  • broadcast ClearPendingTxs (fire-forget)
  • store pruned txs for later retry

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

@ffakenz ffakenz linked an issue Feb 10, 2025 that may be closed by this pull request
@ffakenz ffakenz self-assigned this Feb 10, 2025
Copy link

github-actions bot commented Feb 10, 2025

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 - +0.39 +0.09 -
2 - - - -
3 - $${\color{green}-0.39}$$ $${\color{green}-0.09}$$ -
5 - +0.39 +0.09 -
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

github-actions bot commented Feb 10, 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-02-18 12:13:57.596179766 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 6091 10.80 3.35 0.53
2 6298 13.47 4.19 0.57
3 6493 15.80 4.91 0.60
5 6897 19.98 6.17 0.66
10 7904 31.36 9.67 0.82
40 13936 98.66 30.31 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 741 3.38 1.73 0.22
3 922 4.36 2.33 0.24
5 1278 6.41 3.60 0.28
10 2174 12.13 7.25 0.40
54 10074 98.61 68.52 1.88

CollectCom transaction costs

Parties UTxO (bytes) Tx size % max Mem % max CPU Min fee ₳
1 57 525 25.67 7.41 0.43
2 114 636 33.91 9.76 0.52
3 170 747 45.59 12.92 0.64
4 227 858 50.72 14.58 0.70
5 285 969 66.04 18.67 0.86
6 337 1081 74.36 20.95 0.95
7 394 1196 77.33 22.08 0.99
8 452 1307 96.30 27.11 1.18
9 504 1414 92.59 26.57 1.15

Cost of Increment Transaction

Parties Tx size % max Mem % max CPU Min fee ₳
1 1801 25.03 8.22 0.49
2 1879 25.97 9.08 0.51
3 2140 29.36 10.97 0.56
5 2334 31.49 12.89 0.60
10 3208 43.57 20.24 0.79
44 7787 99.24 60.35 1.73

Cost of Decrement Transaction

Parties Tx size % max Mem % max CPU Min fee ₳
1 605 23.71 7.55 0.42
2 757 25.55 8.71 0.45
3 918 28.09 10.08 0.49
5 1177 31.36 12.31 0.54
10 1962 41.31 18.37 0.70
38 6238 97.28 52.48 1.59

Close transaction costs

Parties Tx size % max Mem % max CPU Min fee ₳
1 601 30.25 9.37 0.49
2 811 32.84 10.93 0.53
3 1012 36.15 12.79 0.58
5 1297 37.14 14.42 0.61
10 2126 51.62 22.45 0.82
34 5810 99.29 54.12 1.60

Contest transaction costs

Parties Tx size % max Mem % max CPU Min fee ₳
1 673 35.99 11.01 0.55
2 898 38.77 12.63 0.59
3 952 40.32 13.64 0.62
5 1263 45.33 16.57 0.69
10 2032 57.64 23.78 0.88
27 4610 97.91 47.85 1.49

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 5999 28.32 9.34 0.71
2 6083 37.60 12.38 0.81
3 6257 47.58 15.73 0.92
4 6439 58.24 19.30 1.04
5 6355 60.77 19.99 1.06
6 6518 71.17 23.36 1.18
7 6677 84.31 27.73 1.33
8 6916 95.98 31.75 1.46
9 6941 98.20 32.35 1.48

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 19.66 6.46 0.62
10 5 284 6261 29.85 10.44 0.74
10 10 568 6429 41.42 14.88 0.88
10 20 1139 6770 60.88 22.52 1.10
10 30 1710 7114 84.03 31.40 1.37
10 37 2105 7348 98.48 37.03 1.54

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-02-18 12:17:03.653528273 UTC

Baseline Scenario

Number of nodes 1
Number of txs 300
Avg. Confirmation Time (ms) 4.262244626
P99 10.046426599999997ms
P95 5.092628000000003ms
P50 4.050094ms
Number of Invalid txs 0

Memory data

Time Used Free
2025-02-18 12:15:38.964769546 UTC 964M 5979M
2025-02-18 12:15:43.964711485 UTC 1068M 5783M
2025-02-18 12:15:48.964727632 UTC 1069M 5782M
2025-02-18 12:15:53.964762698 UTC 1067M 5784M
2025-02-18 12:15:58.96475379 UTC 1064M 5786M
2025-02-18 12:16:03.96480169 UTC 1068M 5782M

Three local nodes

Number of nodes 3
Number of txs 900
Avg. Confirmation Time (ms) 23.879608426
P99 116.42014866000001ms
P95 30.71417ms
P50 21.0709015ms
Number of Invalid txs 0

Memory data

Time Used Free
2025-02-18 12:16:16.681326701 UTC 1012M 5850M
2025-02-18 12:16:21.681431945 UTC 1153M 5709M
2025-02-18 12:16:26.681428304 UTC 1162M 5698M
2025-02-18 12:16:31.681410561 UTC 1164M 5696M
2025-02-18 12:16:36.681586133 UTC 1224M 5570M
2025-02-18 12:16:41.681444015 UTC 1252M 5460M
2025-02-18 12:16:46.681442014 UTC 1255M 5456M
2025-02-18 12:16:51.681429351 UTC 1259M 5451M
2025-02-18 12:16:56.681441827 UTC 1261M 5449M
2025-02-18 12:17:01.681326816 UTC 1261M 5448M

@ffakenz ffakenz force-pushed the clear-pending-txs branch 4 times, most recently from e2f3938 to d16435d Compare February 10, 2025 12:40
@ffakenz ffakenz force-pushed the clear-pending-txs branch 4 times, most recently from 4fb890b to bcd2ce3 Compare February 12, 2025 16:17
ffakenz and others added 11 commits February 17, 2025 16:34
Remove checks that we can't have

Tidyup

Check how many signatures it received
with detailed confirmed observations.
* this helps detect if a head becomes stuck
to see if head becomes stuck regardless of the network reliability
@noonio noonio closed this Feb 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done ✔
Development

Successfully merging this pull request may close these issues.

Clear pending transactions API command
2 participants