Skip to content

Commit 4615b51

Browse files
authored
feath: use sha256 for Relay msgIdFn (#1322)
1 parent d65996b commit 4615b51

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

nwaku

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Subproject commit 03f0de365cfee3a946257a6ce8a61fe19284976c

packages/core/src/lib/relay/index.ts

+2
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import type { PeerIdStr, TopicStr } from "@chainsafe/libp2p-gossipsub/types";
88
import { SignaturePolicy } from "@chainsafe/libp2p-gossipsub/types";
99
import type { Libp2p } from "@libp2p/interface-libp2p";
1010
import type { PubSub } from "@libp2p/interface-pubsub";
11+
import { sha256 } from "@noble/hashes/sha256";
1112
import type {
1213
ActiveSubscriptions,
1314
Callback,
@@ -228,6 +229,7 @@ export function wakuGossipSub(
228229
return (components: GossipSubComponents) => {
229230
init = {
230231
...init,
232+
msgIdFn: ({ data }) => sha256(data),
231233
// Ensure that no signature is included nor expected in the messages.
232234
globalSignaturePolicy: SignaturePolicy.StrictNoSign,
233235
fallbackToFloodsub: false,

0 commit comments

Comments
 (0)