From 95ab9c7239b4130053f552026d31fe9cbf610cd1 Mon Sep 17 00:00:00 2001 From: Prem Chaitanya Prathi Date: Mon, 14 Apr 2025 14:19:48 +0530 Subject: [PATCH] fix issues in refactor --- vendor/mix | 2 +- waku/waku_mix/protocol.nim | 21 ++++++++++++--------- 2 files changed, 13 insertions(+), 10 deletions(-) diff --git a/vendor/mix b/vendor/mix index 9c74e4a35..e2e2cac2d 160000 --- a/vendor/mix +++ b/vendor/mix @@ -1 +1 @@ -Subproject commit 9c74e4a356c7cd0bf45be13c20702a8dd15edc04 +Subproject commit e2e2cac2da129fb9bad340b3086fc8a39eec9b70 diff --git a/waku/waku_mix/protocol.nim b/waku/waku_mix/protocol.nim index 902cc0845..f083d6d3e 100644 --- a/waku/waku_mix/protocol.nim +++ b/waku/waku_mix/protocol.nim @@ -1,19 +1,22 @@ {.push raises: [].} -import chronicles, std/[options], chronos, results +import chronicles, std/[options, sequtils], chronos, results, metrics import libp2p/crypto/curve25519, mix/mix_protocol, mix/mix_node, mix/mix_metrics, + mix/tag_manager, libp2p/[multiaddress, multicodec, peerid] import ../node/peer_manager, + ../waku_core, ../waku_enr/mix, ../waku_enr, - ../node/peer_manager/waku_peer_store + ../node/peer_manager/waku_peer_store, + ../common/nimchronos logScope: topics = "waku mix" @@ -136,17 +139,17 @@ proc new*( let mixPubKey = public(mixPrivKey) info "mixPrivKey", mixPrivKey = mixPrivKey, mixPubKey = mixPubKey - # TODO : ideally mix should not be marked ready until certain min pool of mixNodes are discovered - var m: WakuMix - let localMixNodeInfo = initMixNodeInfo( nodeAddr, mixPubKey, mixPrivKey, switch.peerInfo.publicKey.skkey, switch.peerInfo.privateKey.skkey, ) - m = initMix(localMixNodeInfo, switch, initTable[PeerId, MixPubInfo]()) - m.peerManager = peermgr - m.clusterId = clusterId - return + + # TODO : ideally mix should not be marked ready until certain min pool of mixNodes are discovered + var m = WakuMix(peerManager: peermgr, clusterId: clusterId) + m.init(localMixNodeInfo, switch, initTable[PeerId, MixPubInfo]()) + procCall MixProtocol(m).init() + + return ok(m) proc start*(mix: Wakumix) = discard mix.startMixNodePoolMgr()