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

IPv6 not automatically detected or included in ENR #8670

Open
one-three-three-seven opened this issue Oct 2, 2024 · 3 comments
Open

IPv6 not automatically detected or included in ENR #8670

one-three-three-seven opened this issue Oct 2, 2024 · 3 comments

Comments

@one-three-three-seven
Copy link

Description

I'm testing the IPv6 implementations of all clients and noticed that Teku never updates the ENR with the IPv6 address.
General test results for all clients can be found at https://ipv6eth.info

Steps to Reproduce (Bug)

My idea was to find as many IPv6 peers as possible by increasing the peer limit. In the end I had about 3000 peers, but the ENR still did not include the IPv6 address. The node had ~13 IPv6 peers.

Relevant parameters:
teku --p2p-interface 0.0.0.0,:: --p2p-port 9000 --p2p-port-ipv6 9001 --p2p-peer-upper-bound 10000 ...
Both ports 9000/9001 are open, UDP/TCP each. The system has a global IPv6 address.

I'm using the /eth/v1/node/identity endpoint to fetch the current ENR.

{
  "data": {
    "discovery_addresses": [
      "/ip4/REDACTED/udp/9000/p2p/REDACTED"
    ],
    "enr": "REDACTED_ENR_WITHOUT_IPV6_ADDRESS",
    "metadata": {
      "attnets": "0x0000060000000000",
      "seq_number": "1",
      "syncnets": "0x00"
    },
    "p2p_addresses": [
      "/ip4/10.10.10.2/tcp/9000/p2p/REDACTED", <--- FYI: This is a local IP, not relevant for the node
      "/ip6/::/tcp/9001/p2p/REDACTED"
    ],
    "peer_id": "REDACTED"
  }
}

discovery_addresses does not include the IPv6.

Expected behavior:

Teku should detect the IPv6 address and include it in the ENR.

Actual behavior:

The ENR never includes the IPv6 address. While it can be set manually, this approach is ineffective for dynamic IPv6 addresses.

Frequency: Always

Versions

  • Software version: teku/v24.8.0/linux-x86_64/-eclipseadoptium-openjdk64bitservervm-java-21
  • Cloud VM, type, size: Dedicated Server, Static IPv4/IPv6
@StefanBratanov
Copy link
Contributor

Hi, can you please try also specifying --p2p-advertised-ip=127.0.0.1,::1 as per the docs. Probably should change the default to change if --p2p-interface has been configured with IPv4 and IPv6 address.

@one-three-three-seven
Copy link
Author

I've given it a try, but I don't think it's achieving what I want.

Now the endpoint /eth/v1/node/identity returns the following:

{
  "data": {
    "discovery_addresses": [
      "/ip4/127.0.0.1/udp/9000/p2p/REDACTED",
      "/ip6/::1/udp/9001/p2p/REDACTED"
    ],
    "enr": "REDACTED",
    "metadata": {
      "attnets": "0x0000060000000000",
      "seq_number": "1",
      "syncnets": "0x00"
    },
    "p2p_addresses": [
      "/ip4/127.0.0.1/tcp/9000/p2p/REDACTED",
      "/ip6/::1/tcp/9001/p2p/REDACTED"
    ],
    "peer_id": "REDACTED"
  }
}

What I want is for Teku to automatically detect the IP addresses and use them as follows:

{
  "data": {
    "discovery_addresses": [
      "/ip4/135.151.32.250/udp/9000/p2p/REDACTED",
      "/ip6/54b6:6e28:4636:3f40:c880:3f78:acaf:b0d4/udp/9001/p2p/REDACTED"
    ],
    "enr": "REDACTED",
    "metadata": {
      "attnets": "0x0000060000000000",
      "seq_number": "1",
      "syncnets": "0x00"
    },
    "p2p_addresses": [
      "/ip4/135.151.32.250/tcp/9000/p2p/REDACTED",
      "/ip6/54b6:6e28:4636:3f40:c880:3f78:acaf:b0d4/tcp/9001/p2p/REDACTED"
    ],
    "peer_id": "REDACTED"
  }
}

Teku is already able to do this automatically for IPv4 addresses, but not for IPv6 ones.

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

No branches or pull requests

2 participants