diff --git a/package-lock.json b/package-lock.json index 72a6b36746..8a01ff6a1c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -2690,11 +2690,11 @@ } }, "node_modules/@libp2p/crypto": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/@libp2p/crypto/-/crypto-4.0.0.tgz", - "integrity": "sha512-4R1sqgbgjJdd8rWgnLJJ3jmcSIXZ9yhSwi65VTJX8VGp2qyHzWOOTMFEpUmr8VmwdGiOJvHFiLE2cSsgOIA68w==", + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/@libp2p/crypto/-/crypto-4.0.1.tgz", + "integrity": "sha512-lKGbX8TvQt4JbqlttdexEz2VtYJnTwY31kVBDQviwt0pMF+6Uy2hzNnEQ1FHZBwnow8BIlyb6UevHfgyOFlnkw==", "dependencies": { - "@libp2p/interface": "^1.1.1", + "@libp2p/interface": "^1.1.2", "@noble/curves": "^1.1.0", "@noble/hashes": "^1.3.3", "asn1js": "^3.0.5", @@ -2738,19 +2738,19 @@ } }, "node_modules/@libp2p/identify": { - "version": "1.0.10", - "resolved": "https://registry.npmjs.org/@libp2p/identify/-/identify-1.0.10.tgz", - "integrity": "sha512-dWYMbYvP9XPDcGfuYzCGN965PJGs6uWTx3hV8AeuI4nfix7Bh3XS36R+be2MBZ1sYgfBBfO1GCpvSMjTAdJ5Bw==", + "version": "1.0.11", + "resolved": "https://registry.npmjs.org/@libp2p/identify/-/identify-1.0.11.tgz", + "integrity": "sha512-/f6E2Z+H9sU332DipP3wuxtq06WfP1g4gNnjM7EUJjZ3b6igz8sFRnSVhTq5DGcsPBPT01zct3mrKFCj7ag4Uw==", "dependencies": { - "@libp2p/interface": "^1.1.1", - "@libp2p/interface-internal": "^1.0.6", - "@libp2p/peer-id": "^4.0.4", - "@libp2p/peer-record": "^7.0.5", + "@libp2p/interface": "^1.1.2", + "@libp2p/interface-internal": "^1.0.7", + "@libp2p/peer-id": "^4.0.5", + "@libp2p/peer-record": "^7.0.6", "@multiformats/multiaddr": "^12.1.10", "@multiformats/multiaddr-matcher": "^1.1.0", - "it-protobuf-stream": "^1.0.2", + "it-protobuf-stream": "^1.1.1", "protons-runtime": "^5.0.0", - "uint8arraylist": "^2.4.3", + "uint8arraylist": "^2.4.7", "uint8arrays": "^5.0.0", "wherearewe": "^2.0.1" } @@ -2858,14 +2858,14 @@ } }, "node_modules/@libp2p/interface-internal": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/@libp2p/interface-internal/-/interface-internal-1.0.6.tgz", - "integrity": "sha512-qydJquYkGvNEW+KkvZLMLsVURVgy5KBxMld1lrTbbPCf+CR8LF74d/4qOkJ9HXdJBQKzAOyfkfaxSxBpcHa1yA==", + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/@libp2p/interface-internal/-/interface-internal-1.0.7.tgz", + "integrity": "sha512-r1nGpnGdkq0U7ow5i093OPWPBJXQP3BGwijino8cCZokYwF2P/CU+yeYvL8ncL8fPYLKuuUjLNGO4Z8Th5sqSQ==", "dependencies": { - "@libp2p/interface": "^1.1.1", - "@libp2p/peer-collections": "^5.1.4", + "@libp2p/interface": "^1.1.2", + "@libp2p/peer-collections": "^5.1.5", "@multiformats/multiaddr": "^12.1.10", - "uint8arraylist": "^2.4.3" + "uint8arraylist": "^2.4.7" } }, "node_modules/@libp2p/interface/node_modules/multiformats": { @@ -2956,20 +2956,20 @@ } }, "node_modules/@libp2p/peer-collections": { - "version": "5.1.4", - "resolved": "https://registry.npmjs.org/@libp2p/peer-collections/-/peer-collections-5.1.4.tgz", - "integrity": "sha512-HqjXAe1ymlG8exbGcpPER1hIcXOpLN2x8TgwzmAOUbZcv7ZeQH+NEoZ30suF7OUqBpD4jWrn0MIj/dOF3OvXOg==", + "version": "5.1.5", + "resolved": "https://registry.npmjs.org/@libp2p/peer-collections/-/peer-collections-5.1.5.tgz", + "integrity": "sha512-/9VisdPC7+15n/0XntjGCzJ2Ky/zZnqdnuLNEwdu2LuTCbWTaqItG36ecgcVdO9L/V4mELwgY5XCjZKBDrYgjA==", "dependencies": { - "@libp2p/interface": "^1.1.1", - "@libp2p/peer-id": "^4.0.4" + "@libp2p/interface": "^1.1.2", + "@libp2p/peer-id": "^4.0.5" } }, "node_modules/@libp2p/peer-id": { - "version": "4.0.4", - "resolved": "https://registry.npmjs.org/@libp2p/peer-id/-/peer-id-4.0.4.tgz", - "integrity": "sha512-UHWpo0f34IOaAhlvMNtCMAFVVhv29Dy3IqNvfugFNwzv5p+Jo6TfPGd78H7RX2WIzyVzIgBYxVxmIIHHcqZQ5Q==", + "version": "4.0.5", + "resolved": "https://registry.npmjs.org/@libp2p/peer-id/-/peer-id-4.0.5.tgz", + "integrity": "sha512-/J9U6I/CWSOsYrTpFZpRQrhOhi+bp9WFp7+9Gc7kVt/oevIYTapUEjpxevjViem9ddR5RbdYeCj4ZLHA04QOoQ==", "dependencies": { - "@libp2p/interface": "^1.1.1", + "@libp2p/interface": "^1.1.2", "multiformats": "^13.0.0", "uint8arrays": "^5.0.0" } @@ -3014,18 +3014,18 @@ } }, "node_modules/@libp2p/peer-record": { - "version": "7.0.5", - "resolved": "https://registry.npmjs.org/@libp2p/peer-record/-/peer-record-7.0.5.tgz", - "integrity": "sha512-HG3xYfQ/8gAnAyhATJl9qJCWGfDfAC8KoxsPWW7X3hash9E2Fe8Gdyx1npy904RsJSRt75zMRtPmplQNxE5oIg==", + "version": "7.0.6", + "resolved": "https://registry.npmjs.org/@libp2p/peer-record/-/peer-record-7.0.6.tgz", + "integrity": "sha512-mo7WyJltQU5byC1cwMzqGnzlrSsqkCg8AKhWb0wscuIz2LH6cevmkq+h9mzDnn0KGzJIpZvlInygRVxA/SHS3A==", "dependencies": { - "@libp2p/crypto": "^4.0.0", - "@libp2p/interface": "^1.1.1", - "@libp2p/peer-id": "^4.0.4", - "@libp2p/utils": "^5.2.1", + "@libp2p/crypto": "^4.0.1", + "@libp2p/interface": "^1.1.2", + "@libp2p/peer-id": "^4.0.5", + "@libp2p/utils": "^5.2.2", "@multiformats/multiaddr": "^12.1.10", "protons-runtime": "^5.0.0", - "uint8-varint": "^2.0.0", - "uint8arraylist": "^2.4.3", + "uint8-varint": "^2.0.2", + "uint8arraylist": "^2.4.7", "uint8arrays": "^5.0.0" } }, @@ -13843,8 +13843,9 @@ } }, "node_modules/it-protobuf-stream": { - "version": "1.0.2", - "license": "Apache-2.0 OR MIT", + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/it-protobuf-stream/-/it-protobuf-stream-1.1.2.tgz", + "integrity": "sha512-epZBuG+7cPaTxCR/Lf3ApshBdA9qfflGPQLfLLrp9VQ0w67Z2xo4H+SLLetav57/29oPtAXwVaoyemg99JOWzA==", "dependencies": { "it-length-prefixed-stream": "^1.0.0", "it-stream-types": "^2.0.1", @@ -27918,7 +27919,7 @@ "license": "MIT OR Apache-2.0", "dependencies": { "@chainsafe/libp2p-noise": "^14.1.0", - "@libp2p/identify": "^1.0.10", + "@libp2p/identify": "^1.0.11", "@libp2p/mplex": "^10.0.12", "@libp2p/ping": "^1.0.9", "@libp2p/websockets": "^8.0.11", @@ -29776,11 +29777,11 @@ } }, "@libp2p/crypto": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/@libp2p/crypto/-/crypto-4.0.0.tgz", - "integrity": "sha512-4R1sqgbgjJdd8rWgnLJJ3jmcSIXZ9yhSwi65VTJX8VGp2qyHzWOOTMFEpUmr8VmwdGiOJvHFiLE2cSsgOIA68w==", + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/@libp2p/crypto/-/crypto-4.0.1.tgz", + "integrity": "sha512-lKGbX8TvQt4JbqlttdexEz2VtYJnTwY31kVBDQviwt0pMF+6Uy2hzNnEQ1FHZBwnow8BIlyb6UevHfgyOFlnkw==", "requires": { - "@libp2p/interface": "^1.1.1", + "@libp2p/interface": "^1.1.2", "@noble/curves": "^1.1.0", "@noble/hashes": "^1.3.3", "asn1js": "^3.0.5", @@ -29818,19 +29819,19 @@ } }, "@libp2p/identify": { - "version": "1.0.10", - "resolved": "https://registry.npmjs.org/@libp2p/identify/-/identify-1.0.10.tgz", - "integrity": "sha512-dWYMbYvP9XPDcGfuYzCGN965PJGs6uWTx3hV8AeuI4nfix7Bh3XS36R+be2MBZ1sYgfBBfO1GCpvSMjTAdJ5Bw==", + "version": "1.0.11", + "resolved": "https://registry.npmjs.org/@libp2p/identify/-/identify-1.0.11.tgz", + "integrity": "sha512-/f6E2Z+H9sU332DipP3wuxtq06WfP1g4gNnjM7EUJjZ3b6igz8sFRnSVhTq5DGcsPBPT01zct3mrKFCj7ag4Uw==", "requires": { - "@libp2p/interface": "^1.1.1", - "@libp2p/interface-internal": "^1.0.6", - "@libp2p/peer-id": "^4.0.4", - "@libp2p/peer-record": "^7.0.5", + "@libp2p/interface": "^1.1.2", + "@libp2p/interface-internal": "^1.0.7", + "@libp2p/peer-id": "^4.0.5", + "@libp2p/peer-record": "^7.0.6", "@multiformats/multiaddr": "^12.1.10", "@multiformats/multiaddr-matcher": "^1.1.0", - "it-protobuf-stream": "^1.0.2", + "it-protobuf-stream": "^1.1.1", "protons-runtime": "^5.0.0", - "uint8arraylist": "^2.4.3", + "uint8arraylist": "^2.4.7", "uint8arrays": "^5.0.0", "wherearewe": "^2.0.1" }, @@ -29937,14 +29938,14 @@ } }, "@libp2p/interface-internal": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/@libp2p/interface-internal/-/interface-internal-1.0.6.tgz", - "integrity": "sha512-qydJquYkGvNEW+KkvZLMLsVURVgy5KBxMld1lrTbbPCf+CR8LF74d/4qOkJ9HXdJBQKzAOyfkfaxSxBpcHa1yA==", + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/@libp2p/interface-internal/-/interface-internal-1.0.7.tgz", + "integrity": "sha512-r1nGpnGdkq0U7ow5i093OPWPBJXQP3BGwijino8cCZokYwF2P/CU+yeYvL8ncL8fPYLKuuUjLNGO4Z8Th5sqSQ==", "requires": { - "@libp2p/interface": "^1.1.1", - "@libp2p/peer-collections": "^5.1.4", + "@libp2p/interface": "^1.1.2", + "@libp2p/peer-collections": "^5.1.5", "@multiformats/multiaddr": "^12.1.10", - "uint8arraylist": "^2.4.3" + "uint8arraylist": "^2.4.7" } }, "@libp2p/interfaces": { @@ -30031,20 +30032,20 @@ } }, "@libp2p/peer-collections": { - "version": "5.1.4", - "resolved": "https://registry.npmjs.org/@libp2p/peer-collections/-/peer-collections-5.1.4.tgz", - "integrity": "sha512-HqjXAe1ymlG8exbGcpPER1hIcXOpLN2x8TgwzmAOUbZcv7ZeQH+NEoZ30suF7OUqBpD4jWrn0MIj/dOF3OvXOg==", + "version": "5.1.5", + "resolved": "https://registry.npmjs.org/@libp2p/peer-collections/-/peer-collections-5.1.5.tgz", + "integrity": "sha512-/9VisdPC7+15n/0XntjGCzJ2Ky/zZnqdnuLNEwdu2LuTCbWTaqItG36ecgcVdO9L/V4mELwgY5XCjZKBDrYgjA==", "requires": { - "@libp2p/interface": "^1.1.1", - "@libp2p/peer-id": "^4.0.4" + "@libp2p/interface": "^1.1.2", + "@libp2p/peer-id": "^4.0.5" } }, "@libp2p/peer-id": { - "version": "4.0.4", - "resolved": "https://registry.npmjs.org/@libp2p/peer-id/-/peer-id-4.0.4.tgz", - "integrity": "sha512-UHWpo0f34IOaAhlvMNtCMAFVVhv29Dy3IqNvfugFNwzv5p+Jo6TfPGd78H7RX2WIzyVzIgBYxVxmIIHHcqZQ5Q==", + "version": "4.0.5", + "resolved": "https://registry.npmjs.org/@libp2p/peer-id/-/peer-id-4.0.5.tgz", + "integrity": "sha512-/J9U6I/CWSOsYrTpFZpRQrhOhi+bp9WFp7+9Gc7kVt/oevIYTapUEjpxevjViem9ddR5RbdYeCj4ZLHA04QOoQ==", "requires": { - "@libp2p/interface": "^1.1.1", + "@libp2p/interface": "^1.1.2", "multiformats": "^13.0.0", "uint8arrays": "^5.0.0" }, @@ -30093,18 +30094,18 @@ } }, "@libp2p/peer-record": { - "version": "7.0.5", - "resolved": "https://registry.npmjs.org/@libp2p/peer-record/-/peer-record-7.0.5.tgz", - "integrity": "sha512-HG3xYfQ/8gAnAyhATJl9qJCWGfDfAC8KoxsPWW7X3hash9E2Fe8Gdyx1npy904RsJSRt75zMRtPmplQNxE5oIg==", + "version": "7.0.6", + "resolved": "https://registry.npmjs.org/@libp2p/peer-record/-/peer-record-7.0.6.tgz", + "integrity": "sha512-mo7WyJltQU5byC1cwMzqGnzlrSsqkCg8AKhWb0wscuIz2LH6cevmkq+h9mzDnn0KGzJIpZvlInygRVxA/SHS3A==", "requires": { - "@libp2p/crypto": "^4.0.0", - "@libp2p/interface": "^1.1.1", - "@libp2p/peer-id": "^4.0.4", - "@libp2p/utils": "^5.2.1", + "@libp2p/crypto": "^4.0.1", + "@libp2p/interface": "^1.1.2", + "@libp2p/peer-id": "^4.0.5", + "@libp2p/utils": "^5.2.2", "@multiformats/multiaddr": "^12.1.10", "protons-runtime": "^5.0.0", - "uint8-varint": "^2.0.0", - "uint8arraylist": "^2.4.3", + "uint8-varint": "^2.0.2", + "uint8arraylist": "^2.4.7", "uint8arrays": "^5.0.0" }, "dependencies": { @@ -32064,7 +32065,7 @@ "requires": { "@chainsafe/libp2p-gossipsub": "^11.1.0", "@chainsafe/libp2p-noise": "^14.1.0", - "@libp2p/identify": "^1.0.10", + "@libp2p/identify": "^1.0.11", "@libp2p/mplex": "^10.0.12", "@libp2p/ping": "^1.0.9", "@libp2p/websockets": "^8.0.11", @@ -37554,7 +37555,9 @@ } }, "it-protobuf-stream": { - "version": "1.0.2", + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/it-protobuf-stream/-/it-protobuf-stream-1.1.2.tgz", + "integrity": "sha512-epZBuG+7cPaTxCR/Lf3ApshBdA9qfflGPQLfLLrp9VQ0w67Z2xo4H+SLLetav57/29oPtAXwVaoyemg99JOWzA==", "requires": { "it-length-prefixed-stream": "^1.0.0", "it-stream-types": "^2.0.1", diff --git a/packages/sdk/package.json b/packages/sdk/package.json index 8a3988d41c..c71c5c453f 100644 --- a/packages/sdk/package.json +++ b/packages/sdk/package.json @@ -62,7 +62,7 @@ }, "dependencies": { "@chainsafe/libp2p-noise": "^14.1.0", - "@libp2p/identify": "^1.0.10", + "@libp2p/identify": "^1.0.11", "@libp2p/mplex": "^10.0.12", "@libp2p/ping": "^1.0.9", "@libp2p/websockets": "^8.0.11", diff --git a/packages/tests/tests/filter/single_node/subscribe.node.spec.ts b/packages/tests/tests/filter/single_node/subscribe.node.spec.ts index bdaaa4f4ec..5f64dee724 100644 --- a/packages/tests/tests/filter/single_node/subscribe.node.spec.ts +++ b/packages/tests/tests/filter/single_node/subscribe.node.spec.ts @@ -224,11 +224,14 @@ describe("Waku Filter V2: Subscribe: Single Service Node", function () { }); }); - it("Subscribe to 100 topics at once and receives messages", async function () { - let topicCount = 30; + it("Subscribe to 100 topics (new limit) at once and receives messages", async function () { + let topicCount: number; if (isNwakuAtLeast("0.24.0")) { this.timeout(50000); topicCount = 100; + } else { + // skipping for old versions where the limit is 30 + this.skip(); } const td = generateTestData(topicCount); @@ -259,10 +262,82 @@ describe("Waku Filter V2: Subscribe: Single Service Node", function () { } }); - it("Error when try to subscribe to more than 101 topics", async function () { - let topicCount = 31; + //TODO: remove test when WAKUNODE_IMAGE is 0.24.0 + it("Subscribe to 30 topics (old limit) at once and receives messages", async function () { + let topicCount: number; + if (isNwakuAtLeast("0.24.0")) { + // skipping for new versions where the new limit is 100 + this.skip(); + } else { + topicCount = 30; + } + + const td = generateTestData(topicCount); + + await subscription.subscribe(td.decoders, messageCollector.callback); + + // Send a unique message on each topic. + for (let i = 0; i < topicCount; i++) { + await waku.lightPush.send(td.encoders[i], { + payload: utf8ToBytes(`Message for Topic ${i + 1}`) + }); + } + + // Open issue here: https://github.com/waku-org/js-waku/issues/1790 + // That's why we use the try catch block + try { + // Verify that each message was received on the corresponding topic. + expect(await messageCollector.waitForMessages(topicCount)).to.eq(true); + td.contentTopics.forEach((topic, index) => { + messageCollector.verifyReceivedMessage(index, { + expectedContentTopic: topic, + expectedMessageText: `Message for Topic ${index + 1}` + }); + }); + } catch (error) { + console.warn( + "This test still fails because of https://github.com/waku-org/js-waku/issues/1790" + ); + } + }); + + it("Error when try to subscribe to more than 101 topics (new limit)", async function () { + let topicCount: number; if (isNwakuAtLeast("0.24.0")) { topicCount = 101; + } else { + // skipping for old versions where the limit is 30 + this.skip(); + } + const td = generateTestData(topicCount); + + try { + await subscription.subscribe(td.decoders, messageCollector.callback); + throw new Error( + `Subscribe to ${topicCount} topics was successful but was expected to fail with a specific error.` + ); + } catch (err) { + if ( + err instanceof Error && + err.message.includes( + `exceeds maximum content topics: ${topicCount - 1}` + ) + ) { + return; + } else { + throw err; + } + } + }); + + //TODO: remove test when WAKUNODE_IMAGE is 0.24.0 + it("Error when try to subscribe to more than 31 topics (old limit)", async function () { + let topicCount: number; + if (isNwakuAtLeast("0.24.0")) { + // skipping for new versions where the new limit is 100 + this.skip(); + } else { + topicCount = 31; } const td = generateTestData(topicCount);