Skip to content

Side load snapshot#1864

Merged
ffakenz merged 34 commits into
masterfrom
side-load-snapshot
Mar 21, 2025
Merged

Side load snapshot#1864
ffakenz merged 34 commits into
masterfrom
side-load-snapshot

Conversation

@ffakenz
Copy link
Copy Markdown
Contributor

@ffakenz ffakenz commented Feb 25, 2025

Closes #1858

Summary

🛩️ introduce new SideLoadSnapshot ClientInput

🛩️ introduce new endpoint POST /snapshot

  • calls new ClientInput

🛩️ introduce new ServerOutput SnapshotSideLoaded

  • to signal when SideLoadSnapshot has been performed.

🛩️ HeadLogic now handles SideLoadSnapshot

  • persists LocalStateCleared event: if InitialSnapshot has been side loaded
  • persists LocalStateCleared event + SnapshotConfirmed: if ConfirmedSnapshot has been side loaded
  • produce SnapshotSideLoaded server output

🛩️ introduce new LogicError SideLoadSnapshotFailed

  • to signal when SideLoadSnapshot fails.

🛩️ HeadLogic handles event much like the SnapshotConfirmed

  • the new snapshot its been adopted as latest confirmed.

🛩️ HeadLogic handles event LocalStateCleared

  • It clears pending transactions in the local state, resets the local UTxO, and restarts the snapshot signing round by pruning the latest seen snapshot, which also resets the current leader.

🛩️ introduce new endpoint GET /snapshot

  • returns latest ConfirmedSnapshot

🛩️ introduce new endpoint GET /snapshot

  • returns latest ConfirmedSnapshot
  • useful in combination with new POST /snapshot in order to reset local state to latest known.

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

@ffakenz ffakenz self-assigned this Feb 25, 2025
@ffakenz ffakenz requested a review from a team February 25, 2025 16:24
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Feb 25, 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 - - - -
2 - - - -
3 - - - -
5 - - - -
10 - +0.39 +0.09 +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) - - - - -

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Feb 25, 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-21 12:57:41.411286012 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 6098 10.89 3.38 0.53
2 6295 13.83 4.32 0.57
3 6495 15.89 4.94 0.60
5 6895 20.34 6.30 0.66
10 7903 31.18 9.61 0.82
40 13935 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 558 2.44 1.16 0.20
2 740 3.38 1.73 0.22
3 919 4.36 2.33 0.24
5 1280 6.41 3.60 0.28
10 2172 12.13 7.25 0.40
54 10050 98.61 68.52 1.88

CollectCom transaction costs

Parties UTxO (bytes) Tx size % max Mem % max CPU Min fee ₳
1 57 529 25.67 7.41 0.43
2 113 636 34.96 10.01 0.53
3 169 747 43.50 12.44 0.62
4 228 862 52.00 14.84 0.72
5 284 974 62.41 17.77 0.83
6 340 1081 77.07 21.71 0.98
7 395 1192 78.06 22.39 0.99
8 449 1303 95.88 26.91 1.18
9 507 1414 98.43 27.97 1.21

Cost of Increment Transaction

Parties Tx size % max Mem % max CPU Min fee ₳
1 1797 25.42 8.31 0.49
2 1886 25.98 9.08 0.51
3 2067 28.70 10.66 0.55
5 2507 34.45 14.03 0.64
10 2978 39.68 18.74 0.74
41 7552 98.73 58.33 1.70

Cost of Decrement Transaction

Parties Tx size % max Mem % max CPU Min fee ₳
1 637 23.71 7.55 0.42
2 800 26.86 9.07 0.47
3 937 28.46 10.17 0.49
5 1241 32.78 12.70 0.56
10 2055 44.60 19.29 0.74
37 6027 96.95 51.66 1.57

Close transaction costs

Parties Tx size % max Mem % max CPU Min fee ₳
1 689 29.19 9.21 0.48
2 740 32.18 10.62 0.52
3 907 32.15 11.35 0.53
5 1309 37.92 14.74 0.62
10 2093 47.96 21.37 0.78
34 5823 99.35 54.15 1.60

Contest transaction costs

Parties Tx size % max Mem % max CPU Min fee ₳
1 679 35.95 11.00 0.55
2 768 37.45 12.01 0.57
3 988 41.07 13.96 0.63
5 1320 46.07 16.89 0.70
10 2029 57.44 23.73 0.87
28 4644 99.56 48.94 1.51

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 5972 28.20 9.30 0.71
2 6106 37.47 12.36 0.81
3 6228 44.39 14.63 0.89
4 6510 59.16 19.63 1.06
5 6607 68.61 22.76 1.16
6 6656 76.36 25.23 1.24
7 6841 88.20 29.23 1.37
8 6998 97.11 32.08 1.47

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 19.66 6.46 0.62
10 5 286 6262 31.23 10.90 0.76
10 10 567 6428 41.15 14.79 0.87
10 30 1707 7111 84.03 31.40 1.37
10 37 2108 7350 98.68 37.10 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-03-21 13:00:42.046024836 UTC

Baseline Scenario

Number of nodes 1
Number of txs 300
Avg. Confirmation Time (ms) 4.666231230
P99 7.309821229999956ms
P95 5.523969450000001ms
P50 4.28415ms
Number of Invalid txs 0

Memory data

Time Used Free
2025-03-21 12:59:25.597754241 UTC 865M 5823M
2025-03-21 12:59:30.597639142 UTC 1007M 5622M
2025-03-21 12:59:35.597735389 UTC 1022M 5607M
2025-03-21 12:59:40.597658278 UTC 1033M 5595M
2025-03-21 12:59:45.597728899 UTC 1033M 5595M
2025-03-21 12:59:50.597759721 UTC 1049M 5579M

Three local nodes

Number of nodes 3
Number of txs 900
Avg. Confirmation Time (ms) 32.670433371
P99 66.92226374ms
P95 54.3454221ms
P50 29.2079485ms
Number of Invalid txs 0

Memory data

Time Used Free
2025-03-21 13:00:04.594960291 UTC 924M 5713M
2025-03-21 13:00:09.59504447 UTC 1173M 5463M
2025-03-21 13:00:14.595239656 UTC 1239M 5339M
2025-03-21 13:00:19.595855403 UTC 1252M 5279M
2025-03-21 13:00:24.595060074 UTC 1254M 5271M
2025-03-21 13:00:29.595039768 UTC 1254M 5270M
2025-03-21 13:00:34.595076951 UTC 1257M 5266M
2025-03-21 13:00:39.595034651 UTC 1257M 5265M

@ffakenz ffakenz force-pushed the side-load-snapshot branch 2 times, most recently from 5a5e550 to 11fb205 Compare February 27, 2025 20:44
@noonio noonio moved this from Triage 🏥 to In progress 🕐 in ☕ Hydra Team Work Feb 28, 2025
@ffakenz ffakenz force-pushed the side-load-snapshot branch 8 times, most recently from 5c79937 to d3c1bc9 Compare March 6, 2025 10:41
@noonio noonio linked an issue Mar 6, 2025 that may be closed by this pull request
@github-project-automation github-project-automation Bot moved this to Triage 🏥 in ☕ Hydra Team Work Mar 9, 2025
@ffakenz ffakenz force-pushed the side-load-snapshot branch 7 times, most recently from 24e8e1d to 858ebb6 Compare March 9, 2025 21:16
@ffakenz ffakenz marked this pull request as ready for review March 9, 2025 21:40
@ffakenz ffakenz moved this from Triage 🏥 to In review 👀 in ☕ Hydra Team Work Mar 9, 2025
@ffakenz ffakenz force-pushed the side-load-snapshot branch 2 times, most recently from dcd2ca1 to 6ad8e0a Compare March 12, 2025 14:33
ffakenz and others added 23 commits March 19, 2025 22:18
Co-authored-by: Sasha Bogicevic <Sasha.Bogicevic@iohk.io>
* as it is not part of normal user journey, thus, it is not part of our formal spec.
* also removing unnintended macOS file
To avoid accepting snapshots which can not be use to close the head with.

Also refactor solution:
* split SnapshotSideLoaded into SnapshotConfirmed + ClearLocalState
** reuses SnapshotConfirmed outcome and server outcome
** simplifies SnapshotSideLoaded to be produced upon ClearLocalState
* missing to reset localUTxO upon ClearLocalState event
Co-authored-by: Sebastian Nagel <ch1bo@users.noreply.github.com>
* to enhance readability

Co-authored-by: Sebastian Nagel <ch1bo@users.noreply.github.com>
* as it ounds a lot like a 'command'
@ffakenz ffakenz force-pushed the side-load-snapshot branch from 181f245 to e7f94ac Compare March 19, 2025 21:18
@ffakenz ffakenz merged commit b06f4f8 into master Mar 21, 2025
@ffakenz ffakenz deleted the side-load-snapshot branch March 21, 2025 14:09
@github-project-automation github-project-automation Bot moved this from In review 👀 to Done ✔ in ☕ Hydra Team Work Mar 21, 2025
@ffakenz ffakenz restored the side-load-snapshot branch April 2, 2025 14:44
@ffakenz ffakenz deleted the side-load-snapshot branch September 2, 2025 02:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

Side load of fully-signed snapshot Heads stuck in a state without being able to progress snapshots

4 participants