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

Minor changes in direct chain #666

Merged
merged 3 commits into from
Jan 9, 2023

Conversation

ghost
Copy link

@ghost ghost commented Jan 5, 2023

This PR introduces 2 minor changes I found useful when implementing a multi-headed node:

  1. Create the TinyWallet instance used by Direct chain component outside of the call to withDirectChain which allows the wallet to be shared by all instances of Direct and paves the way for an external wallet (Commit from external wallet #215)
  2. Allow following the chain from genesis by passing --start-chain-from 0 at startup time to the node. This useful when catching up a Hydra node esp. on testnets.

To check before merging:

  • CHANGELOG is up to date
  • Up to date with master

@ghost ghost requested review from ch1bo and ffakenz January 5, 2023 08:29
@github-actions
Copy link

github-actions bot commented Jan 5, 2023

Test Results

270 tests   - 10   264 ✔️  - 10   13m 41s ⏱️ -21s
  92 suites  -   4       6 💤 ±  0 
    4 files    -   1       0 ±  0 

Results for commit da40813. ± Comparison against base commit 42a5048.

This pull request removes 11 and adds 1 tests. Note that renamed tests count towards both.
Hydra.TUI.Options ‑ parses --cardano-signing-key option
Hydra.TUI.Options ‑ parses --connect option
Hydra.TUI.Options ‑ parses --network-id option
Hydra.TUI.Options ‑ parses --node-socket option
Hydra.TUI/end-to-end smoke tests ‑ display feedback long enough
Hydra.TUI/end-to-end smoke tests ‑ doesn't allow multiple initializations
Hydra.TUI/end-to-end smoke tests ‑ starts & renders
Hydra.TUI/end-to-end smoke tests ‑ supports the full Head life cycle
Hydra.TUI/end-to-end smoke tests ‑ supports the init & abort Head life cycle
Hydra.TUI/text rendering errors ‑ should show not enough fuel message and suggestion
…
Hydra.Options/Hydra Node RunOptions ‑ parses --start-chain-from 0 as starting from genesis

♻️ This comment has been updated with latest results.

@github-actions
Copy link

github-actions bot commented Jan 5, 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-01-09 11:11:07.661216411 UTC
Max. memory units 14000000
Max. CPU units 10000000000
Max. tx size (kB) 16384

Cost of Init Transaction

Parties Tx size % max Mem % max CPU Min fee ₳
1 4832 11.08 4.40 0.48
2 5041 11.17 4.38 0.49
3 5242 16.21 6.41 0.56
5 5652 19.27 7.56 0.61
10 6676 26.97 10.47 0.74
46 14059 99.89 38.61 1.85

Cost of Commit Transaction

Currently only one UTxO per commit allowed (this is about to change soon)

UTxO Tx size % max Mem % max CPU Min fee ₳
1 576 20.54 8.33 0.40

Cost of CollectCom Transaction

Parties Tx size % max Mem % max CPU Min fee ₳
1 13306 20.77 8.32 0.96
2 13700 37.32 15.12 1.16
3 13915 53.97 22.02 1.36
4 14272 75.90 31.15 1.62

Cost of Close Transaction

Parties Tx size % max Mem % max CPU Min fee ₳
1 9581 8.36 3.42 0.66
2 9746 9.14 3.88 0.68
3 9911 9.92 4.33 0.70
5 10271 11.92 5.40 0.74
10 11140 16.39 7.88 0.83
30 14473 32.61 17.15 1.17
65 15959 38.95 14.74 1.27

Cost of Contest Transaction

Parties Tx size % max Mem % max CPU Min fee ₳
1 9568 8.17 3.34 0.66
2 9741 8.94 3.79 0.68
3 9975 10.56 4.57 0.71
5 10270 11.72 5.32 0.74
10 11099 15.81 7.65 0.82
30 14467 32.42 17.07 1.17
41 16249 40.55 21.86 1.35

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 13742 22.51 9.35 1.00
2 14137 39.29 16.78 1.21
3 14388 58.64 25.61 1.44
4 14712 83.56 37.33 1.74

Cost of FanOut Transaction

Involves spending head output and burning head tokens. Uses ada-only UTxO for better comparability.

UTxO Tx size % max Mem % max CPU Min fee ₳
1 13664 10.18 4.43 0.87
2 13703 11.40 5.19 0.88
3 13734 12.92 6.07 0.90
5 13806 16.26 7.95 0.95
10 13991 23.87 12.35 1.05
50 15427 84.50 47.45 1.85
60 15781 99.75 56.26 2.06

Copy link
Collaborator

@ch1bo ch1bo left a comment

Choose a reason for hiding this comment

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

LGTM. I do not see how this is anyhow related to external commits, but okay 🤷

@ghost
Copy link
Author

ghost commented Jan 5, 2023

You somehow need an independent wallet to do that. Of course, you could have both an internal and an external wallet but it seemed to me separating the lifecycles of chain component from the wallet made sense.

@ch1bo ch1bo force-pushed the abailly-iohk/fix-wallet-logs branch from 85fc0a0 to d0ecf6e Compare January 9, 2023 08:53
@pgrange pgrange assigned ghost Jan 9, 2023
Base automatically changed from abailly-iohk/fix-wallet-logs to master January 9, 2023 10:53
This is needed for the case of have  a single shared wallet and set of
keys with multiple (virtual) nodes. Each node observes and posts tx
directly to the chain independently but they share a single wallet
which simplifies key handling and fuel creation.
@ch1bo ch1bo force-pushed the abailly-iohk/minor-changes-in-direct-chain branch from 711574a to da40813 Compare January 9, 2023 11:01
@ch1bo ch1bo merged commit e60cbcd into master Jan 9, 2023
@ch1bo ch1bo deleted the abailly-iohk/minor-changes-in-direct-chain branch January 9, 2023 11:27
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.

2 participants