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

network from fork version #102

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open

network from fork version #102

wants to merge 6 commits into from

Conversation

y0sher
Copy link

@y0sher y0sher commented Oct 31, 2023

Description

The eth2-key-manager package provides networks functionality to our other packages as a library, one of the functions we provide is NetworkFromString that can read a string like "mainnet" and return a struct that has functions with genesistime and other params related to the network.

Another way to identify a network is using the 4 bytes of genesis fork version, it is mostly recommended to use this in network messages to minimize message size. Though we don't have a way to revert back to the network from the 4 bytes in the package. This means we have to implement a list of networks in our packages so we can convert it back.

The problem with this is that it will require a change everytime a network is added like just happened with holesky. if we support this functionality in e2m, every other package could just use the functions and make the changes seamless and require only a change to e2m.

Changes

  • Added NetworkFromGenesisForkVersion
  • Added a list of available networks Networks. - another optional way to not hardcode anything by iterating the available networks.

side note

this pr has quite a few prs because I did it using github.dev experimenting with it for the first time :)

Base automatically changed from holesky-support to master November 7, 2023 11:49
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.

None yet

2 participants