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

p2p/enode: improve IPv6 support, add ENR text representation #19663

merged 6 commits into from Jun 7, 2019


None yet
3 participants
Copy link

commented Jun 4, 2019

This PR adapts p2p/enr and p2p/enode to the final version of EIP-778 (ethereum/EIPs#2097). It also changes all invocations of enode.ParseV4 to enode.Parse, allowing signed ENRs to be set as bootnodes and static peers.

@fjl fjl requested review from gballet, rjl493456442 and zsfelfoldi as code owners Jun 4, 2019

fjl added some commits Jun 3, 2019

p2p/enr: add entries for for IPv4/IPv6 separation
This adds entry types for "ip6", "udp6", "tcp6" keys. The IP type stays
around because removing it would break a lot of code and force everyone
to care about the distinction.

I also added a Signature method for completeness' sake.

@fjl fjl force-pushed the fjl:enr-update-2 branch from e9d27ca to 5918b52 Jun 5, 2019

@fjl fjl added this to the 1.9.0 milestone Jun 5, 2019

fjl added some commits Jun 4, 2019

p2p/enode: track IPv4 and IPv6 address separately
LocalNode predicts the local node's UDP endpoint and updates the record.
This change makes it predict IPv4 and IPv6 endpoints separately since
they can now be in the record at the same time.
all: switch to enode.Parse(...)
This allows passing base64-encoded node records to all the places that
previously accepted enode:// URLs. The URL format is still supported.
cmd/bootnode, p2p: log node URL instead of ENR
...and return the base64 record in NodeInfo.

@fjl fjl force-pushed the fjl:enr-update-2 branch from 5918b52 to 0324ece Jun 5, 2019


gballet approved these changes Jun 6, 2019

Copy link

left a comment

Tested the Whisper stuff with IPV4, works fine.

@@ -747,9 +747,9 @@ func requestExpiredMessagesLoop() {

func extractIDFromEnode(s string) []byte {
n, err := enode.ParseV4(s)

This comment has been minimized.

Copy link

gballet Jun 6, 2019


Quick reminder to also change the NodeInfo().Enode on line 302

Copy link

left a comment

LGTM + tests pass on Windows

@fjl fjl merged commit e83c3cc into ethereum:master Jun 7, 2019

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.