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

Feat/peer info forkid #396

Merged
merged 3 commits into from
Jul 7, 2021
Merged

Feat/peer info forkid #396

merged 3 commits into from
Jul 7, 2021

Conversation

meowsbits
Copy link
Contributor

Installs a forkId value returned under PeerInfo via the admin API (ie. admin_peers).

The forkId value is only included when the peer has an eth protocol version of eth/64 or greater.

eg.

{
  "enr": "enr:-J24QaWZmRB53gMDDrpTINl-3SMWtaPY-X0WFPgg2mDNtyAeVAgJlZg15PfpyaxaiAg6I2jW678ADXDKv0JHV5Z57lQKg2V0aMfGhPA-VOeAgmlkgnY0gmlwhDMPKROJc2VjcDI1NmsxoQOTsSODx0w5tnr6maf_RM4lD-lClfofwIdGXMT-LQszuYRzbmFwwIN0Y3CCdl-DdWRwgnZf", 
  "enode": "enode://9cb12383c74c39b67afa99a7ff44ce250fe94295fa1fc087465cc4fe2d0b33b91a8d8cabe03b250104a9096aa0e06bcde5f95665a5bd9f890edd2ab33e16ae47@55.15.41.19:30303", 
  "id": "f8e8f899c0e6e08ed1580fba2f36c658af44f7a2823dcc520bd17a38cc24fdcf", 
  "name": "CoreGeth/v1.12.0-rc2/linux-amd64/go1.16.4", 
  "caps": ["eth/65", "eth/66", "snap/1"], 
  "network": {
    "localAddress": "11.19.0.26:37522", 
    "remoteAddress": "55.15.41.19:30303", 
    "inbound": false, 
    "trusted": false, 
    "static": false
  }, 
  "protocols": {
    "eth": {
      "version": 66, 
      "difficulty": 6533294, 
      "head": "0x9cf875a63ecef682f08c9b3a6d56b045cb5a42e5c74ec224fc34dd1d6fb21d25", 
      "forkId": {
        "next": 0, 
        "hash": "f03e54e7"
      }
    }, 
    "snap": {
      "version": 1
    }
  }
}

meowsbits added 2 commits July 1, 2021 17:05
Date: 2021-07-01 17:05:14-05:00
Signed-off-by: meows <[email protected]>
ForkID is returned if the peers uses an eth/
protocol level of 64+.

Date: 2021-07-01 17:18:01-05:00
Signed-off-by: meows <[email protected]>
Date: 2021-07-01 17:29:57-05:00
Signed-off-by: meows <[email protected]>
Copy link
Member

@ziogaschr ziogaschr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM and a nice addition

@meowsbits meowsbits merged commit 77fa002 into master Jul 7, 2021
@meowsbits meowsbits deleted the feat/peer-info-forkid branch July 7, 2021 16:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants