Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
The
eth2-key-manager
package provides networks functionality to our other packages as a library, one of the functions we provide isNetworkFromString
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
NetworkFromGenesisForkVersion
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 :)