diff --git a/package-lock.json b/package-lock.json index ceeb0d9d3e..de2de1851a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -2641,34 +2641,6 @@ "npm": ">=8.7.0" } }, - "node_modules/@chainsafe/libp2p-gossipsub/node_modules/@libp2p/crypto": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/@libp2p/crypto/-/crypto-5.0.1.tgz", - "integrity": "sha512-j7X4ISdWHnIJh752bl70z+3R4LdB8xftFU0ShOuuHg9ETTViHa3O0AK5v1HxyaSXE/uhXhfwjVH3vxn8ECQl/A==", - "license": "Apache-2.0 OR MIT", - "dependencies": { - "@libp2p/interface": "^2.0.1", - "@noble/curves": "^1.4.0", - "@noble/hashes": "^1.4.0", - "asn1js": "^3.0.5", - "multiformats": "^13.1.0", - "protons-runtime": "^5.4.0", - "uint8arraylist": "^2.4.8", - "uint8arrays": "^5.1.0" - } - }, - "node_modules/@chainsafe/libp2p-gossipsub/node_modules/@libp2p/peer-id": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/@libp2p/peer-id/-/peer-id-5.0.1.tgz", - "integrity": "sha512-HwoW7dQ/o4NQ+5PQThOzMK2OHMRicmTZxVuMjbjWcPNnNWb8x/5vwjzdEUfqXimHYdZTIpy2PMMq6Jf4zvculQ==", - "license": "Apache-2.0 OR MIT", - "dependencies": { - "@libp2p/crypto": "^5.0.1", - "@libp2p/interface": "^2.0.1", - "multiformats": "^13.1.0", - "uint8arrays": "^5.1.0" - } - }, "node_modules/@chainsafe/libp2p-noise": { "version": "16.0.0", "resolved": "https://registry.npmjs.org/@chainsafe/libp2p-noise/-/libp2p-noise-16.0.0.tgz", @@ -2694,34 +2666,6 @@ "wherearewe": "^2.0.1" } }, - "node_modules/@chainsafe/libp2p-noise/node_modules/@libp2p/crypto": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/@libp2p/crypto/-/crypto-5.0.1.tgz", - "integrity": "sha512-j7X4ISdWHnIJh752bl70z+3R4LdB8xftFU0ShOuuHg9ETTViHa3O0AK5v1HxyaSXE/uhXhfwjVH3vxn8ECQl/A==", - "license": "Apache-2.0 OR MIT", - "dependencies": { - "@libp2p/interface": "^2.0.1", - "@noble/curves": "^1.4.0", - "@noble/hashes": "^1.4.0", - "asn1js": "^3.0.5", - "multiformats": "^13.1.0", - "protons-runtime": "^5.4.0", - "uint8arraylist": "^2.4.8", - "uint8arrays": "^5.1.0" - } - }, - "node_modules/@chainsafe/libp2p-noise/node_modules/@libp2p/peer-id": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/@libp2p/peer-id/-/peer-id-5.0.1.tgz", - "integrity": "sha512-HwoW7dQ/o4NQ+5PQThOzMK2OHMRicmTZxVuMjbjWcPNnNWb8x/5vwjzdEUfqXimHYdZTIpy2PMMq6Jf4zvculQ==", - "license": "Apache-2.0 OR MIT", - "dependencies": { - "@libp2p/crypto": "^5.0.1", - "@libp2p/interface": "^2.0.1", - "multiformats": "^13.1.0", - "uint8arrays": "^5.1.0" - } - }, "node_modules/@chainsafe/netmask": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/@chainsafe/netmask/-/netmask-2.0.0.tgz", @@ -5510,7 +5454,7 @@ "@multiformats/multiaddr": "^12.2.3" } }, - "node_modules/@libp2p/bootstrap/node_modules/@libp2p/crypto": { + "node_modules/@libp2p/crypto": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/@libp2p/crypto/-/crypto-5.0.1.tgz", "integrity": "sha512-j7X4ISdWHnIJh752bl70z+3R4LdB8xftFU0ShOuuHg9ETTViHa3O0AK5v1HxyaSXE/uhXhfwjVH3vxn8ECQl/A==", @@ -5526,18 +5470,6 @@ "uint8arrays": "^5.1.0" } }, - "node_modules/@libp2p/bootstrap/node_modules/@libp2p/peer-id": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/@libp2p/peer-id/-/peer-id-5.0.1.tgz", - "integrity": "sha512-HwoW7dQ/o4NQ+5PQThOzMK2OHMRicmTZxVuMjbjWcPNnNWb8x/5vwjzdEUfqXimHYdZTIpy2PMMq6Jf4zvculQ==", - "license": "Apache-2.0 OR MIT", - "dependencies": { - "@libp2p/crypto": "^5.0.1", - "@libp2p/interface": "^2.0.1", - "multiformats": "^13.1.0", - "uint8arrays": "^5.1.0" - } - }, "node_modules/@libp2p/identify": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/@libp2p/identify/-/identify-3.0.1.tgz", @@ -5560,34 +5492,6 @@ "wherearewe": "^2.0.1" } }, - "node_modules/@libp2p/identify/node_modules/@libp2p/crypto": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/@libp2p/crypto/-/crypto-5.0.1.tgz", - "integrity": "sha512-j7X4ISdWHnIJh752bl70z+3R4LdB8xftFU0ShOuuHg9ETTViHa3O0AK5v1HxyaSXE/uhXhfwjVH3vxn8ECQl/A==", - "license": "Apache-2.0 OR MIT", - "dependencies": { - "@libp2p/interface": "^2.0.1", - "@noble/curves": "^1.4.0", - "@noble/hashes": "^1.4.0", - "asn1js": "^3.0.5", - "multiformats": "^13.1.0", - "protons-runtime": "^5.4.0", - "uint8arraylist": "^2.4.8", - "uint8arrays": "^5.1.0" - } - }, - "node_modules/@libp2p/identify/node_modules/@libp2p/peer-id": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/@libp2p/peer-id/-/peer-id-5.0.1.tgz", - "integrity": "sha512-HwoW7dQ/o4NQ+5PQThOzMK2OHMRicmTZxVuMjbjWcPNnNWb8x/5vwjzdEUfqXimHYdZTIpy2PMMq6Jf4zvculQ==", - "license": "Apache-2.0 OR MIT", - "dependencies": { - "@libp2p/crypto": "^5.0.1", - "@libp2p/interface": "^2.0.1", - "multiformats": "^13.1.0", - "uint8arrays": "^5.1.0" - } - }, "node_modules/@libp2p/interface": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/@libp2p/interface/-/interface-2.0.1.tgz", @@ -5642,22 +5546,6 @@ "uint8arrays": "^5.1.0" } }, - "node_modules/@libp2p/interface-compliance-tests/node_modules/@libp2p/crypto": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/@libp2p/crypto/-/crypto-5.0.1.tgz", - "integrity": "sha512-j7X4ISdWHnIJh752bl70z+3R4LdB8xftFU0ShOuuHg9ETTViHa3O0AK5v1HxyaSXE/uhXhfwjVH3vxn8ECQl/A==", - "license": "Apache-2.0 OR MIT", - "dependencies": { - "@libp2p/interface": "^2.0.1", - "@noble/curves": "^1.4.0", - "@noble/hashes": "^1.4.0", - "asn1js": "^3.0.5", - "multiformats": "^13.1.0", - "protons-runtime": "^5.4.0", - "uint8arraylist": "^2.4.8", - "uint8arrays": "^5.1.0" - } - }, "node_modules/@libp2p/interface-compliance-tests/node_modules/@libp2p/logger": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/@libp2p/logger/-/logger-5.0.1.tgz", @@ -5671,18 +5559,6 @@ "weald": "^1.0.2" } }, - "node_modules/@libp2p/interface-compliance-tests/node_modules/@libp2p/peer-id": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/@libp2p/peer-id/-/peer-id-5.0.1.tgz", - "integrity": "sha512-HwoW7dQ/o4NQ+5PQThOzMK2OHMRicmTZxVuMjbjWcPNnNWb8x/5vwjzdEUfqXimHYdZTIpy2PMMq6Jf4zvculQ==", - "license": "Apache-2.0 OR MIT", - "dependencies": { - "@libp2p/crypto": "^5.0.1", - "@libp2p/interface": "^2.0.1", - "multiformats": "^13.1.0", - "uint8arrays": "^5.1.0" - } - }, "node_modules/@libp2p/interface-compliance-tests/node_modules/p-limit": { "version": "6.1.0", "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-6.1.0.tgz", @@ -5797,23 +5673,7 @@ "multiformats": "^13.2.2" } }, - "node_modules/@libp2p/peer-collections/node_modules/@libp2p/crypto": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/@libp2p/crypto/-/crypto-5.0.1.tgz", - "integrity": "sha512-j7X4ISdWHnIJh752bl70z+3R4LdB8xftFU0ShOuuHg9ETTViHa3O0AK5v1HxyaSXE/uhXhfwjVH3vxn8ECQl/A==", - "license": "Apache-2.0 OR MIT", - "dependencies": { - "@libp2p/interface": "^2.0.1", - "@noble/curves": "^1.4.0", - "@noble/hashes": "^1.4.0", - "asn1js": "^3.0.5", - "multiformats": "^13.1.0", - "protons-runtime": "^5.4.0", - "uint8arraylist": "^2.4.8", - "uint8arrays": "^5.1.0" - } - }, - "node_modules/@libp2p/peer-collections/node_modules/@libp2p/peer-id": { + "node_modules/@libp2p/peer-id": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/@libp2p/peer-id/-/peer-id-5.0.1.tgz", "integrity": "sha512-HwoW7dQ/o4NQ+5PQThOzMK2OHMRicmTZxVuMjbjWcPNnNWb8x/5vwjzdEUfqXimHYdZTIpy2PMMq6Jf4zvculQ==", @@ -5843,34 +5703,6 @@ "uint8arrays": "^5.1.0" } }, - "node_modules/@libp2p/peer-record/node_modules/@libp2p/crypto": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/@libp2p/crypto/-/crypto-5.0.1.tgz", - "integrity": "sha512-j7X4ISdWHnIJh752bl70z+3R4LdB8xftFU0ShOuuHg9ETTViHa3O0AK5v1HxyaSXE/uhXhfwjVH3vxn8ECQl/A==", - "license": "Apache-2.0 OR MIT", - "dependencies": { - "@libp2p/interface": "^2.0.1", - "@noble/curves": "^1.4.0", - "@noble/hashes": "^1.4.0", - "asn1js": "^3.0.5", - "multiformats": "^13.1.0", - "protons-runtime": "^5.4.0", - "uint8arraylist": "^2.4.8", - "uint8arrays": "^5.1.0" - } - }, - "node_modules/@libp2p/peer-record/node_modules/@libp2p/peer-id": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/@libp2p/peer-id/-/peer-id-5.0.1.tgz", - "integrity": "sha512-HwoW7dQ/o4NQ+5PQThOzMK2OHMRicmTZxVuMjbjWcPNnNWb8x/5vwjzdEUfqXimHYdZTIpy2PMMq6Jf4zvculQ==", - "license": "Apache-2.0 OR MIT", - "dependencies": { - "@libp2p/crypto": "^5.0.1", - "@libp2p/interface": "^2.0.1", - "multiformats": "^13.1.0", - "uint8arrays": "^5.1.0" - } - }, "node_modules/@libp2p/peer-store": { "version": "11.0.1", "resolved": "https://registry.npmjs.org/@libp2p/peer-store/-/peer-store-11.0.1.tgz", @@ -5892,34 +5724,6 @@ "uint8arrays": "^5.1.0" } }, - "node_modules/@libp2p/peer-store/node_modules/@libp2p/crypto": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/@libp2p/crypto/-/crypto-5.0.1.tgz", - "integrity": "sha512-j7X4ISdWHnIJh752bl70z+3R4LdB8xftFU0ShOuuHg9ETTViHa3O0AK5v1HxyaSXE/uhXhfwjVH3vxn8ECQl/A==", - "license": "Apache-2.0 OR MIT", - "dependencies": { - "@libp2p/interface": "^2.0.1", - "@noble/curves": "^1.4.0", - "@noble/hashes": "^1.4.0", - "asn1js": "^3.0.5", - "multiformats": "^13.1.0", - "protons-runtime": "^5.4.0", - "uint8arraylist": "^2.4.8", - "uint8arrays": "^5.1.0" - } - }, - "node_modules/@libp2p/peer-store/node_modules/@libp2p/peer-id": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/@libp2p/peer-id/-/peer-id-5.0.1.tgz", - "integrity": "sha512-HwoW7dQ/o4NQ+5PQThOzMK2OHMRicmTZxVuMjbjWcPNnNWb8x/5vwjzdEUfqXimHYdZTIpy2PMMq6Jf4zvculQ==", - "license": "Apache-2.0 OR MIT", - "dependencies": { - "@libp2p/crypto": "^5.0.1", - "@libp2p/interface": "^2.0.1", - "multiformats": "^13.1.0", - "uint8arrays": "^5.1.0" - } - }, "node_modules/@libp2p/ping": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/@libp2p/ping/-/ping-2.0.1.tgz", @@ -5935,22 +5739,6 @@ "uint8arrays": "^5.1.0" } }, - "node_modules/@libp2p/ping/node_modules/@libp2p/crypto": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/@libp2p/crypto/-/crypto-5.0.1.tgz", - "integrity": "sha512-j7X4ISdWHnIJh752bl70z+3R4LdB8xftFU0ShOuuHg9ETTViHa3O0AK5v1HxyaSXE/uhXhfwjVH3vxn8ECQl/A==", - "license": "Apache-2.0 OR MIT", - "dependencies": { - "@libp2p/interface": "^2.0.1", - "@noble/curves": "^1.4.0", - "@noble/hashes": "^1.4.0", - "asn1js": "^3.0.5", - "multiformats": "^13.1.0", - "protons-runtime": "^5.4.0", - "uint8arraylist": "^2.4.8", - "uint8arrays": "^5.1.0" - } - }, "node_modules/@libp2p/pubsub": { "version": "10.0.1", "resolved": "https://registry.npmjs.org/@libp2p/pubsub/-/pubsub-10.0.1.tgz", @@ -5972,34 +5760,6 @@ "uint8arrays": "^5.1.0" } }, - "node_modules/@libp2p/pubsub/node_modules/@libp2p/crypto": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/@libp2p/crypto/-/crypto-5.0.1.tgz", - "integrity": "sha512-j7X4ISdWHnIJh752bl70z+3R4LdB8xftFU0ShOuuHg9ETTViHa3O0AK5v1HxyaSXE/uhXhfwjVH3vxn8ECQl/A==", - "license": "Apache-2.0 OR MIT", - "dependencies": { - "@libp2p/interface": "^2.0.1", - "@noble/curves": "^1.4.0", - "@noble/hashes": "^1.4.0", - "asn1js": "^3.0.5", - "multiformats": "^13.1.0", - "protons-runtime": "^5.4.0", - "uint8arraylist": "^2.4.8", - "uint8arrays": "^5.1.0" - } - }, - "node_modules/@libp2p/pubsub/node_modules/@libp2p/peer-id": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/@libp2p/peer-id/-/peer-id-5.0.1.tgz", - "integrity": "sha512-HwoW7dQ/o4NQ+5PQThOzMK2OHMRicmTZxVuMjbjWcPNnNWb8x/5vwjzdEUfqXimHYdZTIpy2PMMq6Jf4zvculQ==", - "license": "Apache-2.0 OR MIT", - "dependencies": { - "@libp2p/crypto": "^5.0.1", - "@libp2p/interface": "^2.0.1", - "multiformats": "^13.1.0", - "uint8arrays": "^5.1.0" - } - }, "node_modules/@libp2p/utils": { "version": "6.0.1", "resolved": "https://registry.npmjs.org/@libp2p/utils/-/utils-6.0.1.tgz", @@ -6031,22 +5791,6 @@ "uint8arrays": "^5.1.0" } }, - "node_modules/@libp2p/utils/node_modules/@libp2p/crypto": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/@libp2p/crypto/-/crypto-5.0.1.tgz", - "integrity": "sha512-j7X4ISdWHnIJh752bl70z+3R4LdB8xftFU0ShOuuHg9ETTViHa3O0AK5v1HxyaSXE/uhXhfwjVH3vxn8ECQl/A==", - "license": "Apache-2.0 OR MIT", - "dependencies": { - "@libp2p/interface": "^2.0.1", - "@noble/curves": "^1.4.0", - "@noble/hashes": "^1.4.0", - "asn1js": "^3.0.5", - "multiformats": "^13.1.0", - "protons-runtime": "^5.4.0", - "uint8arraylist": "^2.4.8", - "uint8arrays": "^5.1.0" - } - }, "node_modules/@libp2p/utils/node_modules/@libp2p/logger": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/@libp2p/logger/-/logger-5.0.1.tgz", @@ -22298,22 +22042,6 @@ "uint8arrays": "^5.1.0" } }, - "node_modules/libp2p/node_modules/@libp2p/crypto": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/@libp2p/crypto/-/crypto-5.0.1.tgz", - "integrity": "sha512-j7X4ISdWHnIJh752bl70z+3R4LdB8xftFU0ShOuuHg9ETTViHa3O0AK5v1HxyaSXE/uhXhfwjVH3vxn8ECQl/A==", - "license": "Apache-2.0 OR MIT", - "dependencies": { - "@libp2p/interface": "^2.0.1", - "@noble/curves": "^1.4.0", - "@noble/hashes": "^1.4.0", - "asn1js": "^3.0.5", - "multiformats": "^13.1.0", - "protons-runtime": "^5.4.0", - "uint8arraylist": "^2.4.8", - "uint8arrays": "^5.1.0" - } - }, "node_modules/libp2p/node_modules/@libp2p/logger": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/@libp2p/logger/-/logger-5.0.1.tgz", @@ -22327,18 +22055,6 @@ "weald": "^1.0.2" } }, - "node_modules/libp2p/node_modules/@libp2p/peer-id": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/@libp2p/peer-id/-/peer-id-5.0.1.tgz", - "integrity": "sha512-HwoW7dQ/o4NQ+5PQThOzMK2OHMRicmTZxVuMjbjWcPNnNWb8x/5vwjzdEUfqXimHYdZTIpy2PMMq6Jf4zvculQ==", - "license": "Apache-2.0 OR MIT", - "dependencies": { - "@libp2p/crypto": "^5.0.1", - "@libp2p/interface": "^2.0.1", - "multiformats": "^13.1.0", - "uint8arrays": "^5.1.0" - } - }, "node_modules/libp2p/node_modules/datastore-core": { "version": "10.0.2", "resolved": "https://registry.npmjs.org/datastore-core/-/datastore-core-10.0.2.tgz", @@ -39458,6 +39174,7 @@ "uuid": "^9.0.0" }, "devDependencies": { + "@libp2p/peer-id": "^5.0.1", "@multiformats/multiaddr": "^12.0.0", "@rollup/plugin-commonjs": "^25.0.7", "@rollup/plugin-json": "^6.0.0", @@ -39552,36 +39269,6 @@ } } }, - "packages/discovery/node_modules/@libp2p/crypto": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/@libp2p/crypto/-/crypto-5.0.1.tgz", - "integrity": "sha512-j7X4ISdWHnIJh752bl70z+3R4LdB8xftFU0ShOuuHg9ETTViHa3O0AK5v1HxyaSXE/uhXhfwjVH3vxn8ECQl/A==", - "dev": true, - "license": "Apache-2.0 OR MIT", - "dependencies": { - "@libp2p/interface": "^2.0.1", - "@noble/curves": "^1.4.0", - "@noble/hashes": "^1.4.0", - "asn1js": "^3.0.5", - "multiformats": "^13.1.0", - "protons-runtime": "^5.4.0", - "uint8arraylist": "^2.4.8", - "uint8arrays": "^5.1.0" - } - }, - "packages/discovery/node_modules/@libp2p/peer-id": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/@libp2p/peer-id/-/peer-id-5.0.1.tgz", - "integrity": "sha512-HwoW7dQ/o4NQ+5PQThOzMK2OHMRicmTZxVuMjbjWcPNnNWb8x/5vwjzdEUfqXimHYdZTIpy2PMMq6Jf4zvculQ==", - "dev": true, - "license": "Apache-2.0 OR MIT", - "dependencies": { - "@libp2p/crypto": "^5.0.1", - "@libp2p/interface": "^2.0.1", - "multiformats": "^13.1.0", - "uint8arrays": "^5.1.0" - } - }, "packages/enr": { "name": "@waku/enr", "version": "0.0.26", @@ -39625,34 +39312,6 @@ } } }, - "packages/enr/node_modules/@libp2p/crypto": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/@libp2p/crypto/-/crypto-5.0.1.tgz", - "integrity": "sha512-j7X4ISdWHnIJh752bl70z+3R4LdB8xftFU0ShOuuHg9ETTViHa3O0AK5v1HxyaSXE/uhXhfwjVH3vxn8ECQl/A==", - "license": "Apache-2.0 OR MIT", - "dependencies": { - "@libp2p/interface": "^2.0.1", - "@noble/curves": "^1.4.0", - "@noble/hashes": "^1.4.0", - "asn1js": "^3.0.5", - "multiformats": "^13.1.0", - "protons-runtime": "^5.4.0", - "uint8arraylist": "^2.4.8", - "uint8arrays": "^5.1.0" - } - }, - "packages/enr/node_modules/@libp2p/peer-id": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/@libp2p/peer-id/-/peer-id-5.0.1.tgz", - "integrity": "sha512-HwoW7dQ/o4NQ+5PQThOzMK2OHMRicmTZxVuMjbjWcPNnNWb8x/5vwjzdEUfqXimHYdZTIpy2PMMq6Jf4zvculQ==", - "license": "Apache-2.0 OR MIT", - "dependencies": { - "@libp2p/crypto": "^5.0.1", - "@libp2p/interface": "^2.0.1", - "multiformats": "^13.1.0", - "uint8arrays": "^5.1.0" - } - }, "packages/interfaces": { "name": "@waku/interfaces", "version": "0.0.27", @@ -39879,6 +39538,7 @@ }, "devDependencies": { "@libp2p/bootstrap": "^11.0.1", + "@libp2p/crypto": "^5.0.1", "@types/chai": "^4.3.11", "@types/dockerode": "^3.3.19", "@types/mocha": "^10.0.6", @@ -39904,34 +39564,6 @@ "node": ">=20" } }, - "packages/tests/node_modules/@libp2p/crypto": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/@libp2p/crypto/-/crypto-5.0.1.tgz", - "integrity": "sha512-j7X4ISdWHnIJh752bl70z+3R4LdB8xftFU0ShOuuHg9ETTViHa3O0AK5v1HxyaSXE/uhXhfwjVH3vxn8ECQl/A==", - "license": "Apache-2.0 OR MIT", - "dependencies": { - "@libp2p/interface": "^2.0.1", - "@noble/curves": "^1.4.0", - "@noble/hashes": "^1.4.0", - "asn1js": "^3.0.5", - "multiformats": "^13.1.0", - "protons-runtime": "^5.4.0", - "uint8arraylist": "^2.4.8", - "uint8arrays": "^5.1.0" - } - }, - "packages/tests/node_modules/@libp2p/peer-id": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/@libp2p/peer-id/-/peer-id-5.0.1.tgz", - "integrity": "sha512-HwoW7dQ/o4NQ+5PQThOzMK2OHMRicmTZxVuMjbjWcPNnNWb8x/5vwjzdEUfqXimHYdZTIpy2PMMq6Jf4zvculQ==", - "license": "Apache-2.0 OR MIT", - "dependencies": { - "@libp2p/crypto": "^5.0.1", - "@libp2p/interface": "^2.0.1", - "multiformats": "^13.1.0", - "uint8arrays": "^5.1.0" - } - }, "packages/utils": { "name": "@waku/utils", "version": "0.0.20", diff --git a/packages/core/package.json b/packages/core/package.json index 3947dafdff..f76b735de3 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -82,6 +82,7 @@ "uuid": "^9.0.0" }, "devDependencies": { + "@libp2p/peer-id": "^5.0.1", "@multiformats/multiaddr": "^12.0.0", "@rollup/plugin-commonjs": "^25.0.7", "@rollup/plugin-json": "^6.0.0", diff --git a/packages/core/src/lib/filterPeers.spec.ts b/packages/core/src/lib/filterPeers.spec.ts index 8ae77c3bd2..e9737d9021 100644 --- a/packages/core/src/lib/filterPeers.spec.ts +++ b/packages/core/src/lib/filterPeers.spec.ts @@ -1,6 +1,7 @@ +import { generateKeyPair } from "@libp2p/crypto/keys"; import { Peer } from "@libp2p/interface"; import type { Tag } from "@libp2p/interface"; -import { createSecp256k1PeerId } from "@libp2p/peer-id-factory"; +import { peerIdFromPrivateKey } from "@libp2p/peer-id"; import { Tags } from "@waku/interfaces"; import { expect } from "chai"; @@ -8,9 +9,11 @@ import { filterPeersByDiscovery } from "./filterPeers.js"; describe("filterPeersByDiscovery function", function () { it("should return all peers when numPeers is 0", async function () { - const peer1 = await createSecp256k1PeerId(); - const peer2 = await createSecp256k1PeerId(); - const peer3 = await createSecp256k1PeerId(); + const [peer1, peer2, peer3] = await Promise.all([ + generateKeyPair("secp256k1").then(peerIdFromPrivateKey), + generateKeyPair("secp256k1").then(peerIdFromPrivateKey), + generateKeyPair("secp256k1").then(peerIdFromPrivateKey) + ]); const mockPeers = [ { @@ -32,10 +35,12 @@ describe("filterPeersByDiscovery function", function () { }); it("should return all non-bootstrap peers and no bootstrap peer when numPeers is 0 and maxBootstrapPeers is 0", async function () { - const peer1 = await createSecp256k1PeerId(); - const peer2 = await createSecp256k1PeerId(); - const peer3 = await createSecp256k1PeerId(); - const peer4 = await createSecp256k1PeerId(); + const [peer1, peer2, peer3, peer4] = await Promise.all([ + generateKeyPair("secp256k1").then(peerIdFromPrivateKey), + generateKeyPair("secp256k1").then(peerIdFromPrivateKey), + generateKeyPair("secp256k1").then(peerIdFromPrivateKey), + generateKeyPair("secp256k1").then(peerIdFromPrivateKey) + ]); const mockPeers = [ { @@ -66,11 +71,13 @@ describe("filterPeersByDiscovery function", function () { }); it("should return one bootstrap peer, and all non-boostrap peers, when numPeers is 0 & maxBootstrap is 1", async function () { - const peer1 = await createSecp256k1PeerId(); - const peer2 = await createSecp256k1PeerId(); - const peer3 = await createSecp256k1PeerId(); - const peer4 = await createSecp256k1PeerId(); - const peer5 = await createSecp256k1PeerId(); + const [peer1, peer2, peer3, peer4, peer5] = await Promise.all([ + generateKeyPair("secp256k1").then(peerIdFromPrivateKey), + generateKeyPair("secp256k1").then(peerIdFromPrivateKey), + generateKeyPair("secp256k1").then(peerIdFromPrivateKey), + generateKeyPair("secp256k1").then(peerIdFromPrivateKey), + generateKeyPair("secp256k1").then(peerIdFromPrivateKey) + ]); const mockPeers = [ { @@ -105,11 +112,13 @@ describe("filterPeersByDiscovery function", function () { }); it("should return only bootstrap peers up to maxBootstrapPeers", async function () { - const peer1 = await createSecp256k1PeerId(); - const peer2 = await createSecp256k1PeerId(); - const peer3 = await createSecp256k1PeerId(); - const peer4 = await createSecp256k1PeerId(); - const peer5 = await createSecp256k1PeerId(); + const [peer1, peer2, peer3, peer4, peer5] = await Promise.all([ + generateKeyPair("secp256k1").then(peerIdFromPrivateKey), + generateKeyPair("secp256k1").then(peerIdFromPrivateKey), + generateKeyPair("secp256k1").then(peerIdFromPrivateKey), + generateKeyPair("secp256k1").then(peerIdFromPrivateKey), + generateKeyPair("secp256k1").then(peerIdFromPrivateKey) + ]); const mockPeers = [ { diff --git a/packages/discovery/src/dns/fetch_nodes.spec.ts b/packages/discovery/src/dns/fetch_nodes.spec.ts index 15b22b9b59..4b4bd261c0 100644 --- a/packages/discovery/src/dns/fetch_nodes.spec.ts +++ b/packages/discovery/src/dns/fetch_nodes.spec.ts @@ -1,4 +1,5 @@ -import { createSecp256k1PeerId } from "@libp2p/peer-id-factory"; +import { generateKeyPair } from "@libp2p/crypto/keys"; +import { peerIdFromPrivateKey } from "@libp2p/peer-id"; import { multiaddr } from "@multiformats/multiaddr"; import { ENR } from "@waku/enr"; import { EnrCreator } from "@waku/enr"; @@ -8,7 +9,7 @@ import { expect } from "chai"; import { fetchNodesUntilCapabilitiesFulfilled } from "./fetch_nodes.js"; async function createEnr(waku2: Waku2): Promise { - const peerId = await createSecp256k1PeerId(); + const peerId = await generateKeyPair("secp256k1").then(peerIdFromPrivateKey); const enr = await EnrCreator.fromPeerId(peerId); enr.setLocationMultiaddr(multiaddr("/ip4/18.223.219.100/udp/9000")); enr.multiaddrs = [ diff --git a/packages/discovery/src/local-peer-cache/index.spec.ts b/packages/discovery/src/local-peer-cache/index.spec.ts index 28cb0677d5..03f84b7217 100644 --- a/packages/discovery/src/local-peer-cache/index.spec.ts +++ b/packages/discovery/src/local-peer-cache/index.spec.ts @@ -1,9 +1,9 @@ +import { generateKeyPair } from "@libp2p/crypto/keys"; import type { IdentifyResult } from "@libp2p/interface"; import { TypedEventEmitter } from "@libp2p/interface"; import tests from "@libp2p/interface-compliance-tests/peer-discovery"; import { prefixLogger } from "@libp2p/logger"; -import { createSecp256k1PeerId } from "@libp2p/peer-id-factory"; -import { createFromJSON } from "@libp2p/peer-id-factory"; +import { peerIdFromPrivateKey, peerIdFromString } from "@libp2p/peer-id"; import { PersistentPeerStore } from "@libp2p/peer-store"; import { multiaddr } from "@multiformats/multiaddr"; import { Libp2pComponents } from "@waku/interfaces"; @@ -55,7 +55,7 @@ describe("Local Storage Discovery", function () { components = { peerStore: new PersistentPeerStore({ events: new TypedEventEmitter(), - peerId: await createSecp256k1PeerId(), + peerId: await generateKeyPair("secp256k1").then(peerIdFromPrivateKey), datastore: new MemoryDatastore(), logger: prefixLogger("local_discovery.spec.ts") }), @@ -103,9 +103,7 @@ describe("Local Storage Discovery", function () { it("should update peers in local storage on 'peer:identify' event", async () => { const newPeerIdentifyEvent = { detail: { - peerId: await createFromJSON({ - id: mockPeers[1].id - }), + peerId: peerIdFromString(mockPeers[1].id.toString()), listenAddrs: [multiaddr(mockPeers[1].address)] } } as CustomEvent; diff --git a/packages/enr/src/decoder.ts b/packages/enr/src/decoder.ts index 0fdcca9578..0fc27ddfb8 100644 --- a/packages/enr/src/decoder.ts +++ b/packages/enr/src/decoder.ts @@ -37,7 +37,7 @@ async function fromValues(values: Uint8Array[]): Promise { } const _seq = decodeSeq(seq); - const enr = await ENR.create(obj, _seq, signature); + const enr = ENR.create(obj, _seq, signature); checkSignature(seq, kvs, enr, signature); return enr; } diff --git a/packages/enr/src/enr.spec.ts b/packages/enr/src/enr.spec.ts index 14e5c1f197..65105368ee 100644 --- a/packages/enr/src/enr.spec.ts +++ b/packages/enr/src/enr.spec.ts @@ -1,5 +1,6 @@ +import { generateKeyPair } from "@libp2p/crypto/keys"; import type { PeerId } from "@libp2p/interface"; -import { createSecp256k1PeerId } from "@libp2p/peer-id-factory"; +import { peerIdFromPrivateKey } from "@libp2p/peer-id"; import { multiaddr } from "@multiformats/multiaddr"; import * as secp from "@noble/secp256k1"; import type { Waku2 } from "@waku/interfaces"; @@ -16,14 +17,13 @@ import { TransportProtocol, TransportProtocolPerIpVersion } from "./enr.js"; -import { getPrivateKeyFromPeerId } from "./peer_id.js"; describe("ENR", function () { describe("Txt codec", () => { it("should encodeTxt and decodeTxt", async () => { - const peerId = await createSecp256k1PeerId(); + const privateKey = await generateKeyPair("secp256k1"); + const peerId = peerIdFromPrivateKey(privateKey); const enr = await EnrCreator.fromPeerId(peerId); - const privateKey = await getPrivateKeyFromPeerId(peerId); enr.setLocationMultiaddr(multiaddr("/ip4/18.223.219.100/udp/9000")); enr.multiaddrs = [ multiaddr("/dns4/node-01.do-ams3.waku.test.status.im/tcp/443/wss"), @@ -42,7 +42,7 @@ describe("ENR", function () { lightPush: false }; - const txt = await EnrEncoder.toString(enr, privateKey); + const txt = await EnrEncoder.toString(enr, privateKey.raw); const enr2 = await EnrDecoder.fromString(txt); if (!enr.signature) throw "enr.signature is undefined"; @@ -115,13 +115,13 @@ describe("ENR", function () { it("should throw error - no id", async () => { try { - const peerId = await createSecp256k1PeerId(); + const privateKey = await generateKeyPair("secp256k1"); + const peerId = peerIdFromPrivateKey(privateKey); const enr = await EnrCreator.fromPeerId(peerId); - const privateKey = await getPrivateKeyFromPeerId(peerId); enr.setLocationMultiaddr(multiaddr("/ip4/18.223.219.100/udp/9000")); enr.set("id", new Uint8Array([0])); - const txt = await EnrEncoder.toString(enr, privateKey); + const txt = await EnrEncoder.toString(enr, privateKey.raw); await EnrDecoder.fromString(txt); assert.fail("Expect error here"); @@ -147,7 +147,7 @@ describe("ENR", function () { describe("Verify", () => { it("should throw error - no id", async () => { try { - const enr = await ENR.create({}, BigInt(0), new Uint8Array()); + const enr = ENR.create({}, BigInt(0), new Uint8Array()); enr.verify(new Uint8Array(), new Uint8Array()); assert.fail("Expect error here"); } catch (err: unknown) { @@ -158,7 +158,7 @@ describe("ENR", function () { it("should throw error - invalid id", async () => { try { - const enr = await ENR.create( + const enr = ENR.create( { id: utf8ToBytes("v3") }, BigInt(0), new Uint8Array() @@ -173,7 +173,7 @@ describe("ENR", function () { it("should throw error - no public key", async () => { try { - const enr = await ENR.create( + const enr = ENR.create( { id: utf8ToBytes("v4") }, BigInt(0), new Uint8Array() @@ -204,7 +204,7 @@ describe("ENR", function () { privateKey = hexToBytes( "b71c71a67e1177ad4e901695e1b4b9ee17ae16c6668d313eac2f96dbcda3f291" ); - record = await EnrCreator.fromPublicKey(secp.getPublicKey(privateKey)); + record = EnrCreator.fromPublicKey(secp.getPublicKey(privateKey)); record.setLocationMultiaddr(multiaddr("/ip4/127.0.0.1/udp/30303")); record.seq = seq; await EnrEncoder.toString(record, privateKey); @@ -249,7 +249,7 @@ describe("ENR", function () { privateKey = hexToBytes( "b71c71a67e1177ad4e901695e1b4b9ee17ae16c6668d313eac2f96dbcda3f291" ); - record = await EnrCreator.fromPublicKey(secp.getPublicKey(privateKey)); + record = EnrCreator.fromPublicKey(secp.getPublicKey(privateKey)); }); it("should get / set UDP multiaddr", () => { @@ -320,7 +320,8 @@ describe("ENR", function () { let enr: ENR; before(async function () { - peerId = await createSecp256k1PeerId(); + const privateKey = await generateKeyPair("secp256k1"); + peerId = peerIdFromPrivateKey(privateKey); enr = await EnrCreator.fromPeerId(peerId); enr.ip = ip4; enr.ip6 = ip6; @@ -422,9 +423,9 @@ describe("ENR", function () { let privateKey: Uint8Array; beforeEach(async function () { - peerId = await createSecp256k1PeerId(); + const privateKey = await generateKeyPair("secp256k1"); + peerId = peerIdFromPrivateKey(privateKey); enr = await EnrCreator.fromPeerId(peerId); - privateKey = await getPrivateKeyFromPeerId(peerId); waku2Protocols = { relay: false, store: false, diff --git a/packages/relay/src/message_validator.spec.ts b/packages/relay/src/message_validator.spec.ts index c5fb36a444..313898708f 100644 --- a/packages/relay/src/message_validator.spec.ts +++ b/packages/relay/src/message_validator.spec.ts @@ -1,6 +1,7 @@ +import { generateKeyPair } from "@libp2p/crypto/keys"; import { TopicValidatorResult } from "@libp2p/interface"; import type { UnsignedMessage } from "@libp2p/interface"; -import { createSecp256k1PeerId } from "@libp2p/peer-id-factory"; +import { peerIdFromPrivateKey } from "@libp2p/peer-id"; import { createEncoder } from "@waku/core"; import { determinePubsubTopic } from "@waku/utils"; import { expect } from "chai"; @@ -15,7 +16,8 @@ describe("Message Validator", () => { it("Accepts a valid Waku Message", async () => { await fc.assert( fc.asyncProperty(fc.uint8Array({ minLength: 1 }), async (payload) => { - const peerId = await createSecp256k1PeerId(); + const privateKey = await generateKeyPair("secp256k1"); + const peerId = peerIdFromPrivateKey(privateKey); const encoder = createEncoder({ contentTopic: TestContentTopic, @@ -39,7 +41,8 @@ describe("Message Validator", () => { it("Rejects garbage", async () => { await fc.assert( fc.asyncProperty(fc.uint8Array(), async (data) => { - const peerId = await createSecp256k1PeerId(); + const peerId = + await generateKeyPair("secp256k1").then(peerIdFromPrivateKey); const message: UnsignedMessage = { type: "unsigned",