PR #3807 still uses std/Option.valueOr in ~30 places across logos_delivery
but does not consistently import waku/common/option_shims (the local
template that restores libp2p-1.15.2's valueOr/withValue for Option[T];
libp2p 1.15.3 dropped those overloads). Without the shim, nim picks up
only Result[T,E].valueOr from nim-results and fails with 'type mismatch'.
Surfaced when building liblogoschat which pulls a much wider slice of
nwaku than liblogosdelivery does. Each touched file now imports
option_shims either inline alongside other ../common/ entries or as a
standalone top-level import where the file uses absolute logos_delivery/
paths.
No semantic change — the shim restores the historical Option valueOr
behavior. Same files compiling against the older libp2p (where valueOr
on Option came from libp2p/utility) would behave identically.
Combines the post-feature cleanup pass:
- Extract bytesToHexUpper helper for idCommitment hex (was duplicated
across logos_core_client.nim + node_factory.nim).
- Drop dead helper functions, unused imports, and duplicate kademlia
wiring left over from the feature commit.
- Narrow waitForChainCommit's broad except, add CancelledError
carve-outs to the self-registration watcher to avoid swallowing
shutdown signals.
Ports commit 14562878 onto PR #3807's logos_delivery/ layout.
Changes vs original 14562878:
- Plugin consumed via nimble dep (no submodule add); the PR #3807 nimble
resolution already provides it.
- mountMix signature carries both PR #3807's disableSpamProtection AND
the patch's useOnchainLEZ parameters (callsite passes both).
- WakuMix.new branches on disableSpamProtection while also setting
useOnchainLEZ on the spam-protection config. Cover-traffic params come
from the plugin config when RLN is enabled, fall back to waku defaults
when disabled.
- start() retains HEAD's split between local-only init and the separate
registerDoSProtectionWithNetwork retry loop. publishGossipsubTrigger is
promoted to a standalone proc instead of inline in an else branch.
- MixProtocol.init uses libp2p_mix's new Opt-wrapped coverTraffic and
the MixRlnSpamProtection.new constructor (not the renamed newMixRlnSpamProtection).
- Makefile reverted to HEAD: PR #3807 dropped the separate mix-librln
archive in favor of a single stateless zerokit, so the patch's
MIX_LIBRLN_* additions are obsolete.
- README/sim helper config files: HEAD's values retained (env-specific
paths from patch author dropped).
Adds:
- logos_delivery/waku/waku_mix/logos_core_client.nim (RLN client layer)
- logos_delivery/waku/waku_mix/coordination handler (via waku_node)
- logos_delivery/waku/waku_rln_relay/rln_gifter/{client,protocol,rpc,rpc_codec}.nim
- 5 new C FFI exports (logosdelivery_set_rln_fetcher, _set_rln_config,
_set_rln_identity, _push_roots, _push_proof)
- --mix-gifter-* CLI flags + MixConf fields + MixConfBuilder methods
- tests/waku_rln_relay/test_rln_gifter.nim
- Integrate ConstantRateCoverTraffic from libp2p mix module with default
totalSlots = userMessageLimit (or 2) and 10s epoch
- Add --mix-user-message-limit and --mix-disable-spam-protection CLI flags
with corresponding MixConfBuilder accessors and MixConf fields
- Wrap mixRlnSpamProtection construction so it is skipped when spam
protection is disabled, with a nil guard in setupSpamProtectionCallbacks
- Add waku/common/option_shims.nim restoring valueOr/withValue templates
for std/options (removed upstream by results), and import it across
modules that relied on the old behavior
- Sink chat2mix logs to textlines (stdout) instead of textlines[file] to
work around a chronicles compile-time macro-eval bug under Nim 2.2.4
- Rename ExtendedKademliaDiscoveryParams -> ExtendedServiceDiscoveryParams
to match the kad_disco -> service_discovery rename in nim-libp2p
- Bump nim-libp2p to e1bbda4f6 (PR #2243 "cover traffic with constant
rate") and mix-rln-spam-protection-plugin to 153d0c0 (PR #5 cover
traffic epoch change support); both pre-libp2p_mix-extraction
- Add simulations/mixnet/check_cover_traffic.sh for monitoring
mix_cover_* / mix_slot_* metrics, plus per-node cover-traffic configs