Conversation
|
Thanks for lightning fast work! To follow the original 3SF-mini impl strictly it would be this I think (initializing |
|
Thanks @pk910 for your work! @unnawut I agree with your comment. Here's some additional information we need to understand the genesis generation of 3SF-mini (and also I expect there's few inconsistency with current beacon tooling):
At this moment, Ream strictly follows both assumption (Genesis generation / Slot calculation), but I'm keen to fix it if it is needed. |
|
thanks a lot for your reviews :) |
|
Would it be fine to put a network field like the el/cl configs?, so we could be "devnet0" or just "dev" if we want to run a local instance without P2P? I need to ask @syjn99 if we are keeping the local thing |
|
Something like this? |
|
@pk910 would it be possible to export the lean consensis config in YAML? as it would be nice to stay consistent with the beacon chain in that regard |
|
the lean config is an input of this tool. there is currently an empty default config used, but that's just a placeholder for the unspecified config format :D |
That would be nice
I need to check with @syjn99 and @unnawut but they added a 1 node devnet, I am not sure if they are planning to keep it or not, but if they are it would be nice to just distinguish it via a config_name |
Oh, yeah it is fine if it isn't add lean stuff isn't added toethereum-genesis-generator yet . I just assumed that we are defining the config format here myb. |
|
Looks like the ephemery mode @syjn99 added was just for early testing and we will be removing it, so nvm |
| ) | ||
|
|
||
| func runLeanchain(_ context.Context, cmd *cli.Command) error { //nolint:gocyclo // ignore | ||
| eth1Config := cmd.String(eth1ConfigFlag.Name) |
| func runLeanchain(_ context.Context, cmd *cli.Command) error { //nolint:gocyclo // ignore | ||
| eth1Config := cmd.String(eth1ConfigFlag.Name) | ||
| eth2Config := cmd.String(configFlag.Name) | ||
| massValidatorsFile := cmd.String(massValidatorsFileFlag.Name) |
There was a problem hiding this comment.
there is no validators in state yet in devent0 as its without real signatures, but will come back on it if we want to add validators array still in state
|
I've extended the validators input format and added a enr generator. shuffle: roundrobin
validators:
- name: "ream_0"
enr: "enr:-IS4QHCYrYZbAKWCBRlAy5zzaDZXJBGkcnh4MHcBFZntXNFrdvJjX04jRzjzCBOonrkTfj499SZuOh8R33Ls8RRcy5wBgmlkgnY0gmlwhH8AAAGJc2VjcDI1NmsxoQPKY0yuDUmstAHYpMa2_oxVtw0RW_QAdpzBQA8yWM0xOIN1ZHCCdl8"
count: 3 # number of indices for this node
- name: "zeam_0"
privkey: "a94f5374fce5edbc8e2a8697c15331677e6ebf0b906c5aa9515b9c5cb11b1e0f"
enrFields:
ip: "172.20.0.100"
tcp: 9000
quic: 9001
seq: 1
whatever: "0x01000000"
count: 3
- name: "quadrivium_0"
privkey: "c2bbdac5e876b3e9d4b8b6b8c2bbdac5e876b3e9d4b8b6b8c2bbdac5e876b3e9"
enrFields:
ip6: "2001:db8:85a3::8a2e:370:7334"
tcp: 30303
udp: 30303
quic: 8080
seq: 1
count: 3the tool also takes a config.yaml similar to the beaconchain config.yaml format: # Genesis Settings
GENESIS_TIME: 1704085200
# Validator Settings
VALIDATOR_COUNT: 0 # This will be updatedthe tool can be run with this command: mkdir genesis
./bin/eth-genesis-state-generator leanchain --config config.yaml --mass-validators validator-config.yaml --json-output genesis/state.json --state-output genesis/state.ssz --config-output genesis/config.yaml --nodes-output genesis/nodes.yaml --validators-output genesis/validators.yamlthis will generate these output files: # config.yaml
# Genesis Settings
GENESIS_TIME: 1704085200
# Validator Settings
VALIDATOR_COUNT: 9# nodes.yaml
- enr:-IS4QHCYrYZbAKWCBRlAy5zzaDZXJBGkcnh4MHcBFZntXNFrdvJjX04jRzjzCBOonrkTfj499SZuOh8R33Ls8RRcy5wBgmlkgnY0gmlwhH8AAAGJc2VjcDI1NmsxoQPKY0yuDUmstAHYpMa2_oxVtw0RW_QAdpzBQA8yWM0xOIN1ZHCCdl8
- enr:-Jq4QLr_Fk_QGFra0TebsQCGJ8cq1c4ohik7TC0huKTiMSvQTSBSQLYKUoAQzwLHxbf71JQU8KnmgkHvFJAFn6myxMEBgmlkgnY0gmlwhKwUAGSEcXVpY4IjKYlzZWNwMjU2azGhA2hqUIfSG58w4lGPMiPp9llh1pjFuoSRUuoHmwNdHELwg3RjcIIjKIh3aGF0ZXZlcoQBAAAA
- enr:-KC4QD-aISxtgctnjeVxgrF5Qp-k2zvyMl5wI6bfzT1rGj3xd3y-AT9F6CmI3267KfBv2JpMPnR8J71At0hK8P2t_z8BgmlkgnY0g2lwNpAgAQ24haMAAAAAii4DcHM0hHF1aWOCH5CJc2VjcDI1NmsxoQOzU8YHzphhNhEGuB4bF8RTnh3Uy2CHNjBAXM8ppvSFDYN0Y3CCdl-DdWRwgnZf# validators.yaml
quadrivium_0:
- 2
- 5
- 8
ream_0:
- 0
- 3
- 6
zeam_0:
- 1
- 4
- 7 |
|
this looks fairly complete to me, will give a deeper look |
|
@pk910 This seems nice, Ream will also prepare for those outputs. |
|
There is now a docker image for this branch too: you can run it like this: mkdir -p genesis
docker run --rm -v .:/data -it ethpandaops/eth-beacon-genesis:pk910-leanchain leanchain \
--config /data/config.yaml \
--mass-validators /data/validator-config.yaml \
--state-output /data/genesis/genesis.ssz \
--json-output /data/genesis/genesis.json \
--nodes-output /data/genesis/nodes.yaml \
--validators-output /data/genesis/validators.yaml \
--config-output /data/genesis/config.yamlthis needs a config.yaml & validator-config.yaml as described in the comment above and outputs the same files as described above. |
|
I want to know what is the purpose of this file and how to consume it in the client. # validators.yaml
quadrivium_0:
- 2
- 5
- 8
ream_0:
- 0
- 3
- 6
zeam_0:
- 1
- 4
- 7 |
|
this looks fairly complete to me, will give a deeper look
explained in the team conversation |
@pk910 @unnawut @syjn99 @KolbyML @g11tech I saw the ENR in the example files for Ream and Quadrivium are not consistent with spec, since Zeam currently only support the format in the spec so that I got issues when testing. Is that just example error, Ream and Quadrivium will use the same format in the spec, right? |
|
Heya @GrapeBaBa, # validator-config.yaml
shuffle: roundrobin
validators:
- name: "ream_0"
privkey: "a94f5374fce5edbc8e2a8697c15331677e6ebf0b906c5aa9515b9c5cb11b1e12"
enrFields:
ip: "172.20.0.1"
quic: 8080
seq: 1
count: 3
- name: "zeam_0"
privkey: "a94f5374fce5edbc8e2a8697c15331677e6ebf0b906c5aa9515b9c5cb11b1e0f"
enrFields:
ip: "172.20.0.2"
quic: 8080
seq: 1
count: 3
- name: "quadrivium_0"
privkey: "c2bbdac5e876b3e9d4b8b6b8c2bbdac5e876b3e9d4b8b6b8c2bbdac5e876b3e9"
enrFields:
ip: "172.20.0.3"
quic: 8080
seq: 1
count: 3ENRs: - enr:-IW4QA0pljjdLfxS_EyUxNAxJSoGCwmOVNJauYWsTiYHyWG5Bky-7yCEktSvu_w-PWUrmzbc8vYL_Mx5pgsAix2OfOMBgmlkgnY0gmlwhKwUAAGEcXVpY4IfkIlzZWNwMjU2azGhA6mw8mfwe-3TpjMMSk7GHe3cURhOn9-ufyAqy40wEyui
- enr:-IW4QNx7F6OKXCmx9igmSwOAOdUEiQ9Et73HNygWV1BbuFgkXZLMslJVgpLYmKAzBF-AO0qJYq40TtqvtFkfeh2jzqYBgmlkgnY0gmlwhKwUAAKEcXVpY4IfkIlzZWNwMjU2azGhA2hqUIfSG58w4lGPMiPp9llh1pjFuoSRUuoHmwNdHELw
- enr:-IW4QOh370UNQipE8qYlVRK3MpT7I0hcOmrTgLO9agIxuPS2B485Se8LTQZ4Rhgo6eUuEXgMAa66Wt7lRYNHQo9zk8QBgmlkgnY0gmlwhKwUAAOEcXVpY4IfkIlzZWNwMjU2azGhA7NTxgfOmGE2EQa4HhsXxFOeHdTLYIc2MEBczymm9IUN |
|
@pk910 I found the |
|
@GrapeBaBa Creating this config.yaml manually upfront shouldn't be a big hassle. We can even automate the genesis time value with a simple bash script that sed-replaces the timestamp before calling this tool. |
Got it. |
This PR adds support for building leanchain genesis states for pq-devnet-0.
./bin/eth-genesis-state-generator leanchain --eth1-config ./genesis.json --config ./config.yaml --additional-validators ./validators.txt --json-output ./state.json --state-output ./state.sszmost of these parameters are currently not used, but will probably be needed to build proper states in future.
Genesis state currently looks as simple as this:
{ "config": { "num_validators": 3 }, "latest_justified": { "root": "0x0000000000000000000000000000000000000000000000000000000000000000", "slot": "0" }, "latest_finalized": { "root": "0x0000000000000000000000000000000000000000000000000000000000000000", "slot": "0" }, "historical_block_hashes": [], "justified_slots": [], "justifications_roots": [], "justifications_validators": [] }