Skip to content

network from fork version#102

Open
y0sher wants to merge 6 commits intomainfrom
feat/net_from_fork
Open

network from fork version#102
y0sher wants to merge 6 commits intomainfrom
feat/net_from_fork

Conversation

@y0sher
Copy link
Copy Markdown
Contributor

@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.

1 participant