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

ForkDigest command based on Slot #67

Open
tdahar opened this issue Nov 28, 2023 · 1 comment
Open

ForkDigest command based on Slot #67

tdahar opened this issue Nov 28, 2023 · 1 comment
Labels
good first issue Good for newcomers

Comments

@tdahar
Copy link
Collaborator

tdahar commented Nov 28, 2023

Motivation

The Ethereum Ecosystem is showing interest in the peers that are online in the distributed network. However, the peer-to-peer network is open to anyone to use it, so nodes running different chains could overlap. We use the ForkDigest to differentiate which chain a node follows: mainnet, prater, sepolia... Not only that, the ForkDigest is a result of computing the genesis of the chain with the current fork version, so we could even detect which fork the node is following.
See more details here:

Description

As ForkDigest is computed from the genesis root and the current fork version, it would be very nice to have a command to know which fork_digest represents a network (mainnet, goerli, sepolia...) in a specific fork version (Altair, Capella...). Armiarma already computes this for the current head of a given node, but it would be awesome to do this with past forks, in order to check if there are nodes in the network left behind in a previous fork.

For this, it would be nice to have a small command that could receive two parameters:

  • Beacon Node URL
  • Slot or Epoch

Then, the tool could request the Genesis and the fork version at the given slot, then output the fork_digest.
Example:
./eth-crawler fork_digest http://localhost:5052 2375711

The given slot is the last slot of the first epoch in Altair.

@cortze cortze added the good first issue Good for newcomers label Nov 28, 2023
@cortze
Copy link
Collaborator

cortze commented Nov 28, 2023

hey @tdahar , this is a really cool idea!
To give some context on the crawler, there is already this functionality that can request all the necessary info from a local beacon node to later compose the fork_digest.

func GetForkDigetsOfEth2Head(ctx context.Context, infCli *InfuraClient) (common.ForkDigest, error) {

So it seems to be a pretty straight forward implementation

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants