Skip to content
This repository has been archived by the owner on Aug 18, 2020. It is now read-only.

[release/1.3.1] [DEVOPS-398] Testnet config #3585

Merged
merged 6 commits into from
Sep 26, 2018

Conversation

rvl
Copy link
Contributor

@rvl rvl commented Sep 13, 2018

Description

This PR contains:

Linked issues

https://iohk.myjetbrains.com/youtrack/issue/DEVOPS-398
https://iohk.myjetbrains.com/youtrack/issue/CO-354
https://iohk.myjetbrains.com/youtrack/issue/CBR-414

QA Steps

nix-build -A demoClusterLaunchGenesis -o demo-cluster-launch-genesis.sh
./demo-cluster-launch-genesis.sh

Copy link
Contributor

@mhuesch mhuesch left a comment

Choose a reason for hiding this comment

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

I'm confused by one part, which I commented on with a "❓"

protocolMagic: 55550001
protocolMagic:
pm: 55550001
requiresNetworkMagic: NMMustBeNothing
Copy link
Contributor

Choose a reason for hiding this comment

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

👍 (assuming that "dev core" means this net will emulate mainnet/staging in development)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes I would like any dev clusters to work more like mainnet than testnet.

protocolMagic: 10000000 # arbitrary protocolMagic, to be overridden in actual configs
protocolMagic:
pm: 10000000 # arbitrary protocolMagic, to be overridden in actual configs
requiresNetworkMagic: NMMustBeNothing
Copy link
Contributor

Choose a reason for hiding this comment

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

👍 mainnet has NMMustBeNothing

avvmDistr: *mainnet_avvmDistr
protocolMagic:
pm: 1097911063
requiresNetworkMagic: NMMustBeJust
Copy link
Contributor

Choose a reason for hiding this comment

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

❓ I'm not sure why this is NMMustBeJust when the above mainnet config was NMMustBeNothing (but I'm also not very good and reading these config files)

Copy link
Contributor

Choose a reason for hiding this comment

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

Also wondering about this..

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks for ❓. This section describes the testnet genesis parameters. The << mainnet_... means to "inherit" config from the section labelled &mainnet_.... So my intention is to set up the testnet genesis data with most of the same parameters as mainnet, except overriding things such as protocolMagic.

Copy link
Contributor

Choose a reason for hiding this comment

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

Ah ok, that makes sense. Thanks for clarifying.

protocolMagic: 170987650
protocolMagic:
pm: 170987650
requiresNetworkMagic: NMMustBeNothing
Copy link
Contributor

Choose a reason for hiding this comment

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

@rvl rvl requested a review from dcoutts September 13, 2018 22:17
Copy link
Contributor

@dcoutts dcoutts left a comment

Choose a reason for hiding this comment

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

Looks correct, but...

I worry order of overriding here however, that it could lead to mistakes too easily. Here we have a mainnet setting for Nothing, and then the testnet inheriting mainnet and overriding it back to Just. This seems fragile. I'd prefer if we can arrange things so that we only ever override from the default of Just to the special value of Nothing, and do so only for the "leaf" configurations, not for anything else that gets inherited later.

Could we do that? Have nothing inherit from the mainnet config itself, so that the mainnet config is a leaf config. So for example instead of of putting the Nothing into mainnet_base, where it gets inherited by the testnets, put it into the mainnet config only (which I assume it a leaf config). Then the testnets would not need any special override.

Summary: can we follow the rule that we only use requiresNetworkMagic: NMMustBeNothing and not NMMustBeJust, and we only use it at "leaf" configurations, not configurations that are inherited from. I think this rule will make it much more explicit and harder to make silly mistakes.

@rvl
Copy link
Contributor Author

rvl commented Sep 17, 2018

Thanks @dcoutts . I have reset the mainnet_base genesis spec protocolMagic, so that there is no double-overriding of the setting. In addition, I made all of the testnet_launch genesis spec protocolConstants explicit and not inherited just to try and improve clarity.

@jmitchell
Copy link
Contributor

jmitchell commented Sep 17, 2018

We need to ensure any legacy clusters, like staging and mainnet, explicitly pass requiresNetworkMagic: NMMustBeNothing. Otherwise, they will default to NMMustBeJust, which is the new address behavior for testnet.

cc @mhuesch

@rvl rvl force-pushed the devops-398-testnet-config branch 2 times, most recently from c69ba4e to ab3f412 Compare September 26, 2018 01:47
@rvl rvl dismissed dcoutts’s stale review September 26, 2018 03:59

I have implemented your suggestions in #3659

@rvl rvl merged commit df2a489 into release/1.3.1 Sep 26, 2018
@rvl rvl deleted the devops-398-testnet-config branch September 26, 2018 04:00
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants