diff --git a/logos_delivery.nimble b/logos_delivery.nimble index b80ba7cf3..0f29fa6fd 100644 --- a/logos_delivery.nimble +++ b/logos_delivery.nimble @@ -28,7 +28,7 @@ requires "nim >= 2.2.4", "toml_serialization", "faststreams", # Networking & P2P - "https://github.com/vacp2p/nim-libp2p.git#c43199378f46d0aaf61be1cad1ee1d63e8f665d6", + "https://github.com/vacp2p/nim-libp2p.git#v2.0.0", "eth", "nat_traversal", "dnsdisc", @@ -71,7 +71,7 @@ requires "https://github.com/NagyZoltanPeter/nim-brokers.git#v3.1.1" requires "https://github.com/vacp2p/nim-lsquic" requires "https://github.com/vacp2p/nim-jwt.git#057ec95eb5af0eea9c49bfe9025b3312c95dc5f2" -requires "https://github.com/logos-co/nim-libp2p-mix#7cb7556d9a228573fc5622af7ffb2dd11741e043" +requires "https://github.com/logos-co/nim-libp2p-mix#380513117d556bf8f70066f5e72a7fd74fe36ba6" proc getMyCPU(): string = ## Need to set cpu more explicit manner to avoid arch issues between dependencies diff --git a/logos_delivery/waku/discovery/waku_kademlia.nim b/logos_delivery/waku/discovery/waku_kademlia.nim index acedadbff..92ff4d94a 100644 --- a/logos_delivery/waku/discovery/waku_kademlia.nim +++ b/logos_delivery/waku/discovery/waku_kademlia.nim @@ -55,7 +55,8 @@ proc new*( switch, bootstrapNodes = params.bootstrapNodes, config = KadDHTConfig.new( - validator = svdisc_types.ExtEntryValidator(), selector = svdisc_types.ExtEntrySelector() + validator = svdisc_types.ExtEntryValidator(), + selector = svdisc_types.ExtEntrySelector(), ), rng = switch.rng, codec = ExtendedServiceDiscoveryCodec, diff --git a/logos_delivery/waku/waku_filter_v2/client.nim b/logos_delivery/waku/waku_filter_v2/client.nim index b3e0cd28f..ddae363a3 100644 --- a/logos_delivery/waku/waku_filter_v2/client.nim +++ b/logos_delivery/waku/waku_filter_v2/client.nim @@ -212,9 +212,7 @@ proc initProtocolHandler(wfc: WakuFilterClient) = wfc.handler = handler wfc.codec = WakuFilterPushCodec -proc new*( - T: type WakuFilterClient, peerManager: PeerManager, rng: crypto.Rng -): T = +proc new*(T: type WakuFilterClient, peerManager: PeerManager, rng: crypto.Rng): T = let brokerCtx = globalBrokerContext() let wfc = WakuFilterClient( brokerCtx: brokerCtx, rng: rng, peerManager: peerManager, pushHandlers: @[] diff --git a/logos_delivery/waku/waku_lightpush/client.nim b/logos_delivery/waku/waku_lightpush/client.nim index afd4fa539..680970a51 100644 --- a/logos_delivery/waku/waku_lightpush/client.nim +++ b/logos_delivery/waku/waku_lightpush/client.nim @@ -21,9 +21,7 @@ type WakuLightPushClient* = ref object rng*: crypto.Rng peerManager*: PeerManager -proc new*( - T: type WakuLightPushClient, peerManager: PeerManager, rng: crypto.Rng -): T = +proc new*(T: type WakuLightPushClient, peerManager: PeerManager, rng: crypto.Rng): T = WakuLightPushClient(peerManager: peerManager, rng: rng) proc ensureTimestampSet(message: var WakuMessage) = diff --git a/logos_delivery/waku/waku_lightpush_legacy/client.nim b/logos_delivery/waku/waku_lightpush_legacy/client.nim index cb65ee597..511c3f543 100644 --- a/logos_delivery/waku/waku_lightpush_legacy/client.nim +++ b/logos_delivery/waku/waku_lightpush_legacy/client.nim @@ -22,9 +22,7 @@ type WakuLegacyLightPushClient* = ref object rng*: crypto.Rng proc new*( - T: type WakuLegacyLightPushClient, - peerManager: PeerManager, - rng: crypto.Rng, + T: type WakuLegacyLightPushClient, peerManager: PeerManager, rng: crypto.Rng ): T = WakuLegacyLightPushClient(peerManager: peerManager, rng: rng) diff --git a/logos_delivery/waku/waku_mix/protocol.nim b/logos_delivery/waku/waku_mix/protocol.nim index e648040f1..613b6e3c7 100644 --- a/logos_delivery/waku/waku_mix/protocol.nim +++ b/logos_delivery/waku/waku_mix/protocol.nim @@ -93,7 +93,9 @@ proc new*( localMixNodeInfo, peermgr.switch, delayStrategy = Opt.some( - DelayStrategy(ExponentialDelayStrategy.new(meanDelay = 50'u16, rng = crypto.newRng())) + DelayStrategy( + ExponentialDelayStrategy.new(meanDelay = 50'u16, rng = crypto.newRng()) + ) ), ) diff --git a/nimble.lock b/nimble.lock index b482a2f25..53a911ad2 100644 --- a/nimble.lock +++ b/nimble.lock @@ -583,7 +583,7 @@ } }, "libp2p": { - "version": "#c43199378f46d0aaf61be1cad1ee1d63e8f665d6", + "version": "2.0.0", "vcsRevision": "c43199378f46d0aaf61be1cad1ee1d63e8f665d6", "url": "https://github.com/vacp2p/nim-libp2p.git", "downloadMethod": "git", @@ -700,7 +700,7 @@ }, "libp2p_mix": { "version": "0.1.0", - "vcsRevision": "7cb7556d9a228573fc5622af7ffb2dd11741e043", + "vcsRevision": "380513117d556bf8f70066f5e72a7fd74fe36ba6", "url": "https://github.com/logos-co/nim-libp2p-mix", "downloadMethod": "git", "dependencies": [ @@ -715,7 +715,7 @@ "unittest2" ], "checksums": { - "sha1": "8287dda862a4398966cd66a5b3d7d66834c9a9a6" + "sha1": "ccfb0f0160ac15ac970471964c730d57edacad91" } } }, diff --git a/tests/node/test_wakunode_peer_manager.nim b/tests/node/test_wakunode_peer_manager.nim index 3aba26e22..a43f76d97 100644 --- a/tests/node/test_wakunode_peer_manager.nim +++ b/tests/node/test_wakunode_peer_manager.nim @@ -29,11 +29,10 @@ import # nim-libp2p 2.0.0 enables the IdentifyPush protocol by default, so every node # now also advertises "/ipfs/id/push/1.0.0" (prepended to the identify list). -const DEFAULT_PROTOCOLS: seq[string] = - @[ - "/ipfs/id/push/1.0.0", "/ipfs/id/1.0.0", "/libp2p/autonat/1.0.0", - "/libp2p/circuit/relay/0.2.0/hop", - ] +const DEFAULT_PROTOCOLS: seq[string] = @[ + "/ipfs/id/push/1.0.0", "/ipfs/id/1.0.0", "/libp2p/autonat/1.0.0", + "/libp2p/circuit/relay/0.2.0/hop", +] let listenIp = parseIpAddress("0.0.0.0") diff --git a/tests/test_peer_manager.nim b/tests/test_peer_manager.nim index 7b5cf3624..1505a686f 100644 --- a/tests/test_peer_manager.nim +++ b/tests/test_peer_manager.nim @@ -955,7 +955,8 @@ procSuite "Peer Manager": # Create peer manager let pm = PeerManager.new( - switch = SwitchBuilder.new().withRng(crypto.newRng()).withMplex().withNoise().build(), + switch = + SwitchBuilder.new().withRng(crypto.newRng()).withMplex().withNoise().build(), storage = nil, ) @@ -1040,7 +1041,9 @@ procSuite "Peer Manager": # Create 30 peers and add them to the peerstore let peers = toSeq(1 .. 30) - .mapIt(parsePeerInfo("/ip4/0.0.0.0/tcp/0/p2p/" & $PeerId.random(crypto.newRng()).get())) + .mapIt( + parsePeerInfo("/ip4/0.0.0.0/tcp/0/p2p/" & $PeerId.random(crypto.newRng()).get()) + ) .filterIt(it.isOk()) .mapIt(it.value) for p in peers: diff --git a/tests/waku_lightpush_legacy/lightpush_utils.nim b/tests/waku_lightpush_legacy/lightpush_utils.nim index 5d1a6e7e5..e64f5d69f 100644 --- a/tests/waku_lightpush_legacy/lightpush_utils.nim +++ b/tests/waku_lightpush_legacy/lightpush_utils.nim @@ -19,7 +19,8 @@ proc newTestWakuLegacyLightpushNode*( ): Future[WakuLegacyLightPush] {.async.} = let peerManager = PeerManager.new(switch) - proto = WakuLegacyLightPush.new(peerManager, crypto.newRng(), handler, rateLimitSetting) + proto = + WakuLegacyLightPush.new(peerManager, crypto.newRng(), handler, rateLimitSetting) await proto.start() switch.mount(proto)