msgid formatting, libp2p bump (#2198)

* msgid formatting, libp2p bump

* fix libp2p commit
This commit is contained in:
Jacek Sieka 2020-12-18 19:45:27 +01:00 committed by GitHub
parent 3d87bc0033
commit 452042b17b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 6 deletions

View File

@ -1628,14 +1628,16 @@ proc addValidator*[MsgType](node: Eth2Node,
proc unsubscribe*(node: Eth2Node, topic: string): Future[void] =
node.pubsub.unsubscribeAll(topic)
proc traceMessage(fut: FutureBase, msgId: string) =
proc traceMessage(fut: FutureBase, msgId: seq[byte]) =
fut.addCallback do (arg: pointer):
if not(fut.failed):
trace "Outgoing pubsub message sent", msgId
trace "Outgoing pubsub message sent", msgId = byteutils.toHex(msgId)
elif fut.error != nil:
debug "Gossip message not sent", msgId, err = fut.error.msg
debug "Gossip message not sent",
msgId = byteutils.toHex(msgId), err = fut.error.msg
else:
debug "Unexpected future state for gossip", msgId, state = fut.state
debug "Unexpected future state for gossip",
msgId = byteutils.toHex(msgId), state = fut.state
proc broadcast*(node: Eth2Node, topic: string, msg: auto) =
let
@ -1648,4 +1650,4 @@ proc broadcast*(node: Eth2Node, topic: string, msg: auto) =
inc nbc_gossip_messages_sent
var futSnappy = node.pubsub.publish(topic & "_snappy", compressed)
traceMessage(futSnappy, string.fromBytes(gossipId(uncompressed, true)))
traceMessage(futSnappy, gossipId(uncompressed, true))

2
vendor/nim-libp2p vendored

@ -1 +1 @@
Subproject commit 9e5ba64c4888caa46938b2ef87e74c65cb7fab4b
Subproject commit a1a5f9abaca41ec37ea2c4d6b34b5c4fcecf7591