diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0b029c3f32..cff194b6f2 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -77,16 +77,23 @@ jobs: node-version: ${{ env.NODE_JS }} - uses: bahmutov/npm-install@v1 - run: npm run build - - run: npm run test:node + - run: npm run test:node > debug.log env: DEBUG: "waku:nwaku*,waku:test*" - - name: Upload logs on failure - uses: actions/upload-artifact@v2 + - name: Upload debug logs on failure + uses: actions/upload-artifact@v3 + if: failure() + with: + name: debug.log + path: debug.log + + - name: Upload nwaku logs on failure + uses: actions/upload-artifact@v3 if: failure() with: name: nwaku-logs - path: log/ + path: packages/tests/log/ node_with_go_waku: runs-on: ubuntu-latest @@ -124,16 +131,23 @@ jobs: - uses: bahmutov/npm-install@v1 - run: npm run build - - run: npm run test:node + - run: npm run test:node > debug.log env: DEBUG: "waku:nwaku*,waku:test*" + - name: Upload debug logs on failure + uses: actions/upload-artifact@v3 + if: failure() + with: + name: go-waku-debug.log + path: debug.log + - name: Upload logs on failure - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v3 if: failure() with: name: go-waku-logs - path: log/ + path: packages/tests/log/ node_with_nwaku_master: runs-on: ubuntu-latest @@ -171,13 +185,20 @@ jobs: ./build/wakunode2 --help - run: npm run build - - run: npm run test:node + - run: npm run test:node > debug.log env: DEBUG: "waku:nwaku*,waku:test*" + - name: Upload debug logs on failure + uses: actions/upload-artifact@v3 + if: failure() + with: + name: nwaku-master-debug.log + path: debug.log + - name: Upload logs on failure - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v3 if: failure() with: name: nwaku-master-logs - path: log/ + path: packages/tests/log/ diff --git a/package-lock.json b/package-lock.json index 354fe1f34a..63237e1889 100644 --- a/package-lock.json +++ b/package-lock.json @@ -220,46 +220,49 @@ "integrity": "sha512-nqSJ8u2a1Rv9FYbyI8qpDhTYujaKEyLknNrTejLYoSWmdeg+2WB7R6BZqPZYfrJzDxVi3rl6ZQuoaEvpKRZWgQ==" }, "node_modules/@chainsafe/libp2p-gossipsub": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/@chainsafe/libp2p-gossipsub/-/libp2p-gossipsub-4.1.1.tgz", - "integrity": "sha512-W3z52uTVm48qvwTAcE+tz6ML2CPWA4ErmuL2aCWAW8S7ce6iH8anqo+xI9rcedyIOChWMWLLD4Gtaj4TMrWacw==", + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/@chainsafe/libp2p-gossipsub/-/libp2p-gossipsub-5.2.1.tgz", + "integrity": "sha512-diwYLJ+6ccM25CL2EbnvPd2k8thTkQK3lm9WfbcOqOrZZimaa+kBWuhxXNOXtVEtadX8A5Uwxpq3Gt8zZ9JdjA==", "dependencies": { - "@libp2p/components": "^2.0.3", "@libp2p/crypto": "^1.0.3", "@libp2p/interface-connection": "^3.0.1", + "@libp2p/interface-connection-manager": "^1.3.0", "@libp2p/interface-keys": "^1.0.3", "@libp2p/interface-peer-id": "^1.0.4", - "@libp2p/interface-pubsub": "^2.0.1", + "@libp2p/interface-peer-store": "^1.2.2", + "@libp2p/interface-pubsub": "^3.0.0", "@libp2p/interface-registrar": "^2.0.3", "@libp2p/interfaces": "^3.0.3", "@libp2p/logger": "^2.0.0", "@libp2p/peer-id": "^1.1.15", "@libp2p/peer-record": "^4.0.1", - "@libp2p/pubsub": "^3.1.2", + "@libp2p/pubsub": "^5.0.0", "@libp2p/topology": "^3.0.0", + "@multiformats/multiaddr": "^11.0.0", "abortable-iterator": "^4.0.2", "denque": "^1.5.0", "err-code": "^3.0.1", "it-length-prefixed": "^8.0.2", "it-pipe": "^2.0.4", "it-pushable": "^3.1.0", - "multiformats": "^9.6.4", + "multiformats": "^10.0.0", "protobufjs": "^6.11.2", "uint8arraylist": "^2.3.2", - "uint8arrays": "^3.0.0" + "uint8arrays": "^4.0.2" }, "engines": { "npm": ">=8.7.0" } }, "node_modules/@chainsafe/libp2p-noise": { - "version": "8.0.2", - "resolved": "https://registry.npmjs.org/@chainsafe/libp2p-noise/-/libp2p-noise-8.0.2.tgz", - "integrity": "sha512-YouGuPOZcP9VG8jarL21KseZZXLsa9RCkFnec3EMrRLIiL5qbbxgpDhbGzocAXSbsbitNBNrexQA524R/GB+2Q==", + "version": "10.1.0", + "resolved": "https://registry.npmjs.org/@chainsafe/libp2p-noise/-/libp2p-noise-10.1.0.tgz", + "integrity": "sha512-7Q5L/KDmjhA/X9va2wPpEMSW4VX9L7382qy23V3THV753z+7f3tFOfGjn1pWJ+rS6nm1OGLT1k5yoN3lF+MzLg==", "dependencies": { "@libp2p/crypto": "^1.0.0", - "@libp2p/interface-connection-encrypter": "^2.0.1", + "@libp2p/interface-connection-encrypter": "^3.0.0", "@libp2p/interface-keys": "^1.0.2", + "@libp2p/interface-metrics": "^4.0.2", "@libp2p/interface-peer-id": "^1.0.2", "@libp2p/logger": "^2.0.0", "@libp2p/peer-id": "^1.1.8", @@ -272,15 +275,71 @@ "it-pb-stream": "^2.0.2", "it-pipe": "^2.0.3", "it-stream-types": "^1.0.4", - "protons-runtime": "^3.1.0", + "protons-runtime": "^4.0.1", "uint8arraylist": "^2.3.2", - "uint8arrays": "^3.1.0" + "uint8arrays": "^4.0.2" }, "engines": { "node": ">=16.0.0", "npm": ">=7.0.0" } }, + "node_modules/@chainsafe/libp2p-noise/node_modules/@libp2p/interface-metrics": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/@libp2p/interface-metrics/-/interface-metrics-4.0.2.tgz", + "integrity": "sha512-HON9yXhFaTnQ86tOdE18bFJv71zQdI7xrZJuA6pNUtpsfA+djhqWXv0a4mwEGUP7k4zz3FkH0M9CrrvL0pkBWg==", + "dependencies": { + "@libp2p/interface-connection": "^3.0.0" + }, + "engines": { + "node": ">=16.0.0", + "npm": ">=7.0.0" + } + }, + "node_modules/@chainsafe/libp2p-noise/node_modules/long": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/long/-/long-5.2.1.tgz", + "integrity": "sha512-GKSNGeNAtw8IryjjkhZxuKB3JzlcLTwjtiQCHKvqQet81I93kXslhDQruGI/QsddO83mcDToBVy7GqGS/zYf/A==" + }, + "node_modules/@chainsafe/libp2p-noise/node_modules/protobufjs": { + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/protobufjs/-/protobufjs-7.1.2.tgz", + "integrity": "sha512-4ZPTPkXCdel3+L81yw3dG6+Kq3umdWKh7Dc7GW/CpNk4SX3hK58iPCWeCyhVTDrbkNeKrYNZ7EojM5WDaEWTLQ==", + "hasInstallScript": true, + "dependencies": { + "@protobufjs/aspromise": "^1.1.2", + "@protobufjs/base64": "^1.1.2", + "@protobufjs/codegen": "^2.0.4", + "@protobufjs/eventemitter": "^1.1.0", + "@protobufjs/fetch": "^1.1.0", + "@protobufjs/float": "^1.0.2", + "@protobufjs/inquire": "^1.1.0", + "@protobufjs/path": "^1.1.2", + "@protobufjs/pool": "^1.1.0", + "@protobufjs/utf8": "^1.1.0", + "@types/node": ">=13.7.0", + "long": "^5.0.0" + }, + "engines": { + "node": ">=12.0.0" + } + }, + "node_modules/@chainsafe/libp2p-noise/node_modules/protons-runtime": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/protons-runtime/-/protons-runtime-4.0.1.tgz", + "integrity": "sha512-SPeV+8TzJAp5UJYPV7vJkLRi08CP0DksxpKK60rcNaZSPkMBQwc0jQrmkHqwc5P0cYbZzKsdYrUBwRrDLrzTfQ==", + "dependencies": { + "protobufjs": "^7.0.0", + "uint8arraylist": "^2.3.2" + }, + "engines": { + "node": ">=16.0.0", + "npm": ">=7.0.0" + }, + "peerDependencies": { + "uint8arraylist": "^2.3.2" + } + }, "node_modules/@changesets/types": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/@changesets/types/-/types-4.1.0.tgz", @@ -2126,26 +2185,19 @@ "node": "^12.13.0 || ^14.15.0 || >=16.0.0" } }, - "node_modules/@libp2p/components": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/@libp2p/components/-/components-2.1.1.tgz", - "integrity": "sha512-/XtfEdBHaNhwiaf9RowiSYnyVFIl+shuZNGQlCsJmOnn5X490TMo9GJ9PVfrTRnRn3ZXPBLS5Vp0s6++ShSv7g==", + "node_modules/@libp2p/bootstrap": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/@libp2p/bootstrap/-/bootstrap-5.0.0.tgz", + "integrity": "sha512-3r20rD2coW0k6j7C7EBfRPh3vaUKVKcTmMksesn7ybcNezu8ziEHxZx93BBwnw8sy+ZwSfnUsK/vOtiGWJPAhw==", "dependencies": { - "@libp2p/interface-address-manager": "^1.0.2", - "@libp2p/interface-connection": "^3.0.1", - "@libp2p/interface-connection-manager": "^1.1.0", - "@libp2p/interface-content-routing": "^1.0.2", - "@libp2p/interface-dht": "^1.0.1", - "@libp2p/interface-metrics": "^3.0.0", - "@libp2p/interface-peer-id": "^1.0.2", - "@libp2p/interface-peer-routing": "^1.0.1", - "@libp2p/interface-peer-store": "^1.2.1", - "@libp2p/interface-pubsub": "^2.1.0", - "@libp2p/interface-registrar": "^2.0.3", - "@libp2p/interface-transport": "^1.0.3", + "@libp2p/interface-peer-discovery": "^1.0.1", + "@libp2p/interface-peer-info": "^1.0.3", + "@libp2p/interface-peer-store": "^1.2.2", "@libp2p/interfaces": "^3.0.3", - "err-code": "^3.0.1", - "interface-datastore": "^7.0.0" + "@libp2p/logger": "^2.0.1", + "@libp2p/peer-id": "^1.1.15", + "@multiformats/mafmt": "^11.0.3", + "@multiformats/multiaddr": "^11.0.0" }, "engines": { "node": ">=16.0.0", @@ -2193,15 +2245,6 @@ "resolved": "https://registry.npmjs.org/long/-/long-5.2.0.tgz", "integrity": "sha512-9RTUNjK60eJbx3uz+TEGF7fUr29ZDxR5QzXcyDpeSfeH28S9ycINflOgOlppit5U+4kNTe83KQnMEerw7GmE8w==" }, - "node_modules/@libp2p/crypto/node_modules/multiformats": { - "version": "10.0.2", - "resolved": "https://registry.npmjs.org/multiformats/-/multiformats-10.0.2.tgz", - "integrity": "sha512-nJEHLFOYhO4L+aNApHhCnWqa31FyqAHv9Q77AhmwU3KsM2f1j7tuJpCk5ByZ33smzycNCpSG5klNIejIyfFx2A==", - "engines": { - "node": ">=16.0.0", - "npm": ">=7.0.0" - } - }, "node_modules/@libp2p/crypto/node_modules/protobufjs": { "version": "7.1.2", "resolved": "https://registry.npmjs.org/protobufjs/-/protobufjs-7.1.2.tgz", @@ -2241,31 +2284,6 @@ "uint8arraylist": "^2.3.2" } }, - "node_modules/@libp2p/crypto/node_modules/uint8arrays": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/uint8arrays/-/uint8arrays-4.0.2.tgz", - "integrity": "sha512-8CWXXZdOvVrIL4SeY/Gnp+idxxiGK4XFkP4FY26Sx/fpTz/b6vv4BVWELMDzQweSyyhdcuAcU14H6izzB6k1Cw==", - "dependencies": { - "multiformats": "^10.0.0" - }, - "engines": { - "node": ">=16.0.0", - "npm": ">=7.0.0" - } - }, - "node_modules/@libp2p/interface-address-manager": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/@libp2p/interface-address-manager/-/interface-address-manager-1.0.3.tgz", - "integrity": "sha512-/DNGUQEXA0Ks+EOp0IVv3TsWq1H+4ZlSnyBozzNGDmufz6wG+EvUDBbwIXieHR898bj4pHfmmogK+Vwz5s5Kdw==", - "dependencies": { - "@libp2p/interfaces": "^3.0.0", - "@multiformats/multiaddr": "^11.0.0" - }, - "engines": { - "node": ">=16.0.0", - "npm": ">=7.0.0" - } - }, "node_modules/@libp2p/interface-connection": { "version": "3.0.3", "resolved": "https://registry.npmjs.org/@libp2p/interface-connection/-/interface-connection-3.0.3.tgz", @@ -2283,13 +2301,13 @@ } }, "node_modules/@libp2p/interface-connection-encrypter": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/@libp2p/interface-connection-encrypter/-/interface-connection-encrypter-2.0.2.tgz", - "integrity": "sha512-kp8CgNICXTE/j21l6j3H7y028OR+I7yqwQH1769c5A1ikh2Gl/e1rgoMcwz8HPVNyS8qtw2TEWn45th8Kn4NMQ==", + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/@libp2p/interface-connection-encrypter/-/interface-connection-encrypter-3.0.2.tgz", + "integrity": "sha512-7b4t1aW3xbPcq3ORBi/nplIia8X7mdHlUg4SRWs92fDNciFwm1NUr63aVVs9WMwXmN3XB9UNbxKrrrXAWHRuHw==", "dependencies": { "@libp2p/interface-peer-id": "^1.0.0", "it-stream-types": "^1.0.4", - "uint8arraylist": "^2.1.1" + "uint8arraylist": "^2.1.2" }, "engines": { "node": ">=16.0.0", @@ -2325,15 +2343,6 @@ "npm": ">=7.0.0" } }, - "node_modules/@libp2p/interface-content-routing/node_modules/multiformats": { - "version": "10.0.2", - "resolved": "https://registry.npmjs.org/multiformats/-/multiformats-10.0.2.tgz", - "integrity": "sha512-nJEHLFOYhO4L+aNApHhCnWqa31FyqAHv9Q77AhmwU3KsM2f1j7tuJpCk5ByZ33smzycNCpSG5klNIejIyfFx2A==", - "engines": { - "node": ">=16.0.0", - "npm": ">=7.0.0" - } - }, "node_modules/@libp2p/interface-dht": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/@libp2p/interface-dht/-/interface-dht-1.0.2.tgz", @@ -2350,15 +2359,6 @@ "npm": ">=7.0.0" } }, - "node_modules/@libp2p/interface-dht/node_modules/multiformats": { - "version": "10.0.2", - "resolved": "https://registry.npmjs.org/multiformats/-/multiformats-10.0.2.tgz", - "integrity": "sha512-nJEHLFOYhO4L+aNApHhCnWqa31FyqAHv9Q77AhmwU3KsM2f1j7tuJpCk5ByZ33smzycNCpSG5klNIejIyfFx2A==", - "engines": { - "node": ">=16.0.0", - "npm": ">=7.0.0" - } - }, "node_modules/@libp2p/interface-keys": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/@libp2p/interface-keys/-/interface-keys-1.0.3.tgz", @@ -2382,9 +2382,9 @@ } }, "node_modules/@libp2p/interface-peer-discovery": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/@libp2p/interface-peer-discovery/-/interface-peer-discovery-1.0.1.tgz", - "integrity": "sha512-ZqBhpX7fR3ROYQaGYV47YhyTJJzFDzyyEIsQ7NnDuG3KhcQb2PtocnN0sy1Ozm784M0oYveM/HjfuNxxcOwdYg==", + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/@libp2p/interface-peer-discovery/-/interface-peer-discovery-1.0.2.tgz", + "integrity": "sha512-Zgjw0bVd8DDwL5qkh/GA1JCQiEGD16wRQ7nhlGe+tXHdZb8LCP/1/P6ry0v0W6MgxAnO90SegC4T3TGYlsj6hw==", "dependencies": { "@libp2p/interface-peer-info": "^1.0.0", "@libp2p/interfaces": "^3.0.0" @@ -2395,9 +2395,9 @@ } }, "node_modules/@libp2p/interface-peer-id": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/@libp2p/interface-peer-id/-/interface-peer-id-1.0.5.tgz", - "integrity": "sha512-K7TJTmtPWfIrH4NS5y+dvAwQltoga+ScGgjs+ZGKz07uHzoPUeE/OpXxs5Msdela6hp+dP1Ha7bZmA/Njbq5bg==", + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/@libp2p/interface-peer-id/-/interface-peer-id-1.0.6.tgz", + "integrity": "sha512-3iMoAnXq/F+t/JWbNPb9UePvwgmm5rFUCEwNgAiDOUtXUZsXZO0Ko3eF9O1gpLe1KNH5wK7g2Wf46YW1vRAS8A==", "dependencies": { "multiformats": "^10.0.0" }, @@ -2406,19 +2406,10 @@ "npm": ">=7.0.0" } }, - "node_modules/@libp2p/interface-peer-id/node_modules/multiformats": { - "version": "10.0.2", - "resolved": "https://registry.npmjs.org/multiformats/-/multiformats-10.0.2.tgz", - "integrity": "sha512-nJEHLFOYhO4L+aNApHhCnWqa31FyqAHv9Q77AhmwU3KsM2f1j7tuJpCk5ByZ33smzycNCpSG5klNIejIyfFx2A==", - "engines": { - "node": ">=16.0.0", - "npm": ">=7.0.0" - } - }, "node_modules/@libp2p/interface-peer-info": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/@libp2p/interface-peer-info/-/interface-peer-info-1.0.3.tgz", - "integrity": "sha512-QKybxfp/NmDGDMkgf/CTt4fU03ajZnldHr9TYg5wMkJrnVaaHbhDTYBg5YWt+iOH1mgR89/dpKv/Na0ZE5sPIA==", + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/@libp2p/interface-peer-info/-/interface-peer-info-1.0.4.tgz", + "integrity": "sha512-ILW2j7NMD1jZwWdJyxXY8fv/aiaJf2rOjgQkXgidy1GdaZ7UtNiiyvZmksqfEVlWH6opfd/GbuwrMemzM2E7Xg==", "dependencies": { "@libp2p/interface-peer-id": "^1.0.0", "@multiformats/multiaddr": "^11.0.0" @@ -2443,9 +2434,9 @@ } }, "node_modules/@libp2p/interface-peer-store": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/@libp2p/interface-peer-store/-/interface-peer-store-1.2.2.tgz", - "integrity": "sha512-ZjE9AkDtjz4R+SppCgZ66oko7Z9pDsdFk1lbba0hTPA2i0uuWdTYep7bZ3RvKot0Q2UrWg8ySL/30pW+Wp70sA==", + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/@libp2p/interface-peer-store/-/interface-peer-store-1.2.3.tgz", + "integrity": "sha512-nSSaOO2zvZa9ZGoDbLsjPDEVC1OFWY5/FoQPkxokaPTz0AFJ5jDTAgii8iQ+6XRo2WvV7ZYcEd+AusSYeE3w6Q==", "dependencies": { "@libp2p/interface-peer-id": "^1.0.0", "@libp2p/interface-peer-info": "^1.0.0", @@ -2459,15 +2450,15 @@ } }, "node_modules/@libp2p/interface-pubsub": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/@libp2p/interface-pubsub/-/interface-pubsub-2.1.0.tgz", - "integrity": "sha512-X+SIqzfeCO8ZDGrFTzH9EMwMf8ojW5nk20rxv3h1sCXEdfvyJCARZ51r9UlwJcnucnHqvFChfkbubAkrr3R4Cw==", + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/@libp2p/interface-pubsub/-/interface-pubsub-3.0.1.tgz", + "integrity": "sha512-VLMr6Mn8e2m2moda3dGNbsAkWjPoENBebJIzFV7QDd9NOKwNiAs59vIoNi2n+y5XzUBmgBeKeFB8G03/m0NOdA==", "dependencies": { "@libp2p/interface-connection": "^3.0.0", "@libp2p/interface-peer-id": "^1.0.0", "@libp2p/interfaces": "^3.0.0", "it-pushable": "^3.0.0", - "uint8arraylist": "^2.0.0" + "uint8arraylist": "^2.1.2" }, "engines": { "node": ">=16.0.0", @@ -2488,9 +2479,9 @@ } }, "node_modules/@libp2p/interface-registrar": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/@libp2p/interface-registrar/-/interface-registrar-2.0.3.tgz", - "integrity": "sha512-YA/A+o+166/+noXxMFXvZdg9soZSZX2EPOlUwnGXZWR7J5B2sxyP76QxHWXL5npsEMj7suP+Rjb/GJYGz7rDyg==", + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/@libp2p/interface-registrar/-/interface-registrar-2.0.4.tgz", + "integrity": "sha512-GD5EY+LrtV4v4Mvm/L/ObeMWb96VPZppi7Vl1b1HU5dMzWSnPdOylJZ/N0/Ppryg30CO6yayq9g+/CQN8YEk4g==", "dependencies": { "@libp2p/interface-connection": "^3.0.0", "@libp2p/interface-peer-id": "^1.0.0" @@ -2501,9 +2492,9 @@ } }, "node_modules/@libp2p/interface-stream-muxer": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/@libp2p/interface-stream-muxer/-/interface-stream-muxer-2.0.2.tgz", - "integrity": "sha512-BcLsV8ZVr34G32u/w4pgSAgFju9CTuBB9OJwgX6ugasYf6LtJ0a3m5Kwddy79lvvM/gBvVv/McpCr4mPxP4WWg==", + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/@libp2p/interface-stream-muxer/-/interface-stream-muxer-3.0.1.tgz", + "integrity": "sha512-HlIZFMMSYTKOKn5VBw8UHQ5qya6oWSqpP2ygtSoB/nbBcC/3mv/4cbvozJUAGrOrDz01YY3QOB2LJ6R1b0EWCQ==", "dependencies": { "@libp2p/interface-connection": "^3.0.0", "@libp2p/interfaces": "^3.0.0", @@ -2514,25 +2505,10 @@ "npm": ">=7.0.0" } }, - "node_modules/@libp2p/interface-transport": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/@libp2p/interface-transport/-/interface-transport-1.0.4.tgz", - "integrity": "sha512-MOkhtykUrrbgHC1CcAFe/6QTz/BEBbHfu5sf+go6dhBlHXeHI+AcV8Fic5zTZNz71E1SRi2UR+5TVi7ORPL57Q==", - "dependencies": { - "@libp2p/interface-connection": "^3.0.0", - "@libp2p/interfaces": "^3.0.0", - "@multiformats/multiaddr": "^11.0.0", - "it-stream-types": "^1.0.4" - }, - "engines": { - "node": ">=16.0.0", - "npm": ">=7.0.0" - } - }, "node_modules/@libp2p/interfaces": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/@libp2p/interfaces/-/interfaces-3.0.3.tgz", - "integrity": "sha512-8IIxw7TKpaYTtVfZN3jePLlm/E/VzqPpqerN+jhA+1s86akRSeyxVBYi3W9SWDSf0oIauHJSDE8KNxLceAfeag==", + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/@libp2p/interfaces/-/interfaces-3.0.4.tgz", + "integrity": "sha512-e8GZAgr72bT2qfDsIVb9lKDA2itLLGfXnaC18VXsToFUd4kCAe6ggUsRFpCBjrX3aWZ16pRiGy4afprOCfgyIg==", "engines": { "node": ">=16.0.0", "npm": ">=7.0.0" @@ -2553,23 +2529,13 @@ "npm": ">=7.0.0" } }, - "node_modules/@libp2p/logger/node_modules/multiformats": { - "version": "10.0.2", - "resolved": "https://registry.npmjs.org/multiformats/-/multiformats-10.0.2.tgz", - "integrity": "sha512-nJEHLFOYhO4L+aNApHhCnWqa31FyqAHv9Q77AhmwU3KsM2f1j7tuJpCk5ByZ33smzycNCpSG5klNIejIyfFx2A==", - "engines": { - "node": ">=16.0.0", - "npm": ">=7.0.0" - } - }, "node_modules/@libp2p/mplex": { - "version": "5.2.4", - "resolved": "https://registry.npmjs.org/@libp2p/mplex/-/mplex-5.2.4.tgz", - "integrity": "sha512-DyyDaDjSaCNT5eIgtlvyMvDejFhHEoPmICElPVHxFF0Wo7kr2CV8WLlYmwxdO7fKUZQA6NYhX5E1ZrQltCbBqg==", + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/@libp2p/mplex/-/mplex-7.0.0.tgz", + "integrity": "sha512-pzPxBXxvLJI1xBwrz2b2mcLblVvoj6swoI6Trgezjx2myLMKIXjFTcK7KBWor5J8RF+vLmnmOLDEDvqOJJtCWg==", "dependencies": { - "@libp2p/components": "^2.0.0", "@libp2p/interface-connection": "^3.0.1", - "@libp2p/interface-stream-muxer": "^2.0.0", + "@libp2p/interface-stream-muxer": "^3.0.0", "@libp2p/logger": "^2.0.0", "abortable-iterator": "^4.0.2", "any-signal": "^3.0.0", @@ -2580,7 +2546,7 @@ "it-stream-types": "^1.0.4", "rate-limiter-flexible": "^2.3.9", "uint8arraylist": "^2.1.1", - "uint8arrays": "^3.0.0", + "uint8arrays": "^4.0.2", "varint": "^6.0.0" }, "engines": { @@ -2614,27 +2580,6 @@ "npm": ">=7.0.0" } }, - "node_modules/@libp2p/multistream-select/node_modules/multiformats": { - "version": "10.0.2", - "resolved": "https://registry.npmjs.org/multiformats/-/multiformats-10.0.2.tgz", - "integrity": "sha512-nJEHLFOYhO4L+aNApHhCnWqa31FyqAHv9Q77AhmwU3KsM2f1j7tuJpCk5ByZ33smzycNCpSG5klNIejIyfFx2A==", - "engines": { - "node": ">=16.0.0", - "npm": ">=7.0.0" - } - }, - "node_modules/@libp2p/multistream-select/node_modules/uint8arrays": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/uint8arrays/-/uint8arrays-4.0.2.tgz", - "integrity": "sha512-8CWXXZdOvVrIL4SeY/Gnp+idxxiGK4XFkP4FY26Sx/fpTz/b6vv4BVWELMDzQweSyyhdcuAcU14H6izzB6k1Cw==", - "dependencies": { - "multiformats": "^10.0.0" - }, - "engines": { - "node": ">=16.0.0", - "npm": ">=7.0.0" - } - }, "node_modules/@libp2p/peer-collections": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/@libp2p/peer-collections/-/peer-collections-2.2.0.tgz", @@ -2687,15 +2632,6 @@ "resolved": "https://registry.npmjs.org/long/-/long-5.2.0.tgz", "integrity": "sha512-9RTUNjK60eJbx3uz+TEGF7fUr29ZDxR5QzXcyDpeSfeH28S9ycINflOgOlppit5U+4kNTe83KQnMEerw7GmE8w==" }, - "node_modules/@libp2p/peer-id-factory/node_modules/multiformats": { - "version": "10.0.2", - "resolved": "https://registry.npmjs.org/multiformats/-/multiformats-10.0.2.tgz", - "integrity": "sha512-nJEHLFOYhO4L+aNApHhCnWqa31FyqAHv9Q77AhmwU3KsM2f1j7tuJpCk5ByZ33smzycNCpSG5klNIejIyfFx2A==", - "engines": { - "node": ">=16.0.0", - "npm": ">=7.0.0" - } - }, "node_modules/@libp2p/peer-id-factory/node_modules/protobufjs": { "version": "7.1.2", "resolved": "https://registry.npmjs.org/protobufjs/-/protobufjs-7.1.2.tgz", @@ -2735,39 +2671,6 @@ "uint8arraylist": "^2.3.2" } }, - "node_modules/@libp2p/peer-id-factory/node_modules/uint8arrays": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/uint8arrays/-/uint8arrays-4.0.2.tgz", - "integrity": "sha512-8CWXXZdOvVrIL4SeY/Gnp+idxxiGK4XFkP4FY26Sx/fpTz/b6vv4BVWELMDzQweSyyhdcuAcU14H6izzB6k1Cw==", - "dependencies": { - "multiformats": "^10.0.0" - }, - "engines": { - "node": ">=16.0.0", - "npm": ">=7.0.0" - } - }, - "node_modules/@libp2p/peer-id/node_modules/multiformats": { - "version": "10.0.2", - "resolved": "https://registry.npmjs.org/multiformats/-/multiformats-10.0.2.tgz", - "integrity": "sha512-nJEHLFOYhO4L+aNApHhCnWqa31FyqAHv9Q77AhmwU3KsM2f1j7tuJpCk5ByZ33smzycNCpSG5klNIejIyfFx2A==", - "engines": { - "node": ">=16.0.0", - "npm": ">=7.0.0" - } - }, - "node_modules/@libp2p/peer-id/node_modules/uint8arrays": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/uint8arrays/-/uint8arrays-4.0.2.tgz", - "integrity": "sha512-8CWXXZdOvVrIL4SeY/Gnp+idxxiGK4XFkP4FY26Sx/fpTz/b6vv4BVWELMDzQweSyyhdcuAcU14H6izzB6k1Cw==", - "dependencies": { - "multiformats": "^10.0.0" - }, - "engines": { - "node": ">=16.0.0", - "npm": ">=7.0.0" - } - }, "node_modules/@libp2p/peer-record": { "version": "4.0.4", "resolved": "https://registry.npmjs.org/@libp2p/peer-record/-/peer-record-4.0.4.tgz", @@ -2804,15 +2707,6 @@ "resolved": "https://registry.npmjs.org/long/-/long-5.2.0.tgz", "integrity": "sha512-9RTUNjK60eJbx3uz+TEGF7fUr29ZDxR5QzXcyDpeSfeH28S9ycINflOgOlppit5U+4kNTe83KQnMEerw7GmE8w==" }, - "node_modules/@libp2p/peer-record/node_modules/multiformats": { - "version": "10.0.2", - "resolved": "https://registry.npmjs.org/multiformats/-/multiformats-10.0.2.tgz", - "integrity": "sha512-nJEHLFOYhO4L+aNApHhCnWqa31FyqAHv9Q77AhmwU3KsM2f1j7tuJpCk5ByZ33smzycNCpSG5klNIejIyfFx2A==", - "engines": { - "node": ">=16.0.0", - "npm": ">=7.0.0" - } - }, "node_modules/@libp2p/peer-record/node_modules/protobufjs": { "version": "7.1.2", "resolved": "https://registry.npmjs.org/protobufjs/-/protobufjs-7.1.2.tgz", @@ -2852,24 +2746,11 @@ "uint8arraylist": "^2.3.2" } }, - "node_modules/@libp2p/peer-record/node_modules/uint8arrays": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/uint8arrays/-/uint8arrays-4.0.2.tgz", - "integrity": "sha512-8CWXXZdOvVrIL4SeY/Gnp+idxxiGK4XFkP4FY26Sx/fpTz/b6vv4BVWELMDzQweSyyhdcuAcU14H6izzB6k1Cw==", - "dependencies": { - "multiformats": "^10.0.0" - }, - "engines": { - "node": ">=16.0.0", - "npm": ">=7.0.0" - } - }, "node_modules/@libp2p/peer-store": { - "version": "3.1.5", - "resolved": "https://registry.npmjs.org/@libp2p/peer-store/-/peer-store-3.1.5.tgz", - "integrity": "sha512-tChz3TqkQj1t0+yugWroeGhHbX+q7e1goVRJQbli4sZ1j5NEAQlxHpPq2yDOOCB5RVvX0oZ8b32999ILOJXbvA==", + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/@libp2p/peer-store/-/peer-store-5.0.0.tgz", + "integrity": "sha512-Yz/JykQ9xA0cpv4jIOt9dzYXBAugjoJFPVpA8/LEwU6Y+aUcTIAC3AhOe88QxjYxy4pz+H7C711K2HNCj207jg==", "dependencies": { - "@libp2p/components": "^2.0.0", "@libp2p/interface-peer-id": "^1.0.4", "@libp2p/interface-peer-info": "^1.0.3", "@libp2p/interface-peer-store": "^1.2.2", @@ -2887,26 +2768,69 @@ "it-map": "^1.0.6", "it-pipe": "^2.0.3", "mortice": "^3.0.0", - "multiformats": "^9.6.3", - "protons-runtime": "^3.1.0", + "multiformats": "^10.0.0", + "protons-runtime": "^4.0.1", "uint8arraylist": "^2.1.1", - "uint8arrays": "^3.1.0" + "uint8arrays": "^4.0.2" }, "engines": { "node": ">=16.0.0", "npm": ">=7.0.0" } }, - "node_modules/@libp2p/pubsub": { - "version": "3.1.3", - "resolved": "https://registry.npmjs.org/@libp2p/pubsub/-/pubsub-3.1.3.tgz", - "integrity": "sha512-lo3Ay3NHdll2Wt0kzs2RNyWagyECGDx7d4dyKwGQgzhZyoy3FnYQW8vbMLyLLX1FV9DSiWEbFsBxX2MKJXUMyQ==", + "node_modules/@libp2p/peer-store/node_modules/long": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/long/-/long-5.2.1.tgz", + "integrity": "sha512-GKSNGeNAtw8IryjjkhZxuKB3JzlcLTwjtiQCHKvqQet81I93kXslhDQruGI/QsddO83mcDToBVy7GqGS/zYf/A==" + }, + "node_modules/@libp2p/peer-store/node_modules/protobufjs": { + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/protobufjs/-/protobufjs-7.1.2.tgz", + "integrity": "sha512-4ZPTPkXCdel3+L81yw3dG6+Kq3umdWKh7Dc7GW/CpNk4SX3hK58iPCWeCyhVTDrbkNeKrYNZ7EojM5WDaEWTLQ==", + "hasInstallScript": true, + "dependencies": { + "@protobufjs/aspromise": "^1.1.2", + "@protobufjs/base64": "^1.1.2", + "@protobufjs/codegen": "^2.0.4", + "@protobufjs/eventemitter": "^1.1.0", + "@protobufjs/fetch": "^1.1.0", + "@protobufjs/float": "^1.0.2", + "@protobufjs/inquire": "^1.1.0", + "@protobufjs/path": "^1.1.2", + "@protobufjs/pool": "^1.1.0", + "@protobufjs/utf8": "^1.1.0", + "@types/node": ">=13.7.0", + "long": "^5.0.0" + }, + "engines": { + "node": ">=12.0.0" + } + }, + "node_modules/@libp2p/peer-store/node_modules/protons-runtime": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/protons-runtime/-/protons-runtime-4.0.1.tgz", + "integrity": "sha512-SPeV+8TzJAp5UJYPV7vJkLRi08CP0DksxpKK60rcNaZSPkMBQwc0jQrmkHqwc5P0cYbZzKsdYrUBwRrDLrzTfQ==", + "dependencies": { + "protobufjs": "^7.0.0", + "uint8arraylist": "^2.3.2" + }, + "engines": { + "node": ">=16.0.0", + "npm": ">=7.0.0" + }, + "peerDependencies": { + "uint8arraylist": "^2.3.2" + } + }, + "node_modules/@libp2p/pubsub": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/@libp2p/pubsub/-/pubsub-5.0.0.tgz", + "integrity": "sha512-E391cFkWDFG7SnE4aoG5y8eRr5OkUWEarWbWkGjnzt2IYSO5wj3K9XKn9U8DDg4Fskl1KQAQDZayS8crMxyHAA==", "dependencies": { - "@libp2p/components": "^2.0.0", "@libp2p/crypto": "^1.0.0", "@libp2p/interface-connection": "^3.0.1", "@libp2p/interface-peer-id": "^1.0.2", - "@libp2p/interface-pubsub": "^2.0.0", + "@libp2p/interface-pubsub": "^3.0.0", "@libp2p/interface-registrar": "^2.0.0", "@libp2p/interfaces": "^3.0.2", "@libp2p/logger": "^2.0.0", @@ -2919,10 +2843,10 @@ "it-length-prefixed": "^8.0.2", "it-pipe": "^2.0.3", "it-pushable": "^3.0.0", - "multiformats": "^9.6.3", + "multiformats": "^10.0.0", "p-queue": "^7.2.0", "uint8arraylist": "^2.0.0", - "uint8arrays": "^3.0.0" + "uint8arrays": "^4.0.2" }, "engines": { "node": ">=16.0.0", @@ -2980,12 +2904,12 @@ } }, "node_modules/@libp2p/websockets": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/@libp2p/websockets/-/websockets-3.0.4.tgz", - "integrity": "sha512-Xu2ENTcc05D+QALo7ayVlMJjKPUoABToUve1JQQmfH2Pb6ck1fACmjLTTpumoRDNm6UZTbkW1k8SgUmzg57iiw==", + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/@libp2p/websockets/-/websockets-5.0.0.tgz", + "integrity": "sha512-aQ1aVIuLXuUrjWIug9rJ3iLwyaJ1zgcHQfSGg0eE3a2DE1zpFgFyH0hK6zN+PT23GY/BFmNk/zlilKnA6ayatQ==", "dependencies": { "@libp2p/interface-connection": "^3.0.2", - "@libp2p/interface-transport": "^1.0.4", + "@libp2p/interface-transport": "^2.0.0", "@libp2p/interfaces": "^3.0.3", "@libp2p/logger": "^2.0.0", "@libp2p/utils": "^3.0.2", @@ -3004,6 +2928,22 @@ "npm": ">=7.0.0" } }, + "node_modules/@libp2p/websockets/node_modules/@libp2p/interface-transport": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/@libp2p/interface-transport/-/interface-transport-2.0.1.tgz", + "integrity": "sha512-yrL6YZmPQX4JT/E/60XgNgNSCu9tNPjjq2HuWZs1n1k8cstV0/WvViUE8aoOlJlKZSVjQNcpRAy9LgVxznK7/g==", + "dependencies": { + "@libp2p/interface-connection": "^3.0.0", + "@libp2p/interface-stream-muxer": "^3.0.0", + "@libp2p/interfaces": "^3.0.0", + "@multiformats/multiaddr": "^11.0.0", + "it-stream-types": "^1.0.4" + }, + "engines": { + "node": ">=16.0.0", + "npm": ">=7.0.0" + } + }, "node_modules/@manypkg/find-root": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/@manypkg/find-root/-/find-root-1.1.0.tgz", @@ -3193,27 +3133,6 @@ "npm": ">=7.0.0" } }, - "node_modules/@multiformats/multiaddr/node_modules/multiformats": { - "version": "10.0.2", - "resolved": "https://registry.npmjs.org/multiformats/-/multiformats-10.0.2.tgz", - "integrity": "sha512-nJEHLFOYhO4L+aNApHhCnWqa31FyqAHv9Q77AhmwU3KsM2f1j7tuJpCk5ByZ33smzycNCpSG5klNIejIyfFx2A==", - "engines": { - "node": ">=16.0.0", - "npm": ">=7.0.0" - } - }, - "node_modules/@multiformats/multiaddr/node_modules/uint8arrays": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/uint8arrays/-/uint8arrays-4.0.2.tgz", - "integrity": "sha512-8CWXXZdOvVrIL4SeY/Gnp+idxxiGK4XFkP4FY26Sx/fpTz/b6vv4BVWELMDzQweSyyhdcuAcU14H6izzB6k1Cw==", - "dependencies": { - "multiformats": "^10.0.0" - }, - "engines": { - "node": ">=16.0.0", - "npm": ">=7.0.0" - } - }, "node_modules/@noble/ed25519": { "version": "1.7.1", "resolved": "https://registry.npmjs.org/@noble/ed25519/-/ed25519-1.7.1.tgz", @@ -7145,27 +7064,6 @@ "npm": ">=7.0.0" } }, - "node_modules/datastore-core/node_modules/multiformats": { - "version": "10.0.2", - "resolved": "https://registry.npmjs.org/multiformats/-/multiformats-10.0.2.tgz", - "integrity": "sha512-nJEHLFOYhO4L+aNApHhCnWqa31FyqAHv9Q77AhmwU3KsM2f1j7tuJpCk5ByZ33smzycNCpSG5klNIejIyfFx2A==", - "engines": { - "node": ">=16.0.0", - "npm": ">=7.0.0" - } - }, - "node_modules/datastore-core/node_modules/uint8arrays": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/uint8arrays/-/uint8arrays-4.0.2.tgz", - "integrity": "sha512-8CWXXZdOvVrIL4SeY/Gnp+idxxiGK4XFkP4FY26Sx/fpTz/b6vv4BVWELMDzQweSyyhdcuAcU14H6izzB6k1Cw==", - "dependencies": { - "multiformats": "^10.0.0" - }, - "engines": { - "node": ">=16.0.0", - "npm": ">=7.0.0" - } - }, "node_modules/date-format": { "version": "4.0.14", "resolved": "https://registry.npmjs.org/date-format/-/date-format-4.0.14.tgz", @@ -10149,15 +10047,6 @@ "npm": ">=7.0.0" } }, - "node_modules/interface-datastore/node_modules/multiformats": { - "version": "10.0.2", - "resolved": "https://registry.npmjs.org/multiformats/-/multiformats-10.0.2.tgz", - "integrity": "sha512-nJEHLFOYhO4L+aNApHhCnWqa31FyqAHv9Q77AhmwU3KsM2f1j7tuJpCk5ByZ33smzycNCpSG5klNIejIyfFx2A==", - "engines": { - "node": ">=16.0.0", - "npm": ">=7.0.0" - } - }, "node_modules/interface-datastore/node_modules/nanoid": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-4.0.0.tgz", @@ -10169,18 +10058,6 @@ "node": "^14 || ^16 || >=18" } }, - "node_modules/interface-datastore/node_modules/uint8arrays": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/uint8arrays/-/uint8arrays-4.0.2.tgz", - "integrity": "sha512-8CWXXZdOvVrIL4SeY/Gnp+idxxiGK4XFkP4FY26Sx/fpTz/b6vv4BVWELMDzQweSyyhdcuAcU14H6izzB6k1Cw==", - "dependencies": { - "multiformats": "^10.0.0" - }, - "engines": { - "node": ">=16.0.0", - "npm": ">=7.0.0" - } - }, "node_modules/interface-store": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/interface-store/-/interface-store-3.0.1.tgz", @@ -10775,27 +10652,6 @@ "npm": ">=7.0.0" } }, - "node_modules/it-length-prefixed/node_modules/multiformats": { - "version": "10.0.2", - "resolved": "https://registry.npmjs.org/multiformats/-/multiformats-10.0.2.tgz", - "integrity": "sha512-nJEHLFOYhO4L+aNApHhCnWqa31FyqAHv9Q77AhmwU3KsM2f1j7tuJpCk5ByZ33smzycNCpSG5klNIejIyfFx2A==", - "engines": { - "node": ">=16.0.0", - "npm": ">=7.0.0" - } - }, - "node_modules/it-length-prefixed/node_modules/uint8arrays": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/uint8arrays/-/uint8arrays-4.0.2.tgz", - "integrity": "sha512-8CWXXZdOvVrIL4SeY/Gnp+idxxiGK4XFkP4FY26Sx/fpTz/b6vv4BVWELMDzQweSyyhdcuAcU14H6izzB6k1Cw==", - "dependencies": { - "multiformats": "^10.0.0" - }, - "engines": { - "node": ">=16.0.0", - "npm": ">=7.0.0" - } - }, "node_modules/it-map": { "version": "1.0.6", "resolved": "https://registry.npmjs.org/it-map/-/it-map-1.0.6.tgz", @@ -10878,11 +10734,24 @@ } }, "node_modules/it-sort": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/it-sort/-/it-sort-1.0.1.tgz", - "integrity": "sha512-c+C48cP7XMMebB9irLrJs2EmpLILId8NYSojqAqN8etE8ienx0azBgaKvZHYH1DkerqIul0Fl2FqISu2BZgTEQ==", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/it-sort/-/it-sort-2.0.0.tgz", + "integrity": "sha512-yeAE97b5PEjCrWFUiNyR90eJdGslj8FB3cjT84rsc+mzx9lxPyR2zJkYB9ZOJoWE5MMebxqcQCLRT3OSlzo7Zg==", "dependencies": { - "it-all": "^1.0.6" + "it-all": "^2.0.0" + }, + "engines": { + "node": ">=16.0.0", + "npm": ">=7.0.0" + } + }, + "node_modules/it-sort/node_modules/it-all": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/it-all/-/it-all-2.0.0.tgz", + "integrity": "sha512-I/yi9ogTY59lFxtfsDSlI9w9QZtC/5KJt6g7CPPBJJh2xql2ZS7Ghcp9hoqDDbc4QfwQvtx8Loy0zlKQ8H5gFg==", + "engines": { + "node": ">=16.0.0", + "npm": ">=7.0.0" } }, "node_modules/it-stream-types": { @@ -10911,27 +10780,6 @@ "npm": ">=7.0.0" } }, - "node_modules/it-ws/node_modules/multiformats": { - "version": "10.0.2", - "resolved": "https://registry.npmjs.org/multiformats/-/multiformats-10.0.2.tgz", - "integrity": "sha512-nJEHLFOYhO4L+aNApHhCnWqa31FyqAHv9Q77AhmwU3KsM2f1j7tuJpCk5ByZ33smzycNCpSG5klNIejIyfFx2A==", - "engines": { - "node": ">=16.0.0", - "npm": ">=7.0.0" - } - }, - "node_modules/it-ws/node_modules/uint8arrays": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/uint8arrays/-/uint8arrays-4.0.2.tgz", - "integrity": "sha512-8CWXXZdOvVrIL4SeY/Gnp+idxxiGK4XFkP4FY26Sx/fpTz/b6vv4BVWELMDzQweSyyhdcuAcU14H6izzB6k1Cw==", - "dependencies": { - "multiformats": "^10.0.0" - }, - "engines": { - "node": ">=16.0.0", - "npm": ">=7.0.0" - } - }, "node_modules/jake": { "version": "10.8.5", "resolved": "https://registry.npmjs.org/jake/-/jake-10.8.5.tgz", @@ -11502,17 +11350,16 @@ } }, "node_modules/libp2p": { - "version": "0.39.5", - "resolved": "https://registry.npmjs.org/libp2p/-/libp2p-0.39.5.tgz", - "integrity": "sha512-zF/Tc3IRQ3M+W3wqn6zSICUc6gsdCdXCNjsWMudinfRTia6CnRbj68ZkjrUw0TA1j2bODwD2+CxAFTsn9iS0Nw==", + "version": "0.40.0", + "resolved": "https://registry.npmjs.org/libp2p/-/libp2p-0.40.0.tgz", + "integrity": "sha512-AeLaA+8KIhUhjpXZcs20+Pnf2wIBp+zdSYPD1IgGCF0PlMbTdCvaIqhPzpTSd3+e5k7NZlgpd/BvCOLgQbfm5Q==", "dependencies": { "@achingbrain/nat-port-mapper": "^1.0.3", - "@libp2p/components": "^2.1.0", "@libp2p/connection": "^4.0.2", "@libp2p/crypto": "^1.0.4", - "@libp2p/interface-address-manager": "^1.0.3", + "@libp2p/interface-address-manager": "^2.0.0", "@libp2p/interface-connection": "^3.0.2", - "@libp2p/interface-connection-encrypter": "^2.0.1", + "@libp2p/interface-connection-encrypter": "^3.0.1", "@libp2p/interface-connection-manager": "^1.1.1", "@libp2p/interface-content-routing": "^1.0.2", "@libp2p/interface-dht": "^1.0.1", @@ -11522,10 +11369,10 @@ "@libp2p/interface-peer-info": "^1.0.3", "@libp2p/interface-peer-routing": "^1.0.1", "@libp2p/interface-peer-store": "^1.2.2", - "@libp2p/interface-pubsub": "^2.1.0", + "@libp2p/interface-pubsub": "^3.0.0", "@libp2p/interface-registrar": "^2.0.3", - "@libp2p/interface-stream-muxer": "^2.0.2", - "@libp2p/interface-transport": "^1.0.4", + "@libp2p/interface-stream-muxer": "^3.0.0", + "@libp2p/interface-transport": "^2.0.0", "@libp2p/interfaces": "^3.0.3", "@libp2p/logger": "^2.0.1", "@libp2p/multistream-select": "^3.0.0", @@ -11533,7 +11380,7 @@ "@libp2p/peer-id": "^1.1.15", "@libp2p/peer-id-factory": "^1.0.18", "@libp2p/peer-record": "^4.0.3", - "@libp2p/peer-store": "^3.1.5", + "@libp2p/peer-store": "^5.0.0", "@libp2p/tracked-map": "^2.0.1", "@libp2p/utils": "^3.0.2", "@multiformats/mafmt": "^11.0.2", @@ -11545,34 +11392,35 @@ "events": "^3.3.0", "hashlru": "^2.3.0", "interface-datastore": "^7.0.0", - "it-all": "^1.0.6", - "it-drain": "^1.0.5", - "it-filter": "^1.0.3", - "it-first": "^1.0.6", - "it-foreach": "^0.1.1", + "it-all": "^2.0.0", + "it-drain": "^2.0.0", + "it-filter": "^2.0.0", + "it-first": "^2.0.0", + "it-foreach": "^1.0.0", "it-handshake": "^4.1.2", "it-length-prefixed": "^8.0.2", - "it-map": "^1.0.6", - "it-merge": "^1.0.3", + "it-map": "^2.0.0", + "it-merge": "^2.0.0", "it-pair": "^2.0.2", "it-pipe": "^2.0.3", - "it-sort": "^1.0.1", + "it-sort": "^2.0.0", "it-stream-types": "^1.0.4", "merge-options": "^3.0.4", - "multiformats": "^9.6.3", + "multiformats": "^10.0.0", "mutable-proxy": "^1.0.0", "node-forge": "^1.3.1", "p-fifo": "^1.0.0", "p-retry": "^5.0.0", "p-settle": "^5.0.0", "private-ip": "^2.3.3", - "protons-runtime": "^3.0.1", + "protons-runtime": "^4.0.1", + "rate-limiter-flexible": "^2.3.11", "retimer": "^3.0.0", "sanitize-filename": "^1.6.3", "set-delayed-interval": "^1.0.0", "timeout-abort-controller": "^3.0.0", "uint8arraylist": "^2.3.2", - "uint8arrays": "^3.0.0", + "uint8arrays": "^4.0.2", "wherearewe": "^2.0.0", "xsalsa20": "^1.1.0" }, @@ -11581,6 +11429,145 @@ "npm": ">=7.0.0" } }, + "node_modules/libp2p/node_modules/@libp2p/interface-address-manager": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/@libp2p/interface-address-manager/-/interface-address-manager-2.0.1.tgz", + "integrity": "sha512-JjlQUJ0cF1h0wsOS22PNRQiiiMLwftd5QttjJK2jDsou5FkZETeQ9eYL05I0ykQKZvEJqwH8G5WLwxWtwsj7Ag==", + "dependencies": { + "@libp2p/interfaces": "^3.0.0", + "@multiformats/multiaddr": "^11.0.0" + }, + "engines": { + "node": ">=16.0.0", + "npm": ">=7.0.0" + } + }, + "node_modules/libp2p/node_modules/@libp2p/interface-transport": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/@libp2p/interface-transport/-/interface-transport-2.0.1.tgz", + "integrity": "sha512-yrL6YZmPQX4JT/E/60XgNgNSCu9tNPjjq2HuWZs1n1k8cstV0/WvViUE8aoOlJlKZSVjQNcpRAy9LgVxznK7/g==", + "dependencies": { + "@libp2p/interface-connection": "^3.0.0", + "@libp2p/interface-stream-muxer": "^3.0.0", + "@libp2p/interfaces": "^3.0.0", + "@multiformats/multiaddr": "^11.0.0", + "it-stream-types": "^1.0.4" + }, + "engines": { + "node": ">=16.0.0", + "npm": ">=7.0.0" + } + }, + "node_modules/libp2p/node_modules/it-all": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/it-all/-/it-all-2.0.0.tgz", + "integrity": "sha512-I/yi9ogTY59lFxtfsDSlI9w9QZtC/5KJt6g7CPPBJJh2xql2ZS7Ghcp9hoqDDbc4QfwQvtx8Loy0zlKQ8H5gFg==", + "engines": { + "node": ">=16.0.0", + "npm": ">=7.0.0" + } + }, + "node_modules/libp2p/node_modules/it-drain": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/it-drain/-/it-drain-2.0.0.tgz", + "integrity": "sha512-oa/5iyBtRs9UW486vPpyDTC0ee3rqx5qlrPI7txIUJcqqtiO5yVozEB6LQrl5ysQYv+P3y/dlKEqwVqlCV0SEA==", + "engines": { + "node": ">=16.0.0", + "npm": ">=7.0.0" + } + }, + "node_modules/libp2p/node_modules/it-filter": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/it-filter/-/it-filter-2.0.0.tgz", + "integrity": "sha512-E68+zzoNNI7MxdH1T4lUTgwpCyEnymlH349Qg2mcvsqLmYRkaZLM4NfZZ0hUuH7/5DkWXubQSDOYH396va8mpg==", + "engines": { + "node": ">=16.0.0", + "npm": ">=7.0.0" + } + }, + "node_modules/libp2p/node_modules/it-first": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/it-first/-/it-first-2.0.0.tgz", + "integrity": "sha512-fzZGzVf01exFyIZXNjkpSMFr1eW2+J1K0v018tYY26Dd4f/O3pWlBTdrOBfSQRZwtI8Pst6c7eKhYczWvFs6tA==", + "engines": { + "node": ">=16.0.0", + "npm": ">=7.0.0" + } + }, + "node_modules/libp2p/node_modules/it-foreach": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/it-foreach/-/it-foreach-1.0.0.tgz", + "integrity": "sha512-2j5HK1P6aMwEvgL6K5nzUwOk+81B/mjt05PxiSspFEKwJnqy1LfJYlLLS6llBoM+NdoUxf6EsBCHidFGmsXvhw==", + "engines": { + "node": ">=16.0.0", + "npm": ">=7.0.0" + } + }, + "node_modules/libp2p/node_modules/it-map": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/it-map/-/it-map-2.0.0.tgz", + "integrity": "sha512-mLgtk/NZaN7NZ06iLrMXCA6jjhtZO0vZT5Ocsp31H+nsGI18RSPVmUbFyA1sWx7q+g92J22Sixya7T2QSSAwfA==", + "engines": { + "node": ">=16.0.0", + "npm": ">=7.0.0" + } + }, + "node_modules/libp2p/node_modules/it-merge": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/it-merge/-/it-merge-2.0.0.tgz", + "integrity": "sha512-mH4bo/ZrMoU+Wlu7ZuYPNNh9oWZ/GvYbeXZ0zll97+Rp6H4jFu98iu6v9qqXDz//RUjdO9zGh8awzMfOElsjpA==", + "dependencies": { + "it-pushable": "^3.1.0" + }, + "engines": { + "node": ">=16.0.0", + "npm": ">=7.0.0" + } + }, + "node_modules/libp2p/node_modules/long": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/long/-/long-5.2.1.tgz", + "integrity": "sha512-GKSNGeNAtw8IryjjkhZxuKB3JzlcLTwjtiQCHKvqQet81I93kXslhDQruGI/QsddO83mcDToBVy7GqGS/zYf/A==" + }, + "node_modules/libp2p/node_modules/protobufjs": { + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/protobufjs/-/protobufjs-7.1.2.tgz", + "integrity": "sha512-4ZPTPkXCdel3+L81yw3dG6+Kq3umdWKh7Dc7GW/CpNk4SX3hK58iPCWeCyhVTDrbkNeKrYNZ7EojM5WDaEWTLQ==", + "hasInstallScript": true, + "dependencies": { + "@protobufjs/aspromise": "^1.1.2", + "@protobufjs/base64": "^1.1.2", + "@protobufjs/codegen": "^2.0.4", + "@protobufjs/eventemitter": "^1.1.0", + "@protobufjs/fetch": "^1.1.0", + "@protobufjs/float": "^1.0.2", + "@protobufjs/inquire": "^1.1.0", + "@protobufjs/path": "^1.1.2", + "@protobufjs/pool": "^1.1.0", + "@protobufjs/utf8": "^1.1.0", + "@types/node": ">=13.7.0", + "long": "^5.0.0" + }, + "engines": { + "node": ">=12.0.0" + } + }, + "node_modules/libp2p/node_modules/protons-runtime": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/protons-runtime/-/protons-runtime-4.0.1.tgz", + "integrity": "sha512-SPeV+8TzJAp5UJYPV7vJkLRi08CP0DksxpKK60rcNaZSPkMBQwc0jQrmkHqwc5P0cYbZzKsdYrUBwRrDLrzTfQ==", + "dependencies": { + "protobufjs": "^7.0.0", + "uint8arraylist": "^2.3.2" + }, + "engines": { + "node": ">=16.0.0", + "npm": ">=7.0.0" + }, + "peerDependencies": { + "uint8arraylist": "^2.3.2" + } + }, "node_modules/lilconfig": { "version": "2.0.5", "resolved": "https://registry.npmjs.org/lilconfig/-/lilconfig-2.0.5.tgz", @@ -12984,9 +12971,13 @@ } }, "node_modules/multiformats": { - "version": "9.9.0", - "resolved": "https://registry.npmjs.org/multiformats/-/multiformats-9.9.0.tgz", - "integrity": "sha512-HoMUjhH9T8DDBNT+6xzkrd9ga/XiBI4xLr58LJACwK6G3HTOPeMz4nB4KJs33L2BelrIJa7P0VuNaVF3hMYfjg==" + "version": "10.0.2", + "resolved": "https://registry.npmjs.org/multiformats/-/multiformats-10.0.2.tgz", + "integrity": "sha512-nJEHLFOYhO4L+aNApHhCnWqa31FyqAHv9Q77AhmwU3KsM2f1j7tuJpCk5ByZ33smzycNCpSG5klNIejIyfFx2A==", + "engines": { + "node": ">=16.0.0", + "npm": ">=7.0.0" + } }, "node_modules/multimatch": { "version": "5.0.0", @@ -20837,27 +20828,6 @@ "npm": ">=7.0.0" } }, - "node_modules/uint8-varint/node_modules/multiformats": { - "version": "10.0.2", - "resolved": "https://registry.npmjs.org/multiformats/-/multiformats-10.0.2.tgz", - "integrity": "sha512-nJEHLFOYhO4L+aNApHhCnWqa31FyqAHv9Q77AhmwU3KsM2f1j7tuJpCk5ByZ33smzycNCpSG5klNIejIyfFx2A==", - "engines": { - "node": ">=16.0.0", - "npm": ">=7.0.0" - } - }, - "node_modules/uint8-varint/node_modules/uint8arrays": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/uint8arrays/-/uint8arrays-4.0.2.tgz", - "integrity": "sha512-8CWXXZdOvVrIL4SeY/Gnp+idxxiGK4XFkP4FY26Sx/fpTz/b6vv4BVWELMDzQweSyyhdcuAcU14H6izzB6k1Cw==", - "dependencies": { - "multiformats": "^10.0.0" - }, - "engines": { - "node": ">=16.0.0", - "npm": ">=7.0.0" - } - }, "node_modules/uint8arraylist": { "version": "2.3.3", "resolved": "https://registry.npmjs.org/uint8arraylist/-/uint8arraylist-2.3.3.tgz", @@ -20870,16 +20840,7 @@ "npm": ">=7.0.0" } }, - "node_modules/uint8arraylist/node_modules/multiformats": { - "version": "10.0.2", - "resolved": "https://registry.npmjs.org/multiformats/-/multiformats-10.0.2.tgz", - "integrity": "sha512-nJEHLFOYhO4L+aNApHhCnWqa31FyqAHv9Q77AhmwU3KsM2f1j7tuJpCk5ByZ33smzycNCpSG5klNIejIyfFx2A==", - "engines": { - "node": ">=16.0.0", - "npm": ">=7.0.0" - } - }, - "node_modules/uint8arraylist/node_modules/uint8arrays": { + "node_modules/uint8arrays": { "version": "4.0.2", "resolved": "https://registry.npmjs.org/uint8arrays/-/uint8arrays-4.0.2.tgz", "integrity": "sha512-8CWXXZdOvVrIL4SeY/Gnp+idxxiGK4XFkP4FY26Sx/fpTz/b6vv4BVWELMDzQweSyyhdcuAcU14H6izzB6k1Cw==", @@ -20891,14 +20852,6 @@ "npm": ">=7.0.0" } }, - "node_modules/uint8arrays": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/uint8arrays/-/uint8arrays-3.1.1.tgz", - "integrity": "sha512-+QJa8QRnbdXVpHYjLoTpJIdCTiw9Ir62nocClWuXIq2JIh4Uta0cQsTSpFL678p2CN8B+XSApwcU+pQEqVpKWg==", - "dependencies": { - "multiformats": "^9.4.2" - } - }, "node_modules/unbox-primitive": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/unbox-primitive/-/unbox-primitive-1.0.2.tgz", @@ -21871,40 +21824,20 @@ "node": ">=16" } }, - "packages/byte-utils/node_modules/multiformats": { - "version": "10.0.2", - "resolved": "https://registry.npmjs.org/multiformats/-/multiformats-10.0.2.tgz", - "integrity": "sha512-nJEHLFOYhO4L+aNApHhCnWqa31FyqAHv9Q77AhmwU3KsM2f1j7tuJpCk5ByZ33smzycNCpSG5klNIejIyfFx2A==", - "engines": { - "node": ">=16.0.0", - "npm": ">=7.0.0" - } - }, - "packages/byte-utils/node_modules/uint8arrays": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/uint8arrays/-/uint8arrays-4.0.2.tgz", - "integrity": "sha512-8CWXXZdOvVrIL4SeY/Gnp+idxxiGK4XFkP4FY26Sx/fpTz/b6vv4BVWELMDzQweSyyhdcuAcU14H6izzB6k1Cw==", - "dependencies": { - "multiformats": "^10.0.0" - }, - "engines": { - "node": ">=16.0.0", - "npm": ">=7.0.0" - } - }, "packages/core": { "name": "@waku/core", "version": "0.0.5", "license": "MIT OR Apache-2.0", "dependencies": { - "@chainsafe/libp2p-gossipsub": "^4.1.1", + "@chainsafe/libp2p-gossipsub": "^5.2.1", "@libp2p/interface-connection": "^3.0.3", "@libp2p/interface-peer-discovery": "^1.0.0", - "@libp2p/interface-peer-id": "^1.0.2", - "@libp2p/interface-peer-info": "^1.0.1", - "@libp2p/interface-peer-store": "^1.0.0", - "@libp2p/interface-pubsub": "^2.0.1", - "@libp2p/interfaces": "^3.0.2", + "@libp2p/interface-peer-id": "^1.0.6", + "@libp2p/interface-peer-info": "^1.0.4", + "@libp2p/interface-peer-store": "^1.2.3", + "@libp2p/interface-pubsub": "^3.0.1", + "@libp2p/interface-registrar": "^2.0.4", + "@libp2p/interfaces": "^3.0.4", "@libp2p/peer-id": "^1.1.10", "@multiformats/multiaddr": "^11.0.6", "@waku/byte-utils": "*", @@ -21913,7 +21846,7 @@ "it-all": "^1.0.6", "it-length-prefixed": "^8.0.2", "it-pipe": "^2.0.4", - "libp2p": "0.39.5", + "libp2p": "0.40.0", "p-event": "^5.0.1", "protons-runtime": "^3.1.0", "uint8arraylist": "^2.3.2", @@ -21970,36 +21903,16 @@ "node": ">=16" } }, - "packages/core/node_modules/multiformats": { - "version": "10.0.2", - "resolved": "https://registry.npmjs.org/multiformats/-/multiformats-10.0.2.tgz", - "integrity": "sha512-nJEHLFOYhO4L+aNApHhCnWqa31FyqAHv9Q77AhmwU3KsM2f1j7tuJpCk5ByZ33smzycNCpSG5klNIejIyfFx2A==", - "engines": { - "node": ">=16.0.0", - "npm": ">=7.0.0" - } - }, - "packages/core/node_modules/uint8arrays": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/uint8arrays/-/uint8arrays-4.0.2.tgz", - "integrity": "sha512-8CWXXZdOvVrIL4SeY/Gnp+idxxiGK4XFkP4FY26Sx/fpTz/b6vv4BVWELMDzQweSyyhdcuAcU14H6izzB6k1Cw==", - "dependencies": { - "multiformats": "^10.0.0" - }, - "engines": { - "node": ">=16.0.0", - "npm": ">=7.0.0" - } - }, "packages/create": { "name": "@waku/create", "version": "0.0.3", "license": "MIT OR Apache-2.0", "dependencies": { - "@chainsafe/libp2p-noise": "^8.0.1", - "@libp2p/interface-peer-discovery": "^1.0.0", - "@libp2p/mplex": "^5.1.1", - "@libp2p/websockets": "^3.0.3", + "@chainsafe/libp2p-noise": "^10.1.0", + "@libp2p/bootstrap": "^5.0.0", + "@libp2p/interface-peer-discovery": "^1.0.2", + "@libp2p/mplex": "^7.0.0", + "@libp2p/websockets": "^5.0.0", "@waku/core": "*", "@waku/interfaces": "*" }, @@ -22066,27 +21979,6 @@ "node": ">=16" } }, - "packages/dns-discovery/node_modules/multiformats": { - "version": "10.0.2", - "resolved": "https://registry.npmjs.org/multiformats/-/multiformats-10.0.2.tgz", - "integrity": "sha512-nJEHLFOYhO4L+aNApHhCnWqa31FyqAHv9Q77AhmwU3KsM2f1j7tuJpCk5ByZ33smzycNCpSG5klNIejIyfFx2A==", - "engines": { - "node": ">=16.0.0", - "npm": ">=7.0.0" - } - }, - "packages/dns-discovery/node_modules/uint8arrays": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/uint8arrays/-/uint8arrays-4.0.2.tgz", - "integrity": "sha512-8CWXXZdOvVrIL4SeY/Gnp+idxxiGK4XFkP4FY26Sx/fpTz/b6vv4BVWELMDzQweSyyhdcuAcU14H6izzB6k1Cw==", - "dependencies": { - "multiformats": "^10.0.0" - }, - "engines": { - "node": ">=16.0.0", - "npm": ">=7.0.0" - } - }, "packages/enr": { "name": "@waku/enr", "version": "0.0.2", @@ -22127,40 +22019,17 @@ "node": ">=16" } }, - "packages/enr/node_modules/multiformats": { - "version": "10.0.2", - "resolved": "https://registry.npmjs.org/multiformats/-/multiformats-10.0.2.tgz", - "integrity": "sha512-nJEHLFOYhO4L+aNApHhCnWqa31FyqAHv9Q77AhmwU3KsM2f1j7tuJpCk5ByZ33smzycNCpSG5klNIejIyfFx2A==", - "dev": true, - "engines": { - "node": ">=16.0.0", - "npm": ">=7.0.0" - } - }, - "packages/enr/node_modules/uint8arrays": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/uint8arrays/-/uint8arrays-4.0.2.tgz", - "integrity": "sha512-8CWXXZdOvVrIL4SeY/Gnp+idxxiGK4XFkP4FY26Sx/fpTz/b6vv4BVWELMDzQweSyyhdcuAcU14H6izzB6k1Cw==", - "dev": true, - "dependencies": { - "multiformats": "^10.0.0" - }, - "engines": { - "node": ">=16.0.0", - "npm": ">=7.0.0" - } - }, "packages/interfaces": { "name": "@waku/interfaces", "version": "0.0.4", "license": "MIT OR Apache-2.0", "dependencies": { - "@chainsafe/libp2p-gossipsub": "^4.1.1", + "@chainsafe/libp2p-gossipsub": "^5.2.1", "@libp2p/interface-connection": "^3.0.2", "@libp2p/interface-peer-id": "^1.0.5", - "@libp2p/interface-peer-store": "^1.2.2", + "@libp2p/interface-peer-store": "^1.2.3", "@multiformats/multiaddr": "^11.0.6", - "libp2p": "0.39.5" + "libp2p": "0.40.0" }, "devDependencies": { "@typescript-eslint/eslint-plugin": "^5.8.1", @@ -22229,6 +22098,7 @@ "@waku/message-encryption": "*" }, "devDependencies": { + "@libp2p/bootstrap": "^5.0.0", "@typescript-eslint/eslint-plugin": "^5.8.1", "@typescript-eslint/parser": "^5.8.1", "cspell": "^5.14.0", @@ -22396,43 +22266,46 @@ "integrity": "sha512-nqSJ8u2a1Rv9FYbyI8qpDhTYujaKEyLknNrTejLYoSWmdeg+2WB7R6BZqPZYfrJzDxVi3rl6ZQuoaEvpKRZWgQ==" }, "@chainsafe/libp2p-gossipsub": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/@chainsafe/libp2p-gossipsub/-/libp2p-gossipsub-4.1.1.tgz", - "integrity": "sha512-W3z52uTVm48qvwTAcE+tz6ML2CPWA4ErmuL2aCWAW8S7ce6iH8anqo+xI9rcedyIOChWMWLLD4Gtaj4TMrWacw==", + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/@chainsafe/libp2p-gossipsub/-/libp2p-gossipsub-5.2.1.tgz", + "integrity": "sha512-diwYLJ+6ccM25CL2EbnvPd2k8thTkQK3lm9WfbcOqOrZZimaa+kBWuhxXNOXtVEtadX8A5Uwxpq3Gt8zZ9JdjA==", "requires": { - "@libp2p/components": "^2.0.3", "@libp2p/crypto": "^1.0.3", "@libp2p/interface-connection": "^3.0.1", + "@libp2p/interface-connection-manager": "^1.3.0", "@libp2p/interface-keys": "^1.0.3", "@libp2p/interface-peer-id": "^1.0.4", - "@libp2p/interface-pubsub": "^2.0.1", + "@libp2p/interface-peer-store": "^1.2.2", + "@libp2p/interface-pubsub": "^3.0.0", "@libp2p/interface-registrar": "^2.0.3", "@libp2p/interfaces": "^3.0.3", "@libp2p/logger": "^2.0.0", "@libp2p/peer-id": "^1.1.15", "@libp2p/peer-record": "^4.0.1", - "@libp2p/pubsub": "^3.1.2", + "@libp2p/pubsub": "^5.0.0", "@libp2p/topology": "^3.0.0", + "@multiformats/multiaddr": "^11.0.0", "abortable-iterator": "^4.0.2", "denque": "^1.5.0", "err-code": "^3.0.1", "it-length-prefixed": "^8.0.2", "it-pipe": "^2.0.4", "it-pushable": "^3.1.0", - "multiformats": "^9.6.4", + "multiformats": "^10.0.0", "protobufjs": "^6.11.2", "uint8arraylist": "^2.3.2", - "uint8arrays": "^3.0.0" + "uint8arrays": "^4.0.2" } }, "@chainsafe/libp2p-noise": { - "version": "8.0.2", - "resolved": "https://registry.npmjs.org/@chainsafe/libp2p-noise/-/libp2p-noise-8.0.2.tgz", - "integrity": "sha512-YouGuPOZcP9VG8jarL21KseZZXLsa9RCkFnec3EMrRLIiL5qbbxgpDhbGzocAXSbsbitNBNrexQA524R/GB+2Q==", + "version": "10.1.0", + "resolved": "https://registry.npmjs.org/@chainsafe/libp2p-noise/-/libp2p-noise-10.1.0.tgz", + "integrity": "sha512-7Q5L/KDmjhA/X9va2wPpEMSW4VX9L7382qy23V3THV753z+7f3tFOfGjn1pWJ+rS6nm1OGLT1k5yoN3lF+MzLg==", "requires": { "@libp2p/crypto": "^1.0.0", - "@libp2p/interface-connection-encrypter": "^2.0.1", + "@libp2p/interface-connection-encrypter": "^3.0.0", "@libp2p/interface-keys": "^1.0.2", + "@libp2p/interface-metrics": "^4.0.2", "@libp2p/interface-peer-id": "^1.0.2", "@libp2p/logger": "^2.0.0", "@libp2p/peer-id": "^1.1.8", @@ -22445,9 +22318,52 @@ "it-pb-stream": "^2.0.2", "it-pipe": "^2.0.3", "it-stream-types": "^1.0.4", - "protons-runtime": "^3.1.0", + "protons-runtime": "^4.0.1", "uint8arraylist": "^2.3.2", - "uint8arrays": "^3.1.0" + "uint8arrays": "^4.0.2" + }, + "dependencies": { + "@libp2p/interface-metrics": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/@libp2p/interface-metrics/-/interface-metrics-4.0.2.tgz", + "integrity": "sha512-HON9yXhFaTnQ86tOdE18bFJv71zQdI7xrZJuA6pNUtpsfA+djhqWXv0a4mwEGUP7k4zz3FkH0M9CrrvL0pkBWg==", + "requires": { + "@libp2p/interface-connection": "^3.0.0" + } + }, + "long": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/long/-/long-5.2.1.tgz", + "integrity": "sha512-GKSNGeNAtw8IryjjkhZxuKB3JzlcLTwjtiQCHKvqQet81I93kXslhDQruGI/QsddO83mcDToBVy7GqGS/zYf/A==" + }, + "protobufjs": { + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/protobufjs/-/protobufjs-7.1.2.tgz", + "integrity": "sha512-4ZPTPkXCdel3+L81yw3dG6+Kq3umdWKh7Dc7GW/CpNk4SX3hK58iPCWeCyhVTDrbkNeKrYNZ7EojM5WDaEWTLQ==", + "requires": { + "@protobufjs/aspromise": "^1.1.2", + "@protobufjs/base64": "^1.1.2", + "@protobufjs/codegen": "^2.0.4", + "@protobufjs/eventemitter": "^1.1.0", + "@protobufjs/fetch": "^1.1.0", + "@protobufjs/float": "^1.0.2", + "@protobufjs/inquire": "^1.1.0", + "@protobufjs/path": "^1.1.2", + "@protobufjs/pool": "^1.1.0", + "@protobufjs/utf8": "^1.1.0", + "@types/node": ">=13.7.0", + "long": "^5.0.0" + } + }, + "protons-runtime": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/protons-runtime/-/protons-runtime-4.0.1.tgz", + "integrity": "sha512-SPeV+8TzJAp5UJYPV7vJkLRi08CP0DksxpKK60rcNaZSPkMBQwc0jQrmkHqwc5P0cYbZzKsdYrUBwRrDLrzTfQ==", + "requires": { + "protobufjs": "^7.0.0", + "uint8arraylist": "^2.3.2" + } + } } }, "@changesets/types": { @@ -24003,26 +23919,19 @@ } } }, - "@libp2p/components": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/@libp2p/components/-/components-2.1.1.tgz", - "integrity": "sha512-/XtfEdBHaNhwiaf9RowiSYnyVFIl+shuZNGQlCsJmOnn5X490TMo9GJ9PVfrTRnRn3ZXPBLS5Vp0s6++ShSv7g==", + "@libp2p/bootstrap": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/@libp2p/bootstrap/-/bootstrap-5.0.0.tgz", + "integrity": "sha512-3r20rD2coW0k6j7C7EBfRPh3vaUKVKcTmMksesn7ybcNezu8ziEHxZx93BBwnw8sy+ZwSfnUsK/vOtiGWJPAhw==", "requires": { - "@libp2p/interface-address-manager": "^1.0.2", - "@libp2p/interface-connection": "^3.0.1", - "@libp2p/interface-connection-manager": "^1.1.0", - "@libp2p/interface-content-routing": "^1.0.2", - "@libp2p/interface-dht": "^1.0.1", - "@libp2p/interface-metrics": "^3.0.0", - "@libp2p/interface-peer-id": "^1.0.2", - "@libp2p/interface-peer-routing": "^1.0.1", - "@libp2p/interface-peer-store": "^1.2.1", - "@libp2p/interface-pubsub": "^2.1.0", - "@libp2p/interface-registrar": "^2.0.3", - "@libp2p/interface-transport": "^1.0.3", + "@libp2p/interface-peer-discovery": "^1.0.1", + "@libp2p/interface-peer-info": "^1.0.3", + "@libp2p/interface-peer-store": "^1.2.2", "@libp2p/interfaces": "^3.0.3", - "err-code": "^3.0.1", - "interface-datastore": "^7.0.0" + "@libp2p/logger": "^2.0.1", + "@libp2p/peer-id": "^1.1.15", + "@multiformats/mafmt": "^11.0.3", + "@multiformats/multiaddr": "^11.0.0" } }, "@libp2p/connection": { @@ -24058,11 +23967,6 @@ "resolved": "https://registry.npmjs.org/long/-/long-5.2.0.tgz", "integrity": "sha512-9RTUNjK60eJbx3uz+TEGF7fUr29ZDxR5QzXcyDpeSfeH28S9ycINflOgOlppit5U+4kNTe83KQnMEerw7GmE8w==" }, - "multiformats": { - "version": "10.0.2", - "resolved": "https://registry.npmjs.org/multiformats/-/multiformats-10.0.2.tgz", - "integrity": "sha512-nJEHLFOYhO4L+aNApHhCnWqa31FyqAHv9Q77AhmwU3KsM2f1j7tuJpCk5ByZ33smzycNCpSG5klNIejIyfFx2A==" - }, "protobufjs": { "version": "7.1.2", "resolved": "https://registry.npmjs.org/protobufjs/-/protobufjs-7.1.2.tgz", @@ -24090,26 +23994,9 @@ "protobufjs": "^7.0.0", "uint8arraylist": "^2.3.2" } - }, - "uint8arrays": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/uint8arrays/-/uint8arrays-4.0.2.tgz", - "integrity": "sha512-8CWXXZdOvVrIL4SeY/Gnp+idxxiGK4XFkP4FY26Sx/fpTz/b6vv4BVWELMDzQweSyyhdcuAcU14H6izzB6k1Cw==", - "requires": { - "multiformats": "^10.0.0" - } } } }, - "@libp2p/interface-address-manager": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/@libp2p/interface-address-manager/-/interface-address-manager-1.0.3.tgz", - "integrity": "sha512-/DNGUQEXA0Ks+EOp0IVv3TsWq1H+4ZlSnyBozzNGDmufz6wG+EvUDBbwIXieHR898bj4pHfmmogK+Vwz5s5Kdw==", - "requires": { - "@libp2p/interfaces": "^3.0.0", - "@multiformats/multiaddr": "^11.0.0" - } - }, "@libp2p/interface-connection": { "version": "3.0.3", "resolved": "https://registry.npmjs.org/@libp2p/interface-connection/-/interface-connection-3.0.3.tgz", @@ -24123,13 +24010,13 @@ } }, "@libp2p/interface-connection-encrypter": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/@libp2p/interface-connection-encrypter/-/interface-connection-encrypter-2.0.2.tgz", - "integrity": "sha512-kp8CgNICXTE/j21l6j3H7y028OR+I7yqwQH1769c5A1ikh2Gl/e1rgoMcwz8HPVNyS8qtw2TEWn45th8Kn4NMQ==", + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/@libp2p/interface-connection-encrypter/-/interface-connection-encrypter-3.0.2.tgz", + "integrity": "sha512-7b4t1aW3xbPcq3ORBi/nplIia8X7mdHlUg4SRWs92fDNciFwm1NUr63aVVs9WMwXmN3XB9UNbxKrrrXAWHRuHw==", "requires": { "@libp2p/interface-peer-id": "^1.0.0", "it-stream-types": "^1.0.4", - "uint8arraylist": "^2.1.1" + "uint8arraylist": "^2.1.2" } }, "@libp2p/interface-connection-manager": { @@ -24151,13 +24038,6 @@ "@libp2p/interface-peer-info": "^1.0.0", "@libp2p/interfaces": "^3.0.0", "multiformats": "^10.0.0" - }, - "dependencies": { - "multiformats": { - "version": "10.0.2", - "resolved": "https://registry.npmjs.org/multiformats/-/multiformats-10.0.2.tgz", - "integrity": "sha512-nJEHLFOYhO4L+aNApHhCnWqa31FyqAHv9Q77AhmwU3KsM2f1j7tuJpCk5ByZ33smzycNCpSG5klNIejIyfFx2A==" - } } }, "@libp2p/interface-dht": { @@ -24170,13 +24050,6 @@ "@libp2p/interface-peer-info": "^1.0.0", "@libp2p/interfaces": "^3.0.0", "multiformats": "^10.0.0" - }, - "dependencies": { - "multiformats": { - "version": "10.0.2", - "resolved": "https://registry.npmjs.org/multiformats/-/multiformats-10.0.2.tgz", - "integrity": "sha512-nJEHLFOYhO4L+aNApHhCnWqa31FyqAHv9Q77AhmwU3KsM2f1j7tuJpCk5ByZ33smzycNCpSG5klNIejIyfFx2A==" - } } }, "@libp2p/interface-keys": { @@ -24194,33 +24067,26 @@ } }, "@libp2p/interface-peer-discovery": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/@libp2p/interface-peer-discovery/-/interface-peer-discovery-1.0.1.tgz", - "integrity": "sha512-ZqBhpX7fR3ROYQaGYV47YhyTJJzFDzyyEIsQ7NnDuG3KhcQb2PtocnN0sy1Ozm784M0oYveM/HjfuNxxcOwdYg==", + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/@libp2p/interface-peer-discovery/-/interface-peer-discovery-1.0.2.tgz", + "integrity": "sha512-Zgjw0bVd8DDwL5qkh/GA1JCQiEGD16wRQ7nhlGe+tXHdZb8LCP/1/P6ry0v0W6MgxAnO90SegC4T3TGYlsj6hw==", "requires": { "@libp2p/interface-peer-info": "^1.0.0", "@libp2p/interfaces": "^3.0.0" } }, "@libp2p/interface-peer-id": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/@libp2p/interface-peer-id/-/interface-peer-id-1.0.5.tgz", - "integrity": "sha512-K7TJTmtPWfIrH4NS5y+dvAwQltoga+ScGgjs+ZGKz07uHzoPUeE/OpXxs5Msdela6hp+dP1Ha7bZmA/Njbq5bg==", + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/@libp2p/interface-peer-id/-/interface-peer-id-1.0.6.tgz", + "integrity": "sha512-3iMoAnXq/F+t/JWbNPb9UePvwgmm5rFUCEwNgAiDOUtXUZsXZO0Ko3eF9O1gpLe1KNH5wK7g2Wf46YW1vRAS8A==", "requires": { "multiformats": "^10.0.0" - }, - "dependencies": { - "multiformats": { - "version": "10.0.2", - "resolved": "https://registry.npmjs.org/multiformats/-/multiformats-10.0.2.tgz", - "integrity": "sha512-nJEHLFOYhO4L+aNApHhCnWqa31FyqAHv9Q77AhmwU3KsM2f1j7tuJpCk5ByZ33smzycNCpSG5klNIejIyfFx2A==" - } } }, "@libp2p/interface-peer-info": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/@libp2p/interface-peer-info/-/interface-peer-info-1.0.3.tgz", - "integrity": "sha512-QKybxfp/NmDGDMkgf/CTt4fU03ajZnldHr9TYg5wMkJrnVaaHbhDTYBg5YWt+iOH1mgR89/dpKv/Na0ZE5sPIA==", + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/@libp2p/interface-peer-info/-/interface-peer-info-1.0.4.tgz", + "integrity": "sha512-ILW2j7NMD1jZwWdJyxXY8fv/aiaJf2rOjgQkXgidy1GdaZ7UtNiiyvZmksqfEVlWH6opfd/GbuwrMemzM2E7Xg==", "requires": { "@libp2p/interface-peer-id": "^1.0.0", "@multiformats/multiaddr": "^11.0.0" @@ -24237,9 +24103,9 @@ } }, "@libp2p/interface-peer-store": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/@libp2p/interface-peer-store/-/interface-peer-store-1.2.2.tgz", - "integrity": "sha512-ZjE9AkDtjz4R+SppCgZ66oko7Z9pDsdFk1lbba0hTPA2i0uuWdTYep7bZ3RvKot0Q2UrWg8ySL/30pW+Wp70sA==", + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/@libp2p/interface-peer-store/-/interface-peer-store-1.2.3.tgz", + "integrity": "sha512-nSSaOO2zvZa9ZGoDbLsjPDEVC1OFWY5/FoQPkxokaPTz0AFJ5jDTAgii8iQ+6XRo2WvV7ZYcEd+AusSYeE3w6Q==", "requires": { "@libp2p/interface-peer-id": "^1.0.0", "@libp2p/interface-peer-info": "^1.0.0", @@ -24249,15 +24115,15 @@ } }, "@libp2p/interface-pubsub": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/@libp2p/interface-pubsub/-/interface-pubsub-2.1.0.tgz", - "integrity": "sha512-X+SIqzfeCO8ZDGrFTzH9EMwMf8ojW5nk20rxv3h1sCXEdfvyJCARZ51r9UlwJcnucnHqvFChfkbubAkrr3R4Cw==", + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/@libp2p/interface-pubsub/-/interface-pubsub-3.0.1.tgz", + "integrity": "sha512-VLMr6Mn8e2m2moda3dGNbsAkWjPoENBebJIzFV7QDd9NOKwNiAs59vIoNi2n+y5XzUBmgBeKeFB8G03/m0NOdA==", "requires": { "@libp2p/interface-connection": "^3.0.0", "@libp2p/interface-peer-id": "^1.0.0", "@libp2p/interfaces": "^3.0.0", "it-pushable": "^3.0.0", - "uint8arraylist": "^2.0.0" + "uint8arraylist": "^2.1.2" } }, "@libp2p/interface-record": { @@ -24270,39 +24136,28 @@ } }, "@libp2p/interface-registrar": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/@libp2p/interface-registrar/-/interface-registrar-2.0.3.tgz", - "integrity": "sha512-YA/A+o+166/+noXxMFXvZdg9soZSZX2EPOlUwnGXZWR7J5B2sxyP76QxHWXL5npsEMj7suP+Rjb/GJYGz7rDyg==", + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/@libp2p/interface-registrar/-/interface-registrar-2.0.4.tgz", + "integrity": "sha512-GD5EY+LrtV4v4Mvm/L/ObeMWb96VPZppi7Vl1b1HU5dMzWSnPdOylJZ/N0/Ppryg30CO6yayq9g+/CQN8YEk4g==", "requires": { "@libp2p/interface-connection": "^3.0.0", "@libp2p/interface-peer-id": "^1.0.0" } }, "@libp2p/interface-stream-muxer": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/@libp2p/interface-stream-muxer/-/interface-stream-muxer-2.0.2.tgz", - "integrity": "sha512-BcLsV8ZVr34G32u/w4pgSAgFju9CTuBB9OJwgX6ugasYf6LtJ0a3m5Kwddy79lvvM/gBvVv/McpCr4mPxP4WWg==", + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/@libp2p/interface-stream-muxer/-/interface-stream-muxer-3.0.1.tgz", + "integrity": "sha512-HlIZFMMSYTKOKn5VBw8UHQ5qya6oWSqpP2ygtSoB/nbBcC/3mv/4cbvozJUAGrOrDz01YY3QOB2LJ6R1b0EWCQ==", "requires": { "@libp2p/interface-connection": "^3.0.0", "@libp2p/interfaces": "^3.0.0", "it-stream-types": "^1.0.4" } }, - "@libp2p/interface-transport": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/@libp2p/interface-transport/-/interface-transport-1.0.4.tgz", - "integrity": "sha512-MOkhtykUrrbgHC1CcAFe/6QTz/BEBbHfu5sf+go6dhBlHXeHI+AcV8Fic5zTZNz71E1SRi2UR+5TVi7ORPL57Q==", - "requires": { - "@libp2p/interface-connection": "^3.0.0", - "@libp2p/interfaces": "^3.0.0", - "@multiformats/multiaddr": "^11.0.0", - "it-stream-types": "^1.0.4" - } - }, "@libp2p/interfaces": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/@libp2p/interfaces/-/interfaces-3.0.3.tgz", - "integrity": "sha512-8IIxw7TKpaYTtVfZN3jePLlm/E/VzqPpqerN+jhA+1s86akRSeyxVBYi3W9SWDSf0oIauHJSDE8KNxLceAfeag==" + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/@libp2p/interfaces/-/interfaces-3.0.4.tgz", + "integrity": "sha512-e8GZAgr72bT2qfDsIVb9lKDA2itLLGfXnaC18VXsToFUd4kCAe6ggUsRFpCBjrX3aWZ16pRiGy4afprOCfgyIg==" }, "@libp2p/logger": { "version": "2.0.2", @@ -24313,23 +24168,15 @@ "debug": "^4.3.3", "interface-datastore": "^7.0.0", "multiformats": "^10.0.0" - }, - "dependencies": { - "multiformats": { - "version": "10.0.2", - "resolved": "https://registry.npmjs.org/multiformats/-/multiformats-10.0.2.tgz", - "integrity": "sha512-nJEHLFOYhO4L+aNApHhCnWqa31FyqAHv9Q77AhmwU3KsM2f1j7tuJpCk5ByZ33smzycNCpSG5klNIejIyfFx2A==" - } } }, "@libp2p/mplex": { - "version": "5.2.4", - "resolved": "https://registry.npmjs.org/@libp2p/mplex/-/mplex-5.2.4.tgz", - "integrity": "sha512-DyyDaDjSaCNT5eIgtlvyMvDejFhHEoPmICElPVHxFF0Wo7kr2CV8WLlYmwxdO7fKUZQA6NYhX5E1ZrQltCbBqg==", + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/@libp2p/mplex/-/mplex-7.0.0.tgz", + "integrity": "sha512-pzPxBXxvLJI1xBwrz2b2mcLblVvoj6swoI6Trgezjx2myLMKIXjFTcK7KBWor5J8RF+vLmnmOLDEDvqOJJtCWg==", "requires": { - "@libp2p/components": "^2.0.0", "@libp2p/interface-connection": "^3.0.1", - "@libp2p/interface-stream-muxer": "^2.0.0", + "@libp2p/interface-stream-muxer": "^3.0.0", "@libp2p/logger": "^2.0.0", "abortable-iterator": "^4.0.2", "any-signal": "^3.0.0", @@ -24340,7 +24187,7 @@ "it-stream-types": "^1.0.4", "rate-limiter-flexible": "^2.3.9", "uint8arraylist": "^2.1.1", - "uint8arrays": "^3.0.0", + "uint8arrays": "^4.0.2", "varint": "^6.0.0" } }, @@ -24364,21 +24211,6 @@ "p-defer": "^4.0.0", "uint8arraylist": "^2.3.1", "uint8arrays": "^4.0.2" - }, - "dependencies": { - "multiformats": { - "version": "10.0.2", - "resolved": "https://registry.npmjs.org/multiformats/-/multiformats-10.0.2.tgz", - "integrity": "sha512-nJEHLFOYhO4L+aNApHhCnWqa31FyqAHv9Q77AhmwU3KsM2f1j7tuJpCk5ByZ33smzycNCpSG5klNIejIyfFx2A==" - }, - "uint8arrays": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/uint8arrays/-/uint8arrays-4.0.2.tgz", - "integrity": "sha512-8CWXXZdOvVrIL4SeY/Gnp+idxxiGK4XFkP4FY26Sx/fpTz/b6vv4BVWELMDzQweSyyhdcuAcU14H6izzB6k1Cw==", - "requires": { - "multiformats": "^10.0.0" - } - } } }, "@libp2p/peer-collections": { @@ -24399,21 +24231,6 @@ "err-code": "^3.0.1", "multiformats": "^10.0.0", "uint8arrays": "^4.0.2" - }, - "dependencies": { - "multiformats": { - "version": "10.0.2", - "resolved": "https://registry.npmjs.org/multiformats/-/multiformats-10.0.2.tgz", - "integrity": "sha512-nJEHLFOYhO4L+aNApHhCnWqa31FyqAHv9Q77AhmwU3KsM2f1j7tuJpCk5ByZ33smzycNCpSG5klNIejIyfFx2A==" - }, - "uint8arrays": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/uint8arrays/-/uint8arrays-4.0.2.tgz", - "integrity": "sha512-8CWXXZdOvVrIL4SeY/Gnp+idxxiGK4XFkP4FY26Sx/fpTz/b6vv4BVWELMDzQweSyyhdcuAcU14H6izzB6k1Cw==", - "requires": { - "multiformats": "^10.0.0" - } - } } }, "@libp2p/peer-id-factory": { @@ -24436,11 +24253,6 @@ "resolved": "https://registry.npmjs.org/long/-/long-5.2.0.tgz", "integrity": "sha512-9RTUNjK60eJbx3uz+TEGF7fUr29ZDxR5QzXcyDpeSfeH28S9ycINflOgOlppit5U+4kNTe83KQnMEerw7GmE8w==" }, - "multiformats": { - "version": "10.0.2", - "resolved": "https://registry.npmjs.org/multiformats/-/multiformats-10.0.2.tgz", - "integrity": "sha512-nJEHLFOYhO4L+aNApHhCnWqa31FyqAHv9Q77AhmwU3KsM2f1j7tuJpCk5ByZ33smzycNCpSG5klNIejIyfFx2A==" - }, "protobufjs": { "version": "7.1.2", "resolved": "https://registry.npmjs.org/protobufjs/-/protobufjs-7.1.2.tgz", @@ -24468,14 +24280,6 @@ "protobufjs": "^7.0.0", "uint8arraylist": "^2.3.2" } - }, - "uint8arrays": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/uint8arrays/-/uint8arrays-4.0.2.tgz", - "integrity": "sha512-8CWXXZdOvVrIL4SeY/Gnp+idxxiGK4XFkP4FY26Sx/fpTz/b6vv4BVWELMDzQweSyyhdcuAcU14H6izzB6k1Cw==", - "requires": { - "multiformats": "^10.0.0" - } } } }, @@ -24511,10 +24315,68 @@ "resolved": "https://registry.npmjs.org/long/-/long-5.2.0.tgz", "integrity": "sha512-9RTUNjK60eJbx3uz+TEGF7fUr29ZDxR5QzXcyDpeSfeH28S9ycINflOgOlppit5U+4kNTe83KQnMEerw7GmE8w==" }, - "multiformats": { - "version": "10.0.2", - "resolved": "https://registry.npmjs.org/multiformats/-/multiformats-10.0.2.tgz", - "integrity": "sha512-nJEHLFOYhO4L+aNApHhCnWqa31FyqAHv9Q77AhmwU3KsM2f1j7tuJpCk5ByZ33smzycNCpSG5klNIejIyfFx2A==" + "protobufjs": { + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/protobufjs/-/protobufjs-7.1.2.tgz", + "integrity": "sha512-4ZPTPkXCdel3+L81yw3dG6+Kq3umdWKh7Dc7GW/CpNk4SX3hK58iPCWeCyhVTDrbkNeKrYNZ7EojM5WDaEWTLQ==", + "requires": { + "@protobufjs/aspromise": "^1.1.2", + "@protobufjs/base64": "^1.1.2", + "@protobufjs/codegen": "^2.0.4", + "@protobufjs/eventemitter": "^1.1.0", + "@protobufjs/fetch": "^1.1.0", + "@protobufjs/float": "^1.0.2", + "@protobufjs/inquire": "^1.1.0", + "@protobufjs/path": "^1.1.2", + "@protobufjs/pool": "^1.1.0", + "@protobufjs/utf8": "^1.1.0", + "@types/node": ">=13.7.0", + "long": "^5.0.0" + } + }, + "protons-runtime": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/protons-runtime/-/protons-runtime-4.0.1.tgz", + "integrity": "sha512-SPeV+8TzJAp5UJYPV7vJkLRi08CP0DksxpKK60rcNaZSPkMBQwc0jQrmkHqwc5P0cYbZzKsdYrUBwRrDLrzTfQ==", + "requires": { + "protobufjs": "^7.0.0", + "uint8arraylist": "^2.3.2" + } + } + } + }, + "@libp2p/peer-store": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/@libp2p/peer-store/-/peer-store-5.0.0.tgz", + "integrity": "sha512-Yz/JykQ9xA0cpv4jIOt9dzYXBAugjoJFPVpA8/LEwU6Y+aUcTIAC3AhOe88QxjYxy4pz+H7C711K2HNCj207jg==", + "requires": { + "@libp2p/interface-peer-id": "^1.0.4", + "@libp2p/interface-peer-info": "^1.0.3", + "@libp2p/interface-peer-store": "^1.2.2", + "@libp2p/interface-record": "^2.0.1", + "@libp2p/interfaces": "^3.0.3", + "@libp2p/logger": "^2.0.0", + "@libp2p/peer-id": "^1.1.15", + "@libp2p/peer-record": "^4.0.3", + "@multiformats/multiaddr": "^11.0.0", + "err-code": "^3.0.1", + "interface-datastore": "^7.0.0", + "it-all": "^1.0.6", + "it-filter": "^1.0.3", + "it-foreach": "^0.1.1", + "it-map": "^1.0.6", + "it-pipe": "^2.0.3", + "mortice": "^3.0.0", + "multiformats": "^10.0.0", + "protons-runtime": "^4.0.1", + "uint8arraylist": "^2.1.1", + "uint8arrays": "^4.0.2" + }, + "dependencies": { + "long": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/long/-/long-5.2.1.tgz", + "integrity": "sha512-GKSNGeNAtw8IryjjkhZxuKB3JzlcLTwjtiQCHKvqQet81I93kXslhDQruGI/QsddO83mcDToBVy7GqGS/zYf/A==" }, "protobufjs": { "version": "7.1.2", @@ -24543,56 +24405,18 @@ "protobufjs": "^7.0.0", "uint8arraylist": "^2.3.2" } - }, - "uint8arrays": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/uint8arrays/-/uint8arrays-4.0.2.tgz", - "integrity": "sha512-8CWXXZdOvVrIL4SeY/Gnp+idxxiGK4XFkP4FY26Sx/fpTz/b6vv4BVWELMDzQweSyyhdcuAcU14H6izzB6k1Cw==", - "requires": { - "multiformats": "^10.0.0" - } } } }, - "@libp2p/peer-store": { - "version": "3.1.5", - "resolved": "https://registry.npmjs.org/@libp2p/peer-store/-/peer-store-3.1.5.tgz", - "integrity": "sha512-tChz3TqkQj1t0+yugWroeGhHbX+q7e1goVRJQbli4sZ1j5NEAQlxHpPq2yDOOCB5RVvX0oZ8b32999ILOJXbvA==", - "requires": { - "@libp2p/components": "^2.0.0", - "@libp2p/interface-peer-id": "^1.0.4", - "@libp2p/interface-peer-info": "^1.0.3", - "@libp2p/interface-peer-store": "^1.2.2", - "@libp2p/interface-record": "^2.0.1", - "@libp2p/interfaces": "^3.0.3", - "@libp2p/logger": "^2.0.0", - "@libp2p/peer-id": "^1.1.15", - "@libp2p/peer-record": "^4.0.3", - "@multiformats/multiaddr": "^11.0.0", - "err-code": "^3.0.1", - "interface-datastore": "^7.0.0", - "it-all": "^1.0.6", - "it-filter": "^1.0.3", - "it-foreach": "^0.1.1", - "it-map": "^1.0.6", - "it-pipe": "^2.0.3", - "mortice": "^3.0.0", - "multiformats": "^9.6.3", - "protons-runtime": "^3.1.0", - "uint8arraylist": "^2.1.1", - "uint8arrays": "^3.1.0" - } - }, "@libp2p/pubsub": { - "version": "3.1.3", - "resolved": "https://registry.npmjs.org/@libp2p/pubsub/-/pubsub-3.1.3.tgz", - "integrity": "sha512-lo3Ay3NHdll2Wt0kzs2RNyWagyECGDx7d4dyKwGQgzhZyoy3FnYQW8vbMLyLLX1FV9DSiWEbFsBxX2MKJXUMyQ==", + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/@libp2p/pubsub/-/pubsub-5.0.0.tgz", + "integrity": "sha512-E391cFkWDFG7SnE4aoG5y8eRr5OkUWEarWbWkGjnzt2IYSO5wj3K9XKn9U8DDg4Fskl1KQAQDZayS8crMxyHAA==", "requires": { - "@libp2p/components": "^2.0.0", "@libp2p/crypto": "^1.0.0", "@libp2p/interface-connection": "^3.0.1", "@libp2p/interface-peer-id": "^1.0.2", - "@libp2p/interface-pubsub": "^2.0.0", + "@libp2p/interface-pubsub": "^3.0.0", "@libp2p/interface-registrar": "^2.0.0", "@libp2p/interfaces": "^3.0.2", "@libp2p/logger": "^2.0.0", @@ -24605,10 +24429,10 @@ "it-length-prefixed": "^8.0.2", "it-pipe": "^2.0.3", "it-pushable": "^3.0.0", - "multiformats": "^9.6.3", + "multiformats": "^10.0.0", "p-queue": "^7.2.0", "uint8arraylist": "^2.0.0", - "uint8arrays": "^3.0.0" + "uint8arrays": "^4.0.2" } }, "@libp2p/topology": { @@ -24650,12 +24474,12 @@ } }, "@libp2p/websockets": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/@libp2p/websockets/-/websockets-3.0.4.tgz", - "integrity": "sha512-Xu2ENTcc05D+QALo7ayVlMJjKPUoABToUve1JQQmfH2Pb6ck1fACmjLTTpumoRDNm6UZTbkW1k8SgUmzg57iiw==", + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/@libp2p/websockets/-/websockets-5.0.0.tgz", + "integrity": "sha512-aQ1aVIuLXuUrjWIug9rJ3iLwyaJ1zgcHQfSGg0eE3a2DE1zpFgFyH0hK6zN+PT23GY/BFmNk/zlilKnA6ayatQ==", "requires": { "@libp2p/interface-connection": "^3.0.2", - "@libp2p/interface-transport": "^1.0.4", + "@libp2p/interface-transport": "^2.0.0", "@libp2p/interfaces": "^3.0.3", "@libp2p/logger": "^2.0.0", "@libp2p/utils": "^3.0.2", @@ -24668,6 +24492,20 @@ "p-defer": "^4.0.0", "p-timeout": "^6.0.0", "wherearewe": "^2.0.1" + }, + "dependencies": { + "@libp2p/interface-transport": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/@libp2p/interface-transport/-/interface-transport-2.0.1.tgz", + "integrity": "sha512-yrL6YZmPQX4JT/E/60XgNgNSCu9tNPjjq2HuWZs1n1k8cstV0/WvViUE8aoOlJlKZSVjQNcpRAy9LgVxznK7/g==", + "requires": { + "@libp2p/interface-connection": "^3.0.0", + "@libp2p/interface-stream-muxer": "^3.0.0", + "@libp2p/interfaces": "^3.0.0", + "@multiformats/multiaddr": "^11.0.0", + "it-stream-types": "^1.0.4" + } + } } }, "@manypkg/find-root": { @@ -24814,21 +24652,6 @@ "multiformats": "^10.0.0", "uint8arrays": "^4.0.2", "varint": "^6.0.0" - }, - "dependencies": { - "multiformats": { - "version": "10.0.2", - "resolved": "https://registry.npmjs.org/multiformats/-/multiformats-10.0.2.tgz", - "integrity": "sha512-nJEHLFOYhO4L+aNApHhCnWqa31FyqAHv9Q77AhmwU3KsM2f1j7tuJpCk5ByZ33smzycNCpSG5klNIejIyfFx2A==" - }, - "uint8arrays": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/uint8arrays/-/uint8arrays-4.0.2.tgz", - "integrity": "sha512-8CWXXZdOvVrIL4SeY/Gnp+idxxiGK4XFkP4FY26Sx/fpTz/b6vv4BVWELMDzQweSyyhdcuAcU14H6izzB6k1Cw==", - "requires": { - "multiformats": "^10.0.0" - } - } } }, "@multiformats/multiaddr-to-uri": { @@ -26232,34 +26055,20 @@ "rollup": "^2.75.0", "typescript": "^4.6.3", "uint8arrays": "^4.0.2" - }, - "dependencies": { - "multiformats": { - "version": "10.0.2", - "resolved": "https://registry.npmjs.org/multiformats/-/multiformats-10.0.2.tgz", - "integrity": "sha512-nJEHLFOYhO4L+aNApHhCnWqa31FyqAHv9Q77AhmwU3KsM2f1j7tuJpCk5ByZ33smzycNCpSG5klNIejIyfFx2A==" - }, - "uint8arrays": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/uint8arrays/-/uint8arrays-4.0.2.tgz", - "integrity": "sha512-8CWXXZdOvVrIL4SeY/Gnp+idxxiGK4XFkP4FY26Sx/fpTz/b6vv4BVWELMDzQweSyyhdcuAcU14H6izzB6k1Cw==", - "requires": { - "multiformats": "^10.0.0" - } - } } }, "@waku/core": { "version": "file:packages/core", "requires": { - "@chainsafe/libp2p-gossipsub": "^4.1.1", + "@chainsafe/libp2p-gossipsub": "^5.2.1", "@libp2p/interface-connection": "^3.0.3", "@libp2p/interface-peer-discovery": "^1.0.0", - "@libp2p/interface-peer-id": "^1.0.2", - "@libp2p/interface-peer-info": "^1.0.1", - "@libp2p/interface-peer-store": "^1.0.0", - "@libp2p/interface-pubsub": "^2.0.1", - "@libp2p/interfaces": "^3.0.2", + "@libp2p/interface-peer-id": "^1.0.6", + "@libp2p/interface-peer-info": "^1.0.4", + "@libp2p/interface-peer-store": "^1.2.3", + "@libp2p/interface-pubsub": "^3.0.1", + "@libp2p/interface-registrar": "^2.0.4", + "@libp2p/interfaces": "^3.0.4", "@libp2p/peer-id": "^1.1.10", "@multiformats/multiaddr": "^11.0.6", "@rollup/plugin-commonjs": "^22.0.0", @@ -26299,7 +26108,7 @@ "karma-chrome-launcher": "^3.1.0", "karma-mocha": "^2.0.1", "karma-webpack": "^5.0.0", - "libp2p": "0.39.5", + "libp2p": "0.40.0", "mocha": "^9.1.3", "npm-run-all": "^4.1.5", "p-event": "^5.0.1", @@ -26318,30 +26127,16 @@ "uint8arraylist": "^2.3.2", "uint8arrays": "^4.0.2", "uuid": "^8.3.2" - }, - "dependencies": { - "multiformats": { - "version": "10.0.2", - "resolved": "https://registry.npmjs.org/multiformats/-/multiformats-10.0.2.tgz", - "integrity": "sha512-nJEHLFOYhO4L+aNApHhCnWqa31FyqAHv9Q77AhmwU3KsM2f1j7tuJpCk5ByZ33smzycNCpSG5klNIejIyfFx2A==" - }, - "uint8arrays": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/uint8arrays/-/uint8arrays-4.0.2.tgz", - "integrity": "sha512-8CWXXZdOvVrIL4SeY/Gnp+idxxiGK4XFkP4FY26Sx/fpTz/b6vv4BVWELMDzQweSyyhdcuAcU14H6izzB6k1Cw==", - "requires": { - "multiformats": "^10.0.0" - } - } } }, "@waku/create": { "version": "file:packages/create", "requires": { - "@chainsafe/libp2p-noise": "^8.0.1", - "@libp2p/interface-peer-discovery": "^1.0.0", - "@libp2p/mplex": "^5.1.1", - "@libp2p/websockets": "^3.0.3", + "@chainsafe/libp2p-noise": "^10.1.0", + "@libp2p/bootstrap": "^5.0.0", + "@libp2p/interface-peer-discovery": "^1.0.2", + "@libp2p/mplex": "^7.0.0", + "@libp2p/websockets": "^5.0.0", "@rollup/plugin-commonjs": "^22.0.0", "@rollup/plugin-json": "^4.1.0", "@rollup/plugin-node-resolve": "^13.3.0", @@ -26394,21 +26189,6 @@ "rollup": "^2.75.0", "typescript": "^4.6.3", "uint8arrays": "^4.0.2" - }, - "dependencies": { - "multiformats": { - "version": "10.0.2", - "resolved": "https://registry.npmjs.org/multiformats/-/multiformats-10.0.2.tgz", - "integrity": "sha512-nJEHLFOYhO4L+aNApHhCnWqa31FyqAHv9Q77AhmwU3KsM2f1j7tuJpCk5ByZ33smzycNCpSG5klNIejIyfFx2A==" - }, - "uint8arrays": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/uint8arrays/-/uint8arrays-4.0.2.tgz", - "integrity": "sha512-8CWXXZdOvVrIL4SeY/Gnp+idxxiGK4XFkP4FY26Sx/fpTz/b6vv4BVWELMDzQweSyyhdcuAcU14H6izzB6k1Cw==", - "requires": { - "multiformats": "^10.0.0" - } - } } }, "@waku/enr": { @@ -26442,32 +26222,15 @@ "ts-loader": "^9.4.1", "typescript": "^4.6.3", "uint8arrays": "^4.0.2" - }, - "dependencies": { - "multiformats": { - "version": "10.0.2", - "resolved": "https://registry.npmjs.org/multiformats/-/multiformats-10.0.2.tgz", - "integrity": "sha512-nJEHLFOYhO4L+aNApHhCnWqa31FyqAHv9Q77AhmwU3KsM2f1j7tuJpCk5ByZ33smzycNCpSG5klNIejIyfFx2A==", - "dev": true - }, - "uint8arrays": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/uint8arrays/-/uint8arrays-4.0.2.tgz", - "integrity": "sha512-8CWXXZdOvVrIL4SeY/Gnp+idxxiGK4XFkP4FY26Sx/fpTz/b6vv4BVWELMDzQweSyyhdcuAcU14H6izzB6k1Cw==", - "dev": true, - "requires": { - "multiformats": "^10.0.0" - } - } } }, "@waku/interfaces": { "version": "file:packages/interfaces", "requires": { - "@chainsafe/libp2p-gossipsub": "^4.1.1", + "@chainsafe/libp2p-gossipsub": "^5.2.1", "@libp2p/interface-connection": "^3.0.2", "@libp2p/interface-peer-id": "^1.0.5", - "@libp2p/interface-peer-store": "^1.2.2", + "@libp2p/interface-peer-store": "^1.2.3", "@multiformats/multiaddr": "^11.0.6", "@typescript-eslint/eslint-plugin": "^5.8.1", "@typescript-eslint/parser": "^5.8.1", @@ -26478,7 +26241,7 @@ "eslint-plugin-functional": "^4.0.2", "eslint-plugin-import": "^2.25.3", "eslint-plugin-prettier": "^4.0.0", - "libp2p": "0.39.5", + "libp2p": "0.40.0", "npm-run-all": "^4.1.5", "prettier": "^2.1.1", "typescript": "^4.6.3" @@ -26516,6 +26279,7 @@ "@waku/tests": { "version": "file:packages/tests", "requires": { + "@libp2p/bootstrap": "^5.0.0", "@typescript-eslint/eslint-plugin": "^5.8.1", "@typescript-eslint/parser": "^5.8.1", "@waku/byte-utils": "*", @@ -28245,21 +28009,6 @@ "it-pushable": "^3.0.0", "it-take": "^1.0.1", "uint8arrays": "^4.0.2" - }, - "dependencies": { - "multiformats": { - "version": "10.0.2", - "resolved": "https://registry.npmjs.org/multiformats/-/multiformats-10.0.2.tgz", - "integrity": "sha512-nJEHLFOYhO4L+aNApHhCnWqa31FyqAHv9Q77AhmwU3KsM2f1j7tuJpCk5ByZ33smzycNCpSG5klNIejIyfFx2A==" - }, - "uint8arrays": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/uint8arrays/-/uint8arrays-4.0.2.tgz", - "integrity": "sha512-8CWXXZdOvVrIL4SeY/Gnp+idxxiGK4XFkP4FY26Sx/fpTz/b6vv4BVWELMDzQweSyyhdcuAcU14H6izzB6k1Cw==", - "requires": { - "multiformats": "^10.0.0" - } - } } }, "date-format": { @@ -30550,23 +30299,10 @@ "uint8arrays": "^4.0.2" }, "dependencies": { - "multiformats": { - "version": "10.0.2", - "resolved": "https://registry.npmjs.org/multiformats/-/multiformats-10.0.2.tgz", - "integrity": "sha512-nJEHLFOYhO4L+aNApHhCnWqa31FyqAHv9Q77AhmwU3KsM2f1j7tuJpCk5ByZ33smzycNCpSG5klNIejIyfFx2A==" - }, "nanoid": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-4.0.0.tgz", "integrity": "sha512-IgBP8piMxe/gf73RTQx7hmnhwz0aaEXYakvqZyE302IXW3HyVNhdNGC+O2MwMAVhLEnvXlvKtGbtJf6wvHihCg==" - }, - "uint8arrays": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/uint8arrays/-/uint8arrays-4.0.2.tgz", - "integrity": "sha512-8CWXXZdOvVrIL4SeY/Gnp+idxxiGK4XFkP4FY26Sx/fpTz/b6vv4BVWELMDzQweSyyhdcuAcU14H6izzB6k1Cw==", - "requires": { - "multiformats": "^10.0.0" - } } } }, @@ -30991,21 +30727,6 @@ "uint8-varint": "^1.0.1", "uint8arraylist": "^2.0.0", "uint8arrays": "^4.0.2" - }, - "dependencies": { - "multiformats": { - "version": "10.0.2", - "resolved": "https://registry.npmjs.org/multiformats/-/multiformats-10.0.2.tgz", - "integrity": "sha512-nJEHLFOYhO4L+aNApHhCnWqa31FyqAHv9Q77AhmwU3KsM2f1j7tuJpCk5ByZ33smzycNCpSG5klNIejIyfFx2A==" - }, - "uint8arrays": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/uint8arrays/-/uint8arrays-4.0.2.tgz", - "integrity": "sha512-8CWXXZdOvVrIL4SeY/Gnp+idxxiGK4XFkP4FY26Sx/fpTz/b6vv4BVWELMDzQweSyyhdcuAcU14H6izzB6k1Cw==", - "requires": { - "multiformats": "^10.0.0" - } - } } }, "it-map": { @@ -31076,11 +30797,18 @@ } }, "it-sort": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/it-sort/-/it-sort-1.0.1.tgz", - "integrity": "sha512-c+C48cP7XMMebB9irLrJs2EmpLILId8NYSojqAqN8etE8ienx0azBgaKvZHYH1DkerqIul0Fl2FqISu2BZgTEQ==", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/it-sort/-/it-sort-2.0.0.tgz", + "integrity": "sha512-yeAE97b5PEjCrWFUiNyR90eJdGslj8FB3cjT84rsc+mzx9lxPyR2zJkYB9ZOJoWE5MMebxqcQCLRT3OSlzo7Zg==", "requires": { - "it-all": "^1.0.6" + "it-all": "^2.0.0" + }, + "dependencies": { + "it-all": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/it-all/-/it-all-2.0.0.tgz", + "integrity": "sha512-I/yi9ogTY59lFxtfsDSlI9w9QZtC/5KJt6g7CPPBJJh2xql2ZS7Ghcp9hoqDDbc4QfwQvtx8Loy0zlKQ8H5gFg==" + } } }, "it-stream-types": { @@ -31103,21 +30831,6 @@ "it-stream-types": "^1.0.2", "uint8arrays": "^4.0.2", "ws": "^8.4.0" - }, - "dependencies": { - "multiformats": { - "version": "10.0.2", - "resolved": "https://registry.npmjs.org/multiformats/-/multiformats-10.0.2.tgz", - "integrity": "sha512-nJEHLFOYhO4L+aNApHhCnWqa31FyqAHv9Q77AhmwU3KsM2f1j7tuJpCk5ByZ33smzycNCpSG5klNIejIyfFx2A==" - }, - "uint8arrays": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/uint8arrays/-/uint8arrays-4.0.2.tgz", - "integrity": "sha512-8CWXXZdOvVrIL4SeY/Gnp+idxxiGK4XFkP4FY26Sx/fpTz/b6vv4BVWELMDzQweSyyhdcuAcU14H6izzB6k1Cw==", - "requires": { - "multiformats": "^10.0.0" - } - } } }, "jake": { @@ -31588,17 +31301,16 @@ } }, "libp2p": { - "version": "0.39.5", - "resolved": "https://registry.npmjs.org/libp2p/-/libp2p-0.39.5.tgz", - "integrity": "sha512-zF/Tc3IRQ3M+W3wqn6zSICUc6gsdCdXCNjsWMudinfRTia6CnRbj68ZkjrUw0TA1j2bODwD2+CxAFTsn9iS0Nw==", + "version": "0.40.0", + "resolved": "https://registry.npmjs.org/libp2p/-/libp2p-0.40.0.tgz", + "integrity": "sha512-AeLaA+8KIhUhjpXZcs20+Pnf2wIBp+zdSYPD1IgGCF0PlMbTdCvaIqhPzpTSd3+e5k7NZlgpd/BvCOLgQbfm5Q==", "requires": { "@achingbrain/nat-port-mapper": "^1.0.3", - "@libp2p/components": "^2.1.0", "@libp2p/connection": "^4.0.2", "@libp2p/crypto": "^1.0.4", - "@libp2p/interface-address-manager": "^1.0.3", + "@libp2p/interface-address-manager": "^2.0.0", "@libp2p/interface-connection": "^3.0.2", - "@libp2p/interface-connection-encrypter": "^2.0.1", + "@libp2p/interface-connection-encrypter": "^3.0.1", "@libp2p/interface-connection-manager": "^1.1.1", "@libp2p/interface-content-routing": "^1.0.2", "@libp2p/interface-dht": "^1.0.1", @@ -31608,10 +31320,10 @@ "@libp2p/interface-peer-info": "^1.0.3", "@libp2p/interface-peer-routing": "^1.0.1", "@libp2p/interface-peer-store": "^1.2.2", - "@libp2p/interface-pubsub": "^2.1.0", + "@libp2p/interface-pubsub": "^3.0.0", "@libp2p/interface-registrar": "^2.0.3", - "@libp2p/interface-stream-muxer": "^2.0.2", - "@libp2p/interface-transport": "^1.0.4", + "@libp2p/interface-stream-muxer": "^3.0.0", + "@libp2p/interface-transport": "^2.0.0", "@libp2p/interfaces": "^3.0.3", "@libp2p/logger": "^2.0.1", "@libp2p/multistream-select": "^3.0.0", @@ -31619,7 +31331,7 @@ "@libp2p/peer-id": "^1.1.15", "@libp2p/peer-id-factory": "^1.0.18", "@libp2p/peer-record": "^4.0.3", - "@libp2p/peer-store": "^3.1.5", + "@libp2p/peer-store": "^5.0.0", "@libp2p/tracked-map": "^2.0.1", "@libp2p/utils": "^3.0.2", "@multiformats/mafmt": "^11.0.2", @@ -31631,36 +31343,131 @@ "events": "^3.3.0", "hashlru": "^2.3.0", "interface-datastore": "^7.0.0", - "it-all": "^1.0.6", - "it-drain": "^1.0.5", - "it-filter": "^1.0.3", - "it-first": "^1.0.6", - "it-foreach": "^0.1.1", + "it-all": "^2.0.0", + "it-drain": "^2.0.0", + "it-filter": "^2.0.0", + "it-first": "^2.0.0", + "it-foreach": "^1.0.0", "it-handshake": "^4.1.2", "it-length-prefixed": "^8.0.2", - "it-map": "^1.0.6", - "it-merge": "^1.0.3", + "it-map": "^2.0.0", + "it-merge": "^2.0.0", "it-pair": "^2.0.2", "it-pipe": "^2.0.3", - "it-sort": "^1.0.1", + "it-sort": "^2.0.0", "it-stream-types": "^1.0.4", "merge-options": "^3.0.4", - "multiformats": "^9.6.3", + "multiformats": "^10.0.0", "mutable-proxy": "^1.0.0", "node-forge": "^1.3.1", "p-fifo": "^1.0.0", "p-retry": "^5.0.0", "p-settle": "^5.0.0", "private-ip": "^2.3.3", - "protons-runtime": "^3.0.1", + "protons-runtime": "^4.0.1", + "rate-limiter-flexible": "^2.3.11", "retimer": "^3.0.0", "sanitize-filename": "^1.6.3", "set-delayed-interval": "^1.0.0", "timeout-abort-controller": "^3.0.0", "uint8arraylist": "^2.3.2", - "uint8arrays": "^3.0.0", + "uint8arrays": "^4.0.2", "wherearewe": "^2.0.0", "xsalsa20": "^1.1.0" + }, + "dependencies": { + "@libp2p/interface-address-manager": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/@libp2p/interface-address-manager/-/interface-address-manager-2.0.1.tgz", + "integrity": "sha512-JjlQUJ0cF1h0wsOS22PNRQiiiMLwftd5QttjJK2jDsou5FkZETeQ9eYL05I0ykQKZvEJqwH8G5WLwxWtwsj7Ag==", + "requires": { + "@libp2p/interfaces": "^3.0.0", + "@multiformats/multiaddr": "^11.0.0" + } + }, + "@libp2p/interface-transport": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/@libp2p/interface-transport/-/interface-transport-2.0.1.tgz", + "integrity": "sha512-yrL6YZmPQX4JT/E/60XgNgNSCu9tNPjjq2HuWZs1n1k8cstV0/WvViUE8aoOlJlKZSVjQNcpRAy9LgVxznK7/g==", + "requires": { + "@libp2p/interface-connection": "^3.0.0", + "@libp2p/interface-stream-muxer": "^3.0.0", + "@libp2p/interfaces": "^3.0.0", + "@multiformats/multiaddr": "^11.0.0", + "it-stream-types": "^1.0.4" + } + }, + "it-all": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/it-all/-/it-all-2.0.0.tgz", + "integrity": "sha512-I/yi9ogTY59lFxtfsDSlI9w9QZtC/5KJt6g7CPPBJJh2xql2ZS7Ghcp9hoqDDbc4QfwQvtx8Loy0zlKQ8H5gFg==" + }, + "it-drain": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/it-drain/-/it-drain-2.0.0.tgz", + "integrity": "sha512-oa/5iyBtRs9UW486vPpyDTC0ee3rqx5qlrPI7txIUJcqqtiO5yVozEB6LQrl5ysQYv+P3y/dlKEqwVqlCV0SEA==" + }, + "it-filter": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/it-filter/-/it-filter-2.0.0.tgz", + "integrity": "sha512-E68+zzoNNI7MxdH1T4lUTgwpCyEnymlH349Qg2mcvsqLmYRkaZLM4NfZZ0hUuH7/5DkWXubQSDOYH396va8mpg==" + }, + "it-first": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/it-first/-/it-first-2.0.0.tgz", + "integrity": "sha512-fzZGzVf01exFyIZXNjkpSMFr1eW2+J1K0v018tYY26Dd4f/O3pWlBTdrOBfSQRZwtI8Pst6c7eKhYczWvFs6tA==" + }, + "it-foreach": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/it-foreach/-/it-foreach-1.0.0.tgz", + "integrity": "sha512-2j5HK1P6aMwEvgL6K5nzUwOk+81B/mjt05PxiSspFEKwJnqy1LfJYlLLS6llBoM+NdoUxf6EsBCHidFGmsXvhw==" + }, + "it-map": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/it-map/-/it-map-2.0.0.tgz", + "integrity": "sha512-mLgtk/NZaN7NZ06iLrMXCA6jjhtZO0vZT5Ocsp31H+nsGI18RSPVmUbFyA1sWx7q+g92J22Sixya7T2QSSAwfA==" + }, + "it-merge": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/it-merge/-/it-merge-2.0.0.tgz", + "integrity": "sha512-mH4bo/ZrMoU+Wlu7ZuYPNNh9oWZ/GvYbeXZ0zll97+Rp6H4jFu98iu6v9qqXDz//RUjdO9zGh8awzMfOElsjpA==", + "requires": { + "it-pushable": "^3.1.0" + } + }, + "long": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/long/-/long-5.2.1.tgz", + "integrity": "sha512-GKSNGeNAtw8IryjjkhZxuKB3JzlcLTwjtiQCHKvqQet81I93kXslhDQruGI/QsddO83mcDToBVy7GqGS/zYf/A==" + }, + "protobufjs": { + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/protobufjs/-/protobufjs-7.1.2.tgz", + "integrity": "sha512-4ZPTPkXCdel3+L81yw3dG6+Kq3umdWKh7Dc7GW/CpNk4SX3hK58iPCWeCyhVTDrbkNeKrYNZ7EojM5WDaEWTLQ==", + "requires": { + "@protobufjs/aspromise": "^1.1.2", + "@protobufjs/base64": "^1.1.2", + "@protobufjs/codegen": "^2.0.4", + "@protobufjs/eventemitter": "^1.1.0", + "@protobufjs/fetch": "^1.1.0", + "@protobufjs/float": "^1.0.2", + "@protobufjs/inquire": "^1.1.0", + "@protobufjs/path": "^1.1.2", + "@protobufjs/pool": "^1.1.0", + "@protobufjs/utf8": "^1.1.0", + "@types/node": ">=13.7.0", + "long": "^5.0.0" + } + }, + "protons-runtime": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/protons-runtime/-/protons-runtime-4.0.1.tgz", + "integrity": "sha512-SPeV+8TzJAp5UJYPV7vJkLRi08CP0DksxpKK60rcNaZSPkMBQwc0jQrmkHqwc5P0cYbZzKsdYrUBwRrDLrzTfQ==", + "requires": { + "protobufjs": "^7.0.0", + "uint8arraylist": "^2.3.2" + } + } } }, "lilconfig": { @@ -32702,9 +32509,9 @@ } }, "multiformats": { - "version": "9.9.0", - "resolved": "https://registry.npmjs.org/multiformats/-/multiformats-9.9.0.tgz", - "integrity": "sha512-HoMUjhH9T8DDBNT+6xzkrd9ga/XiBI4xLr58LJACwK6G3HTOPeMz4nB4KJs33L2BelrIJa7P0VuNaVF3hMYfjg==" + "version": "10.0.2", + "resolved": "https://registry.npmjs.org/multiformats/-/multiformats-10.0.2.tgz", + "integrity": "sha512-nJEHLFOYhO4L+aNApHhCnWqa31FyqAHv9Q77AhmwU3KsM2f1j7tuJpCk5ByZ33smzycNCpSG5klNIejIyfFx2A==" }, "multimatch": { "version": "5.0.0", @@ -38433,21 +38240,6 @@ "longbits": "^1.1.0", "uint8arraylist": "^2.0.0", "uint8arrays": "^4.0.2" - }, - "dependencies": { - "multiformats": { - "version": "10.0.2", - "resolved": "https://registry.npmjs.org/multiformats/-/multiformats-10.0.2.tgz", - "integrity": "sha512-nJEHLFOYhO4L+aNApHhCnWqa31FyqAHv9Q77AhmwU3KsM2f1j7tuJpCk5ByZ33smzycNCpSG5klNIejIyfFx2A==" - }, - "uint8arrays": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/uint8arrays/-/uint8arrays-4.0.2.tgz", - "integrity": "sha512-8CWXXZdOvVrIL4SeY/Gnp+idxxiGK4XFkP4FY26Sx/fpTz/b6vv4BVWELMDzQweSyyhdcuAcU14H6izzB6k1Cw==", - "requires": { - "multiformats": "^10.0.0" - } - } } }, "uint8arraylist": { @@ -38456,29 +38248,14 @@ "integrity": "sha512-5uM6jtxAEnkRSTQewKCwX5IvaQb1gTadNSQLTZexNh9j8e10+0o208VP81VGmfkMUud2ApMxT5O6P4BRu1J/jA==", "requires": { "uint8arrays": "^4.0.2" - }, - "dependencies": { - "multiformats": { - "version": "10.0.2", - "resolved": "https://registry.npmjs.org/multiformats/-/multiformats-10.0.2.tgz", - "integrity": "sha512-nJEHLFOYhO4L+aNApHhCnWqa31FyqAHv9Q77AhmwU3KsM2f1j7tuJpCk5ByZ33smzycNCpSG5klNIejIyfFx2A==" - }, - "uint8arrays": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/uint8arrays/-/uint8arrays-4.0.2.tgz", - "integrity": "sha512-8CWXXZdOvVrIL4SeY/Gnp+idxxiGK4XFkP4FY26Sx/fpTz/b6vv4BVWELMDzQweSyyhdcuAcU14H6izzB6k1Cw==", - "requires": { - "multiformats": "^10.0.0" - } - } } }, "uint8arrays": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/uint8arrays/-/uint8arrays-3.1.1.tgz", - "integrity": "sha512-+QJa8QRnbdXVpHYjLoTpJIdCTiw9Ir62nocClWuXIq2JIh4Uta0cQsTSpFL678p2CN8B+XSApwcU+pQEqVpKWg==", + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/uint8arrays/-/uint8arrays-4.0.2.tgz", + "integrity": "sha512-8CWXXZdOvVrIL4SeY/Gnp+idxxiGK4XFkP4FY26Sx/fpTz/b6vv4BVWELMDzQweSyyhdcuAcU14H6izzB6k1Cw==", "requires": { - "multiformats": "^9.4.2" + "multiformats": "^10.0.0" } }, "unbox-primitive": { diff --git a/packages/core/CHANGELOG.md b/packages/core/CHANGELOG.md index 06b2a7dec3..e4cffa6b22 100644 --- a/packages/core/CHANGELOG.md +++ b/packages/core/CHANGELOG.md @@ -11,6 +11,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Waku Message `ephemeral` field to mark messages as do-not-store. +### Changed + +- Bumped `libp2p` to 0.40.0 and associated libp2p libraries. + +### Removed + +- `PeerDiscoveryStaticPeer` has been removed, use `@libp2p/bootstrap` instead. + ## @waku/core [0.0.5](https://github.com/waku-org/js-waku/compare/@waku/core@0.0.4...@waku/core@0.0.5) (2022-11-11) ### Changed diff --git a/packages/core/package.json b/packages/core/package.json index 84b24025bf..37e0294353 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -9,10 +9,6 @@ "types": "./dist/index.d.ts", "import": "./dist/index.js" }, - "./lib/peer_discovery_static_list": { - "types": "./dist/lib/peer_discovery_static_list.d.ts", - "import": "./dist/lib/peer_discovery_static_list.js" - }, "./lib/predefined_bootstrap_nodes": { "types": "./dist/lib/predefined_bootstrap_nodes.d.ts", "import": "./dist/lib/predefined_bootstrap_nodes.js" @@ -86,23 +82,24 @@ "node": ">=16" }, "dependencies": { - "@waku/byte-utils": "*", - "@chainsafe/libp2p-gossipsub": "^4.1.1", + "@chainsafe/libp2p-gossipsub": "^5.2.1", "@libp2p/interface-connection": "^3.0.3", "@libp2p/interface-peer-discovery": "^1.0.0", - "@libp2p/interface-peer-id": "^1.0.2", - "@libp2p/interface-peer-info": "^1.0.1", - "@libp2p/interface-peer-store": "^1.0.0", - "@libp2p/interface-pubsub": "^2.0.1", - "@libp2p/interfaces": "^3.0.2", + "@libp2p/interface-peer-id": "^1.0.6", + "@libp2p/interface-peer-info": "^1.0.4", + "@libp2p/interface-peer-store": "^1.2.3", + "@libp2p/interface-pubsub": "^3.0.1", + "@libp2p/interface-registrar": "^2.0.4", + "@libp2p/interfaces": "^3.0.4", "@libp2p/peer-id": "^1.1.10", "@multiformats/multiaddr": "^11.0.6", + "@waku/byte-utils": "*", "@waku/interfaces": "*", "debug": "^4.3.4", "it-all": "^1.0.6", "it-length-prefixed": "^8.0.2", "it-pipe": "^2.0.4", - "libp2p": "0.39.5", + "libp2p": "0.40.0", "p-event": "^5.0.1", "protons-runtime": "^3.1.0", "uint8arraylist": "^2.3.2", diff --git a/packages/core/rollup.config.js b/packages/core/rollup.config.js index c8d31b555a..fd47526e18 100644 --- a/packages/core/rollup.config.js +++ b/packages/core/rollup.config.js @@ -5,7 +5,6 @@ import json from "@rollup/plugin-json"; export default { input: { index: "dist/index.js", - "lib/peer_discovery_static_list": "dist/lib/peer_discovery_static_list.js", "lib/predefined_bootstrap_nodes": "dist/lib/predefined_bootstrap_nodes.js", "lib/wait_for_remote_peer": "dist/lib/wait_for_remote_peer.js", "lib/waku_message/version_0": "dist/lib/waku_message/version_0.js", diff --git a/packages/core/src/index.ts b/packages/core/src/index.ts index e90b55e3f4..eb8de3e863 100644 --- a/packages/core/src/index.ts +++ b/packages/core/src/index.ts @@ -7,17 +7,17 @@ export * as waku from "./lib/waku"; export { WakuNode } from "./lib/waku"; export * as waku_filter from "./lib/waku_filter"; -export { WakuFilter } from "./lib/waku_filter"; +export { wakuFilter } from "./lib/waku_filter"; export * as waku_light_push from "./lib/waku_light_push"; export { - WakuLightPush, + wakuLightPush, LightPushCodec, PushResponse, } from "./lib/waku_light_push"; export * as waku_relay from "./lib/waku_relay"; -export { WakuRelay } from "./lib/waku_relay"; +export { wakuRelay } from "./lib/waku_relay"; export * as waku_store from "./lib/waku_store"; -export { PageDirection, WakuStore, StoreCodec } from "./lib/waku_store"; +export { PageDirection, wakuStore, StoreCodec } from "./lib/waku_store"; diff --git a/packages/core/src/lib/peer_discovery_static_list.ts b/packages/core/src/lib/peer_discovery_static_list.ts deleted file mode 100644 index a50d089e35..0000000000 --- a/packages/core/src/lib/peer_discovery_static_list.ts +++ /dev/null @@ -1,118 +0,0 @@ -import type { - PeerDiscovery, - PeerDiscoveryEvents, -} from "@libp2p/interface-peer-discovery"; -import { symbol } from "@libp2p/interface-peer-discovery"; -import type { PeerInfo } from "@libp2p/interface-peer-info"; -import { CustomEvent, EventEmitter } from "@libp2p/interfaces/events"; -import type { Multiaddr } from "@multiformats/multiaddr"; -import { multiaddr } from "@multiformats/multiaddr"; -import debug from "debug"; - -import { multiaddrsToPeerInfo } from "./multiaddr_to_peer_info"; -import { getPseudoRandomSubset } from "./random_subset"; - -const log = debug("waku:peer-discovery-static-list"); - -export interface Options { - /** - * The maximum of peers to connect to as part of the bootstrap process. - * - * @default The length of the passed `peers` array. - */ - maxPeers?: number; - /** - * The interval between emitting addresses in milliseconds. - * - * @default {@link PeerDiscoveryStaticPeers.DefaultInterval} - */ - interval?: number; -} - -/** - * Pass a list of multiaddr that will be used to bootstrap a node. - */ -export class PeerDiscoveryStaticPeers - extends EventEmitter - implements PeerDiscovery -{ - static DefaultInterval = 200; - private readonly peers: PeerInfo[]; - private timer?: ReturnType; - private readonly interval: number; - - /** - * @param peers Multiaddrs of peers to connect to. - * @param opts - */ - constructor(peers: string[] | Multiaddr[], opts?: Options) { - super(); - - this.interval = opts?.interval ?? PeerDiscoveryStaticPeers.DefaultInterval; - const maxPeers = opts?.maxPeers ?? peers?.length; - - const peerMas = peers.map((peer: string | Multiaddr) => { - if (typeof peer === "string") { - return multiaddr(peer); - } else { - return peer; - } - }); - this.peers = multiaddrsToPeerInfo(getPseudoRandomSubset(peerMas, maxPeers)); - log( - "Use provided list of peers (reduced to maxPeers)", - this.peers.map((ma) => ma.toString()) - ); - } - - /** - * Start emitting static peers. - */ - start(): void { - this._startTimer(); - } - - private _startTimer(): void { - if (this.peers) { - log("Starting to emit static peers."); - if (this.timer != null) { - return; - } - - this.timer = setInterval(() => this._returnPeers(), this.interval); - - this._returnPeers(); - } - } - - _returnPeers(): void { - if (this.timer == null) { - return; - } - - this.peers.forEach((peerData) => { - this.dispatchEvent( - new CustomEvent("peer", { detail: peerData }) - ); - }); - } - - /** - * Stop emitting peers. - */ - stop(): void { - if (this.timer != null) { - clearInterval(this.timer); - } - - this.timer = undefined; - } - - get [symbol](): true { - return true; - } - - get [Symbol.toStringTag](): string { - return "@waku/peer-discovery-static-list"; - } -} diff --git a/packages/core/src/lib/predefined_bootstrap_nodes.ts b/packages/core/src/lib/predefined_bootstrap_nodes.ts index cfe4bf2983..b46ea5f461 100644 --- a/packages/core/src/lib/predefined_bootstrap_nodes.ts +++ b/packages/core/src/lib/predefined_bootstrap_nodes.ts @@ -1,6 +1,3 @@ -import type { Multiaddr } from "@multiformats/multiaddr"; -import { multiaddr } from "@multiformats/multiaddr"; - import { getPseudoRandomSubset } from "./random_subset"; export const DefaultWantedNumber = 1; @@ -23,7 +20,7 @@ export enum Fleet { export function getPredefinedBootstrapNodes( fleet: Fleet = Fleet.Prod, wantedNumber: number = DefaultWantedNumber -): Multiaddr[] { +): string[] { if (wantedNumber <= 0) { return []; } @@ -42,7 +39,6 @@ export function getPredefinedBootstrapNodes( nodes = Object.values(nodes) as string[]; - nodes = nodes.map((node: string) => multiaddr(node)); return getPseudoRandomSubset(nodes, wantedNumber); } diff --git a/packages/core/src/lib/wait_for_remote_peer.ts b/packages/core/src/lib/wait_for_remote_peer.ts index caa254239a..a7f9e2d64b 100644 --- a/packages/core/src/lib/wait_for_remote_peer.ts +++ b/packages/core/src/lib/wait_for_remote_peer.ts @@ -94,13 +94,13 @@ async function waitForConnectedPeer( for (const codec of codecs) { if (evt.detail.protocols.includes(codec)) { log("Resolving for", codec, evt.detail.protocols); - waku.libp2p.peerStore.removeEventListener("change:protocols", cb); + waku.peerStore.removeEventListener("change:protocols", cb); resolve(); break; } } }; - waku.libp2p.peerStore.addEventListener("change:protocols", cb); + waku.peerStore.addEventListener("change:protocols", cb); }); } diff --git a/packages/core/src/lib/waku.ts b/packages/core/src/lib/waku.ts index ba1bdd6c9e..7192d2a59d 100644 --- a/packages/core/src/lib/waku.ts +++ b/packages/core/src/lib/waku.ts @@ -1,21 +1,18 @@ import type { Stream } from "@libp2p/interface-connection"; import type { PeerId } from "@libp2p/interface-peer-id"; import type { PubSub } from "@libp2p/interface-pubsub"; -import { peerIdFromString } from "@libp2p/peer-id"; import type { Multiaddr } from "@multiformats/multiaddr"; -import { multiaddr } from "@multiformats/multiaddr"; -import type { Waku } from "@waku/interfaces"; +import type { Filter, LightPush, Relay, Store, Waku } from "@waku/interfaces"; import { Protocols } from "@waku/interfaces"; import debug from "debug"; import type { Libp2p } from "libp2p"; -import { FilterCodec, WakuFilter } from "./waku_filter"; -import { LightPushCodec, WakuLightPush } from "./waku_light_push"; +import { FilterCodec, FilterComponents } from "./waku_filter"; +import { LightPushCodec, LightPushComponents } from "./waku_light_push"; import { EncoderV0 } from "./waku_message/version_0"; -import { WakuRelay } from "./waku_relay"; import * as relayConstants from "./waku_relay/constants"; import { RelayCodecs, RelayPingContentTopic } from "./waku_relay/constants"; -import { StoreCodec, WakuStore } from "./waku_store"; +import { StoreCodec, StoreComponents } from "./waku_store"; export const DefaultPingKeepAliveValueSecs = 0; export const DefaultRelayKeepAliveValueSecs = 5 * 60; @@ -41,10 +38,10 @@ export interface WakuOptions { export class WakuNode implements Waku { public libp2p: Libp2p; - public relay?: WakuRelay; - public store?: WakuStore; - public filter?: WakuFilter; - public lightPush?: WakuLightPush; + public relay?: Relay; + public store?: Store; + public filter?: Filter; + public lightPush?: LightPush; private pingKeepAliveTimers: { [peer: string]: ReturnType; @@ -56,16 +53,26 @@ export class WakuNode implements Waku { constructor( options: WakuOptions, libp2p: Libp2p, - store?: WakuStore, - lightPush?: WakuLightPush, - filter?: WakuFilter + store?: (components: StoreComponents) => Store, + lightPush?: (components: LightPushComponents) => LightPush, + filter?: (components: FilterComponents) => Filter ) { this.libp2p = libp2p; - this.store = store; - this.filter = filter; - this.lightPush = lightPush; - if (isWakuRelay(libp2p.pubsub)) { + const { peerStore, connectionManager, registrar } = libp2p; + const components = { peerStore, connectionManager, registrar }; + + if (store) { + this.store = store(components); + } + if (filter) { + this.filter = filter(components); + } + if (lightPush) { + this.lightPush = lightPush(components); + } + + if (isRelay(libp2p.pubsub)) { this.relay = libp2p.pubsub; } @@ -103,6 +110,15 @@ export class WakuNode implements Waku { libp2p.connectionManager.addEventListener("peer:disconnect", (evt) => { this.stopKeepAlive(evt.detail.remotePeer); }); + + // Trivial handling of discovered peers, to be refined. + libp2p.addEventListener("peer:discovery", (evt) => { + const peerId = evt.detail.id; + log(`Found peer ${peerId.toString()}, dialing.`); + libp2p.dial(peerId).catch((err) => { + log(`Fail to dial ${peerId}`, err); + }); + }); } /** @@ -141,29 +157,6 @@ export class WakuNode implements Waku { return this.libp2p.dialProtocol(peer, codecs); } - /** - * Add peer to address book, it will be auto-dialed in the background. - */ - async addPeerToAddressBook( - peerId: PeerId | string, - multiaddrs: Multiaddr[] | string[] - ): Promise { - let peer; - if (typeof peerId === "string") { - peer = peerIdFromString(peerId); - } else { - peer = peerId; - } - const addresses = multiaddrs.map((addr: Multiaddr | string) => { - if (typeof addr === "string") { - return multiaddr(addr); - } else { - return addr; - } - }); - await this.libp2p.peerStore.addressBook.set(peer, addresses); - } - async start(): Promise { await this.libp2p.start(); } @@ -249,7 +242,7 @@ export class WakuNode implements Waku { } } -function isWakuRelay(pubsub: PubSub): pubsub is WakuRelay { +function isRelay(pubsub: PubSub): pubsub is Relay { if (pubsub) { try { return pubsub.multicodecs.includes( diff --git a/packages/core/src/lib/waku_filter/index.ts b/packages/core/src/lib/waku_filter/index.ts index e09b9249ea..9a0ccb7cb9 100644 --- a/packages/core/src/lib/waku_filter/index.ts +++ b/packages/core/src/lib/waku_filter/index.ts @@ -1,7 +1,10 @@ import type { Stream } from "@libp2p/interface-connection"; +import type { ConnectionManager } from "@libp2p/interface-connection-manager"; import type { PeerId } from "@libp2p/interface-peer-id"; +import type { PeerStore } from "@libp2p/interface-peer-store"; import type { Peer } from "@libp2p/interface-peer-store"; import type { IncomingStreamData } from "@libp2p/interface-registrar"; +import type { Registrar } from "@libp2p/interface-registrar"; import type { Callback, DecodedMessage, @@ -14,7 +17,6 @@ import debug from "debug"; import all from "it-all"; import * as lp from "it-length-prefixed"; import { pipe } from "it-pipe"; -import type { Libp2p } from "libp2p"; import { WakuMessage as WakuMessageProto } from "../../proto/message"; import { DefaultPubSubTopic } from "../constants"; @@ -28,12 +30,19 @@ import { import { toProtoMessage } from "../to_proto_message"; import { ContentFilter, FilterRPC } from "./filter_rpc"; + export { ContentFilter }; export const FilterCodec = "/vac/waku/filter/2.0.0-beta1"; const log = debug("waku:filter"); +export interface FilterComponents { + peerStore: PeerStore; + registrar: Registrar; + connectionManager: ConnectionManager; +} + export interface CreateOptions { /** * The PubSub Topic to use. Defaults to {@link DefaultPubSubTopic}. @@ -55,7 +64,7 @@ export type UnsubscribeFunction = () => Promise; * - https://github.com/status-im/go-waku/issues/245 * - https://github.com/status-im/nwaku/issues/948 */ -export class WakuFilter implements Filter { +class WakuFilter implements Filter { pubSubTopic: string; private subscriptions: Map>; private decoders: Map< @@ -63,11 +72,11 @@ export class WakuFilter implements Filter { Set> >; - constructor(public libp2p: Libp2p, options?: CreateOptions) { + constructor(public components: FilterComponents, options?: CreateOptions) { this.subscriptions = new Map(); this.decoders = new Map(); this.pubSubTopic = options?.pubSubTopic ?? DefaultPubSubTopic; - this.libp2p + this.components.registrar .handle(FilterCodec, this.onRequest.bind(this)) .catch((e) => log("Failed to register filter protocol", e)); } @@ -139,6 +148,10 @@ export class WakuFilter implements Filter { }; } + get peerStore(): PeerStore { + return this.components.peerStore; + } + private onRequest(streamData: IncomingStreamData): void { log("Receiving message push"); try { @@ -261,7 +274,9 @@ export class WakuFilter implements Filter { } private async newStream(peer: Peer): Promise { - const connections = this.libp2p.connectionManager.getConnections(peer.id); + const connections = this.components.connectionManager.getConnections( + peer.id + ); const connection = selectConnection(connections); if (!connection) { throw new Error("Failed to get a connection to the peer"); @@ -272,7 +287,7 @@ export class WakuFilter implements Filter { private async getPeer(peerId?: PeerId): Promise { const res = await selectPeerForProtocol( - this.libp2p.peerStore, + this.components.peerStore, [FilterCodec], peerId ); @@ -283,10 +298,16 @@ export class WakuFilter implements Filter { } async peers(): Promise { - return getPeersForProtocol(this.libp2p.peerStore, [FilterCodec]); + return getPeersForProtocol(this.components.peerStore, [FilterCodec]); } async randomPeer(): Promise { return selectRandomPeer(await this.peers()); } } + +export function wakuFilter( + init: Partial = {} +): (components: FilterComponents) => Filter { + return (components: FilterComponents) => new WakuFilter(components, init); +} diff --git a/packages/core/src/lib/waku_light_push/index.ts b/packages/core/src/lib/waku_light_push/index.ts index 78600fe9d2..2ddaccaff8 100644 --- a/packages/core/src/lib/waku_light_push/index.ts +++ b/packages/core/src/lib/waku_light_push/index.ts @@ -1,7 +1,10 @@ +import { ConnectionManager } from "@libp2p/interface-connection-manager"; import type { PeerId } from "@libp2p/interface-peer-id"; import type { Peer } from "@libp2p/interface-peer-store"; +import type { PeerStore } from "@libp2p/interface-peer-store"; import type { Encoder, + LightPush, Message, ProtocolOptions, SendResult, @@ -10,7 +13,6 @@ import debug from "debug"; import all from "it-all"; import * as lp from "it-length-prefixed"; import { pipe } from "it-pipe"; -import { Libp2p } from "libp2p"; import { Uint8ArrayList } from "uint8arraylist"; import { PushResponse } from "../../proto/light_push"; @@ -29,6 +31,11 @@ const log = debug("waku:light-push"); export const LightPushCodec = "/vac/waku/lightpush/2.0.0-beta1"; export { PushResponse }; +export interface LightPushComponents { + peerStore: PeerStore; + connectionManager: ConnectionManager; +} + export interface CreateOptions { /** * The PubSub Topic to use. Defaults to {@link DefaultPubSubTopic}. @@ -44,10 +51,10 @@ export interface CreateOptions { /** * Implements the [Waku v2 Light Push protocol](https://rfc.vac.dev/spec/19/). */ -export class WakuLightPush { +class WakuLightPush implements LightPush { pubSubTopic: string; - constructor(public libp2p: Libp2p, options?: CreateOptions) { + constructor(public components: LightPushComponents, options?: CreateOptions) { this.pubSubTopic = options?.pubSubTopic ?? DefaultPubSubTopic; } @@ -59,7 +66,7 @@ export class WakuLightPush { const pubSubTopic = opts?.pubSubTopic ? opts.pubSubTopic : this.pubSubTopic; const res = await selectPeerForProtocol( - this.libp2p.peerStore, + this.components.peerStore, [LightPushCodec], opts?.peerId ); @@ -69,7 +76,9 @@ export class WakuLightPush { } const { peer } = res; - const connections = this.libp2p.connectionManager.getConnections(peer.id); + const connections = this.components.connectionManager.getConnections( + peer.id + ); const connection = selectConnection(connections); if (!connection) throw "Failed to get a connection to the peer"; @@ -123,7 +132,7 @@ export class WakuLightPush { * peers. */ async peers(): Promise { - return getPeersForProtocol(this.libp2p.peerStore, [LightPushCodec]); + return getPeersForProtocol(this.components.peerStore, [LightPushCodec]); } /** @@ -134,4 +143,15 @@ export class WakuLightPush { async randomPeer(): Promise { return selectRandomPeer(await this.peers()); } + + get peerStore(): PeerStore { + return this.components.peerStore; + } +} + +export function wakuLightPush( + init: Partial = {} +): (components: LightPushComponents) => LightPush { + return (components: LightPushComponents) => + new WakuLightPush(components, init); } diff --git a/packages/core/src/lib/waku_message/version_0.spec.ts b/packages/core/src/lib/waku_message/version_0.spec.ts index 8601538ae8..586d72910c 100644 --- a/packages/core/src/lib/waku_message/version_0.spec.ts +++ b/packages/core/src/lib/waku_message/version_0.spec.ts @@ -24,7 +24,7 @@ describe("Waku Message version 0", function () { ); }); - it("Ephemeral", async function () { + it("Ephemeral field set to true", async function () { await fc.assert( fc.asyncProperty(fc.uint8Array({ minLength: 1 }), async (payload) => { const encoder = new EncoderV0(TestContentTopic, true); diff --git a/packages/core/src/lib/waku_relay/index.ts b/packages/core/src/lib/waku_relay/index.ts index eb83314c2e..f1832e9e3d 100644 --- a/packages/core/src/lib/waku_relay/index.ts +++ b/packages/core/src/lib/waku_relay/index.ts @@ -1,5 +1,6 @@ import { GossipSub, + GossipSubComponents, GossipsubMessage, GossipsubOpts, } from "@chainsafe/libp2p-gossipsub"; @@ -55,7 +56,7 @@ export type CreateOptions = { * * @implements {require('libp2p-interfaces/src/pubsub')} */ -export class WakuRelay extends GossipSub implements Relay { +class WakuRelay extends GossipSub implements Relay { pubSubTopic: string; defaultDecoder: Decoder; public static multicodec: string = constants.RelayCodecs[0]; @@ -66,13 +67,16 @@ export class WakuRelay extends GossipSub implements Relay { */ public observers: Map>>; - constructor(options?: Partial) { + constructor( + components: GossipSubComponents, + options?: Partial + ) { options = Object.assign(options ?? {}, { // Ensure that no signature is included nor expected in the messages. globalSignaturePolicy: SignaturePolicy.StrictNoSign, fallbackToFloodsub: false, }); - super(options); + super(components, options); this.multicodecs = constants.RelayCodecs; this.observers = new Map(); @@ -188,3 +192,9 @@ export class WakuRelay extends GossipSub implements Relay { } WakuRelay.multicodec = constants.RelayCodecs[constants.RelayCodecs.length - 1]; + +export function wakuRelay( + init: Partial = {} +): (components: GossipSubComponents) => Relay { + return (components: GossipSubComponents) => new WakuRelay(components, init); +} diff --git a/packages/core/src/lib/waku_store/index.ts b/packages/core/src/lib/waku_store/index.ts index efcbf10b72..c93005bced 100644 --- a/packages/core/src/lib/waku_store/index.ts +++ b/packages/core/src/lib/waku_store/index.ts @@ -1,12 +1,12 @@ import type { Connection } from "@libp2p/interface-connection"; +import type { ConnectionManager } from "@libp2p/interface-connection-manager"; import type { PeerId } from "@libp2p/interface-peer-id"; -import { Peer } from "@libp2p/interface-peer-store"; -import { DecodedMessage, Decoder } from "@waku/interfaces"; +import type { Peer, PeerStore } from "@libp2p/interface-peer-store"; +import { DecodedMessage, Decoder, Store } from "@waku/interfaces"; import debug from "debug"; import all from "it-all"; import * as lp from "it-length-prefixed"; import { pipe } from "it-pipe"; -import { Libp2p } from "libp2p"; import { Uint8ArrayList } from "uint8arraylist"; import * as proto from "../../proto/store"; @@ -27,6 +27,11 @@ export const DefaultPageSize = 10; export { PageDirection }; +export interface StoreComponents { + peerStore: PeerStore; + connectionManager: ConnectionManager; +} + export interface CreateOptions { /** * The PubSub Topic to use. Defaults to {@link DefaultPubSubTopic}. @@ -82,10 +87,10 @@ export interface QueryOptions { * * The Waku Store protocol can be used to retrieved historical messages. */ -export class WakuStore { +class WakuStore implements Store { pubSubTopic: string; - constructor(public libp2p: Libp2p, options?: CreateOptions) { + constructor(public components: StoreComponents, options?: CreateOptions) { this.pubSubTopic = options?.pubSubTopic ?? DefaultPubSubTopic; } @@ -232,7 +237,7 @@ export class WakuStore { }); const res = await selectPeerForProtocol( - this.libp2p.peerStore, + this.components.peerStore, [StoreCodec], options?.peerId ); @@ -242,7 +247,9 @@ export class WakuStore { } const { peer, protocol } = res; - const connections = this.libp2p.connectionManager.getConnections(peer.id); + const connections = this.components.connectionManager.getConnections( + peer.id + ); const connection = selectConnection(connections); if (!connection) throw "Failed to get a connection to the peer"; @@ -262,7 +269,11 @@ export class WakuStore { * store protocol. Waku may or may not be currently connected to these peers. */ async peers(): Promise { - return getPeersForProtocol(this.libp2p.peerStore, [StoreCodec]); + return getPeersForProtocol(this.components.peerStore, [StoreCodec]); + } + + get peerStore(): PeerStore { + return this.components.peerStore; } } @@ -370,3 +381,9 @@ async function* paginate( export function isDefined(msg: T | undefined): msg is T { return !!msg; } + +export function wakuStore( + init: Partial = {} +): (components: StoreComponents) => Store { + return (components: StoreComponents) => new WakuStore(components, init); +} diff --git a/packages/create/package.json b/packages/create/package.json index 7071e81242..2d44fc7f86 100644 --- a/packages/create/package.json +++ b/packages/create/package.json @@ -50,12 +50,13 @@ "node": ">=16" }, "dependencies": { + "@chainsafe/libp2p-noise": "^10.1.0", + "@libp2p/bootstrap": "^5.0.0", + "@libp2p/interface-peer-discovery": "^1.0.2", + "@libp2p/mplex": "^7.0.0", + "@libp2p/websockets": "^5.0.0", "@waku/core": "*", - "@waku/interfaces": "*", - "@chainsafe/libp2p-noise": "^8.0.1", - "@libp2p/interface-peer-discovery": "^1.0.0", - "@libp2p/mplex": "^5.1.1", - "@libp2p/websockets": "^3.0.3" + "@waku/interfaces": "*" }, "devDependencies": { "@rollup/plugin-commonjs": "^22.0.0", diff --git a/packages/create/src/index.ts b/packages/create/src/index.ts index 89a6015f4e..d7f33bb321 100644 --- a/packages/create/src/index.ts +++ b/packages/create/src/index.ts @@ -1,22 +1,23 @@ -import { Noise } from "@chainsafe/libp2p-noise"; +import { noise } from "@chainsafe/libp2p-noise"; +import { bootstrap } from "@libp2p/bootstrap"; import type { PeerDiscovery } from "@libp2p/interface-peer-discovery"; -import { Mplex } from "@libp2p/mplex"; -import { WebSockets } from "@libp2p/websockets"; +import { mplex } from "@libp2p/mplex"; +import { webSockets } from "@libp2p/websockets"; import { all as filterAll } from "@libp2p/websockets/filters"; import { waku, waku_relay, - WakuFilter, - WakuLightPush, + wakuFilter, + wakuLightPush, WakuNode, - WakuRelay, - WakuStore, + wakuRelay, + wakuStore, } from "@waku/core"; -import { PeerDiscoveryStaticPeers } from "@waku/core/lib/peer_discovery_static_list"; import { getPredefinedBootstrapNodes } from "@waku/core/lib/predefined_bootstrap_nodes"; -import type { WakuFull, WakuLight, WakuPrivacy } from "@waku/interfaces"; +import type { Relay, WakuFull, WakuLight, WakuPrivacy } from "@waku/interfaces"; import type { Libp2p } from "libp2p"; import { createLibp2p, Libp2pOptions } from "libp2p"; +import type { Components } from "libp2p/components"; type WakuOptions = waku.WakuOptions; type RelayCreateOptions = waku_relay.CreateOptions; @@ -73,16 +74,16 @@ export async function createLightNode( const libp2p = await defaultLibp2p(undefined, libp2pOptions); - const wakuStore = new WakuStore(libp2p, options); - const wakuLightPush = new WakuLightPush(libp2p, options); - const wakuFilter = new WakuFilter(libp2p, options); + const store = wakuStore(options); + const lightPush = wakuLightPush(options); + const filter = wakuFilter(options); return new WakuNode( options ?? {}, libp2p, - wakuStore, - wakuLightPush, - wakuFilter + store, + lightPush, + filter ) as WakuLight; } @@ -100,7 +101,7 @@ export async function createPrivacyNode( Object.assign(libp2pOptions, { peerDiscovery }); } - const libp2p = await defaultLibp2p(new WakuRelay(options), libp2pOptions); + const libp2p = await defaultLibp2p(wakuRelay(options), libp2pOptions); return new WakuNode(options ?? {}, libp2p) as WakuPrivacy; } @@ -128,34 +129,36 @@ export async function createFullNode( Object.assign(libp2pOptions, { peerDiscovery }); } - const libp2p = await defaultLibp2p(new WakuRelay(options), libp2pOptions); + const libp2p = await defaultLibp2p(wakuRelay(options), libp2pOptions); - const wakuStore = new WakuStore(libp2p, options); - const wakuLightPush = new WakuLightPush(libp2p, options); - const wakuFilter = new WakuFilter(libp2p, options); + const store = wakuStore(options); + const lightPush = wakuLightPush(options); + const filter = wakuFilter(options); return new WakuNode( options ?? {}, libp2p, - wakuStore, - wakuLightPush, - wakuFilter + store, + lightPush, + filter ) as WakuFull; } -export function defaultPeerDiscovery(): PeerDiscovery { - return new PeerDiscoveryStaticPeers(getPredefinedBootstrapNodes()); +export function defaultPeerDiscovery(): ( + components: Components +) => PeerDiscovery { + return bootstrap({ list: getPredefinedBootstrapNodes() }); } export async function defaultLibp2p( - wakuRelay?: WakuRelay, + wakuRelay?: (components: Components) => Relay, options?: Partial ): Promise { const libp2pOpts = Object.assign( { - transports: [new WebSockets({ filter: filterAll })], - streamMuxers: [new Mplex()], - connectionEncryption: [new Noise()], + transports: [webSockets({ filter: filterAll })], + streamMuxers: [mplex()], + connectionEncryption: [noise()], }, wakuRelay ? { pubsub: wakuRelay } : {}, options ?? {} diff --git a/packages/interfaces/package.json b/packages/interfaces/package.json index 80a187a388..696954ab28 100644 --- a/packages/interfaces/package.json +++ b/packages/interfaces/package.json @@ -48,12 +48,12 @@ "node": ">=16" }, "dependencies": { - "@chainsafe/libp2p-gossipsub": "^4.1.1", + "@chainsafe/libp2p-gossipsub": "^5.2.1", "@libp2p/interface-connection": "^3.0.2", "@libp2p/interface-peer-id": "^1.0.5", - "@libp2p/interface-peer-store": "^1.2.2", + "@libp2p/interface-peer-store": "^1.2.3", "@multiformats/multiaddr": "^11.0.6", - "libp2p": "0.39.5" + "libp2p": "0.40.0" }, "devDependencies": { "@typescript-eslint/eslint-plugin": "^5.8.1", diff --git a/packages/interfaces/src/index.ts b/packages/interfaces/src/index.ts index 91258a3b4f..f32176ff00 100644 --- a/packages/interfaces/src/index.ts +++ b/packages/interfaces/src/index.ts @@ -2,6 +2,7 @@ import type { GossipSub } from "@chainsafe/libp2p-gossipsub"; import type { Stream } from "@libp2p/interface-connection"; import type { PeerId } from "@libp2p/interface-peer-id"; import type { Peer } from "@libp2p/interface-peer-store"; +import type { PeerStore } from "@libp2p/interface-peer-store"; import type { Multiaddr } from "@multiformats/multiaddr"; import type { Libp2p } from "libp2p"; @@ -13,7 +14,7 @@ export enum Protocols { } export interface PointToPointProtocol { - libp2p: Libp2p; + peerStore: PeerStore; peers: () => Promise; } @@ -112,11 +113,6 @@ export interface Waku { dial(peer: PeerId | Multiaddr, protocols?: Protocols[]): Promise; - addPeerToAddressBook( - peerId: PeerId | string, - multiaddrs: Multiaddr[] | string[] - ): void; - start(): Promise; stop(): Promise; diff --git a/packages/tests/package.json b/packages/tests/package.json index f2eaabaade..8188105c50 100644 --- a/packages/tests/package.json +++ b/packages/tests/package.json @@ -40,7 +40,7 @@ "pretest": "run-s pretest:*", "pretest:1-init-git-submodules": "[ -f '../../nwaku/build/wakunode2' ] || git submodule update --init --recursive", "pretest:2-build-nwaku": "[ -f '../../nwaku/build/wakunode2' ] || run-s nwaku:build", - "nwaku:build": "(PROC=$(nproc --all 2>/dev/null || echo 2); cd ../../nwaku; make -j$PROC update; NIMFLAGS=\"-d:chronicles_colors=off -d:chronicles_sinks=textlines -d:chronicles_log_level=TRACE\" make -j$PROC wakunode2)", + "nwaku:build": "(PROC=$(nproc --all 2>/dev/null || echo 2); cd ../../nwaku; make -j$PROC update; NIMFLAGS=\"-d:chronicles_colors=off -d:chronicles_sinks=textlines\" make -j$PROC wakunode2)", "nwaku:force-build": "(cd ../../nwaku && rm -rf ./build/ ./vendor) && run-s nwaku:build", "check": "run-s check:*", "check:prettier": "prettier . --list-different", @@ -55,14 +55,15 @@ "node": ">=16" }, "dependencies": { - "@waku/core": "*", - "@waku/enr": "*", - "@waku/create": "*", - "@waku/interfaces": "*", "@waku/byte-utils": "*", + "@waku/core": "*", + "@waku/create": "*", + "@waku/enr": "*", + "@waku/interfaces": "*", "@waku/message-encryption": "*" }, "devDependencies": { + "@libp2p/bootstrap": "^5.0.0", "@typescript-eslint/eslint-plugin": "^5.8.1", "@typescript-eslint/parser": "^5.8.1", "cspell": "^5.14.0", diff --git a/packages/tests/src/nwaku.ts b/packages/tests/src/nwaku.ts index 1a240e6dff..f3d2dab561 100644 --- a/packages/tests/src/nwaku.ts +++ b/packages/tests/src/nwaku.ts @@ -164,6 +164,8 @@ export class Nwaku { args ); + process.env.WAKUNODE2_STORE_MESSAGE_DB_URL = ""; + const argsArray = argsToArray(mergedArgs); if (WAKU_SERVICE_NODE_PARAMS) { argsArray.push(WAKU_SERVICE_NODE_PARAMS); @@ -442,8 +444,7 @@ export function defaultArgs(): Args { rpc: true, rpcAdmin: true, websocketSupport: true, - storeMessageDbUrl: "sqlite://:memory:", - logLevel: LogLevel.Debug, + logLevel: LogLevel.Trace, }; } diff --git a/packages/tests/tests/ephemeral.node.spec.ts b/packages/tests/tests/ephemeral.node.spec.ts new file mode 100644 index 0000000000..7526c27ca6 --- /dev/null +++ b/packages/tests/tests/ephemeral.node.spec.ts @@ -0,0 +1,269 @@ +import { bytesToUtf8, utf8ToBytes } from "@waku/byte-utils"; +import { waitForRemotePeer } from "@waku/core/lib/wait_for_remote_peer"; +import { DecoderV0, EncoderV0 } from "@waku/core/lib/waku_message/version_0"; +import { createFullNode, createLightNode } from "@waku/create"; +import { DecodedMessage, Protocols, WakuLight } from "@waku/interfaces"; +import { + AsymDecoder, + AsymEncoder, + generatePrivateKey, + generateSymmetricKey, + getPublicKey, + SymDecoder, + SymEncoder, +} from "@waku/message-encryption"; +import { expect } from "chai"; +import debug from "debug"; + +import { makeLogFileName, NOISE_KEY_1, NOISE_KEY_2, Nwaku } from "../src"; +import { delay } from "../src/delay"; + +const log = debug("waku:test:ephemeral"); + +const TestContentTopic = "/test/1/ephemeral/utf8"; +const TestEncoder = new EncoderV0(TestContentTopic); +const TestDecoder = new DecoderV0(TestContentTopic); + +describe("Waku Message Ephemeral field", () => { + let waku: WakuLight; + let nwaku: Nwaku; + + afterEach(async function () { + !!nwaku && nwaku.stop(); + !!waku && waku.stop().catch((e) => console.log("Waku failed to stop", e)); + }); + + beforeEach(async function () { + this.timeout(15000); + nwaku = new Nwaku(makeLogFileName(this)); + await nwaku.start({ filter: true, lightpush: true, store: true }); + waku = await createLightNode({ + staticNoiseKey: NOISE_KEY_1, + libp2p: { addresses: { listen: ["/ip4/0.0.0.0/tcp/0/ws"] } }, + }); + await waku.start(); + await waku.dial(await nwaku.getMultiaddrWithId()); + await waitForRemotePeer(waku); + }); + + it("Ephemeral messages are not stored", async function () { + this.timeout(15_000); + + const asymText = + "This message is encrypted for me using asymmetric encryption"; + const symText = + "This message is encrypted for me using symmetric encryption"; + const clearText = "This is a clear text message"; + + const asymMsg = { payload: utf8ToBytes(asymText) }; + const symMsg = { + payload: utf8ToBytes(symText), + }; + const clearMsg = { + payload: utf8ToBytes(clearText), + }; + + const privateKey = generatePrivateKey(); + const symKey = generateSymmetricKey(); + const publicKey = getPublicKey(privateKey); + + const AsymContentTopic = "/test/1/ephemeral-asym/utf8"; + const SymContentTopic = "/test/1/ephemeral-sym/utf8"; + + const asymEncoder = new AsymEncoder( + AsymContentTopic, + publicKey, + undefined, + true + ); + const symEncoder = new SymEncoder(SymContentTopic, symKey, undefined, true); + const clearEncoder = new EncoderV0(TestContentTopic, true); + + const asymDecoder = new AsymDecoder(AsymContentTopic, privateKey); + const symDecoder = new SymDecoder(SymContentTopic, symKey); + + const [waku1, waku2, nimWakuMultiaddr] = await Promise.all([ + createFullNode({ + staticNoiseKey: NOISE_KEY_1, + }).then((waku) => waku.start().then(() => waku)), + createFullNode({ + staticNoiseKey: NOISE_KEY_2, + }).then((waku) => waku.start().then(() => waku)), + nwaku.getMultiaddrWithId(), + ]); + + log("Waku nodes created"); + + await Promise.all([ + waku1.dial(nimWakuMultiaddr), + waku2.dial(nimWakuMultiaddr), + ]); + + log("Waku nodes connected to nwaku"); + + await waitForRemotePeer(waku1, [Protocols.LightPush]); + + log("Sending messages using light push"); + await Promise.all([ + waku1.lightPush.push(asymEncoder, asymMsg), + waku1.lightPush.push(symEncoder, symMsg), + waku1.lightPush.push(clearEncoder, clearMsg), + ]); + + await waitForRemotePeer(waku2, [Protocols.Store]); + + const messages: DecodedMessage[] = []; + log("Retrieve messages from store"); + + for await (const msgPromises of waku2.store.queryGenerator([ + asymDecoder, + symDecoder, + TestDecoder, + ])) { + for (const promise of msgPromises) { + const msg = await promise; + if (msg) { + messages.push(msg); + } + } + } + + expect(messages?.length).eq(0); + + !!waku1 && waku1.stop().catch((e) => console.log("Waku failed to stop", e)); + !!waku2 && waku2.stop().catch((e) => console.log("Waku failed to stop", e)); + }); + + it("Ephemeral field is preserved - encoder v0", async function () { + this.timeout(10000); + + const ephemeralEncoder = new EncoderV0(TestContentTopic, true); + + const messages: DecodedMessage[] = []; + const callback = (msg: DecodedMessage): void => { + messages.push(msg); + }; + await waku.filter.subscribe([TestDecoder], callback); + + await delay(200); + const normalTxt = "Normal message"; + const ephemeralTxt = "Ephemeral Message"; + await waku.lightPush.push(TestEncoder, { + payload: utf8ToBytes(normalTxt), + }); + await waku.lightPush.push(ephemeralEncoder, { + payload: utf8ToBytes(ephemeralTxt), + }); + while (messages.length < 2) { + await delay(250); + } + + const normalMsg = messages.find( + (msg) => bytesToUtf8(msg.payload!) === normalTxt + ); + const ephemeralMsg = messages.find( + (msg) => bytesToUtf8(msg.payload!) === ephemeralTxt + ); + + expect(normalMsg).to.not.be.undefined; + expect(ephemeralMsg).to.not.be.undefined; + + expect(normalMsg!.ephemeral).to.be.false; + expect(ephemeralMsg!.ephemeral).to.be.true; + }); + + it("Ephemeral field is preserved - symmetric encryption", async function () { + this.timeout(10000); + + const symKey = generateSymmetricKey(); + + const ephemeralEncoder = new SymEncoder( + TestContentTopic, + symKey, + undefined, + true + ); + const encoder = new SymEncoder(TestContentTopic, symKey); + const decoder = new SymDecoder(TestContentTopic, symKey); + + const messages: DecodedMessage[] = []; + const callback = (msg: DecodedMessage): void => { + messages.push(msg); + }; + await waku.filter.subscribe([decoder], callback); + + await delay(200); + const normalTxt = "Normal message"; + const ephemeralTxt = "Ephemeral Message"; + await waku.lightPush.push(encoder, { + payload: utf8ToBytes(normalTxt), + }); + await waku.lightPush.push(ephemeralEncoder, { + payload: utf8ToBytes(ephemeralTxt), + }); + while (messages.length < 2) { + await delay(250); + } + + const normalMsg = messages.find( + (msg) => bytesToUtf8(msg.payload!) === normalTxt + ); + const ephemeralMsg = messages.find( + (msg) => bytesToUtf8(msg.payload!) === ephemeralTxt + ); + + expect(normalMsg).to.not.be.undefined; + expect(ephemeralMsg).to.not.be.undefined; + + expect(normalMsg!.ephemeral).to.be.false; + expect(ephemeralMsg!.ephemeral).to.be.true; + }); + + it("Ephemeral field is preserved - asymmetric encryption", async function () { + this.timeout(10000); + + const privKey = generatePrivateKey(); + const pubKey = getPublicKey(privKey); + + const ephemeralEncoder = new AsymEncoder( + TestContentTopic, + pubKey, + undefined, + true + ); + const encoder = new AsymEncoder(TestContentTopic, pubKey); + const decoder = new AsymDecoder(TestContentTopic, privKey); + + const messages: DecodedMessage[] = []; + const callback = (msg: DecodedMessage): void => { + messages.push(msg); + }; + await waku.filter.subscribe([decoder], callback); + + await delay(200); + const normalTxt = "Normal message"; + const ephemeralTxt = "Ephemeral Message"; + await waku.lightPush.push(encoder, { + payload: utf8ToBytes(normalTxt), + }); + await waku.lightPush.push(ephemeralEncoder, { + payload: utf8ToBytes(ephemeralTxt), + }); + while (messages.length < 2) { + await delay(250); + } + + const normalMsg = messages.find( + (msg) => bytesToUtf8(msg.payload!) === normalTxt + ); + const ephemeralMsg = messages.find( + (msg) => bytesToUtf8(msg.payload!) === ephemeralTxt + ); + + expect(normalMsg).to.not.be.undefined; + expect(ephemeralMsg).to.not.be.undefined; + + expect(normalMsg!.ephemeral).to.be.false; + expect(ephemeralMsg!.ephemeral).to.be.true; + }); +}); diff --git a/packages/tests/tests/nwaku.node.spec.ts b/packages/tests/tests/nwaku.node.spec.ts index b1602bb2da..45edb8bf0f 100644 --- a/packages/tests/tests/nwaku.node.spec.ts +++ b/packages/tests/tests/nwaku.node.spec.ts @@ -16,8 +16,7 @@ describe("nwaku", () => { "--rpc=true", "--rpc-admin=true", "--websocket-support=true", - "--store-message-db-url=sqlite://:memory:", - "--log-level=DEBUG", + "--log-level=TRACE", "--ports-shift=42", ]; diff --git a/packages/tests/tests/relay.node.spec.ts b/packages/tests/tests/relay.node.spec.ts index 578aaaa57d..ac8f533127 100644 --- a/packages/tests/tests/relay.node.spec.ts +++ b/packages/tests/tests/relay.node.spec.ts @@ -64,10 +64,11 @@ describe("Waku Relay [node only]", () => { }).then((waku) => waku.start().then(() => waku)), ]); log("Instances started, adding waku2 to waku1's address book"); - waku1.addPeerToAddressBook( + await waku1.libp2p.peerStore.addressBook.set( waku2.libp2p.peerId, waku2.libp2p.getMultiaddrs() ); + await waku1.dial(waku2.libp2p.peerId); log("Wait for mutual pubsub subscription"); await Promise.all([ @@ -281,14 +282,18 @@ describe("Waku Relay [node only]", () => { }).then((waku) => waku.start().then(() => waku)), ]); - waku1.addPeerToAddressBook( + await waku1.libp2p.peerStore.addressBook.set( waku2.libp2p.peerId, waku2.libp2p.getMultiaddrs() ); - waku3.addPeerToAddressBook( + await waku3.libp2p.peerStore.addressBook.set( waku2.libp2p.peerId, waku2.libp2p.getMultiaddrs() ); + await Promise.all([ + waku1.dial(waku2.libp2p.peerId), + waku3.dial(waku2.libp2p.peerId), + ]); await Promise.all([ waitForRemotePeer(waku1, [Protocols.Relay]), diff --git a/packages/tests/tests/store.node.spec.ts b/packages/tests/tests/store.node.spec.ts index 5f17d30616..59cac15265 100644 --- a/packages/tests/tests/store.node.spec.ts +++ b/packages/tests/tests/store.node.spec.ts @@ -18,6 +18,7 @@ import { expect } from "chai"; import debug from "debug"; import { makeLogFileName, NOISE_KEY_1, NOISE_KEY_2, Nwaku } from "../src"; +import { delay } from "../src/delay"; const log = debug("waku:test:store"); @@ -204,6 +205,7 @@ describe("Waku Store", () => { }) ) ).to.be.true; + await delay(1); // to ensure each timestamp is unique. } waku = await createFullNode({ @@ -242,6 +244,7 @@ describe("Waku Store", () => { }) ) ).to.be.true; + await delay(1); // to ensure each timestamp is unique. } waku = await createFullNode({ @@ -369,143 +372,6 @@ describe("Waku Store", () => { !!waku2 && waku2.stop().catch((e) => console.log("Waku failed to stop", e)); }); - it.skip("Ephemeral support", async function () { - this.timeout(15_000); - - const asymText = "This message is encrypted for me using asymmetric"; - const asymTopic = "/test/1/asymmetric/proto"; - - const symText = - "This message is encrypted for me using symmetric encryption"; - const symTopic = "/test/1/symmetric/proto"; - - const clearText = "This is a clear text message for everyone to read"; - - const storeReadableText = "This message is readable by the store"; - const storeUnreadableText = "This message is not readable by the store"; - - const timestamp = new Date(); - - const asymMsg = { payload: utf8ToBytes(asymText), timestamp }; - const symMsg = { - payload: utf8ToBytes(symText), - timestamp: new Date(timestamp.valueOf() + 1), - }; - const clearMsg = { - payload: utf8ToBytes(clearText), - timestamp: new Date(timestamp.valueOf() + 2), - }; - - const storeReadableMsg = { - payload: utf8ToBytes(storeReadableText), - }; - const storeUnreadableMsg = { - payload: utf8ToBytes(storeUnreadableText), - }; - - const privateKey = generatePrivateKey(); - const symKey = generateSymmetricKey(); - const publicKey = getPublicKey(privateKey); - - const storeWithAsymEncoder = new AsymEncoder( - asymTopic, - publicKey, - undefined, - false - ); - const storeWithSymEncoder = new SymEncoder( - symTopic, - symKey, - undefined, - false - ); - - const dontStoreWithAsymEncoder = new AsymEncoder( - asymTopic, - publicKey, - undefined, - true - ); - const dontStoreWithSymEncoder = new SymEncoder( - symTopic, - symKey, - undefined, - true - ); - - const storeEncoder = new EncoderV0(TestContentTopic, false); - const storeUnreadableEncoder = new EncoderV0(TestContentTopic, true); - - const asymDecoder = new AsymDecoder(asymTopic, privateKey); - const symDecoder = new SymDecoder(symTopic, symKey); - - const [waku1, waku2, nimWakuMultiaddr] = await Promise.all([ - createFullNode({ - staticNoiseKey: NOISE_KEY_1, - }).then((waku) => waku.start().then(() => waku)), - createFullNode({ - staticNoiseKey: NOISE_KEY_2, - }).then((waku) => waku.start().then(() => waku)), - nwaku.getMultiaddrWithId(), - ]); - - log("Waku nodes created"); - - await Promise.all([ - waku1.dial(nimWakuMultiaddr), - waku2.dial(nimWakuMultiaddr), - ]); - - log("Waku nodes connected to nwaku"); - - await waitForRemotePeer(waku1, [Protocols.LightPush]); - - log("Sending messages using light push"); - await Promise.all([ - waku1.lightPush.push(storeWithAsymEncoder, asymMsg), - waku1.lightPush.push(storeWithSymEncoder, symMsg), - waku1.lightPush.push(dontStoreWithAsymEncoder, asymMsg), - waku1.lightPush.push(dontStoreWithSymEncoder, symMsg), - waku1.lightPush.push(TestEncoder, clearMsg), - waku1.lightPush.push(storeEncoder, storeReadableMsg), - waku1.lightPush.push(storeUnreadableEncoder, storeUnreadableMsg), - ]); - - await waitForRemotePeer(waku2, [Protocols.Store]); - - const messages: DecodedMessage[] = []; - log("Retrieve messages from store"); - - for await (const msgPromises of waku2.store.queryGenerator([ - asymDecoder, - symDecoder, - TestDecoder, - ])) { - for (const promise of msgPromises) { - const msg = await promise; - if (msg) { - messages.push(msg); - } - } - } - - // Messages are ordered from oldest to latest within a page (1 page query) - expect(bytesToUtf8(messages[0].payload!)).to.eq(asymText); - expect(bytesToUtf8(messages[1].payload!)).to.eq(symText); - expect(bytesToUtf8(messages[2].payload!)).to.eq(clearText); - expect(bytesToUtf8(messages[3].payload!)).to.eq(storeReadableText); - expect(messages?.length).eq(4); - - // check for ephemeral - expect(messages[0].ephemeral).to.be.false; - expect(messages[1].ephemeral).to.be.false; - expect(messages[2].ephemeral).to.be.false; - expect(messages[3].ephemeral).to.be.false; - - !!waku1 && waku1.stop().catch((e) => console.log("Waku failed to stop", e)); - !!waku2 && waku2.stop().catch((e) => console.log("Waku failed to stop", e)); - }); - it("Ordered callback, using start and end time", async function () { this.timeout(20000); @@ -599,6 +465,7 @@ describe("Waku Store", () => { }) ) ).to.be.true; + await delay(1); // to ensure each timestamp is unique. } waku = await createFullNode({ diff --git a/packages/tests/tests/waku.node.spec.ts b/packages/tests/tests/waku.node.spec.ts index 4d8def7b4d..640106ea16 100644 --- a/packages/tests/tests/waku.node.spec.ts +++ b/packages/tests/tests/waku.node.spec.ts @@ -1,6 +1,6 @@ +import { bootstrap } from "@libp2p/bootstrap"; import type { PeerId } from "@libp2p/interface-peer-id"; import { bytesToUtf8, utf8ToBytes } from "@waku/byte-utils"; -import { PeerDiscoveryStaticPeers } from "@waku/core/lib/peer_discovery_static_list"; import { waitForRemotePeer } from "@waku/core/lib/wait_for_remote_peer"; import { createLightNode, createPrivacyNode } from "@waku/create"; import type { @@ -71,7 +71,7 @@ describe("Waku Dial [node only]", function () { waku = await createLightNode({ staticNoiseKey: NOISE_KEY_1, libp2p: { - peerDiscovery: [new PeerDiscoveryStaticPeers([multiAddrWithId])], + peerDiscovery: [bootstrap({ list: [multiAddrWithId.toString()] })], }, }); await waku.start(); @@ -94,12 +94,12 @@ describe("Waku Dial [node only]", function () { nwaku = new Nwaku(makeLogFileName(this)); await nwaku.start(); + const nwakuMa = await nwaku.getMultiaddrWithId(); + waku = await createLightNode({ staticNoiseKey: NOISE_KEY_1, libp2p: { - peerDiscovery: [ - new PeerDiscoveryStaticPeers([await nwaku.getMultiaddrWithId()]), - ], + peerDiscovery: [bootstrap({ list: [nwakuMa.toString()] })], }, }); await waku.start(); @@ -140,10 +140,11 @@ describe("Decryption Keys", () => { }).then((waku) => waku.start().then(() => waku)), ]); - waku1.addPeerToAddressBook( + await waku1.libp2p.peerStore.addressBook.set( waku2.libp2p.peerId, waku2.libp2p.getMultiaddrs() ); + await waku1.dial(waku2.libp2p.peerId); await Promise.all([ waitForRemotePeer(waku1, [Protocols.Relay]),