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

Add cli flag for custom network #336

Open
dapplion opened this issue Mar 10, 2023 · 4 comments
Open

Add cli flag for custom network #336

dapplion opened this issue Mar 10, 2023 · 4 comments

Comments

@dapplion
Copy link

dapplion commented Mar 10, 2023

Producing changes for a custom network requires changes to the source code.

The only data points this tool needs to know about a network to produce deposits and credential changes are:

  • genesis validators root
  • genesis fork version

Both are sufficiently succinct that could be pass as command line args, with some TBD serialization:

csv

--chain 0x41e7c2a77cbd4ecd1b238e7bbcc5e8570edf655b16861b69635d8a1b4fe4a3fd,0x00000000
  • Should be fine while most uses require the same list of values. Otherwise passing all values for all cases should be fine too.

json

--chain `{"genesis_validators_root": "0x41e7c2a77cbd4ecd1b238e7bbcc5e8570edf655b16861b69635d8a1b4fe4a3fd", "genesis_fork_version": "0x00000000"}`

yaml

--chain `{genesis_validators_root: "0x41e7c2a77cbd4ecd1b238e7bbcc5e8570edf655b16861b69635d8a1b4fe4a3fd", genesis_fork_version: "0x00000000"}`

yaml succinct

--chain `{vr: "0x41e7c2a77cbd4ecd1b238e7bbcc5e8570edf655b16861b69635d8a1b4fe4a3fd", fv: "0x00000000"}`
  • The succinct should be safe if full fork schedule in needed in the future. With a key pattern of afv, bfv, etc.

Allowing to just pass a CLI arg would make it very easy to add to guides as a copy paste command and allow to run any network for free without your maintenance.

@avenbreaks
Copy link

working on custom network?

@canximan
Copy link

Hi @dapplion, can you explain what is genesis_validators_root (or a document explain it).

I am working on a custom chain, pre-merge. But don't know how to generate this root.

Thank you.

@dapplion
Copy link
Author

@canximan sure genesis_validators_root is the root of the validators array at genesis time:

state.genesis_validators_root = hash_tree_root(state.validators)

Code for it here https://github.com/ethereum/consensus-specs/blob/dev/specs/phase0/beacon-chain.md#genesis

@canximan
Copy link

@canximan sure genesis_validators_root is the root of the validators array at genesis time:

state.genesis_validators_root = hash_tree_root(state.validators)

Code for it here https://github.com/ethereum/consensus-specs/blob/dev/specs/phase0/beacon-chain.md#genesis

Great, thank you very much.

So deposit before the merge will have the genesis_validators_root = zero hash.

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

No branches or pull requests

3 participants