From 5cd5da74c49cae1d8bcead2c2518dc187d31d1ca Mon Sep 17 00:00:00 2001 From: Jacek Sieka Date: Fri, 7 May 2021 06:31:28 +0200 Subject: [PATCH] Gossipsub unsubscribe fixes (fixes #2540) (#2545) --- beacon_chain/networking/eth2_network.nim | 7 +++++-- vendor/nim-libp2p | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/beacon_chain/networking/eth2_network.nim b/beacon_chain/networking/eth2_network.nim index be1b596f1..5b24c1dfb 100644 --- a/beacon_chain/networking/eth2_network.nim +++ b/beacon_chain/networking/eth2_network.nim @@ -1633,8 +1633,11 @@ proc shortForm*(id: NetKeyPair): string = proc subscribe*( node: Eth2Node, topic: string, topicParams: TopicParams, enableTopicMetrics: bool = false) {.raises: [Defect, CatchableError].} = - proc dummyMsgHandler(topic: string, data: seq[byte]) {.async.} = - discard + proc dummyMsgHandler(topic: string, data: seq[byte]): Future[void] = + # Avoid closure environment with `{.async.}` + var res = newFuture[void]("eth2_network.dummyMsgHandler") + res.complete() + res let topicName = topic & "_snappy" diff --git a/vendor/nim-libp2p b/vendor/nim-libp2p index 9f301964e..83a20a992 160000 --- a/vendor/nim-libp2p +++ b/vendor/nim-libp2p @@ -1 +1 @@ -Subproject commit 9f301964ed74316de7796c0cbd9728190ac2fdda +Subproject commit 83a20a992a56ee1207f575e88d906ee62d911d7f