Fix libp2p and WebSocket IPv6 test timeouts with Node 24 and libsodium 0.8.0#1002
Draft
Fix libp2p and WebSocket IPv6 test timeouts with Node 24 and libsodium 0.8.0#1002
Conversation
- Add await sodium.ready in libp2pTransport.start() to ensure libsodium is initialized before starting libp2p - Increase WEBSOCKET_HANDSHAKE_TIMEOUT from 2500ms to 10000ms to tolerate slower handshakes Co-authored-by: victorhahncastell <3177019+victorhahncastell@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix libsodium initialization timing for libp2p and WebSocket tests
Fix libp2p and WebSocket IPv6 test timeouts with Node 24 and libsodium 0.8.0
Jan 10, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
After upgrading to Node 24 and libsodium 0.8.0, two IPv6 networking tests fail intermittently due to race conditions in libsodium initialization and tight WebSocket handshake timeouts.
Changes
libp2pTransport.ts: Await
sodium.readybefore starting libp2p to prevent crypto handshakes racing with libsodium initializationwebSocketConnection.ts: Increase
WEBSOCKET_HANDSHAKE_TIMEOUTfrom 2500ms to 10000ms to tolerate slower IPv6 and crypto initialization handshakesWarning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
bt1.archive.org/opt/hostedtoolcache/node/24.12.0/x64/bin/node /opt/hostedtoolcache/node/24.12.0/x64/bin/node --conditions node --conditions development --experimental-import-meta-resolve --require /home/REDACTED/work/verity/verity/node_modules/vitest/suppress-warnings.cjs /home/REDACTED/work/verity/verity/node_modules/vitest/dist/workers/forks.js(dns block)bt2.archive.org/opt/hostedtoolcache/node/24.12.0/x64/bin/node /opt/hostedtoolcache/node/24.12.0/x64/bin/node --conditions node --conditions development --experimental-import-meta-resolve --require /home/REDACTED/work/verity/verity/node_modules/vitest/suppress-warnings.cjs /home/REDACTED/work/verity/verity/node_modules/vitest/dist/workers/forks.js(dns block)global.stun.twilio.com/opt/hostedtoolcache/node/24.12.0/x64/bin/node /opt/hostedtoolcache/node/24.12.0/x64/bin/node --conditions node --conditions development --experimental-import-meta-resolve --require /home/REDACTED/work/verity/verity/node_modules/vitest/suppress-warnings.cjs /home/REDACTED/work/verity/verity/node_modules/vitest/dist/workers/forks.js(dns block)opentracker.i2p.rocks/opt/hostedtoolcache/node/24.12.0/x64/bin/node /opt/hostedtoolcache/node/24.12.0/x64/bin/node --conditions node --conditions development --experimental-import-meta-resolve --require /home/REDACTED/work/verity/verity/node_modules/vitest/suppress-warnings.cjs /home/REDACTED/work/verity/verity/node_modules/vitest/dist/workers/forks.js(dns block)retracker.lanta-net.ru/opt/hostedtoolcache/node/24.12.0/x64/bin/node /opt/hostedtoolcache/node/24.12.0/x64/bin/node --conditions node --conditions development --experimental-import-meta-resolve --require /home/REDACTED/work/verity/verity/node_modules/vitest/suppress-warnings.cjs /home/REDACTED/work/verity/verity/node_modules/vitest/dist/workers/forks.js(dns block)stun.l.google.com/opt/hostedtoolcache/node/24.12.0/x64/bin/node /opt/hostedtoolcache/node/24.12.0/x64/bin/node --conditions node --conditions development --experimental-import-meta-resolve --require /home/REDACTED/work/verity/verity/node_modules/vitest/suppress-warnings.cjs /home/REDACTED/work/verity/verity/node_modules/vitest/dist/workers/forks.js(dns block)tracker.files.fm/opt/hostedtoolcache/node/24.12.0/x64/bin/node /opt/hostedtoolcache/node/24.12.0/x64/bin/node --conditions node --conditions development --experimental-import-meta-resolve --require /home/REDACTED/work/verity/verity/node_modules/vitest/suppress-warnings.cjs /home/REDACTED/work/verity/verity/node_modules/vitest/dist/workers/forks.js(dns block)tracker.gbitt.info/opt/hostedtoolcache/node/24.12.0/x64/bin/node /opt/hostedtoolcache/node/24.12.0/x64/bin/node --conditions node --conditions development --experimental-import-meta-resolve --require /home/REDACTED/work/verity/verity/node_modules/vitest/suppress-warnings.cjs /home/REDACTED/work/verity/verity/node_modules/vitest/dist/workers/forks.js(dns block)tracker.openbittorrent.com/opt/hostedtoolcache/node/24.12.0/x64/bin/node /opt/hostedtoolcache/node/24.12.0/x64/bin/node --conditions node --conditions development --experimental-import-meta-resolve --require /home/REDACTED/work/verity/verity/node_modules/vitest/suppress-warnings.cjs /home/REDACTED/work/verity/verity/node_modules/vitest/dist/workers/forks.js(dns block)tracker.opentrackr.org/opt/hostedtoolcache/node/24.12.0/x64/bin/node /opt/hostedtoolcache/node/24.12.0/x64/bin/node --conditions node --conditions development --experimental-import-meta-resolve --require /home/REDACTED/work/verity/verity/node_modules/vitest/suppress-warnings.cjs /home/REDACTED/work/verity/verity/node_modules/vitest/dist/workers/forks.js(dns block)tracker.tamersunion.org/opt/hostedtoolcache/node/24.12.0/x64/bin/node /opt/hostedtoolcache/node/24.12.0/x64/bin/node --conditions node --conditions development --experimental-import-meta-resolve --require /home/REDACTED/work/verity/verity/node_modules/vitest/suppress-warnings.cjs /home/REDACTED/work/verity/verity/node_modules/vitest/dist/workers/forks.js(dns block)tracker.torrent.eu.org/opt/hostedtoolcache/node/24.12.0/x64/bin/node /opt/hostedtoolcache/node/24.12.0/x64/bin/node --conditions node --conditions development --experimental-import-meta-resolve --require /home/REDACTED/work/verity/verity/node_modules/vitest/suppress-warnings.cjs /home/REDACTED/work/verity/verity/node_modules/vitest/dist/workers/forks.js(dns block)If you need me to access, download, or install something from one of these locations, you can either:
Original prompt
This pull request was created from Copilot chat.
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.