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

support for multiple bakers #74

Merged
merged 9 commits into from
Jan 21, 2021

Conversation

nicolasochem
Copy link
Collaborator

Previously we used to create 4 accounts always. We simplify by
creating just one account per baker. As a consequence, all blocks
are baked on priority zero from the beginning.

We add a new parameter to mkchain --number-of-bakers, defaults to

  1. If we pass a higher number n, it will create n bakers and n nodes
    baking for each baker.

Bakers and nodes can be mapped using values.yaml: specify which node
bakes for which address. This requires jq which requires a custom
baking container. This also allowed me to remove helm hacks.

We make a few assumptions for now:

  • every baking node is also a bootstrap node
  • the first baker's address is also the chain activator

I tested in non-zerotier mode and zerotier mode with one create
namespace and one invite namespace in the same minikube cluster; it
works, but required me to remove the hard-coded nodePort for p2p.

Previously we used to create 4 accounts always. We simplify by
creating just one account per baker. As a consequence, all blocks
are baked on priority zero from the beginning.

We add a new parameter to mkchain `--number-of-bakers`, defaults to
1. If we pass a higher number n, it will create n bakers and n nodes
baking for each baker.

Bakers and nodes can be mapped using values.yaml: specify which node
bakes for which address. This requires jq which requires a custom
baking container. This also allowed me to remove helm hacks.

We make a few assumptions for now:
* every baking node is also a bootstrap node
* the first baker's address is also the chain activator

I tested in non-zerotier mode and zerotier mode with one create
namespace and one invite namespace in the same minikube cluster; it
works, but required me to remove the hard-coded nodePort for p2p.
@@ -39,15 +39,15 @@ def main():
if CHAIN_PARAMS["zerotier_in_use"]:
with open("/var/tezos/zerotier_data.json", "r") as f:
net_addr = json.load(f)[0]["assignedAddresses"][0].split("/")[0]
if bootstrap_peers == [] and "bootstrap" not in socket.gethostname():
if bootstrap_peers == []:
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is the logic here now that we want all bootstrap peers to know about each other? We should probably filter out the node's own ip like we talked about.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Done in nicolasochem#1 that I will submit next as a PR.

)
exit(1)

bootstrap_accounts = [f"baker{n}" for n in range(args.number_of_bakers)]
Copy link
Collaborator

@harryttd harryttd Jan 21, 2021

Choose a reason for hiding this comment

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

confirming: for now bootstrap accounts == bakers but we are going to change that?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yes, it's changed in this branch: nicolasochem#1

@nicolasochem nicolasochem merged commit cfd9a34 into oxheadalpha:master Jan 21, 2021
@brandisimus brandisimus linked an issue Jan 26, 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.

--number-of-bakers
2 participants