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

TUI - Enhance UX to request confirmation for terminating actions #1201

Merged
merged 7 commits into from
Dec 13, 2023

Conversation

ffakenz
Copy link
Contributor

@ffakenz ffakenz commented Dec 11, 2023

When running the demo on devnet, we observed that due to the fast confirmation time, it is too easy to close a head immediately after collecting the last commit, as the TUI utilizes the same key-binding for both actions.

Moreover, it is a good practice to safeguard such actions in order to prevent accidents.


🎁 Add a confirmation dialog prompt for Close/Abort actions to prevent accidental termination of the head.

  • 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 Dec 11, 2023
Copy link

github-actions bot commented Dec 11, 2023

Transactions 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 2023-12-12 17:58:49.02028697 UTC
Max. memory units 14000000
Max. CPU units 10000000000
Max. tx size (kB) 16384

Script summary

Name Hash Size (Bytes)
νInitial 985245919fcc6c0c5cd116023cd2c947c43e80dcbb5075fe12433fbb 4072
νCommit 7cb20fa71eb4c563ca283566ebe0aa65859d96c3f8cba35c52c181fd 2043
νHead 7a36661f5c15e9f1783aeaab890812c59b7286cbbc6de762d3110772 8816
μHead 8b111ac12274e46314769295a1c5dcab1d260096fc469fd698065463* 3851
  • The minting policy hash is only usable for comparison. As the script is parameterized, the actual script is unique per Head.

Cost of Init Transaction

Parties Tx size % max Mem % max CPU Min fee ₳
1 4372 10.25 3.95 0.45
2 4575 12.85 4.95 0.49
3 4777 14.89 5.72 0.52
5 5177 19.33 7.40 0.59
10 6188 30.24 11.53 0.75
41 12419 99.02 37.59 1.77

Cost of Commit Transaction

This is using ada-only outputs for better comparability.

UTxO Tx size % max Mem % max CPU Min fee ₳
1 534 11.37 4.44 0.30
2 721 15.04 6.07 0.35
3 906 18.85 7.75 0.40
5 1285 26.90 11.27 0.51
10 2213 49.55 20.97 0.80
19 3909 99.43 41.75 1.43

Cost of CollectCom Transaction

Parties UTxO (bytes) Tx size % max Mem % max CPU Min fee ₳
1 57 480 21.12 8.27 0.40
2 113 590 32.40 12.81 0.53
3 170 700 44.86 17.89 0.67
4 227 810 64.35 25.65 0.89
5 285 920 79.04 31.77 1.06

Cost of Close Transaction

Parties Tx size % max Mem % max CPU Min fee ₳
1 541 16.72 7.69 0.36
2 736 18.41 9.30 0.40
3 908 20.31 10.97 0.43
5 1193 23.35 13.83 0.49
10 2174 32.13 21.95 0.66
50 8556 95.39 81.51 1.89

Cost of Contest Transaction

Parties Tx size % max Mem % max CPU Min fee ₳
1 573 20.27 8.97 0.40
2 709 21.81 10.34 0.43
3 951 24.19 12.38 0.48
5 1324 28.24 15.83 0.55
10 2191 37.55 23.96 0.72
43 7452 97.88 76.04 1.82

Cost of Abort Transaction

Some variation because of random mixture of still initial and already committed outputs.

Parties Tx size % max Mem % max CPU Min fee ₳
1 4334 18.98 8.17 0.55
2 4491 31.83 13.88 0.71
3 4639 48.09 21.07 0.89
4 4864 65.85 29.03 1.11
5 4990 87.15 38.46 1.35

Cost of FanOut Transaction

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 ₳
5 0 0 4205 8.13 3.41 0.43
5 1 57 4239 9.15 4.08 0.44
5 5 284 4374 14.40 7.27 0.51
5 10 570 4545 20.55 11.08 0.60
5 20 1138 4884 32.72 18.65 0.76
5 30 1708 5225 44.82 26.20 0.93
5 40 2273 5560 57.33 33.92 1.10
5 50 2849 5906 69.56 41.52 1.27
5 74 4210 6716 99.01 59.81 1.68

End-To-End Benchmark Results

This page is intended to collect the latest end-to-end benchmarks results produced by Hydra's Continuous Integration system from the latest master code.

Please take those results with a grain of salt as they are currently produced from very limited cloud VMs and not controlled hardware. Instead of focusing on the absolute results, the emphasis should be on relative results, eg. how the timings for a scenario evolve as the code changes.

Generated at 2023-12-12 18:01:43.931398415 UTC

Baseline Scenario

Number of nodes 3
Number of txs 9000
Avg. Confirmation Time (ms) 23.516300517
P99 115.63078501000001ms
P95 32.67969244999999ms
P50 20.593002ms
Number of Invalid txs 0

Baseline Scenario

Number of nodes 1
Number of txs 3000
Avg. Confirmation Time (ms) 4.452366892
P99 7.470860289999989ms
P95 5.703240549999996ms
P50 4.287992ms
Number of Invalid txs 0

@ch1bo ch1bo requested review from locallycompact and a team December 11, 2023 10:40
hydra-tui/src/Hydra/TUI/Forms.hs Outdated Show resolved Hide resolved
@@ -135,15 +136,35 @@ handleVtyEventsInitializingScreen cardanoClient hydraClient e = do
id .= InitializingHome
_ -> pure ()
zoom commitMenuL $ handleFormEvent (VtyEvent e)
ConfirmingAbort i -> do
case e of
EvKey KEsc [] -> id .= InitializingHome
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

id .= is always confusing me.. why not simply put?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

agree, but it is to keep it consistent with the rest.

do you want to include this refactor as part of this PR?

Copy link

github-actions bot commented Dec 12, 2023

Test Results

377 tests  ±0   372 ✔️ ±0   22m 10s ⏱️ +8s
128 suites ±0       5 💤 ±0 
    5 files   ±0       0 ±0 

Results for commit 20f7b3c. ± Comparison against base commit 6ba4954.

♻️ This comment has been updated with latest results.

@ffakenz ffakenz merged commit e46318f into master Dec 13, 2023
21 checks passed
@ffakenz ffakenz deleted the enhance-ux-confirm-action branch December 13, 2023 09:55
@ch1bo ch1bo added this to the 0.15.0 milestone Dec 22, 2023
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.

4 participants