From 4615b515683aaa6b6fe175d5a5cdffddb4d5f230 Mon Sep 17 00:00:00 2001 From: Sasha <118575614+weboko@users.noreply.github.com> Date: Fri, 5 May 2023 18:26:54 +0200 Subject: [PATCH] feath: use sha256 for Relay msgIdFn (#1322) --- nwaku | 1 + packages/core/src/lib/relay/index.ts | 2 ++ 2 files changed, 3 insertions(+) create mode 160000 nwaku diff --git a/nwaku b/nwaku new file mode 160000 index 0000000000..03f0de365c --- /dev/null +++ b/nwaku @@ -0,0 +1 @@ +Subproject commit 03f0de365cfee3a946257a6ce8a61fe19284976c diff --git a/packages/core/src/lib/relay/index.ts b/packages/core/src/lib/relay/index.ts index c1138ca3b3..4ec9b62375 100644 --- a/packages/core/src/lib/relay/index.ts +++ b/packages/core/src/lib/relay/index.ts @@ -8,6 +8,7 @@ import type { PeerIdStr, TopicStr } from "@chainsafe/libp2p-gossipsub/types"; import { SignaturePolicy } from "@chainsafe/libp2p-gossipsub/types"; import type { Libp2p } from "@libp2p/interface-libp2p"; import type { PubSub } from "@libp2p/interface-pubsub"; +import { sha256 } from "@noble/hashes/sha256"; import type { ActiveSubscriptions, Callback, @@ -228,6 +229,7 @@ export function wakuGossipSub( return (components: GossipSubComponents) => { init = { ...init, + msgIdFn: ({ data }) => sha256(data), // Ensure that no signature is included nor expected in the messages. globalSignaturePolicy: SignaturePolicy.StrictNoSign, fallbackToFloodsub: false,