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

Separate deterministic generation of accounts and genesis definition #409

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

picojulien
Copy link
Contributor

For resilience testnet, the structure of the yaml file makes it necessary to activate the generation of deterministic data to declare bakers name and their dispatching amongst pod.
We then rewrite the wallet with a yes-wallet, who's keys are twisted for yes-crypto, that allows to bake "in the name of mainnet bakers" with patched nodes.
However we don't want to generate data for genesis as we are using a mainnet context.

This MR allows to split the SHOULD_GENERATE_UNSAFE_DETERMINISTIC_DATA into tow option that control which of accounts or genesis have to be generated.

Copy link
Contributor

@nicolasochem nicolasochem left a comment

Choose a reason for hiding this comment

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

I understand you are using the deterministic account generation to give good names to your accounts, but you then rewrite the wallets with yes wallets (how do you do that btw?)

I suppose that your mainnet replica yaml does not have a genesis block?

But rather mainnet config like:

node_config_network:
  chain_name: mainnet

In this case, it may be better to modify fill_in_missing_genesis_block to do nothing if node_config_network is like above?

@picojulien
Copy link
Contributor Author

I understand you are using the deterministic account generation to give good names to your accounts, but you then rewrite the wallets with yes wallets (how do you do that btw?)

Yes.
The yes-wallet is embeded in the docker image we are using, and we patched charts/tezos/scripts/tezos-node.sh to place it at the proper place/

I suppose that your mainnet replica yaml does not have a genesis block?

But rather mainnet config like:

node_config_network:
  chain_name: mainnet

In this case, it may be better to modify fill_in_missing_genesis_block to do nothing if node_config_network is like above?

Now that I understand a bit better this aprt of the code, I think that what I want is to have a do_not_verify_bakers_account option that would prevent the config_generator to check if aliases of baker accounts have been declared in the account list.

My yaml file looks like this

nodes:
 ...
    instances:
    - bake_using_accounts:
      - baker_0
      is_bootstrap_node: true
    - bake_using_accounts:
      - baker_1
      is_bootstrap_node: true
    - bake_using_accounts:
      - baker_2
      is_bootstrap_node: true

The file has no accounts section, and baker_0 is an alias in the yes wallet.
I'll try to do this.

@elric1
Copy link
Contributor

elric1 commented Apr 25, 2022

It's probably easier to just elide the account names entirely by doing this:

nodes:
  eu:
    instances:
      - is_bootstrap_node: true
      - is_bootstrap_node: true
      - {}
      - {}
      - {}

The above will make 5 nodes the first two of which are bootstrap nodes, the next three of which aren't. The account names will be the node name: eu-N where N \elem {0,1,2,3,4}.
You shouldn't have to separate the generation of account keys and the genesis block because the code should only generate what is actually missing. If you don't want it to be generated, then provide it.

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.

3 participants