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

Public networks #117

Merged
merged 19 commits into from
Mar 2, 2021
Merged

Public networks #117

merged 19 commits into from
Mar 2, 2021

Conversation

nicolasochem
Copy link
Collaborator

@nicolasochem nicolasochem commented Feb 17, 2021

This introduces a third mode of operation. We previously had zerotier-in-use true/false.

Now we have public/private/isolated networks. Description is in README.

The main addition is the capability to run mainnet or a testnet on tezos-k8s, and sync quickly thanks to snapshots.

Add a new container to import snapshot. Make the assmption of a public network will run in rolling mode.

The config-generator container is now built on top of the tezos container. The reason is that we need to extract the network data from the binary to put it in the bootstrap_peers section. Entrypoint is now a shell script which calls the previous python entrypoint.

To test on edo2net, the master_328bc6c3_20210215194506 branch will work. Replace v8-release with this branch everywhere.

Then you need to submit network: edo2net in the values.yaml. We also add --network support to mkchain.

We switch the default protocol to edo2 because this is the one that runs in mainnet now.

Config-generator was previously using argparse to build config.json because it was originally part of mkchain. We replace it with a simple python object creation.

Black changed the formatting of some of Roland's crypto code for some reason.

If approved, I will be using "squash-and-merge" to merge.

* generate config is now much simpler, gets rid of argparse
* replace zerotier in use true/false with network_type public/private/isolated
@@ -138,7 +138,7 @@ spec:
fieldPath: metadata.name
- name: DAEMON
value: endorser
{{- if .Values.zerotier_in_use }}
{{- if eq .Values.chain_type "private" }}
Copy link
Collaborator

Choose a reason for hiding this comment

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

IMO we should make the chain_types constants somehow. This way it is explicit what are acceptable values. And also so that we don’t have to keep referencing strings everywhere which can very easily introduce bugs. (e.g. hashs/hashes)

We can maybe have 3 (maybe just 2) vals: is_private, is_isolated, is_public. We can prob just go with the first 2. If NOT private AND NOT isolated, then it must be public. These vals get set by mkchain or whatever.

Or we can keep the eq checks in Helm templates but set “private” as a string Helm value. so private: "private" and check based off of that constant.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I don't think we should have is_isolated and is_private because then they would not be mutually exclusive.

What do you recommend? Something like:

{{ $chain_type_private := "private }}
{{ $chain_type_isolated := "isolated" }}
{{ $chain_type_public := "public" }}

Then

{{- if eq .Values.chain_type $chain_type_private }}

?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Yes something like that although I don't think that exact thing will work. Those variables won't be global to all templates.

I think there are a couple of options:

  • Define global values: https://helm.sh/docs/chart_template_guide/subcharts_and_globals/#global-chart-values
  • Define helpers in a .tpl file in charts/tezos/templates. This will contain templates with something like this:
    {{ define "tezos.public_chain" }}
    {{- "public" -}}
    {{ end }}
    Then we can compare on including the template. I think there is a way to treat the template like a function where you can pass a context in and let it spit back out a value like true/false that we can then just if on.

Either way, probably not necessary for getting the F-beta net out the door.

Copy link
Collaborator

Choose a reason for hiding this comment

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

let's iterate on this in another PR

Done as part of config-generator. It is now using the tezos container as base.

remove identity generation - nodes does it

temporarily change tezos container version to master - will revert
change ordering of init containers again to make sure they all download snapshots
@nicolasochem nicolasochem marked this pull request as ready for review March 1, 2021 23:00
do not download snapshot for nodes in isolated chains
@harryttd harryttd merged commit 03edd3c into oxheadalpha:master Mar 2, 2021
@harryttd harryttd linked an issue Mar 16, 2021 that may be closed by this pull request
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.

Support for public nodes (mainnet/testnet)
2 participants