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

Parse mainnet network flag #715

Merged
merged 34 commits into from
Mar 6, 2023
Merged

Parse mainnet network flag #715

merged 34 commits into from
Mar 6, 2023

Conversation

v0d1ch
Copy link
Contributor

@v0d1ch v0d1ch commented Feb 8, 2023

Why

In order to get mainnet ready I am doing this as the kickoff task - be able to actually connect hydra-node to the mainnet.

This PR:

  • Adds the option to parse command line argument for mainnet network in hydra-node and hydra-tui
  • Adds new flag HYDRAW-NETWORK that is either parsed as a testnet magic number or defaults to mainnet
  • Tackles a FIXME in the v_commit validator related to hardcoded network

To check before merging:

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

@v0d1ch v0d1ch self-assigned this Feb 8, 2023
@ch1bo
Copy link
Member

ch1bo commented Feb 8, 2023

I think this should be the last step on #713 and not merged light-heartedly without the right communication in place.

@v0d1ch
Copy link
Contributor Author

v0d1ch commented Feb 8, 2023

I think this should be the last step on #713 and not merged light-heartedly without the right communication in place.

I tried not to break backwards compatibility so hydra-node, tui, and hydraw should still function as is even with this merged.

@v0d1ch v0d1ch force-pushed the parse-mainnet-network-id branch from e59dbe3 to d09600e Compare February 8, 2023 13:26
@github-actions
Copy link

github-actions bot commented Feb 8, 2023

Test Results

294 tests  +13   288 ✔️ +13   19m 21s ⏱️ - 3m 14s
  98 suites +  4       6 💤 ±  0 
    5 files   +  1       0 ±  0 

Results for commit aa3022e. ± Comparison against base commit 2bb6a7b.

This pull request removes 2 and adds 15 tests. Note that renamed tests count towards both.
Hydra.Options/Hydra Node RunOptions ‑ parses --network-id option as a number
Hydra.Options/Hydra Node RunOptions/publish-scripts sub-command ‑ should parse with all options
Hydra.Options/Hydra Node RunOptions ‑ parses --mainnet option
Hydra.Options/Hydra Node RunOptions ‑ parses --testned-magic option as a number
Hydra.Options/Hydra Node RunOptions/publish-scripts sub-command ‑ should parse using mainnet and all options
Hydra.Options/Hydra Node RunOptions/publish-scripts sub-command ‑ should parse using testnet and all options
Hydra.TUI.Options ‑ parses --cardano-signing-key option
Hydra.TUI.Options ‑ parses --connect option
Hydra.TUI.Options ‑ parses --node-socket option
Hydra.TUI.Options ‑ parses --testnet-magic option
Hydra.TUI/end-to-end smoke tests ‑ display feedback long enough
Hydra.TUI/end-to-end smoke tests ‑ doesn't allow multiple initializations
…

♻️ This comment has been updated with latest results.

@github-actions
Copy link

github-actions bot commented Feb 8, 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-03-06 15:23:04.907160633 UTC
Max. memory units 14000000
Max. CPU units 10000000000
Max. tx size (kB) 16384

Script summary

Name Hash Size (Bytes)
μHead N/A 4458
νInitial 9492414f8f96e8483a0b8ee268fc06a954641cb2cbaa9a8b093c2c9b 4621
νCommit 5d3f107aaa56d06188cf231941cf8163e777236a9cfdc48fd4bbfa23 2422
νHead 82f16b51e2d81c6f4d42dd7398b4713a445464902f63dfd86ffe754e 8954

Cost of Init Transaction

Parties Tx size % max Mem % max CPU Min fee ₳
1 5055 13.20 5.19 0.52
2 5260 15.59 6.10 0.55
3 5466 20.81 8.17 0.62
5 5874 25.50 9.94 0.69
10 6899 35.49 13.65 0.84
35 12024 97.48 37.14 1.73

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 600 15.83 6.22 0.35

Cost of CollectCom Transaction

Parties UTxO (bytes) Tx size % max Mem % max CPU Min fee ₳
1 57 817 24.55 9.97 0.46
2 114 1138 40.58 16.60 0.65
3 171 1461 59.02 24.29 0.87
4 227 1783 80.18 33.13 1.12

Cost of Close Transaction

Parties Tx size % max Mem % max CPU Min fee ₳
1 647 16.99 7.31 0.37
2 804 18.77 8.23 0.40
3 804 18.07 7.91 0.39
5 1328 23.36 10.86 0.48
10 2166 30.15 14.64 0.59
50 8850 88.54 47.27 1.60

Cost of Contest Transaction

Parties Tx size % max Mem % max CPU Min fee ₳
1 702 22.70 9.66 0.43
2 883 23.90 10.34 0.46
3 1047 26.08 11.41 0.49
5 1370 29.04 12.99 0.54
10 2228 38.74 18.02 0.69
44 7895 98.15 49.05 1.64

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 5170 29.49 12.60 0.71
2 5497 48.08 20.77 0.93
3 5814 69.95 30.41 1.19
4 6211 97.40 42.54 1.52

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 5082 10.84 4.53 0.49
5 1 57 5117 12.37 5.41 0.51
5 5 285 5257 18.22 8.83 0.59
5 10 569 5441 25.85 13.24 0.69
5 20 1141 5795 41.61 22.25 0.90
5 30 1707 6153 56.62 30.96 1.10
5 40 2276 6515 72.14 39.89 1.31
5 50 2845 6874 87.16 48.61 1.51
5 58 3304 7166 99.39 55.67 1.67

@ch1bo
Copy link
Member

ch1bo commented Feb 9, 2023

It's not about backwards compatibility. It's about making sure that nobody tries this on mainnet and loose funds before we have not properly warned them from it. There are lots of good & important ideas in #713 which we have not even discussed yet.

Copy link
Member

@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.

We need to discuss #713 before merging this

hydra-node/src/Hydra/Options.hs Outdated Show resolved Hide resolved
hydra-node/src/Hydra/Options.hs Outdated Show resolved Hide resolved
hydra-plutus/src/Hydra/Contract/Commit.hs Outdated Show resolved Hide resolved
hydra-plutus/src/Hydra/Contract/Util.hs Outdated Show resolved Hide resolved
hydra-tui/src/Hydra/TUI/Options.hs Outdated Show resolved Hide resolved
hydraw/app/Main.hs Outdated Show resolved Hide resolved
@v0d1ch v0d1ch force-pushed the parse-mainnet-network-id branch 2 times, most recently from 8dbab10 to 78636e1 Compare February 10, 2023 11:32
@ch1bo ch1bo mentioned this pull request Feb 17, 2023
4 tasks
@v0d1ch v0d1ch force-pushed the parse-mainnet-network-id branch from 3697af6 to 394b12e Compare February 21, 2023 09:46
@pgrange pgrange added this to the Mainnet milestone Feb 21, 2023
@pgrange pgrange marked this pull request as draft February 21, 2023 13:34
@v0d1ch v0d1ch force-pushed the parse-mainnet-network-id branch 5 times, most recently from d763a23 to 043c8fc Compare March 2, 2023 16:15
@v0d1ch v0d1ch marked this pull request as ready for review March 2, 2023 16:27
Copy link
Member

@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.

Had a quick look and already spotted some inconsistencies. Will complete the review when these are addressed or you actually request the review :)

CHANGELOG.md Outdated Show resolved Hide resolved
CHANGELOG.md Show resolved Hide resolved
docs/docs/getting-started/quickstart.md Outdated Show resolved Hide resolved
hydra-cardano-api/src/Hydra/Cardano/Api/AddressInEra.hs Outdated Show resolved Hide resolved
hydra-node/test/Hydra/OptionsSpec.hs Outdated Show resolved Hide resolved
hydra-node/src/Hydra/Options.hs Outdated Show resolved Hide resolved
hydra-node/src/Hydra/Options.hs Outdated Show resolved Hide resolved
@ch1bo ch1bo force-pushed the parse-mainnet-network-id branch from c25f0cc to b86478f Compare March 3, 2023 07:16
@v0d1ch v0d1ch force-pushed the parse-mainnet-network-id branch from 62f1423 to a0e905d Compare March 3, 2023 08:41
hydraw/hydraw.cabal Outdated Show resolved Hide resolved
@v0d1ch v0d1ch requested review from ch1bo and ffakenz March 3, 2023 13:13
Copy link
Member

@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.

Some inconsistency within hydraw (not so important to block this PR, but ideally fixed)

Also, the Network type could be pushed further up.

BTW I was wrong with the breaking change on the scripts. The 0.9.0 scripts are actually mainnet compatible.

hydra-cardano-api/src/Hydra/Cardano/Api/TxOut.hs Outdated Show resolved Hide resolved
hydra-plutus/src/Hydra/Contract/Commit.hs Outdated Show resolved Hide resolved
hydraw/README.md Show resolved Hide resolved
hydraw/hydraw.cabal Show resolved Hide resolved
docs/docs/getting-started/quickstart.md Outdated Show resolved Hide resolved
@v0d1ch v0d1ch force-pushed the parse-mainnet-network-id branch from 927d7ad to aa3022e Compare March 6, 2023 15:12
@v0d1ch v0d1ch merged commit ad3dd93 into master Mar 6, 2023
@v0d1ch v0d1ch deleted the parse-mainnet-network-id branch March 6, 2023 15:34
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