Merge branch 'master' into chore/add-dispatch-to-ci

This commit is contained in:
fbarbu15 2023-08-29 14:45:16 +03:00 committed by GitHub
commit a66b451a3e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
11 changed files with 121 additions and 324 deletions

320
package-lock.json generated
View File

@ -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",
@ -12450,7 +12365,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 +12378,6 @@
"url": "https://opencollective.com/fast-check"
}
],
"license": "MIT",
"dependencies": {
"pure-rand": "^6.0.0"
},
@ -15538,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",
@ -30528,7 +30434,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",
@ -30577,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",
@ -30609,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",
@ -30682,7 +30588,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 +30624,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 +30713,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",
@ -30903,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": "*",
@ -30983,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",
@ -31014,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",
@ -32437,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",
@ -32504,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",
@ -33388,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",
@ -33466,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=="
}
}
},
@ -33538,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",
@ -33652,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": {
@ -33689,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",
@ -33763,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",
@ -33853,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",
@ -35738,7 +35546,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",
@ -35769,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",
@ -35802,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",
@ -35860,7 +35668,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 +35698,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 +35772,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",
@ -36025,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",
@ -36096,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": {
@ -36129,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": {
@ -40621,7 +40405,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"
}
@ -42676,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",

View File

@ -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",

View File

@ -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<T extends IDecodedMessage>(
messages: Promise<T | undefined>[],
callback: (message: T) => Promise<void | boolean> | boolean | void,
options?: QueryOptions
): Promise<boolean> {
let abort = false;
const messagesOrUndef: Array<T | undefined> = await Promise.all(messages);
let processedMessages: Array<T> = 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<T extends IDecodedMessage>(
async queryWithOrderedCallback<T extends IDecodedMessage>(
decoders: IDecoder<T>[],
callback: (message: T) => Promise<void | boolean> | boolean | void,
options?: QueryOptions
): Promise<void> {
let abort = false;
for await (const promises of this.queryGenerator(decoders, options)) {
if (abort) break;
const messagesOrUndef: Array<T | undefined> = await Promise.all(promises);
let messages: Array<T> = 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<WakuMessage>` 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<T extends IDecodedMessage>(
async queryWithPromiseCallback<T extends IDecodedMessage>(
decoders: IDecoder<T>[],
callback: (
message: Promise<T | undefined>
@ -160,17 +186,15 @@ class Store extends BaseProtocol implements IStore {
options?: QueryOptions
): Promise<void> {
let abort = false;
let promises: Promise<void>[] = [];
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.

View File

@ -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",

View File

@ -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",

View File

@ -46,12 +46,12 @@ export type StoreQueryOptions = {
} & ProtocolOptions;
export interface IStore extends IBaseProtocol {
queryOrderedCallback: <T extends IDecodedMessage>(
queryWithOrderedCallback: <T extends IDecodedMessage>(
decoders: IDecoder<T>[],
callback: (message: T) => Promise<void | boolean> | boolean | void,
options?: StoreQueryOptions
) => Promise<void>;
queryCallbackOnPromise: <T extends IDecodedMessage>(
queryWithPromiseCallback: <T extends IDecodedMessage>(
decoders: IDecoder<T>[],
callback: (
message: Promise<T | undefined>

View File

@ -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",

View File

@ -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",

View File

@ -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",

View File

@ -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": "*",

View File

@ -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);