ethnode: Handle new PeerInfo[].{ID,Enode} fields in Geth - #59
Merged
Conversation
ryanschneider
approved these changes
Jul 11, 2019
ryanschneider
left a comment
Collaborator
There was a problem hiding this comment.
lgtm, minor suggestion for a test case below
| } | ||
| }, { | ||
| "id": "foo" | ||
| }]`), |
Collaborator
There was a problem hiding this comment.
Minor: you might want to add a test case for the "no IP" enode URLs that geth sometimes (still?) returns when it can't determine a nodes IP, for example seen in ethereum/go-ethereum#2765 :
enode://7134088f7cd3a546e593af7a1cad4e6a6db4ef40bc6240e9f6decad72a1424d9d5d6296a1eca411eedd8113dc609ce05ec0bb3ad23f2ec791c093cfc02f9f398@[::]:30303
The code looks to handle them fine as-is but would be good to have coverage in case they a) start showing up in the wild or b) the EnodeID() method changes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Geth decided to break the PeerInfo layout by replacing the ID field with a hash of the EnodeID (which is the pubkey).
The new EnodeID is retrievable from the new Enode field which has the full enode string.
Fixes #58