diff --git a/.gitmodules b/.gitmodules index 6cdd509..4b75636 100644 --- a/.gitmodules +++ b/.gitmodules @@ -5,7 +5,7 @@ path = vendor/nwaku url = https://github.com/logos-messaging/logos-delivery.git ignore = untracked - branch = feat/cover-traffic + branch = feat/logos-testnetv02-mix [submodule "vendor/nim-protobuf-serialization"] path = vendor/nim-protobuf-serialization url = https://github.com/status-im/nim-protobuf-serialization.git diff --git a/Makefile b/Makefile index 565802a..6d2e2ef 100644 --- a/Makefile +++ b/Makefile @@ -136,9 +136,11 @@ build-waku-nat: @echo "Completed building nat-libs" .PHONY: tests -tests: | build-rust-bundle build-waku-nat logos_chat.nims +# smoke_test / all_tests pull mix + RLN symbols via waku_client; link mix librln +# the same way liblogoschat / examples do (cdylib on Darwin). +tests: | build-rust-bundle build-waku-nat mix-librln logos_chat.nims echo -e $(BUILD_MSG) "build/$@" && \ - $(ENV_SCRIPT) nim tests $(NIM_PARAMS) \ + $(ENV_SCRIPT) nim tests $(NIM_PARAMS) $(MIX_LIBRLN_NIM_PARAMS) \ --passL:$(RUST_BUNDLE_LIB) --passL:-lm \ logos_chat.nims diff --git a/flake.nix b/flake.nix index e0f8ac0..9ff383b 100644 --- a/flake.nix +++ b/flake.nix @@ -26,9 +26,9 @@ }; libchatDrv = pkgs.callPackage ./nix/libchat.nix {}; rustBundleDrv = pkgs.callPackage ./nix/rust_bundle.nix { src = self; }; - # efafdfdc2's nwaku consumes its nim deps via nimble (nimbledeps/pkgs2), - # which isn't reproducible in the nix sandbox. Instead fetch them from - # vendor/nwaku's autogenerated deps.nix (mirrors logos-delivery's build). + # vendor/nwaku (logos-delivery) consumes its nim deps via nimble + # (nimbledeps/pkgs2), which isn't reproducible in the nix sandbox. + # Instead fetch them from vendor/nwaku's autogenerated deps.nix. nwakuDeps = import (self + "/vendor/nwaku/nix/deps.nix") { inherit pkgs; }; in { packages.default = pkgs.callPackage ./nix/default.nix { diff --git a/nix/default.nix b/nix/default.nix index 16f9b68..5abef8c 100644 --- a/nix/default.nix +++ b/nix/default.nix @@ -1,7 +1,7 @@ { lib, stdenv, nim, which, pkg-config, writeScriptBin, fetchurl, openssl, miniupnpc, libnatpmp, rustPlatform, fetchFromGitHub, darwin ? {}, src, # logos-chat source (self from flake, with submodules=1) - nwakuDeps, # efafdfdc2 nim deps from vendor/nwaku/nix/deps.nix + nwakuDeps, # nim deps from vendor/nwaku/nix/deps.nix (logos-delivery pin) rustBundleDrv }: # result of rust_bundle.nix # NOTE: this build requires git submodules to be present in src. @@ -15,8 +15,8 @@ assert lib.assertMsg ((src.submodules or false) == true) let revision = lib.substring 0 8 (src.rev or "dirty"); - # nwaku (efafdfdc2) nim deps on the path. Drop `ffi` — the chat ships its own - # vendor/nim-ffi (1-arg declareLibrary); nwaku's ffi (2-arg) would clash. + # nwaku (logos-delivery pin) nim deps on the path. Drop `ffi` — the chat ships + # its own vendor/nim-ffi (1-arg declareLibrary); nwaku's ffi (2-arg) would clash. nwakuDepPaths = lib.concatStringsSep " " (builtins.concatMap (p: [ "--path:${p}" "--path:${p}/src" ]) (builtins.attrValues (builtins.removeAttrs nwakuDeps [ "ffi" ]))); diff --git a/src/chat/delivery/waku_client.nim b/src/chat/delivery/waku_client.nim index 37d1578..55a490c 100644 --- a/src/chat/delivery/waku_client.nim +++ b/src/chat/delivery/waku_client.nim @@ -346,6 +346,13 @@ proc start*(client: WakuClient) {.async.} = # conf-driven factory that would otherwise auto-mount it (mirrors apps/chat2mix). # Discovered mix peers land in the peerManager and fill the pool waitForMixPool # waits on. + # + # Light-client mix discovery: LOOK UP mix providers only. + # - servicesToDiscover = MixProtocolID (find fleet mix nodes) + # - servicesToAdvertise = empty (do NOT advertise as mix) + # - xprPublishing = false (do NOT publish self-signed XPR into the DHT) + # - clientMode = true (no inbound DHT handler / codec; logos-delivery + # mountKademlia skips switch.mount for clientMode as of 4a3db364) if client.cfg.kadBootstrapNodes.len > 0: var kadBootstrapPeers: seq[(PeerId, seq[MultiAddress])] for nodeStr in client.cfg.kadBootstrapNodes: @@ -368,13 +375,13 @@ proc start*(client: WakuClient) {.async.} = # via maintainBuckets + runServiceLookupLoop + runServicePeerTopUp. kadDhtConfig: KadDHTConfig.new(disableBootstrapping = true), discoConfig: sd_types.ServiceDiscoveryConfig.new(), - clientMode: false, - xprPublishing: true, + clientMode: true, + xprPublishing: false, ) ).isOkOr: error "Failed to mount kademlia mix discovery", error = error quit(QuitFailure) - info "Kademlia mix discovery mounted", + info "Kademlia mix discovery mounted (clientMode, no XPR/advertise)", bootstrapPeers = kadBootstrapPeers.len asyncSpawn client.waitForMixPool() diff --git a/vendor/nwaku b/vendor/nwaku index efafdfd..4a3db36 160000 --- a/vendor/nwaku +++ b/vendor/nwaku @@ -1 +1 @@ -Subproject commit efafdfdc24f369942951dd7ceeec37e5913b19eb +Subproject commit 4a3db364e7e90bc7fdfdd1eb7caa30fa7130d220