feat: service discovery integration#3772
Closed
SionoiS wants to merge 34 commits into
Closed
Conversation
SionoiS
force-pushed
the
feat--service-discovery
branch
from
March 30, 2026 13:08
840c6dd to
77750fd
Compare
Closed
3 tasks
SionoiS
force-pushed
the
feat--service-discovery
branch
from
April 30, 2026 17:01
78785e6 to
515f567
Compare
|
You can find the image built from this PR at Built from 94ba1eb |
SionoiS
force-pushed
the
feat--service-discovery
branch
from
May 5, 2026 16:25
4d21fba to
f94efda
Compare
std/options fixes - add Option[T] valueOr/withValue no longer provided by libp2p - add missing std/options imports no longer re-exported by libp2p
SionoiS
force-pushed
the
feat--service-discovery
branch
from
May 12, 2026 11:57
5ec18fb to
55e752c
Compare
This was referenced Jun 4, 2026
… to compile chat2disco - waku.nimble: libp2p #f54c7150a7ccbc4e9871bb8b56ecfd7e3e59f7de; also pin protobuf_serialization#ce97ba0 and websock#fb8ba71 to match new libp2p reqs; mix remains on 6c5f43 (its declared pins lag) - nimble.lock + nix/deps.nix updated (libp2p rev/sha) - Source fixes for new libp2p (object configs, removed utility module -> libp2p/utils/opt, rendezvous nil, kademlia no longer imports mix_protocol to reduce bad dep surface) - nph on touched .nim - chat2disco builds+starts successfully against the updated libp2p (with in-nimbledeps patches to mix for its removed symbols like sequninit/utility and withValue(Opt) sites; run make update will require similar or upstream mix bump) Refs the 106-commit libp2p delta with kademlia/service-disco fixes (e.g. ticket time, record sizes, registration).
…89 on start Root cause (post libp2p f54c715 update + rv/kad/service-disco changes): - chat2disco (and waku factory for circuitRelayClient) do direct `node.switch.services = @[Service(hp/autonat)]` (bypassing the deprecated switch.add that called .setup). - AutonatService (enableAddressMapper=true by default) + HP require their .setup(switch) to populate .addressMapper (and handlers) before start(). - In switch.start: services.start → autonat.start does addressMappers.add(nil); await peerInfo.update() → for m in ...: await m(...) → nil proc deref (Defect/SEGV in release). - Surfaces at the `await node.switch.start()` (waku_node:589). - Secondary: wakuKademlia.start() + waku mapper (capturing node, returning announced which hp mutates) scheduled before switch.start (which activates the mounted kad via ms + runs the hp mappers/updates). Fix: - After services= in apps/chat2disco/chat2disco.nim and in waku/factory/waku.nim (both hp and bare autonat branches), explicitly call the .setup(node.switch) (or hp.setup) and handle error. - Move `if not node.wakuKademlia.isNil(): ...start()` to after switch.start() + reconnectRelayPeers (correct ordering for mounted protocol user loops). - Harden waku addressMapper (nil/empty guard, return listenAddrs) and set peerInfo.announcedAddrs (short-circuit) at the add site, in updateAnnounced..., and in the onReservation callbacks (chat2disco + factory) so expandAddrs prefers it. - Minor: lookup/periodic guards in waku_kademlia; doc in autonat_service. Also nph reformats on touched files. Reuses: the .setup methods, existing post-switch init patterns, isNil guards, CatchableError handling, make chat2disco + nph. Verified: make chat2disco (twice, pre/post nph) SuccessX; no SEGV in multiple start-path runs (only expected thread EOF on pipe close); diff only our 5 files. Builds on 82d87cfa (libp2p update) without touching pins or vendored. Caveat: clean `make update` still requires the mix temp patches in pkgs2 (as documented in the update). Fixes the reported chat2disco startup segfault.
Contributor
Author
|
Can't make it compile anymore with latest libp2p. Closing in favor of something else that works... |
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.
Service discovery integration for testing purposes. Will not be merged.