From 45baa768ad8f9dfafe9c75271b8a39aec2a2bfa1 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 28 Aug 2023 12:46:48 +0530 Subject: [PATCH 1/3] chore(deps)(deps): bump fast-check from 3.8.1 to 3.12.0 (#1498) Bumps [fast-check](https://github.com/dubzzz/fast-check/tree/HEAD/packages/fast-check) from 3.8.1 to 3.12.0. - [Release notes](https://github.com/dubzzz/fast-check/releases) - [Changelog](https://github.com/dubzzz/fast-check/blob/main/packages/fast-check/CHANGELOG.md) - [Commits](https://github.com/dubzzz/fast-check/commits/v3.12.0/packages/fast-check) --- updated-dependencies: - dependency-name: fast-check dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- package-lock.json | 25 +++++++++++++----------- packages/core/package.json | 2 +- packages/message-encryption/package.json | 2 +- packages/message-hash/package.json | 2 +- packages/relay/package.json | 2 +- 5 files changed, 18 insertions(+), 15 deletions(-) diff --git a/package-lock.json b/package-lock.json index 7f9dd025d2..347c86c70d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -12450,7 +12450,9 @@ } }, "node_modules/fast-check": { - "version": "3.8.1", + "version": "3.12.0", + "resolved": "https://registry.npmjs.org/fast-check/-/fast-check-3.12.0.tgz", + "integrity": "sha512-SqahE9mlL3+lhjJ39joMLwcj6F+24hfZdf/tchlNO8sHcTdrUUdA5P/ZbSFZM9Xpzs36XaneGwE0FWepm/zyOA==", "funding": [ { "type": "individual", @@ -12461,7 +12463,6 @@ "url": "https://opencollective.com/fast-check" } ], - "license": "MIT", "dependencies": { "pure-rand": "^6.0.0" }, @@ -30528,7 +30529,7 @@ "@waku/build-utils": "*", "chai": "^4.3.7", "cspell": "^7.0.1", - "fast-check": "^3.8.1", + "fast-check": "^3.12.0", "ignore-loader": "^0.1.2", "isomorphic-fetch": "^3.0.0", "karma": "^6.4.1", @@ -30682,7 +30683,7 @@ "@waku/build-utils": "*", "chai": "^4.3.7", "cspell": "^7.0.1", - "fast-check": "^3.8.1", + "fast-check": "^3.12.0", "karma": "^6.4.1", "karma-chrome-launcher": "^3.2.0", "karma-mocha": "^2.0.1", @@ -30718,7 +30719,7 @@ "@waku/interfaces": "0.0.17", "chai": "^4.3.7", "cspell": "^7.0.1", - "fast-check": "^3.7.0", + "fast-check": "^3.12.0", "ignore-loader": "^0.1.2", "isomorphic-fetch": "^3.0.0", "karma": "^6.4.1", @@ -30807,7 +30808,7 @@ "@waku/utils": "0.0.10", "chai": "^4.3.7", "debug": "^4.3.4", - "fast-check": "^3.8.1" + "fast-check": "^3.12.0" }, "devDependencies": { "@rollup/plugin-commonjs": "^24.1.0", @@ -35738,7 +35739,7 @@ "chai": "^4.3.7", "cspell": "^7.0.1", "debug": "^4.3.4", - "fast-check": "^3.8.1", + "fast-check": "^3.12.0", "ignore-loader": "^0.1.2", "isomorphic-fetch": "^3.0.0", "it-all": "^3.0.2", @@ -35860,7 +35861,7 @@ "chai": "^4.3.7", "cspell": "^7.0.1", "debug": "^4.3.4", - "fast-check": "^3.8.1", + "fast-check": "^3.12.0", "js-sha3": "^0.8.0", "karma": "^6.4.1", "karma-chrome-launcher": "^3.2.0", @@ -35890,7 +35891,7 @@ "@waku/utils": "0.0.10", "chai": "^4.3.7", "cspell": "^7.0.1", - "fast-check": "^3.7.0", + "fast-check": "^3.12.0", "ignore-loader": "^0.1.2", "isomorphic-fetch": "^3.0.0", "karma": "^6.4.1", @@ -35964,7 +35965,7 @@ "@waku/utils": "0.0.10", "chai": "^4.3.7", "debug": "^4.3.4", - "fast-check": "^3.8.1", + "fast-check": "^3.12.0", "rollup": "^3.28.0", "ts-loader": "^9.4.2", "ts-node": "^10.9.1", @@ -40621,7 +40622,9 @@ "dev": true }, "fast-check": { - "version": "3.8.1", + "version": "3.12.0", + "resolved": "https://registry.npmjs.org/fast-check/-/fast-check-3.12.0.tgz", + "integrity": "sha512-SqahE9mlL3+lhjJ39joMLwcj6F+24hfZdf/tchlNO8sHcTdrUUdA5P/ZbSFZM9Xpzs36XaneGwE0FWepm/zyOA==", "requires": { "pure-rand": "^6.0.0" } diff --git a/packages/core/package.json b/packages/core/package.json index e1c3a191a5..af0376d39b 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -96,7 +96,7 @@ "@waku/build-utils": "*", "chai": "^4.3.7", "cspell": "^7.0.1", - "fast-check": "^3.8.1", + "fast-check": "^3.12.0", "ignore-loader": "^0.1.2", "isomorphic-fetch": "^3.0.0", "karma": "^6.4.1", diff --git a/packages/message-encryption/package.json b/packages/message-encryption/package.json index fd2b6bd273..8754fb4638 100644 --- a/packages/message-encryption/package.json +++ b/packages/message-encryption/package.json @@ -88,7 +88,7 @@ "@waku/build-utils": "*", "chai": "^4.3.7", "cspell": "^7.0.1", - "fast-check": "^3.8.1", + "fast-check": "^3.12.0", "karma": "^6.4.1", "karma-chrome-launcher": "^3.2.0", "karma-mocha": "^2.0.1", diff --git a/packages/message-hash/package.json b/packages/message-hash/package.json index d8e112f78f..72d07f3ecb 100644 --- a/packages/message-hash/package.json +++ b/packages/message-hash/package.json @@ -64,7 +64,7 @@ "@waku/interfaces": "0.0.17", "chai": "^4.3.7", "cspell": "^7.0.1", - "fast-check": "^3.7.0", + "fast-check": "^3.12.0", "ignore-loader": "^0.1.2", "isomorphic-fetch": "^3.0.0", "karma": "^6.4.1", diff --git a/packages/relay/package.json b/packages/relay/package.json index 0dabc5c5a4..b9919ebdfa 100644 --- a/packages/relay/package.json +++ b/packages/relay/package.json @@ -57,7 +57,7 @@ "@waku/utils": "0.0.10", "chai": "^4.3.7", "debug": "^4.3.4", - "fast-check": "^3.8.1" + "fast-check": "^3.12.0" }, "devDependencies": { "@rollup/plugin-commonjs": "^24.1.0", From 2389977a9840281dff4008c015fe76451c0f0df5 Mon Sep 17 00:00:00 2001 From: Danish Arora <35004822+danisharora099@users.noreply.github.com> Date: Mon, 28 Aug 2023 13:19:47 +0530 Subject: [PATCH 2/3] chore!: refactor store protocol for readability (#1456) * refactor store protocol for readability * update interface * fix: test * rm: comments * Update packages/core/src/lib/store/index.ts Co-authored-by: fryorcraken <110212804+fryorcraken@users.noreply.github.com> * fix commit --------- Co-authored-by: fryorcraken <110212804+fryorcraken@users.noreply.github.com> --- packages/core/src/lib/store/index.ts | 93 +++++++++++++++---------- packages/interfaces/src/store.ts | 4 +- packages/tests/tests/store.node.spec.ts | 14 ++-- 3 files changed, 66 insertions(+), 45 deletions(-) diff --git a/packages/core/src/lib/store/index.ts b/packages/core/src/lib/store/index.ts index 7583caac72..05068c1358 100644 --- a/packages/core/src/lib/store/index.ts +++ b/packages/core/src/lib/store/index.ts @@ -86,6 +86,54 @@ class Store extends BaseProtocol implements IStore { this.options = options ?? {}; } + /** + * Processes messages based on the provided callback and options. + * @private + */ + private async processMessages( + messages: Promise[], + callback: (message: T) => Promise | boolean | void, + options?: QueryOptions + ): Promise { + let abort = false; + const messagesOrUndef: Array = await Promise.all(messages); + let processedMessages: Array = messagesOrUndef.filter(isDefined); + + if (this.shouldReverseOrder(options)) { + processedMessages = processedMessages.reverse(); + } + + await Promise.all( + processedMessages.map(async (msg) => { + if (msg && !abort) { + abort = Boolean(await callback(msg)); + } + }) + ); + + return abort; + } + + /** + * Determines whether to reverse the order of messages based on the provided options. + * + * Messages in pages are ordered from oldest (first) to most recent (last). + * https://github.com/vacp2p/rfc/issues/533 + * + * @private + */ + private shouldReverseOrder(options?: QueryOptions): boolean { + return ( + typeof options?.pageDirection === "undefined" || + options?.pageDirection === PageDirection.BACKWARD + ); + } + + /** + * @deprecated Use `queryWithOrderedCallback` instead + **/ + queryOrderedCallback = this.queryWithOrderedCallback; + /** * Do a query to a Waku Store to retrieve historical/missed messages. * @@ -103,42 +151,20 @@ class Store extends BaseProtocol implements IStore { * or if an error is encountered when processing the reply, * or if two decoders with the same content topic are passed. */ - async queryOrderedCallback( + async queryWithOrderedCallback( decoders: IDecoder[], callback: (message: T) => Promise | boolean | void, options?: QueryOptions ): Promise { - let abort = false; for await (const promises of this.queryGenerator(decoders, options)) { - if (abort) break; - const messagesOrUndef: Array = await Promise.all(promises); - - let messages: Array = messagesOrUndef.filter(isDefined); - - // Messages in pages are ordered from oldest (first) to most recent (last). - // https://github.com/vacp2p/rfc/issues/533 - if ( - typeof options?.pageDirection === "undefined" || - options?.pageDirection === PageDirection.BACKWARD - ) { - messages = messages.reverse(); - } - - await Promise.all( - messages.map(async (msg) => { - if (msg && !abort) { - abort = Boolean(await callback(msg)); - } - }) - ); + if (await this.processMessages(promises, callback, options)) break; } } /** * Do a query to a Waku Store to retrieve historical/missed messages. - * * The callback function takes a `Promise` in input, - * useful if messages needs to be decrypted and performance matters. + * useful if messages need to be decrypted and performance matters. * * The order of the messages passed to the callback is as follows: * - within a page, messages are expected to be ordered from oldest to most recent @@ -152,7 +178,7 @@ class Store extends BaseProtocol implements IStore { * or if an error is encountered when processing the reply, * or if two decoders with the same content topic are passed. */ - async queryCallbackOnPromise( + async queryWithPromiseCallback( decoders: IDecoder[], callback: ( message: Promise @@ -160,17 +186,15 @@ class Store extends BaseProtocol implements IStore { options?: QueryOptions ): Promise { let abort = false; - let promises: Promise[] = []; for await (const page of this.queryGenerator(decoders, options)) { - const _promises = page.map(async (msg) => { - if (!abort) { - abort = Boolean(await callback(msg)); - } + const _promises = page.map(async (msgPromise) => { + if (abort) return; + abort = Boolean(await callback(msgPromise)); }); - promises = promises.concat(_promises); + await Promise.all(_promises); + if (abort) break; } - await Promise.all(promises); } /** @@ -183,9 +207,6 @@ class Store extends BaseProtocol implements IStore { * as follows: * - within a page, messages SHOULD be ordered from oldest to most recent * - pages direction depends on { @link QueryOptions.pageDirection } - * - * However, there is no way to guarantee the behavior of the remote node. - * * @throws If not able to reach a Waku Store peer to query, * or if an error is encountered when processing the reply, * or if two decoders with the same content topic are passed. diff --git a/packages/interfaces/src/store.ts b/packages/interfaces/src/store.ts index e3ad74c74d..aea825b3b2 100644 --- a/packages/interfaces/src/store.ts +++ b/packages/interfaces/src/store.ts @@ -46,12 +46,12 @@ export type StoreQueryOptions = { } & ProtocolOptions; export interface IStore extends IBaseProtocol { - queryOrderedCallback: ( + queryWithOrderedCallback: ( decoders: IDecoder[], callback: (message: T) => Promise | boolean | void, options?: StoreQueryOptions ) => Promise; - queryCallbackOnPromise: ( + queryWithPromiseCallback: ( decoders: IDecoder[], callback: ( message: Promise diff --git a/packages/tests/tests/store.node.spec.ts b/packages/tests/tests/store.node.spec.ts index f75d1b5935..cde93d098c 100644 --- a/packages/tests/tests/store.node.spec.ts +++ b/packages/tests/tests/store.node.spec.ts @@ -204,7 +204,7 @@ describe("Waku Store", () => { await waitForRemotePeer(waku, [Protocols.Store]); const messages: IMessage[] = []; - await waku.store.queryCallbackOnPromise( + await waku.store.queryWithPromiseCallback( [TestDecoder], async (msgPromise) => { const msg = await msgPromise; @@ -246,7 +246,7 @@ describe("Waku Store", () => { const desiredMsgs = 14; const messages: IMessage[] = []; - await waku.store.queryCallbackOnPromise( + await waku.store.queryWithPromiseCallback( [TestDecoder], async (msgPromise) => { const msg = await msgPromise; @@ -285,7 +285,7 @@ describe("Waku Store", () => { await waitForRemotePeer(waku, [Protocols.Store]); const messages: IMessage[] = []; - await waku.store.queryOrderedCallback( + await waku.store.queryWithOrderedCallback( [TestDecoder], async (msg) => { messages.push(msg); @@ -324,7 +324,7 @@ describe("Waku Store", () => { await waitForRemotePeer(waku, [Protocols.Store]); let messages: IMessage[] = []; - await waku.store.queryOrderedCallback( + await waku.store.queryWithOrderedCallback( [TestDecoder], async (msg) => { messages.push(msg); @@ -491,7 +491,7 @@ describe("Waku Store", () => { const nwakuPeerId = await nwaku.getPeerId(); const firstMessages: IMessage[] = []; - await waku.store.queryOrderedCallback( + await waku.store.queryWithOrderedCallback( [TestDecoder], (msg) => { if (msg) { @@ -505,7 +505,7 @@ describe("Waku Store", () => { ); const bothMessages: IMessage[] = []; - await waku.store.queryOrderedCallback( + await waku.store.queryWithOrderedCallback( [TestDecoder], async (msg) => { bothMessages.push(msg); @@ -552,7 +552,7 @@ describe("Waku Store", () => { const desiredMsgs = 14; const messages: IMessage[] = []; - await waku.store.queryOrderedCallback( + await waku.store.queryWithOrderedCallback( [TestDecoder], async (msg) => { messages.push(msg); From df5f286e68fe81b2d98520c8cccece44256a49d8 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 28 Aug 2023 22:12:23 +0530 Subject: [PATCH 3/3] chore(deps)(deps): bump @libp2p/peer-id from 2.0.4 to 3.0.2 (#1512) Bumps [@libp2p/peer-id](https://github.com/libp2p/js-libp2p) from 2.0.4 to 3.0.2. - [Release notes](https://github.com/libp2p/js-libp2p/releases) - [Changelog](https://github.com/libp2p/js-libp2p/blob/master/.release-please.json) - [Commits](https://github.com/libp2p/js-libp2p/compare/prometheus-metrics-v2.0.4...logger-v3.0.2) --- updated-dependencies: - dependency-name: "@libp2p/peer-id" dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- package-lock.json | 295 ++++------------------------ packages/dns-discovery/package.json | 2 +- packages/enr/package.json | 2 +- packages/tests/package.json | 2 +- 4 files changed, 37 insertions(+), 264 deletions(-) diff --git a/package-lock.json b/package-lock.json index 347c86c70d..06fde93af2 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1553,16 +1553,6 @@ "multiformats": "^12.0.1" } }, - "node_modules/@chainsafe/libp2p-gossipsub/node_modules/@libp2p/peer-id": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/@libp2p/peer-id/-/peer-id-3.0.1.tgz", - "integrity": "sha512-iR4lP9nEnIl1fW7beuB55A262lW78sOdH6r/57XcyMtsE/mCZiRhUVhGfvcM4GgLWm26vyla/UV3FVr7hIpMIQ==", - "dependencies": { - "@libp2p/interface": "^0.1.1", - "multiformats": "^12.0.1", - "uint8arrays": "^4.0.4" - } - }, "node_modules/@chainsafe/libp2p-gossipsub/node_modules/multiformats": { "version": "12.0.1", "resolved": "https://registry.npmjs.org/multiformats/-/multiformats-12.0.1.tgz", @@ -1626,16 +1616,6 @@ "multiformats": "^12.0.1" } }, - "node_modules/@chainsafe/libp2p-noise/node_modules/@libp2p/peer-id": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/@libp2p/peer-id/-/peer-id-3.0.1.tgz", - "integrity": "sha512-iR4lP9nEnIl1fW7beuB55A262lW78sOdH6r/57XcyMtsE/mCZiRhUVhGfvcM4GgLWm26vyla/UV3FVr7hIpMIQ==", - "dependencies": { - "@libp2p/interface": "^0.1.1", - "multiformats": "^12.0.1", - "uint8arrays": "^4.0.4" - } - }, "node_modules/@chainsafe/libp2p-noise/node_modules/it-stream-types": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/it-stream-types/-/it-stream-types-2.0.1.tgz", @@ -2868,17 +2848,6 @@ "multiformats": "^12.0.1" } }, - "node_modules/@libp2p/bootstrap/node_modules/@libp2p/peer-id": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/@libp2p/peer-id/-/peer-id-3.0.1.tgz", - "integrity": "sha512-iR4lP9nEnIl1fW7beuB55A262lW78sOdH6r/57XcyMtsE/mCZiRhUVhGfvcM4GgLWm26vyla/UV3FVr7hIpMIQ==", - "dev": true, - "dependencies": { - "@libp2p/interface": "^0.1.1", - "multiformats": "^12.0.1", - "uint8arrays": "^4.0.4" - } - }, "node_modules/@libp2p/bootstrap/node_modules/multiformats": { "version": "12.0.1", "resolved": "https://registry.npmjs.org/multiformats/-/multiformats-12.0.1.tgz", @@ -2942,25 +2911,6 @@ "@libp2p/peer-id": "^3.0.1" } }, - "node_modules/@libp2p/interface-internal/node_modules/@libp2p/peer-id": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/@libp2p/peer-id/-/peer-id-3.0.1.tgz", - "integrity": "sha512-iR4lP9nEnIl1fW7beuB55A262lW78sOdH6r/57XcyMtsE/mCZiRhUVhGfvcM4GgLWm26vyla/UV3FVr7hIpMIQ==", - "dependencies": { - "@libp2p/interface": "^0.1.1", - "multiformats": "^12.0.1", - "uint8arrays": "^4.0.4" - } - }, - "node_modules/@libp2p/interface-internal/node_modules/multiformats": { - "version": "12.0.1", - "resolved": "https://registry.npmjs.org/multiformats/-/multiformats-12.0.1.tgz", - "integrity": "sha512-s01wijBJoDUqESWSzePY0lvTw7J3PVO9x2Cc6ASI5AMZM2Gnhh7BC17+nlFhHKU7dDzaCaRfb+NiqNzOsgPUoQ==", - "engines": { - "node": ">=16.0.0", - "npm": ">=7.0.0" - } - }, "node_modules/@libp2p/interface-keys": { "version": "1.0.7", "license": "Apache-2.0 OR MIT", @@ -3048,16 +2998,6 @@ "multiformats": "^12.0.1" } }, - "node_modules/@libp2p/keychain/node_modules/@libp2p/peer-id": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/@libp2p/peer-id/-/peer-id-3.0.1.tgz", - "integrity": "sha512-iR4lP9nEnIl1fW7beuB55A262lW78sOdH6r/57XcyMtsE/mCZiRhUVhGfvcM4GgLWm26vyla/UV3FVr7hIpMIQ==", - "dependencies": { - "@libp2p/interface": "^0.1.1", - "multiformats": "^12.0.1", - "uint8arrays": "^4.0.4" - } - }, "node_modules/@libp2p/keychain/node_modules/multiformats": { "version": "12.0.1", "resolved": "https://registry.npmjs.org/multiformats/-/multiformats-12.0.1.tgz", @@ -3181,17 +3121,13 @@ } }, "node_modules/@libp2p/peer-id": { - "version": "2.0.4", - "license": "Apache-2.0 OR MIT", + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/@libp2p/peer-id/-/peer-id-3.0.2.tgz", + "integrity": "sha512-133qGXu9UBiqsYm7nBDJaAh4eiKe79DPLKF+/aRu0Z7gKcX7I0+LewEky4kBt3olhYQSF1CAnJIzD8Dmsn40Yw==", "dependencies": { - "@libp2p/interface-peer-id": "^2.0.0", - "@libp2p/interfaces": "^3.2.0", - "multiformats": "^11.0.0", - "uint8arrays": "^4.0.2" - }, - "engines": { - "node": ">=16.0.0", - "npm": ">=7.0.0" + "@libp2p/interface": "^0.1.2", + "multiformats": "^12.0.1", + "uint8arrays": "^4.0.6" } }, "node_modules/@libp2p/peer-id-factory": { @@ -3223,16 +3159,6 @@ "uint8arrays": "^4.0.6" } }, - "node_modules/@libp2p/peer-id-factory/node_modules/@libp2p/peer-id": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/@libp2p/peer-id/-/peer-id-3.0.2.tgz", - "integrity": "sha512-133qGXu9UBiqsYm7nBDJaAh4eiKe79DPLKF+/aRu0Z7gKcX7I0+LewEky4kBt3olhYQSF1CAnJIzD8Dmsn40Yw==", - "dependencies": { - "@libp2p/interface": "^0.1.2", - "multiformats": "^12.0.1", - "uint8arrays": "^4.0.6" - } - }, "node_modules/@libp2p/peer-id-factory/node_modules/multiformats": { "version": "12.0.1", "resolved": "https://registry.npmjs.org/multiformats/-/multiformats-12.0.1.tgz", @@ -3242,6 +3168,15 @@ "npm": ">=7.0.0" } }, + "node_modules/@libp2p/peer-id/node_modules/multiformats": { + "version": "12.1.0", + "resolved": "https://registry.npmjs.org/multiformats/-/multiformats-12.1.0.tgz", + "integrity": "sha512-/qTOKKnU8nwcVURjRcS+UN0QYgdS5BPZzY10Aiciu2SqncyCVMGV8KtD83EBFmsuJDsSEmT4sGvzcTkCoMw0sQ==", + "engines": { + "node": ">=16.0.0", + "npm": ">=7.0.0" + } + }, "node_modules/@libp2p/peer-store": { "version": "9.0.2", "resolved": "https://registry.npmjs.org/@libp2p/peer-store/-/peer-store-9.0.2.tgz", @@ -3299,16 +3234,6 @@ "@libp2p/peer-id": "^3.0.1" } }, - "node_modules/@libp2p/peer-store/node_modules/@libp2p/peer-id": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/@libp2p/peer-id/-/peer-id-3.0.1.tgz", - "integrity": "sha512-iR4lP9nEnIl1fW7beuB55A262lW78sOdH6r/57XcyMtsE/mCZiRhUVhGfvcM4GgLWm26vyla/UV3FVr7hIpMIQ==", - "dependencies": { - "@libp2p/interface": "^0.1.1", - "multiformats": "^12.0.1", - "uint8arrays": "^4.0.4" - } - }, "node_modules/@libp2p/peer-store/node_modules/@libp2p/peer-record": { "version": "6.0.2", "resolved": "https://registry.npmjs.org/@libp2p/peer-record/-/peer-record-6.0.2.tgz", @@ -3391,16 +3316,6 @@ "@libp2p/peer-id": "^3.0.1" } }, - "node_modules/@libp2p/pubsub/node_modules/@libp2p/peer-id": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/@libp2p/peer-id/-/peer-id-3.0.1.tgz", - "integrity": "sha512-iR4lP9nEnIl1fW7beuB55A262lW78sOdH6r/57XcyMtsE/mCZiRhUVhGfvcM4GgLWm26vyla/UV3FVr7hIpMIQ==", - "dependencies": { - "@libp2p/interface": "^0.1.1", - "multiformats": "^12.0.1", - "uint8arrays": "^4.0.4" - } - }, "node_modules/@libp2p/pubsub/node_modules/multiformats": { "version": "12.0.1", "resolved": "https://registry.npmjs.org/multiformats/-/multiformats-12.0.1.tgz", @@ -15539,16 +15454,6 @@ "@libp2p/peer-id": "^3.0.1" } }, - "node_modules/libp2p/node_modules/@libp2p/peer-id": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/@libp2p/peer-id/-/peer-id-3.0.1.tgz", - "integrity": "sha512-iR4lP9nEnIl1fW7beuB55A262lW78sOdH6r/57XcyMtsE/mCZiRhUVhGfvcM4GgLWm26vyla/UV3FVr7hIpMIQ==", - "dependencies": { - "@libp2p/interface": "^0.1.1", - "multiformats": "^12.0.1", - "uint8arrays": "^4.0.4" - } - }, "node_modules/libp2p/node_modules/@libp2p/peer-record": { "version": "6.0.2", "resolved": "https://registry.npmjs.org/@libp2p/peer-record/-/peer-record-6.0.2.tgz", @@ -30578,7 +30483,7 @@ "uint8arrays": "^4.0.4" }, "devDependencies": { - "@libp2p/peer-id": "^2.0.4", + "@libp2p/peer-id": "^3.0.2", "@libp2p/peer-id-factory": "^3.0.3", "@multiformats/multiaddr": "^12.0.0", "@rollup/plugin-commonjs": "^24.0.1", @@ -30610,7 +30515,7 @@ "dependencies": { "@ethersproject/rlp": "^5.7.0", "@libp2p/crypto": "^1.0.17", - "@libp2p/peer-id": "^2.0.4", + "@libp2p/peer-id": "^3.0.2", "@multiformats/multiaddr": "^12.0.0", "@noble/secp256k1": "^1.7.1", "@waku/utils": "0.0.10", @@ -30904,7 +30809,7 @@ "license": "MIT OR Apache-2.0", "dependencies": { "@libp2p/interface-compliance-tests": "^4.0.2", - "@libp2p/peer-id": "^2.0.4", + "@libp2p/peer-id": "^3.0.2", "@waku/core": "*", "@waku/enr": "*", "@waku/interfaces": "*", @@ -30984,16 +30889,6 @@ "uint8arrays": "^4.0.4" } }, - "packages/tests/node_modules/@libp2p/interface-compliance-tests/node_modules/@libp2p/peer-id": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/@libp2p/peer-id/-/peer-id-3.0.1.tgz", - "integrity": "sha512-iR4lP9nEnIl1fW7beuB55A262lW78sOdH6r/57XcyMtsE/mCZiRhUVhGfvcM4GgLWm26vyla/UV3FVr7hIpMIQ==", - "dependencies": { - "@libp2p/interface": "^0.1.1", - "multiformats": "^12.0.1", - "uint8arrays": "^4.0.4" - } - }, "packages/tests/node_modules/@libp2p/logger": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/@libp2p/logger/-/logger-3.0.1.tgz", @@ -31015,16 +30910,6 @@ "@libp2p/peer-id": "^3.0.1" } }, - "packages/tests/node_modules/@libp2p/peer-collections/node_modules/@libp2p/peer-id": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/@libp2p/peer-id/-/peer-id-3.0.1.tgz", - "integrity": "sha512-iR4lP9nEnIl1fW7beuB55A262lW78sOdH6r/57XcyMtsE/mCZiRhUVhGfvcM4GgLWm26vyla/UV3FVr7hIpMIQ==", - "dependencies": { - "@libp2p/interface": "^0.1.1", - "multiformats": "^12.0.1", - "uint8arrays": "^4.0.4" - } - }, "packages/tests/node_modules/@typescript-eslint/eslint-plugin": { "version": "5.62.0", "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.62.0.tgz", @@ -32438,16 +32323,6 @@ "multiformats": "^12.0.1" } }, - "@libp2p/peer-id": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/@libp2p/peer-id/-/peer-id-3.0.1.tgz", - "integrity": "sha512-iR4lP9nEnIl1fW7beuB55A262lW78sOdH6r/57XcyMtsE/mCZiRhUVhGfvcM4GgLWm26vyla/UV3FVr7hIpMIQ==", - "requires": { - "@libp2p/interface": "^0.1.1", - "multiformats": "^12.0.1", - "uint8arrays": "^4.0.4" - } - }, "multiformats": { "version": "12.0.1", "resolved": "https://registry.npmjs.org/multiformats/-/multiformats-12.0.1.tgz", @@ -32505,16 +32380,6 @@ "multiformats": "^12.0.1" } }, - "@libp2p/peer-id": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/@libp2p/peer-id/-/peer-id-3.0.1.tgz", - "integrity": "sha512-iR4lP9nEnIl1fW7beuB55A262lW78sOdH6r/57XcyMtsE/mCZiRhUVhGfvcM4GgLWm26vyla/UV3FVr7hIpMIQ==", - "requires": { - "@libp2p/interface": "^0.1.1", - "multiformats": "^12.0.1", - "uint8arrays": "^4.0.4" - } - }, "it-stream-types": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/it-stream-types/-/it-stream-types-2.0.1.tgz", @@ -33389,17 +33254,6 @@ "multiformats": "^12.0.1" } }, - "@libp2p/peer-id": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/@libp2p/peer-id/-/peer-id-3.0.1.tgz", - "integrity": "sha512-iR4lP9nEnIl1fW7beuB55A262lW78sOdH6r/57XcyMtsE/mCZiRhUVhGfvcM4GgLWm26vyla/UV3FVr7hIpMIQ==", - "dev": true, - "requires": { - "@libp2p/interface": "^0.1.1", - "multiformats": "^12.0.1", - "uint8arrays": "^4.0.4" - } - }, "multiformats": { "version": "12.0.1", "resolved": "https://registry.npmjs.org/multiformats/-/multiformats-12.0.1.tgz", @@ -33467,21 +33321,6 @@ "@libp2p/interface": "^0.1.1", "@libp2p/peer-id": "^3.0.1" } - }, - "@libp2p/peer-id": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/@libp2p/peer-id/-/peer-id-3.0.1.tgz", - "integrity": "sha512-iR4lP9nEnIl1fW7beuB55A262lW78sOdH6r/57XcyMtsE/mCZiRhUVhGfvcM4GgLWm26vyla/UV3FVr7hIpMIQ==", - "requires": { - "@libp2p/interface": "^0.1.1", - "multiformats": "^12.0.1", - "uint8arrays": "^4.0.4" - } - }, - "multiformats": { - "version": "12.0.1", - "resolved": "https://registry.npmjs.org/multiformats/-/multiformats-12.0.1.tgz", - "integrity": "sha512-s01wijBJoDUqESWSzePY0lvTw7J3PVO9x2Cc6ASI5AMZM2Gnhh7BC17+nlFhHKU7dDzaCaRfb+NiqNzOsgPUoQ==" } } }, @@ -33539,16 +33378,6 @@ "multiformats": "^12.0.1" } }, - "@libp2p/peer-id": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/@libp2p/peer-id/-/peer-id-3.0.1.tgz", - "integrity": "sha512-iR4lP9nEnIl1fW7beuB55A262lW78sOdH6r/57XcyMtsE/mCZiRhUVhGfvcM4GgLWm26vyla/UV3FVr7hIpMIQ==", - "requires": { - "@libp2p/interface": "^0.1.1", - "multiformats": "^12.0.1", - "uint8arrays": "^4.0.4" - } - }, "multiformats": { "version": "12.0.1", "resolved": "https://registry.npmjs.org/multiformats/-/multiformats-12.0.1.tgz", @@ -33653,12 +33482,20 @@ } }, "@libp2p/peer-id": { - "version": "2.0.4", + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/@libp2p/peer-id/-/peer-id-3.0.2.tgz", + "integrity": "sha512-133qGXu9UBiqsYm7nBDJaAh4eiKe79DPLKF+/aRu0Z7gKcX7I0+LewEky4kBt3olhYQSF1CAnJIzD8Dmsn40Yw==", "requires": { - "@libp2p/interface-peer-id": "^2.0.0", - "@libp2p/interfaces": "^3.2.0", - "multiformats": "^11.0.0", - "uint8arrays": "^4.0.2" + "@libp2p/interface": "^0.1.2", + "multiformats": "^12.0.1", + "uint8arrays": "^4.0.6" + }, + "dependencies": { + "multiformats": { + "version": "12.1.0", + "resolved": "https://registry.npmjs.org/multiformats/-/multiformats-12.1.0.tgz", + "integrity": "sha512-/qTOKKnU8nwcVURjRcS+UN0QYgdS5BPZzY10Aiciu2SqncyCVMGV8KtD83EBFmsuJDsSEmT4sGvzcTkCoMw0sQ==" + } } }, "@libp2p/peer-id-factory": { @@ -33690,16 +33527,6 @@ "uint8arrays": "^4.0.6" } }, - "@libp2p/peer-id": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/@libp2p/peer-id/-/peer-id-3.0.2.tgz", - "integrity": "sha512-133qGXu9UBiqsYm7nBDJaAh4eiKe79DPLKF+/aRu0Z7gKcX7I0+LewEky4kBt3olhYQSF1CAnJIzD8Dmsn40Yw==", - "requires": { - "@libp2p/interface": "^0.1.2", - "multiformats": "^12.0.1", - "uint8arrays": "^4.0.6" - } - }, "multiformats": { "version": "12.0.1", "resolved": "https://registry.npmjs.org/multiformats/-/multiformats-12.0.1.tgz", @@ -33764,16 +33591,6 @@ "@libp2p/peer-id": "^3.0.1" } }, - "@libp2p/peer-id": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/@libp2p/peer-id/-/peer-id-3.0.1.tgz", - "integrity": "sha512-iR4lP9nEnIl1fW7beuB55A262lW78sOdH6r/57XcyMtsE/mCZiRhUVhGfvcM4GgLWm26vyla/UV3FVr7hIpMIQ==", - "requires": { - "@libp2p/interface": "^0.1.1", - "multiformats": "^12.0.1", - "uint8arrays": "^4.0.4" - } - }, "@libp2p/peer-record": { "version": "6.0.2", "resolved": "https://registry.npmjs.org/@libp2p/peer-record/-/peer-record-6.0.2.tgz", @@ -33854,16 +33671,6 @@ "@libp2p/peer-id": "^3.0.1" } }, - "@libp2p/peer-id": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/@libp2p/peer-id/-/peer-id-3.0.1.tgz", - "integrity": "sha512-iR4lP9nEnIl1fW7beuB55A262lW78sOdH6r/57XcyMtsE/mCZiRhUVhGfvcM4GgLWm26vyla/UV3FVr7hIpMIQ==", - "requires": { - "@libp2p/interface": "^0.1.1", - "multiformats": "^12.0.1", - "uint8arrays": "^4.0.4" - } - }, "multiformats": { "version": "12.0.1", "resolved": "https://registry.npmjs.org/multiformats/-/multiformats-12.0.1.tgz", @@ -35770,7 +35577,7 @@ "@waku/dns-discovery": { "version": "file:packages/dns-discovery", "requires": { - "@libp2p/peer-id": "^2.0.4", + "@libp2p/peer-id": "^3.0.2", "@libp2p/peer-id-factory": "^3.0.3", "@multiformats/multiaddr": "^12.0.0", "@rollup/plugin-commonjs": "^24.0.1", @@ -35803,7 +35610,7 @@ "requires": { "@ethersproject/rlp": "^5.7.0", "@libp2p/crypto": "^1.0.17", - "@libp2p/peer-id": "^2.0.4", + "@libp2p/peer-id": "^3.0.2", "@libp2p/peer-id-factory": "^3.0.3", "@multiformats/multiaddr": "^12.0.0", "@noble/secp256k1": "^1.7.1", @@ -36026,7 +35833,7 @@ "requires": { "@libp2p/bootstrap": "^9.0.2", "@libp2p/interface-compliance-tests": "^4.0.2", - "@libp2p/peer-id": "^2.0.4", + "@libp2p/peer-id": "^3.0.2", "@types/chai": "^4.3.5", "@types/dockerode": "^3.3.19", "@types/mocha": "^10.0.1", @@ -36097,18 +35904,6 @@ "ts-sinon": "^2.0.2", "uint8arraylist": "^2.4.3", "uint8arrays": "^4.0.4" - }, - "dependencies": { - "@libp2p/peer-id": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/@libp2p/peer-id/-/peer-id-3.0.1.tgz", - "integrity": "sha512-iR4lP9nEnIl1fW7beuB55A262lW78sOdH6r/57XcyMtsE/mCZiRhUVhGfvcM4GgLWm26vyla/UV3FVr7hIpMIQ==", - "requires": { - "@libp2p/interface": "^0.1.1", - "multiformats": "^12.0.1", - "uint8arrays": "^4.0.4" - } - } } }, "@libp2p/logger": { @@ -36130,18 +35925,6 @@ "requires": { "@libp2p/interface": "^0.1.1", "@libp2p/peer-id": "^3.0.1" - }, - "dependencies": { - "@libp2p/peer-id": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/@libp2p/peer-id/-/peer-id-3.0.1.tgz", - "integrity": "sha512-iR4lP9nEnIl1fW7beuB55A262lW78sOdH6r/57XcyMtsE/mCZiRhUVhGfvcM4GgLWm26vyla/UV3FVr7hIpMIQ==", - "requires": { - "@libp2p/interface": "^0.1.1", - "multiformats": "^12.0.1", - "uint8arrays": "^4.0.4" - } - } } }, "@typescript-eslint/eslint-plugin": { @@ -42679,16 +42462,6 @@ "@libp2p/peer-id": "^3.0.1" } }, - "@libp2p/peer-id": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/@libp2p/peer-id/-/peer-id-3.0.1.tgz", - "integrity": "sha512-iR4lP9nEnIl1fW7beuB55A262lW78sOdH6r/57XcyMtsE/mCZiRhUVhGfvcM4GgLWm26vyla/UV3FVr7hIpMIQ==", - "requires": { - "@libp2p/interface": "^0.1.1", - "multiformats": "^12.0.1", - "uint8arrays": "^4.0.4" - } - }, "@libp2p/peer-record": { "version": "6.0.2", "resolved": "https://registry.npmjs.org/@libp2p/peer-record/-/peer-record-6.0.2.tgz", diff --git a/packages/dns-discovery/package.json b/packages/dns-discovery/package.json index 2fa7542201..3300efe886 100644 --- a/packages/dns-discovery/package.json +++ b/packages/dns-discovery/package.json @@ -59,7 +59,7 @@ "uint8arrays": "^4.0.4" }, "devDependencies": { - "@libp2p/peer-id": "^2.0.4", + "@libp2p/peer-id": "^3.0.2", "@libp2p/peer-id-factory": "^3.0.3", "@multiformats/multiaddr": "^12.0.0", "@rollup/plugin-commonjs": "^24.0.1", diff --git a/packages/enr/package.json b/packages/enr/package.json index 5d91a164eb..0c5b15790b 100644 --- a/packages/enr/package.json +++ b/packages/enr/package.json @@ -53,7 +53,7 @@ "dependencies": { "@ethersproject/rlp": "^5.7.0", "@libp2p/crypto": "^1.0.17", - "@libp2p/peer-id": "^2.0.4", + "@libp2p/peer-id": "^3.0.2", "@multiformats/multiaddr": "^12.0.0", "@noble/secp256k1": "^1.7.1", "@waku/utils": "0.0.10", diff --git a/packages/tests/package.json b/packages/tests/package.json index 57b5dad392..2baebffbcd 100644 --- a/packages/tests/package.json +++ b/packages/tests/package.json @@ -51,7 +51,7 @@ }, "dependencies": { "@libp2p/interface-compliance-tests": "^4.0.2", - "@libp2p/peer-id": "^2.0.4", + "@libp2p/peer-id": "^3.0.2", "@waku/core": "*", "@waku/enr": "*", "@waku/interfaces": "*",