Skip to content

ethnode: Handle new PeerInfo[].{ID,Enode} fields in Geth - #59

Merged
shazow merged 2 commits into
fix-pool-requesthostfrom
ethnode-new-id
Jul 11, 2019
Merged

ethnode: Handle new PeerInfo[].{ID,Enode} fields in Geth#59
shazow merged 2 commits into
fix-pool-requesthostfrom
ethnode-new-id

Conversation

@shazow

@shazow shazow commented Jul 11, 2019

Copy link
Copy Markdown
Member

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

@shazow
shazow requested a review from ryanschneider July 11, 2019 21:44

@ryanschneider ryanschneider left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

lgtm, minor suggestion for a test case below

Comment thread ethnode/geth_test.go Outdated
}
}, {
"id": "foo"
}]`),

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

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.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

@ryanschneider Good call, added!

@shazow
shazow merged commit f1a73ee into fix-pool-requesthost Jul 11, 2019
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.

2 participants