Skip to content

IPv6 By Default #6808

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

Merged
merged 6 commits into from
Feb 10, 2025
Merged

IPv6 By Default #6808

merged 6 commits into from
Feb 10, 2025

Conversation

AgeManning
Copy link
Member

@AgeManning AgeManning commented Jan 15, 2025

Description

This enables ipv4 and ipv6 by default in Lighthouse.

Motivation

IPv6 has been around for quite a few years now and most parts of the internet are supporting it. It is strange that a cutting-edge blockchain such as Ethereum doesn't support it natively. I've tested Lighthouse quite a bit and our recent upgrades should have no problem supporting IPv6. The problem is that we need a few more nodes on our DHT to also support IPv6 for some of the discovery mechanisms to function. So we need to bootstrap the network with a few IPv6 nodes and our original plan was to make lighthouse do this by default if the host system supports a globally routable IPV6 address.

What this PR does

If a user has specified a listening address of 0.0.0.0 and their node also has a globally routable IPv6 address (i.e their ISP and router is configured for IPv6, then we also listen on :: and go to dual stack mode. This also adds a CLI to disable this default behaviour --disable-ipv6.

Why I no longer like this approach

  • Security - If a user has opened their IPv6 firewall, and run lighthouse to listen on ipv4 0.0.0.0 they may not expect us to secretly also open :: and expose those ports when they have not specifically set it. I think if users are exposing ports on their computers they need to do it explicitly rather than us trying to force ipv6 on them.
  • Practicality - I think even if we do dual-stack by default, the majority of users who are behind a normal firewall, will still not see IPv6 traffic. They will need to manually intervene to allow IPv6 traffic through their firewall. If they are manually doing this, then they can just set --ip-address :: also to enable dual stack.

After some thought I think the best approach is just via education rather than code. We should make announcements and encourage users to support dual stack, rather than set it by default.

I'll leave this PR around in case others feel differently.

Also, this should not be merged until: sigp/discv5#275

Copy link
Member

@jxs jxs left a comment

Choose a reason for hiding this comment

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

Hi age! Left a comment

@AgeManning AgeManning added ready-for-review The code is ready for review and removed do-not-merge labels Feb 3, 2025
@AgeManning
Copy link
Member Author

Had a bit more of a think about this, now I'm back onboard for including this.

I changed the logic around the "listening by default".

Factors that changed my mind:

  • We now only listen on ipv6 by default if the user doesn't specify ANY listening address. This is more inline with what I've seen in the industry. Currently Lighthouse, will default to listen on Ipv4, so now, if the host has a globally routable ipv6 address, it will also listen on ipv6 ::.
  • The arguments I made about firewalls and users being unaware that it was listening on IPv6, equally apply to listening by default on IPv4. I think now, if anything we are being consistent across the IP versions.

Users are free to specify their listening address, this negates the need to enable/disable ipv4/6 as the user has full control. It is only in the case the user doesn't put any --listen-address CLI param, that we MAY now listen on IPv6.

@AgeManning AgeManning added the v6.0.2 Small patch release for Q1 2025 label Feb 3, 2025
@AgeManning AgeManning added v7.0.0-beta.0 New release c. Q1 2025 and removed v6.0.2 Small patch release for Q1 2025 labels Feb 6, 2025
michaelsproul added a commit that referenced this pull request Feb 7, 2025
Squashed commit of the following:

commit 66a9375
Author: Age Manning <Age@AgeManning.com>
Date:   Tue Feb 4 11:16:41 2025 +1100

    Fix CLI md

commit 7571d1a
Author: Age Manning <Age@AgeManning.com>
Date:   Tue Feb 4 11:12:00 2025 +1100

    Handle default CLI

commit 02ac4af
Author: Age Manning <Age@AgeManning.com>
Date:   Mon Feb 3 16:47:47 2025 +1100

    Appease cargo sort

commit e664fb8
Author: Age Manning <Age@AgeManning.com>
Date:   Mon Feb 3 16:41:02 2025 +1100

    Listen by default if user does not specify

commit d544829
Merge: 7ee6a71 a088b0b
Author: Age Manning <Age@AgeManning.com>
Date:   Mon Feb 3 16:22:28 2025 +1100

    Merge branch 'unstable' into ipv6-by-default

commit 7ee6a71
Author: Age Manning <Age@AgeManning.com>
Date:   Wed Jan 15 17:53:32 2025 +1100

    Ipv6 dual-stack by default
michaelsproul added a commit that referenced this pull request Feb 10, 2025
Squashed commit of the following:

commit 66a9375
Author: Age Manning <Age@AgeManning.com>
Date:   Tue Feb 4 11:16:41 2025 +1100

    Fix CLI md

commit 7571d1a
Author: Age Manning <Age@AgeManning.com>
Date:   Tue Feb 4 11:12:00 2025 +1100

    Handle default CLI

commit 02ac4af
Author: Age Manning <Age@AgeManning.com>
Date:   Mon Feb 3 16:47:47 2025 +1100

    Appease cargo sort

commit e664fb8
Author: Age Manning <Age@AgeManning.com>
Date:   Mon Feb 3 16:41:02 2025 +1100

    Listen by default if user does not specify

commit d544829
Merge: 7ee6a71 a088b0b
Author: Age Manning <Age@AgeManning.com>
Date:   Mon Feb 3 16:22:28 2025 +1100

    Merge branch 'unstable' into ipv6-by-default

commit 7ee6a71
Author: Age Manning <Age@AgeManning.com>
Date:   Wed Jan 15 17:53:32 2025 +1100

    Ipv6 dual-stack by default
@AgeManning
Copy link
Member Author

@Mergifyio queue

Copy link

mergify bot commented Feb 10, 2025

queue

✅ The pull request has been merged automatically

The pull request has been merged automatically at 62a0f25

@michaelsproul michaelsproul mentioned this pull request Feb 10, 2025
7 tasks
Copy link
Member

@michaelsproul michaelsproul left a comment

Choose a reason for hiding this comment

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

Stamp of approval to unblock merging. I haven't tested this, but the code change & concept seem sane.

@michaelsproul michaelsproul added ready-for-merge This PR is ready to merge. and removed ready-for-review The code is ready for review labels Feb 10, 2025
mergify bot added a commit that referenced this pull request Feb 10, 2025
@mergify mergify bot merged commit 62a0f25 into sigp:unstable Feb 10, 2025
32 checks passed
mergify bot pushed a commit that referenced this pull request Feb 13, 2025
New release for Electra on Holesky and Sepolia.

Includes PRs:

- #6808
- #6914
- #6949
- #6950
- #6958
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready-for-merge This PR is ready to merge. v7.0.0-beta.0 New release c. Q1 2025
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants