Skip to content

Conversation

@nflaig
Copy link
Member

@nflaig nflaig commented Sep 10, 2025

We are using the same port for IPv4 and IPv6 since ChainSafe/lodestar#8190 but binding to the same port in dual-stack mode doesn't actually work and discv5 just gets stuck trying to open sockets.

this promise never resolves

const [socket4, socket6] = await Promise.all([

and results in timeout of network worker on startup

consensus-1  | Sep-09 14:43:28.159[network]          info: libp2p worker started peer=<redacted>
consensus-1  | 2025-09-09T14:43:30.209Z discv5:service Starting discv5 service with node id <redacted>
consensus-1  | 2025-09-09T14:43:30.209Z discv5:sessionService Starting session service with node id <redacted>
consensus-1  |  ✖ Error: Timeout: Did not receive an init message from worker after 300000ms. Make sure the worker calls expose().
consensus-1  |     at Timeout._onTimeout (/usr/app/node_modules/@chainsafe/threads/dist/master/spawn.js:35:53)
consensus-1  |     at listOnTimeout (node:internal/timers:588:17)
consensus-1  |     at processTimers (node:internal/timers:523:7)

Setting ipv6Only to true restricts IPv6 sockets to only handle IPv6 traffic, allowing separate IPv4 and IPv6 sockets to bind to the same port number without conflict.

@nflaig nflaig requested a review from a team as a code owner September 10, 2025 18:53
@wemeetagain wemeetagain merged commit fe2e35e into master Sep 10, 2025
5 checks passed
@wemeetagain wemeetagain deleted the nflaig/dual-stack branch September 10, 2025 19:36
@github-actions github-actions bot mentioned this pull request Sep 10, 2025
nflaig pushed a commit to ChainSafe/lodestar that referenced this pull request Sep 10, 2025
**Motivation**

Users reported in the v1.34.0 release that changes in the release
created an issue when ipv6 and ipv4 ports were the same:

```
✖ Error: Timeout: Did not receive an init message from worker after 300000ms. Make sure the worker calls expose().
```

**Description**

This PR bumps discv5 from 11.0.3 to 11.0.4 which includes the fix to
binding ipv4 and ipv6 on the same port in dual stack mode.
See: ChainSafe/discv5#318
philknows added a commit to ChainSafe/lodestar that referenced this pull request Sep 10, 2025
**Motivation**

Users reported in the v1.34.0 release that changes in the release
created an issue when ipv6 and ipv4 ports were the same:

```
✖ Error: Timeout: Did not receive an init message from worker after 300000ms. Make sure the worker calls expose().
```

**Description**

This PR bumps discv5 from 11.0.3 to 11.0.4 which includes the fix to
binding ipv4 and ipv6 on the same port in dual stack mode.
See: ChainSafe/discv5#318
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.

3 participants