-
Notifications
You must be signed in to change notification settings - Fork 99
[Partial fanout]: Add BLS accumulator to Snapshot #2324
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
base: master
Are you sure you want to change the base?
Conversation
6cb5b08 to
f6f7eab
Compare
Transaction costsSizes and execution budgets for Hydra protocol transactions. Note that unlisted parameters are currently using
Script summary
|
| Parties | Tx size | % max Mem | % max CPU | Min fee ₳ |
|---|---|---|---|---|
| 1 | 5868 | 10.26 | 3.25 | 0.51 |
| 2 | 6071 | 12.73 | 4.04 | 0.55 |
| 3 | 6271 | 14.31 | 4.52 | 0.57 |
| 5 | 6670 | 18.58 | 5.86 | 0.64 |
| 10 | 7678 | 28.94 | 9.11 | 0.79 |
| 43 | 14314 | 99.42 | 31.09 | 1.81 |
Commit transaction costs
This uses ada-only outputs for better comparability.
| UTxO | Tx size | % max Mem | % max CPU | Min fee ₳ |
|---|---|---|---|---|
| 1 | 558 | 2.44 | 1.16 | 0.20 |
| 2 | 742 | 3.38 | 1.73 | 0.22 |
| 3 | 923 | 4.36 | 2.33 | 0.24 |
| 5 | 1279 | 6.41 | 3.60 | 0.28 |
| 10 | 2173 | 12.13 | 7.25 | 0.40 |
| 54 | 10062 | 98.61 | 68.52 | 1.88 |
CollectCom transaction costs
| Parties | UTxO (bytes) | Tx size | % max Mem | % max CPU | Min fee ₳ |
|---|---|---|---|---|---|
| 1 | 57 | 525 | 24.46 | 7.13 | 0.42 |
| 2 | 114 | 636 | 34.31 | 9.88 | 0.53 |
| 3 | 170 | 747 | 39.92 | 11.61 | 0.59 |
| 4 | 227 | 858 | 53.80 | 15.36 | 0.73 |
| 5 | 284 | 969 | 61.23 | 17.56 | 0.81 |
| 6 | 338 | 1081 | 74.93 | 21.14 | 0.96 |
| 7 | 397 | 1192 | 84.18 | 23.74 | 1.05 |
| 8 | 451 | 1303 | 96.24 | 27.12 | 1.18 |
| 9 | 506 | 1418 | 93.65 | 26.84 | 1.16 |
Cost of Increment Transaction
| Parties | Tx size | % max Mem | % max CPU | Min fee ₳ |
|---|---|---|---|---|
| 1 | 2223 | 24.34 | 7.84 | 0.50 |
| 2 | 2442 | 25.94 | 9.13 | 0.53 |
| 3 | 2746 | 28.46 | 10.76 | 0.58 |
| 5 | 3076 | 30.44 | 13.17 | 0.63 |
| 10 | 4537 | 42.51 | 22.60 | 0.86 |
| 38 | 11230 | 96.91 | 92.80 | 2.10 |
Cost of Decrement Transaction
| Parties | Tx size | % max Mem | % max CPU | Min fee ₳ |
|---|---|---|---|---|
| 1 | 801 | 22.88 | 7.46 | 0.42 |
| 2 | 1140 | 24.37 | 8.71 | 0.46 |
| 3 | 1464 | 26.91 | 10.32 | 0.51 |
| 5 | 1864 | 29.25 | 12.81 | 0.56 |
| 10 | 2928 | 36.86 | 20.34 | 0.72 |
| 37 | 10306 | 91.73 | 95.30 | 2.03 |
Close transaction costs
| Parties | Tx size | % max Mem | % max CPU | Min fee ₳ |
|---|---|---|---|---|
| 1 | 828 | 31.78 | 9.68 | 0.51 |
| 2 | 995 | 34.42 | 11.16 | 0.55 |
| 3 | 1414 | 36.38 | 12.67 | 0.60 |
| 5 | 1696 | 40.11 | 15.34 | 0.66 |
| 10 | 4125 | 50.24 | 26.36 | 0.93 |
| 33 | 10728 | 98.69 | 97.36 | 2.12 |
Contest transaction costs
| Parties | Tx size | % max Mem | % max CPU | Min fee ₳ |
|---|---|---|---|---|
| 1 | 7264 | 36.84 | 12.80 | 0.86 |
| 2 | 6911 | 39.04 | 15.62 | 0.88 |
| 3 | 7081 | 41.18 | 18.62 | 0.93 |
| 5 | 7160 | 45.42 | 24.27 | 1.01 |
| 10 | 7372 | 58.28 | 37.96 | 1.22 |
| 26 | 10533 | 99.65 | 88.50 | 2.06 |
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 | 5813 | 27.13 | 9.10 | 0.69 |
| 2 | 5854 | 31.60 | 10.51 | 0.74 |
| 3 | 6204 | 45.85 | 15.46 | 0.91 |
| 4 | 6380 | 56.10 | 18.98 | 1.02 |
| 5 | 6390 | 63.36 | 21.32 | 1.10 |
| 6 | 6621 | 71.60 | 24.13 | 1.19 |
| 7 | 6646 | 75.60 | 25.37 | 1.24 |
| 8 | 6940 | 92.57 | 31.18 | 1.43 |
| 9 | 7020 | 98.94 | 33.30 | 1.50 |
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 | 1 | 57 | 5900 | 21.24 | 7.22 | 0.63 |
| 10 | 5 | 284 | 6035 | 28.93 | 10.29 | 0.72 |
| 10 | 10 | 569 | 6205 | 39.09 | 14.31 | 0.84 |
| 10 | 20 | 1138 | 6544 | 59.56 | 22.38 | 1.08 |
| 10 | 30 | 1705 | 6883 | 80.95 | 30.77 | 1.33 |
| 10 | 39 | 2220 | 7192 | 98.96 | 37.89 | 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-12-01 16:16:17.793505613 UTC
Baseline Scenario
| Number of nodes | 1 |
|---|---|
| Number of txs | 300 |
| Avg. Confirmation Time (ms) | 5.472578630 |
| P99 | 6.753868819999999ms |
| P95 | 6.394810949999999ms |
| P50 | 5.3362645ms |
| Number of Invalid txs | 0 |
Memory data
| Time | Used | Free |
|---|---|---|
| 2025-12-01 16:14:50.175301494 UTC | 1468M | 8717M |
| 2025-12-01 16:14:51.175366024 UTC | 1491M | 8659M |
| 2025-12-01 16:14:52.175297567 UTC | 1500M | 8650M |
| 2025-12-01 16:14:53.175274824 UTC | 1530M | 8619M |
| 2025-12-01 16:14:54.175373085 UTC | 1560M | 8514M |
| 2025-12-01 16:14:55.17534722 UTC | 1571M | 8503M |
| 2025-12-01 16:14:56.175250086 UTC | 1586M | 8485M |
| 2025-12-01 16:14:57.17524209 UTC | 1598M | 8468M |
| 2025-12-01 16:14:58.175302923 UTC | 1598M | 8467M |
| 2025-12-01 16:14:59.175299162 UTC | 1598M | 8467M |
| 2025-12-01 16:15:00.175309326 UTC | 1598M | 8467M |
| 2025-12-01 16:15:01.175244091 UTC | 1599M | 8466M |
| 2025-12-01 16:15:02.175288618 UTC | 1601M | 8464M |
| 2025-12-01 16:15:03.175330684 UTC | 1601M | 8464M |
| 2025-12-01 16:15:04.175324868 UTC | 1602M | 8463M |
| 2025-12-01 16:15:05.1753226 UTC | 1602M | 8463M |
| 2025-12-01 16:15:06.175322861 UTC | 1603M | 8462M |
| 2025-12-01 16:15:07.175341584 UTC | 1604M | 8461M |
| 2025-12-01 16:15:08.175330563 UTC | 1606M | 8459M |
| 2025-12-01 16:15:09.175329939 UTC | 1607M | 8458M |
| 2025-12-01 16:15:10.175303678 UTC | 1607M | 8457M |
| 2025-12-01 16:15:11.17533185 UTC | 1608M | 8456M |
| 2025-12-01 16:15:12.17531705 UTC | 1608M | 8456M |
| 2025-12-01 16:15:13.175262916 UTC | 1609M | 8455M |
| 2025-12-01 16:15:14.175275601 UTC | 1609M | 8455M |
| 2025-12-01 16:15:15.175329489 UTC | 1609M | 8455M |
| 2025-12-01 16:15:16.175330548 UTC | 1609M | 8455M |
| 2025-12-01 16:15:17.175320957 UTC | 1609M | 8455M |
| 2025-12-01 16:15:18.175327246 UTC | 1609M | 8454M |
| 2025-12-01 16:15:19.17532526 UTC | 1610M | 8454M |
Three local nodes
| Number of nodes | 3 |
|---|---|
| Number of txs | 900 |
| Avg. Confirmation Time (ms) | 33.163580616 |
| P99 | 50.93763918ms |
| P95 | 43.39761539999999ms |
| P50 | 32.263099499999996ms |
| Number of Invalid txs | 0 |
Memory data
| Time | Used | Free |
|---|---|---|
| 2025-12-01 16:15:30.708414684 UTC | 1508M | 8593M |
| 2025-12-01 16:15:31.708310864 UTC | 1509M | 8593M |
| 2025-12-01 16:15:32.708264261 UTC | 1513M | 8588M |
| 2025-12-01 16:15:33.708350507 UTC | 1516M | 8585M |
| 2025-12-01 16:15:34.708431522 UTC | 1516M | 8585M |
| 2025-12-01 16:15:35.708409414 UTC | 1519M | 8582M |
| 2025-12-01 16:15:36.708273562 UTC | 1519M | 8582M |
| 2025-12-01 16:15:37.708293151 UTC | 1566M | 8507M |
| 2025-12-01 16:15:38.708419107 UTC | 1619M | 8426M |
| 2025-12-01 16:15:39.708522552 UTC | 1684M | 8333M |
| 2025-12-01 16:15:40.708296573 UTC | 1726M | 8291M |
| 2025-12-01 16:15:41.709488092 UTC | 1728M | 8289M |
| 2025-12-01 16:15:42.710891622 UTC | 1768M | 8239M |
| 2025-12-01 16:15:43.709729244 UTC | 1789M | 8205M |
| 2025-12-01 16:15:44.70905106 UTC | 1796M | 8186M |
| 2025-12-01 16:15:45.709256184 UTC | 1803M | 8167M |
| 2025-12-01 16:15:46.70879517 UTC | 1813M | 8146M |
| 2025-12-01 16:15:47.710120026 UTC | 1837M | 8110M |
| 2025-12-01 16:15:48.709210863 UTC | 1855M | 8080M |
| 2025-12-01 16:15:49.708917183 UTC | 1862M | 8061M |
| 2025-12-01 16:15:50.708717859 UTC | 1877M | 8034M |
| 2025-12-01 16:15:51.708508945 UTC | 1897M | 8002M |
| 2025-12-01 16:15:52.708634548 UTC | 1896M | 8000M |
| 2025-12-01 16:15:53.710663088 UTC | 1897M | 7999M |
| 2025-12-01 16:15:54.708280946 UTC | 1900M | 7996M |
| 2025-12-01 16:15:55.708368824 UTC | 1905M | 7991M |
| 2025-12-01 16:15:56.708404712 UTC | 1911M | 7984M |
| 2025-12-01 16:15:57.708462176 UTC | 1911M | 7984M |
| 2025-12-01 16:15:58.708502926 UTC | 1911M | 7984M |
| 2025-12-01 16:15:59.708461934 UTC | 1911M | 7984M |
| 2025-12-01 16:16:00.708444731 UTC | 1912M | 7983M |
| 2025-12-01 16:16:01.70845155 UTC | 1912M | 7983M |
| 2025-12-01 16:16:02.708457632 UTC | 1914M | 7981M |
| 2025-12-01 16:16:03.708416943 UTC | 1915M | 7980M |
| 2025-12-01 16:16:04.708413561 UTC | 1915M | 7980M |
| 2025-12-01 16:16:05.708477578 UTC | 1914M | 7980M |
| 2025-12-01 16:16:06.708389259 UTC | 1914M | 7980M |
| 2025-12-01 16:16:07.708516954 UTC | 1916M | 7978M |
| 2025-12-01 16:16:08.708475907 UTC | 1916M | 7977M |
| 2025-12-01 16:16:09.70843069 UTC | 1916M | 7977M |
| 2025-12-01 16:16:10.708536224 UTC | 1916M | 7977M |
| 2025-12-01 16:16:11.708292115 UTC | 1916M | 7977M |
| 2025-12-01 16:16:12.708568029 UTC | 1916M | 7977M |
| 2025-12-01 16:16:13.708478566 UTC | 1916M | 7977M |
| 2025-12-01 16:16:14.708437175 UTC | 1918M | 7974M |
| 2025-12-01 16:16:15.708374765 UTC | 1918M | 7974M |
| 2025-12-01 16:16:16.708395488 UTC | 1918M | 7974M |
| 2025-12-01 16:16:17.708316228 UTC | 1920M | 7972M |
81114ad to
e2bfe00
Compare
62433f4 to
f4a792f
Compare
Transaction cost differencesScript summary
|
| Parties | Tx size | % max Mem | % max CPU | Min fee ₳ |
|---|---|---|---|---|
| 1 | +32 | - | - | - |
| 2 | +32 | - | - | - |
| 3 | +32 | - | - | +0.01 |
| 5 | +32 | - | - | - |
| 10 | +32 | - | - | - |
| 43 | +32 | - | - | - |
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.42 | +1.53 | +0.07 |
| 6 | - | - | +5.54 | +1.32 | +0.05 |
| 7 | - | - | |||
| 8 | - | - |
Cost of Increment Transaction
| Parties | Tx size | % max Mem | % max CPU | Min fee ₳ |
|---|---|---|---|---|
| 1 | 431 | +0.42 | 0.23 | 0.02 |
| 2 | 462 | 0.22 | 0.02 | |
| 3 | 573 | +0.07 | 0.55 | 0.03 |
| 5 | 832 | +0.11 | 1.27 | 0.05 |
| 10 | 1202 | +0.9 | 3.73 | 0.09 |
Cost of Decrement Transaction
| Parties | Tx size | % max Mem | % max CPU | Min fee ₳ |
|---|---|---|---|---|
| 1 | 202 | +0.31 | 0.15 | 0.02 |
| 2 | 298 | 0.15 | 0.02 | |
| 3 | 401 | +0.1 | 0.42 | 0.02 |
| 5 | 568 | +0.1 | 0.9 | 0.03 |
| 10 | 1401 | +0.17 | 4.09 | 0.09 |
Close transaction costs
| Parties | Tx size | % max Mem | % max CPU | Min fee ₳ |
|---|---|---|---|---|
| 1 | 1088 | 2.58 | 1.01 | 0.08 |
| 2 | 538 | 2.68 | 1.05 | 0.05 |
| 3 | 560 | 2.75 | 1.26 | 0.06 |
| 5 | 626 | 3.01 | 1.76 | 0.07 |
| 10 | 1845 | 3.69 | 6.27 | 0.16 |
Contest transaction costs
| Parties | Tx size | % max Mem | % max CPU | Min fee ₳ |
|---|---|---|---|---|
| 1 | 5965 | 2.96 | 2.47 | 0.3 |
| 2 | 5251 | 3.11 | 3.77 | 0.28 |
| 3 | 5821 | 3.26 | 5.75 | 0.32 |
| 5 | 6138 | 3.56 | 9.51 | 0.37 |
| 10 | 6333 | 4.44 | 18.85 | 0.45 |
FanOut transaction costs
| UTxO, Parties | UTxO (bytes) | Tx size | % max Mem | % max CPU | Min fee ₳ |
|---|---|---|---|---|---|
| (0, 10) | - | +32 | 0.02 | +0.01 | +0.01 |
| (1, 10) | - | +32 | 0.03 | - | - |
| (5, 10) | - | +32 | 0.02 | +0.01 | - |
| (10, 10) | - | +32 | 0.03 | +0.01 | - |
| (20, 10) | - | +32 | 0.03 | +0.01 | - |
| (37, 10) | - | +32 | 0.02 | +0.01 | - |
As close to cardano-scaling/hydra#2324 as possible
v0d1ch
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm. I think the main concern is that we want to have any UTxO to commit/decommit in there when building the accumulator and I gave the reason in one of the comments.
| aliceChain `observesInTime` OnCollectComTx{headId} | ||
| let v = 0 | ||
| let snapshotVersion = 0 | ||
| accumulator = Accumulator.buildFromUTxO someUTxO |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Each time you invoke buildFromUTxO you probably want to include any utxo to commit/decommit since these UTxO can also be part of the fanout outputs.
|
|
||
| -- | Get latest confirmed snapshot UTxO from 'HeadState'. | ||
| getSnapshotUtxo :: Monoid (UTxOType tx) => HeadState tx -> Maybe (UTxOType tx) | ||
| getSnapshotUtxo :: IsTx tx => HeadState tx -> Maybe (UTxOType tx) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why did we have to add IsTx constraint here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now getSnapshot requires IsTx cause it also builds the accumulator
| -- | ||
| -- __Transition__: 'OpenState' → 'ClosedState' | ||
| onOpenChainCloseTx :: | ||
| IsTx tx => |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same question regarding IsTx constraint?
hydra-tx/src/Hydra/Tx/Accumulator.hs
Outdated
| -- Compress the Point2 to a ByteString and encode as hex | ||
| let proofBytes = blsCompress proof | ||
| proofHex = decodeUtf8 $ Base16.encode proofBytes | ||
| in "Success: 0x" <> proofHex |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think we want to have this text pre-pended to the resulting hex? I know we are not using this function currently but perhaps returning Either is more sensible? No big issue, we can also deal with this function once we actually start to use it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, that I was basically using for debug only 🙏🏼
Good catch!
hydra-tx/src/Hydra/Tx/Close.hs
Outdated
| where | ||
| snapshot = getSnapshot confirmedSnapshot | ||
| snapshotUtxo = Hydra.Tx.utxo snapshot | ||
| closedAccumulatorHash = Accumulator.getAccumulatorHash $ Accumulator.buildFromUTxO snapshotUtxo |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just wanted to re-iterate once more: We need to have any utxo to commit/decommit in the accumulator here. For example: It can happen that the head gets closed in the middle of decommitting some UTxO . So since this UTxO was never brought back into L1 by the decommit tx we need to make sure fanout will do that in the end.
b8b3bbd to
5def3a0
Compare
Related log book entry is here https://github.com/cardano-scaling/hydra/wiki/Logbook-2025-H1#2025-12-01 Signed-off-by: Sasha Bogicevic <sasha.bogicevic@iohk.io>
d14c09b to
67d29a6
Compare
Signed-off-by: Sasha Bogicevic <sasha.bogicevic@iohk.io>
3f3c2f1 to
14152aa
Compare
Part of #1468