From 0e06d97715163d7af8a761c9c3df1d6dda156e3c Mon Sep 17 00:00:00 2001 From: Alex Potsides Date: Wed, 11 Sep 2024 11:53:13 +0100 Subject: [PATCH] feat!: update to libp2p@2.x.x (#273) Incorporates API changes appearing in libp2p@2.x.x. BREAKING CHANGE: can only be used with libp2p@2.x.x --- package.json | 9 +- packages/libp2p-daemon-client/package.json | 15 +- packages/libp2p-daemon-client/src/dht.ts | 57 +- packages/libp2p-daemon-client/src/index.ts | 50 +- packages/libp2p-daemon-client/src/pubsub.ts | 29 +- packages/libp2p-daemon-protocol/package.json | 7 +- packages/libp2p-daemon-server/package.json | 14 +- packages/libp2p-daemon-server/src/dht.ts | 6 +- packages/libp2p-daemon-server/src/index.ts | 25 +- packages/libp2p-daemon-server/src/pubsub.ts | 7 +- packages/libp2p-daemon/package.json | 3 +- .../@chainsafe+libp2p-gossipsub+13.2.0.patch | 6447 +++++++++++++++++ 12 files changed, 6566 insertions(+), 103 deletions(-) create mode 100644 patches/@chainsafe+libp2p-gossipsub+13.2.0.patch diff --git a/package.json b/package.json index 5eb35c53..679c8b28 100644 --- a/package.json +++ b/package.json @@ -117,13 +117,16 @@ "lint": "aegir run lint", "dep-check": "aegir run dep-check", "release": "run-s build docs:no-publish npm:release docs", - "npm:release": "aegir release", + "npm:release": "aegir run release --concurrency 1", "docs": "aegir docs", - "docs:no-publish": "aegir docs --publish false" + "docs:no-publish": "aegir docs --publish false", + "postinstall": "patch-package && rm -rf node_modules/@chainsafe/libp2p-gossipsub/node_modules" }, "dependencies": { "aegir": "^44.1.0", - "npm-run-all": "^4.1.5" + "npm-run-all": "^4.1.5", + "patch-package": "^8.0.0", + "rimraf": "^6.0.1" }, "workspaces": [ "packages/*" diff --git a/packages/libp2p-daemon-client/package.json b/packages/libp2p-daemon-client/package.json index e0a38876..5ae7172e 100644 --- a/packages/libp2p-daemon-client/package.json +++ b/packages/libp2p-daemon-client/package.json @@ -46,14 +46,15 @@ "build": "aegir build", "pretest": "npm run build", "test": "aegir test -t node", - "test:node": "aegir test -t node" + "test:node": "aegir test -t node", + "release": "aegir release" }, "dependencies": { "@libp2p/daemon-protocol": "^6.0.0", - "@libp2p/interface": "^1.1.2", - "@libp2p/logger": "^4.0.5", - "@libp2p/peer-id": "^4.0.5", - "@libp2p/tcp": "^9.0.13", + "@libp2p/interface": "^2.0.0", + "@libp2p/logger": "^5.0.0", + "@libp2p/peer-id": "^5.0.0", + "@libp2p/tcp": "^10.0.0", "@multiformats/multiaddr": "^12.1.14", "it-protobuf-stream": "^1.1.2", "multiformats": "^13.0.1" @@ -61,8 +62,8 @@ "devDependencies": { "@chainsafe/libp2p-gossipsub": "^13.0.0", "@libp2p/daemon-server": "^7.0.0", - "@libp2p/interface-compliance-tests": "^5.2.0", - "@libp2p/kad-dht": "^12.0.5", + "@libp2p/interface-compliance-tests": "^6.0.0", + "@libp2p/kad-dht": "^13.0.0", "aegir": "^44.1.0", "it-all": "^3.0.4", "it-pipe": "^3.0.1", diff --git a/packages/libp2p-daemon-client/src/dht.ts b/packages/libp2p-daemon-client/src/dht.ts index dc171624..bbf041b3 100644 --- a/packages/libp2p-daemon-client/src/dht.ts +++ b/packages/libp2p-daemon-client/src/dht.ts @@ -4,13 +4,14 @@ import { DHTRequest, DHTResponse } from '@libp2p/daemon-protocol' -import { CodeError } from '@libp2p/interface' +import { InvalidMessageError, InvalidParametersError, ProtocolError } from '@libp2p/interface' import { isPeerId, type PeerId, type PeerInfo } from '@libp2p/interface' import { logger } from '@libp2p/logger' -import { peerIdFromBytes } from '@libp2p/peer-id' +import { peerIdFromMultihash } from '@libp2p/peer-id' import { multiaddr } from '@multiformats/multiaddr' import { CID } from 'multiformats/cid' -import type { DaemonClient } from './index.js' +import * as Digest from 'multiformats/hashes/digest' +import { OperationFailedError, type DaemonClient } from './index.js' const log = logger('libp2p:daemon-client:dht') @@ -26,11 +27,11 @@ export class DHT { */ async put (key: Uint8Array, value: Uint8Array): Promise { if (!(key instanceof Uint8Array)) { - throw new CodeError('invalid key received', 'ERR_INVALID_KEY') + throw new InvalidParametersError('invalid key received') } if (!(value instanceof Uint8Array)) { - throw new CodeError('value received is not a Uint8Array', 'ERR_INVALID_VALUE') + throw new InvalidParametersError('value received is not a Uint8Array') } const sh = await this.client.send({ @@ -49,7 +50,7 @@ export class DHT { await sh.unwrap().close() if (response.type !== Response.Type.OK) { - throw new CodeError(response.error?.msg ?? 'DHT put failed', 'ERR_DHT_PUT_FAILED') + throw new ProtocolError(response.error?.msg ?? 'DHT put failed') } } @@ -58,7 +59,7 @@ export class DHT { */ async get (key: Uint8Array): Promise { if (!(key instanceof Uint8Array)) { - throw new CodeError('invalid key received', 'ERR_INVALID_KEY') + throw new InvalidParametersError('invalid key received') } const sh = await this.client.send({ @@ -74,11 +75,11 @@ export class DHT { await sh.unwrap().close() if (response.type !== Response.Type.OK) { - throw new CodeError(response.error?.msg ?? 'DHT get failed', 'ERR_DHT_GET_FAILED') + throw new OperationFailedError(response.error?.msg ?? 'DHT get failed') } if (response.dht?.value == null) { - throw new CodeError('Invalid DHT get response', 'ERR_DHT_GET_FAILED') + throw new OperationFailedError('Invalid DHT get response') } return response.dht.value @@ -89,14 +90,14 @@ export class DHT { */ async findPeer (peerId: PeerId): Promise { if (!isPeerId(peerId)) { - throw new CodeError('invalid peer id received', 'ERR_INVALID_PEER_ID') + throw new InvalidParametersError('invalid peer id received') } const sh = await this.client.send({ type: Request.Type.DHT, dht: { type: DHTRequest.Type.FIND_PEER, - peer: peerId.toBytes() + peer: peerId.toMultihash().bytes } }) @@ -105,15 +106,15 @@ export class DHT { await sh.unwrap().close() if (response.type !== Response.Type.OK) { - throw new CodeError(response.error?.msg ?? 'DHT find peer failed', 'ERR_DHT_FIND_PEER_FAILED') + throw new OperationFailedError(response.error?.msg ?? 'DHT find peer failed') } if (response.dht?.peer?.addrs == null) { - throw new CodeError('Invalid response', 'ERR_DHT_FIND_PEER_FAILED') + throw new OperationFailedError('Invalid response') } return { - id: peerIdFromBytes(response.dht.peer.id), + id: peerIdFromMultihash(Digest.decode(response.dht.peer.id)), multiaddrs: response.dht.peer.addrs.map((a) => multiaddr(a)) } } @@ -123,7 +124,7 @@ export class DHT { */ async provide (cid: CID): Promise { if (cid == null || CID.asCID(cid) == null) { - throw new CodeError('invalid cid received', 'ERR_INVALID_CID') + throw new InvalidParametersError('invalid cid received') } const sh = await this.client.send({ @@ -139,7 +140,7 @@ export class DHT { await sh.unwrap().close() if (response.type !== Response.Type.OK) { - throw new CodeError(response.error?.msg ?? 'DHT provide failed', 'ERR_DHT_PROVIDE_FAILED') + throw new OperationFailedError(response.error?.msg ?? 'DHT provide failed') } } @@ -148,7 +149,7 @@ export class DHT { */ async * findProviders (cid: CID, count: number = 1): AsyncIterable { if (cid == null || CID.asCID(cid) == null) { - throw new CodeError('invalid cid received', 'ERR_INVALID_CID') + throw new InvalidParametersError('invalid cid received') } const sh = await this.client.send({ @@ -165,7 +166,7 @@ export class DHT { if (response.type !== Response.Type.OK) { await sh.unwrap().close() - throw new CodeError(response.error?.msg ?? 'DHT find providers failed', 'ERR_DHT_FIND_PROVIDERS_FAILED') + throw new OperationFailedError(response.error?.msg ?? 'DHT find providers failed') } while (true) { @@ -180,13 +181,13 @@ export class DHT { // Stream values if (dhtResponse.type === DHTResponse.Type.VALUE && dhtResponse.peer?.addrs != null) { yield { - id: peerIdFromBytes(dhtResponse.peer.id), + id: peerIdFromMultihash(Digest.decode(dhtResponse.peer.id)), multiaddrs: dhtResponse.peer.addrs.map((a) => multiaddr(a)) } } else { // Unexpected message received await sh.unwrap().close() - throw new CodeError('unexpected message received', 'ERR_UNEXPECTED_MESSAGE_RECEIVED') + throw new ProtocolError('unexpected message received') } } } @@ -196,7 +197,7 @@ export class DHT { */ async * getClosestPeers (key: Uint8Array): AsyncIterable { if (!(key instanceof Uint8Array)) { - throw new CodeError('invalid key received', 'ERR_INVALID_KEY') + throw new InvalidParametersError('invalid key received') } const sh = await this.client.send({ @@ -212,7 +213,7 @@ export class DHT { if (response.type !== Response.Type.OK) { await sh.unwrap().close() - throw new CodeError(response.error?.msg ?? 'DHT find providers failed', 'ERR_DHT_FIND_PROVIDERS_FAILED') + throw new OperationFailedError(response.error?.msg ?? 'DHT find providers failed') } while (true) { @@ -226,7 +227,7 @@ export class DHT { // Stream values if (dhtResponse.type === DHTResponse.Type.VALUE && dhtResponse.value != null) { - const peerId = peerIdFromBytes(dhtResponse.value) + const peerId = peerIdFromMultihash(Digest.decode(dhtResponse.value)) yield { id: peerId, @@ -235,7 +236,7 @@ export class DHT { } else { // Unexpected message received await sh.unwrap().close() - throw new CodeError('unexpected message received', 'ERR_UNEXPECTED_MESSAGE_RECEIVED') + throw new InvalidMessageError('unexpected message received') } } } @@ -245,14 +246,14 @@ export class DHT { */ async getPublicKey (peerId: PeerId): Promise { if (!isPeerId(peerId)) { - throw new CodeError('invalid peer id received', 'ERR_INVALID_PEER_ID') + throw new InvalidParametersError('invalid peer id received') } const sh = await this.client.send({ type: Request.Type.DHT, dht: { type: DHTRequest.Type.GET_PUBLIC_KEY, - peer: peerId.toBytes() + peer: peerId.toMultihash().bytes } }) @@ -261,11 +262,11 @@ export class DHT { await sh.unwrap().close() if (response.type !== Response.Type.OK) { - throw new CodeError(response.error?.msg ?? 'DHT get public key failed', 'ERR_DHT_GET_PUBLIC_KEY_FAILED') + throw new OperationFailedError(response.error?.msg ?? 'DHT get public key failed') } if (response.dht == null) { - throw new CodeError('Invalid response', 'ERR_DHT_GET_PUBLIC_KEY_FAILED') + throw new InvalidMessageError('Invalid response') } return response.dht.value diff --git a/packages/libp2p-daemon-client/src/index.ts b/packages/libp2p-daemon-client/src/index.ts index 6383a653..200a0447 100644 --- a/packages/libp2p-daemon-client/src/index.ts +++ b/packages/libp2p-daemon-client/src/index.ts @@ -1,12 +1,13 @@ import { type PSMessage, Request, Response, StreamInfo } from '@libp2p/daemon-protocol' import { StreamHandler } from '@libp2p/daemon-protocol/stream-handler' import { passThroughUpgrader } from '@libp2p/daemon-protocol/upgrader' -import { CodeError, isPeerId } from '@libp2p/interface' +import { InvalidParametersError, isPeerId } from '@libp2p/interface' import { defaultLogger, logger } from '@libp2p/logger' -import { peerIdFromBytes } from '@libp2p/peer-id' +import { peerIdFromMultihash } from '@libp2p/peer-id' import { tcp } from '@libp2p/tcp' import { multiaddr, isMultiaddr } from '@multiformats/multiaddr' import { pbStream, type ProtobufStream } from 'it-protobuf-stream' +import * as Digest from 'multiformats/hashes/digest' import { DHT } from './dht.js' import { Pubsub } from './pubsub.js' import type { Stream, PeerId, MultiaddrConnection, PeerInfo, Transport } from '@libp2p/interface' @@ -15,6 +16,13 @@ import type { CID } from 'multiformats/cid' const log = logger('libp2p:daemon-client') +export class OperationFailedError extends Error { + constructor (message = 'Operation failed') { + super(message) + this.name = 'OperationFailedError' + } +} + class Client implements DaemonClient { private readonly multiaddr: Multiaddr public dht: DHT @@ -66,23 +74,23 @@ class Client implements DaemonClient { */ async connect (peerId: PeerId, addrs: Multiaddr[]): Promise { if (!isPeerId(peerId)) { - throw new CodeError('invalid peer id received', 'ERR_INVALID_PEER_ID') + throw new InvalidParametersError('invalid peer id received') } if (!Array.isArray(addrs)) { - throw new CodeError('addrs received are not in an array', 'ERR_INVALID_ADDRS_TYPE') + throw new InvalidParametersError('addrs received are not in an array') } addrs.forEach((addr) => { if (!isMultiaddr(addr)) { - throw new CodeError('received an address that is not a multiaddr', 'ERR_NO_MULTIADDR_RECEIVED') + throw new InvalidParametersError('received an address that is not a multiaddr') } }) const sh = await this.send({ type: Request.Type.CONNECT, connect: { - peer: peerId.toBytes(), + peer: peerId.toMultihash().bytes, addrs: addrs.map((a) => a.bytes) } }) @@ -91,7 +99,7 @@ class Client implements DaemonClient { if (response.type !== Response.Type.OK) { const errResponse = response.error ?? { msg: 'unspecified' } - throw new CodeError(errResponse.msg ?? 'unspecified', 'ERR_CONNECT_FAILED') + throw new OperationFailedError(errResponse.msg ?? 'unspecified') } await sh.unwrap().close() @@ -114,14 +122,14 @@ class Client implements DaemonClient { const response = await sh.read(Response) if (response.type !== Response.Type.OK) { - throw new CodeError(response.error?.msg ?? 'Identify failed', 'ERR_IDENTIFY_FAILED') + throw new OperationFailedError(response.error?.msg ?? 'Identify failed') } if (response.identify?.addrs == null) { - throw new CodeError('Invalid response', 'ERR_IDENTIFY_FAILED') + throw new OperationFailedError('Invalid response') } - const peerId = peerIdFromBytes(response.identify?.id) + const peerId = peerIdFromMultihash(Digest.decode(response.identify?.id)) const addrs = response.identify.addrs.map((a) => multiaddr(a)) await sh.unwrap().close() @@ -140,12 +148,12 @@ class Client implements DaemonClient { const response = await sh.read(Response) if (response.type !== Response.Type.OK) { - throw new CodeError(response.error?.msg ?? 'List peers failed', 'ERR_LIST_PEERS_FAILED') + throw new OperationFailedError(response.error?.msg ?? 'List peers failed') } await sh.unwrap().close() - return response.peers.map((peer) => peerIdFromBytes(peer.id)) + return response.peers.map((peer) => peerIdFromMultihash(Digest.decode(peer.id))) } /** @@ -153,17 +161,17 @@ class Client implements DaemonClient { */ async openStream (peerId: PeerId, protocol: string): Promise { if (!isPeerId(peerId)) { - throw new CodeError('invalid peer id received', 'ERR_INVALID_PEER_ID') + throw new InvalidParametersError('invalid peer id received') } if (typeof protocol !== 'string') { - throw new CodeError('invalid protocol received', 'ERR_INVALID_PROTOCOL') + throw new InvalidParametersError('invalid protocol received') } const sh = await this.send({ type: Request.Type.STREAM_OPEN, streamOpen: { - peer: peerId.toBytes(), + peer: peerId.toMultihash().bytes, proto: [protocol] } }) @@ -172,7 +180,7 @@ class Client implements DaemonClient { if (response.type !== Response.Type.OK) { await sh.unwrap().close() - throw new CodeError(response.error?.msg ?? 'Open stream failed', 'ERR_OPEN_STREAM_FAILED') + throw new OperationFailedError(response.error?.msg ?? 'Open stream failed') } return sh.unwrap() @@ -183,7 +191,7 @@ class Client implements DaemonClient { */ async registerStreamHandler (protocol: string, handler: StreamHandlerFunction): Promise { if (typeof protocol !== 'string') { - throw new CodeError('invalid protocol received', 'ERR_INVALID_PROTOCOL') + throw new InvalidParametersError('invalid protocol received') } // open a tcp port, pipe any data from it to the handler function @@ -199,13 +207,13 @@ class Client implements DaemonClient { const message = await sh.read() if (message == null) { - throw new CodeError('Could not read open stream response', 'ERR_OPEN_STREAM_FAILED') + throw new OperationFailedError('Could not read open stream response') } const response = StreamInfo.decode(message) if (response.proto !== protocol) { - throw new CodeError('Incorrect protocol', 'ERR_OPEN_STREAM_FAILED') + throw new OperationFailedError('Incorrect protocol') } // @ts-expect-error because we are using a passthrough upgrader, this is a MultiaddrConnection @@ -230,7 +238,7 @@ class Client implements DaemonClient { const address = listener.getAddrs()[0] if (address == null) { - throw new CodeError('Could not listen on port', 'ERR_REGISTER_STREAM_HANDLER_FAILED') + throw new OperationFailedError('Could not listen on port') } const sh = await this.send({ @@ -246,7 +254,7 @@ class Client implements DaemonClient { await sh.unwrap().close() if (response.type !== Response.Type.OK) { - throw new CodeError(response.error?.msg ?? 'Register stream handler failed', 'ERR_REGISTER_STREAM_HANDLER_FAILED') + throw new OperationFailedError(response.error?.msg ?? 'Register stream handler failed') } } } diff --git a/packages/libp2p-daemon-client/src/pubsub.ts b/packages/libp2p-daemon-client/src/pubsub.ts index d14a6655..2685d7f8 100644 --- a/packages/libp2p-daemon-client/src/pubsub.ts +++ b/packages/libp2p-daemon-client/src/pubsub.ts @@ -4,9 +4,10 @@ import { PSRequest, PSMessage } from '@libp2p/daemon-protocol' -import { CodeError } from '@libp2p/interface' -import { peerIdFromBytes } from '@libp2p/peer-id' -import type { DaemonClient, Subscription } from './index.js' +import { InvalidParametersError } from '@libp2p/interface' +import { peerIdFromMultihash } from '@libp2p/peer-id' +import * as Digest from 'multiformats/hashes/digest' +import { OperationFailedError, type DaemonClient, type Subscription } from './index.js' import type { PeerId } from '@libp2p/interface' export class Pubsub { @@ -34,11 +35,11 @@ export class Pubsub { await sh.unwrap().close() if (response.type !== Response.Type.OK) { - throw new CodeError(response.error?.msg ?? 'Pubsub get topics failed', 'ERR_PUBSUB_GET_TOPICS_FAILED') + throw new OperationFailedError(response.error?.msg ?? 'Pubsub get topics failed') } if (response.pubsub?.topics == null) { - throw new CodeError('Invalid response', 'ERR_PUBSUB_GET_TOPICS_FAILED') + throw new OperationFailedError('Invalid response') } return response.pubsub.topics @@ -49,11 +50,11 @@ export class Pubsub { */ async publish (topic: string, data: Uint8Array): Promise { if (typeof topic !== 'string') { - throw new CodeError('invalid topic received', 'ERR_INVALID_TOPIC') + throw new InvalidParametersError('invalid topic received') } if (!(data instanceof Uint8Array)) { - throw new CodeError('data received is not a Uint8Array', 'ERR_INVALID_DATA') + throw new InvalidParametersError('data received is not a Uint8Array') } const sh = await this.client.send({ @@ -70,7 +71,7 @@ export class Pubsub { await sh.unwrap().close() if (response.type !== Response.Type.OK) { - throw new CodeError(response.error?.msg ?? 'Pubsub publish failed', 'ERR_PUBSUB_PUBLISH_FAILED') + throw new OperationFailedError(response.error?.msg ?? 'Pubsub publish failed') } } @@ -79,7 +80,7 @@ export class Pubsub { */ async subscribe (topic: string): Promise { if (typeof topic !== 'string') { - throw new CodeError('invalid topic received', 'ERR_INVALID_TOPIC') + throw new InvalidParametersError('invalid topic received') } const sh = await this.client.send({ @@ -93,7 +94,7 @@ export class Pubsub { const response = await sh.read(Response) if (response.type !== Response.Type.OK) { - throw new CodeError(response.error?.msg ?? 'Pubsub publish failed', 'ERR_PUBSUB_PUBLISH_FAILED') + throw new OperationFailedError(response.error?.msg ?? 'Pubsub publish failed') } let subscribed = true @@ -115,7 +116,7 @@ export class Pubsub { async getSubscribers (topic: string): Promise { if (typeof topic !== 'string') { - throw new CodeError('invalid topic received', 'ERR_INVALID_TOPIC') + throw new InvalidParametersError('invalid topic received') } const sh = await this.client.send({ @@ -131,13 +132,13 @@ export class Pubsub { await sh.unwrap().close() if (response.type !== Response.Type.OK) { - throw new CodeError(response.error?.msg ?? 'Pubsub get subscribers failed', 'ERR_PUBSUB_GET_SUBSCRIBERS_FAILED') + throw new OperationFailedError(response.error?.msg ?? 'Pubsub get subscribers failed') } if (response.pubsub?.topics == null) { - throw new CodeError('Invalid response', 'ERR_PUBSUB_GET_SUBSCRIBERS_FAILED') + throw new OperationFailedError('Invalid response') } - return response.pubsub.peerIDs.map(buf => peerIdFromBytes(buf)) + return response.pubsub.peerIDs.map(buf => peerIdFromMultihash(Digest.decode(buf))) } } diff --git a/packages/libp2p-daemon-protocol/package.json b/packages/libp2p-daemon-protocol/package.json index a8a3d030..5901c4e2 100644 --- a/packages/libp2p-daemon-protocol/package.json +++ b/packages/libp2p-daemon-protocol/package.json @@ -66,11 +66,12 @@ "lint": "aegir lint", "generate": "protons ./src/index.proto", "build": "aegir build", - "dep-check": "aegir dep-check" + "dep-check": "aegir dep-check", + "release": "aegir release" }, "dependencies": { - "@libp2p/interface": "^1.1.2", - "@libp2p/logger": "^4.0.5", + "@libp2p/interface": "^2.0.0", + "@libp2p/logger": "^5.0.0", "it-length-prefixed-stream": "^1.1.6", "protons-runtime": "^5.4.0", "uint8arraylist": "^2.4.8" diff --git a/packages/libp2p-daemon-server/package.json b/packages/libp2p-daemon-server/package.json index d0f0b672..486f2f05 100644 --- a/packages/libp2p-daemon-server/package.json +++ b/packages/libp2p-daemon-server/package.json @@ -46,16 +46,18 @@ "build": "aegir build", "pretest": "npm run build", "test": "aegir test -t node", - "test:node": "aegir test -t node" + "test:node": "aegir test -t node", + "release": "aegir release" }, "dependencies": { "@chainsafe/libp2p-gossipsub": "^13.0.0", + "@libp2p/crypto": "^5.0.0", "@libp2p/daemon-protocol": "^6.0.0", - "@libp2p/interface": "^1.1.2", - "@libp2p/kad-dht": "^12.0.5", - "@libp2p/logger": "^4.0.5", - "@libp2p/peer-id": "^4.0.5", - "@libp2p/tcp": "^9.0.13", + "@libp2p/interface": "^2.0.0", + "@libp2p/kad-dht": "^13.0.0", + "@libp2p/logger": "^5.0.0", + "@libp2p/peer-id": "^5.0.0", + "@libp2p/tcp": "^10.0.0", "@multiformats/multiaddr": "^12.1.14", "it-drain": "^3.0.5", "it-length-prefixed": "^9.0.4", diff --git a/packages/libp2p-daemon-server/src/dht.ts b/packages/libp2p-daemon-server/src/dht.ts index 4ecb32a4..57536dbc 100644 --- a/packages/libp2p-daemon-server/src/dht.ts +++ b/packages/libp2p-daemon-server/src/dht.ts @@ -46,7 +46,7 @@ export class DHTOperations { if (event.name === 'PEER_RESPONSE') { yield * event.closer.map(peer => DHTResponse.encode({ type: DHTResponse.Type.VALUE, - value: peer.id.toBytes() + value: peer.id.toMultihash().bytes })) } } @@ -97,7 +97,7 @@ export class DHTOperations { dht: { type: DHTResponse.Type.VALUE, peer: { - id: event.peer.id.toBytes(), + id: event.peer.id.toMultihash().bytes, addrs: event.peer.multiaddrs.map(m => m.bytes) } } @@ -131,7 +131,7 @@ export class DHTOperations { yield DHTResponse.encode({ type: DHTResponse.Type.VALUE, peer: { - id: provider.id.toBytes(), + id: provider.id.toMultihash().bytes, addrs: (provider.multiaddrs ?? []).map(m => m.bytes) } }) diff --git a/packages/libp2p-daemon-server/src/index.ts b/packages/libp2p-daemon-server/src/index.ts index a7812f74..177afb8c 100644 --- a/packages/libp2p-daemon-server/src/index.ts +++ b/packages/libp2p-daemon-server/src/index.ts @@ -10,7 +10,7 @@ import { } from '@libp2p/daemon-protocol' import { passThroughUpgrader } from '@libp2p/daemon-protocol/upgrader' import { defaultLogger, logger } from '@libp2p/logger' -import { peerIdFromBytes } from '@libp2p/peer-id' +import { peerIdFromMultihash } from '@libp2p/peer-id' import { tcp } from '@libp2p/tcp' import { multiaddr, protocols } from '@multiformats/multiaddr' import * as lp from 'it-length-prefixed' @@ -18,6 +18,7 @@ import { lpStream } from 'it-length-prefixed-stream' import { pipe } from 'it-pipe' import { pbStream } from 'it-protobuf-stream' import { CID } from 'multiformats/cid' +import * as Digest from 'multiformats/hashes/digest' import { DHTOperations } from './dht.js' import { PubSubOperations } from './pubsub.js' import { ErrorResponse, OkResponse } from './responses.js' @@ -87,7 +88,7 @@ export class Server implements Libp2pServer { const peer = request.connect.peer const addrs = request.connect.addrs.map((a) => multiaddr(a)) - const peerId = peerIdFromBytes(peer) + const peerId = peerIdFromMultihash(Digest.decode(peer)) log('connect - adding multiaddrs %a to peer %p', addrs, peerId) await this.libp2p.peerStore.merge(peerId, { @@ -107,21 +108,19 @@ export class Server implements Libp2pServer { } const { peer, proto } = request.streamOpen - const peerId = peerIdFromBytes(peer) + const peerId = peerIdFromMultihash(Digest.decode(peer)) log('openStream - dial %p', peerId) const connection = await this.libp2p.dial(peerId) log('openStream - open stream for protocol %s', proto) const stream = await connection.newStream(proto, { - runOnTransientConnection: true, - // @ts-expect-error this has not been released yet runOnLimitedConnection: true }) return { streamInfo: { - peer: peerId.toBytes(), + peer: peerId.toMultihash().bytes, addr: connection.remoteAddr.bytes, proto: stream.protocol ?? '' }, @@ -155,7 +154,7 @@ export class Server implements Libp2pServer { }) const message = StreamInfo.encode({ - peer: connection.remotePeer.toBytes(), + peer: connection.remotePeer.toMultihash().bytes, addr: connection.remoteAddr.bytes, proto: stream.protocol ?? '' }) @@ -194,8 +193,6 @@ export class Server implements Libp2pServer { } }) }, { - runOnTransientConnection: true, - // @ts-expect-error this has not been released yet runOnLimitedConnection: true }) } @@ -257,7 +254,7 @@ export class Server implements Libp2pServer { throw new Error('Invalid request') } - const peerId = peerIdFromBytes(request.id) // eslint-disable-line no-case-declarations + const peerId = peerIdFromMultihash(Digest.decode(request.id)) // eslint-disable-line no-case-declarations const peer = await this.libp2p.peerStore.get(peerId) // eslint-disable-line no-case-declarations const protos = peer.protocols // eslint-disable-line no-case-declarations yield OkResponse({ peerStore: { protos } }) @@ -331,7 +328,7 @@ export class Server implements Libp2pServer { throw new Error('Invalid request') } - yield * this.dhtOperations.findPeer(peerIdFromBytes(request.peer)) + yield * this.dhtOperations.findPeer(peerIdFromMultihash(Digest.decode(request.peer))) return case DHTRequest.Type.FIND_PROVIDERS: if (request.cid == null) { @@ -359,7 +356,7 @@ export class Server implements Libp2pServer { throw new Error('Invalid request') } - yield * this.dhtOperations.getPublicKey(peerIdFromBytes(request.peer)) + yield * this.dhtOperations.getPublicKey(peerIdFromMultihash(Digest.decode(request.peer))) return case DHTRequest.Type.GET_VALUE: if (request.key == null) { @@ -414,7 +411,7 @@ export class Server implements Libp2pServer { await pb.write({ type: Response.Type.OK, identify: { - id: daemon.libp2p.peerId.toBytes(), + id: daemon.libp2p.peerId.toMultihash().bytes, addrs: daemon.libp2p.getMultiaddrs().map(ma => ma.decapsulateCode(protocols('p2p').code)).map(m => m.bytes) } }, Response) @@ -436,7 +433,7 @@ export class Server implements Libp2pServer { seen.add(peerId) peers.push({ - id: connection.remotePeer.toBytes(), + id: connection.remotePeer.toMultihash().bytes, addrs: [connection.remoteAddr.bytes] }) } diff --git a/packages/libp2p-daemon-server/src/pubsub.ts b/packages/libp2p-daemon-server/src/pubsub.ts index c59d1424..ba19fcca 100644 --- a/packages/libp2p-daemon-server/src/pubsub.ts +++ b/packages/libp2p-daemon-server/src/pubsub.ts @@ -1,5 +1,6 @@ /* eslint max-depth: ["error", 6] */ +import { publicKeyToProtobuf } from '@libp2p/crypto/keys' import { PSMessage } from '@libp2p/daemon-protocol' @@ -52,12 +53,12 @@ export class PubSubOperations { if (msg.type === 'signed') { onMessage.push(PSMessage.encode({ - from: msg.from.toBytes(), + from: msg.from.toMultihash().bytes, data: msg.data, seqno: msg.sequenceNumber == null ? undefined : uint8ArrayFromString(msg.sequenceNumber.toString(16).padStart(16, '0'), 'base16'), topicIDs: [msg.topic], signature: msg.signature, - key: msg.key + key: publicKeyToProtobuf(msg.key) }).subarray()) } else { onMessage.push(PSMessage.encode({ @@ -90,7 +91,7 @@ export class PubSubOperations { yield OkResponse({ pubsub: { topics: [topic], - peerIDs: this.pubsub.getSubscribers(topic).map(peer => peer.toBytes()) + peerIDs: this.pubsub.getSubscribers(topic).map(peer => peer.toMultihash().bytes) } }) } catch (err: any) { diff --git a/packages/libp2p-daemon/package.json b/packages/libp2p-daemon/package.json index 56ca76c5..e9f096dd 100644 --- a/packages/libp2p-daemon/package.json +++ b/packages/libp2p-daemon/package.json @@ -48,7 +48,8 @@ "dep-check": "aegir dep-check", "build": "aegir build", "test": "aegir test -t node", - "test:node": "aegir test -t node" + "test:node": "aegir test -t node", + "release": "aegir release" }, "dependencies": { "@libp2p/daemon-server": "^7.0.0", diff --git a/patches/@chainsafe+libp2p-gossipsub+13.2.0.patch b/patches/@chainsafe+libp2p-gossipsub+13.2.0.patch new file mode 100644 index 00000000..2bb15803 --- /dev/null +++ b/patches/@chainsafe+libp2p-gossipsub+13.2.0.patch @@ -0,0 +1,6447 @@ +diff --git a/node_modules/@chainsafe/libp2p-gossipsub/dist/index.min.js b/node_modules/@chainsafe/libp2p-gossipsub/dist/index.min.js +index 5736a01..00b6e64 100644 +--- a/node_modules/@chainsafe/libp2p-gossipsub/dist/index.min.js ++++ b/node_modules/@chainsafe/libp2p-gossipsub/dist/index.min.js +@@ -1,10 +1,9 @@ + (function (root, factory) {(typeof module === 'object' && module.exports) ? module.exports = factory() : root.ChainsafeLibp2PGossipsub = factory()}(typeof self !== 'undefined' ? self : this, function () { +-"use strict";var ChainsafeLibp2PGossipsub=(()=>{var Yl=Object.create;var mr=Object.defineProperty;var Xl=Object.getOwnPropertyDescriptor;var Jl=Object.getOwnPropertyNames;var Ql=Object.getPrototypeOf,eu=Object.prototype.hasOwnProperty;var $n=(s,e)=>()=>(e||s((e={exports:{}}).exports,e),e.exports),ue=(s,e)=>{for(var t in e)mr(s,t,{get:e[t],enumerable:!0})},Oo=(s,e,t,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of Jl(e))!eu.call(s,n)&&n!==t&&mr(s,n,{get:()=>e[n],enumerable:!(r=Xl(e,n))||r.enumerable});return s};var jn=(s,e,t)=>(t=s!=null?Yl(Ql(s)):{},Oo(e||!s||!s.__esModule?mr(t,"default",{value:s,enumerable:!0}):t,s)),tu=s=>Oo(mr({},"__esModule",{value:!0}),s);var ma=$n((hm,ga)=>{"use strict";function pa(s,e){for(let t in e)Object.defineProperty(s,t,{value:e[t],enumerable:!0,configurable:!0});return s}function ph(s,e,t){if(!s||typeof s=="string")throw new TypeError("Please pass an Error to err-code");t||(t={}),typeof e=="object"&&(t=e,e=""),e&&(t.code=e);try{return pa(s,t)}catch{t.message=s.message,t.stack=s.stack;let n=function(){};return n.prototype=Object.create(Object.getPrototypeOf(s)),pa(new n,t)}}ga.exports=ph});var Ga=$n((I0,Ha)=>{"use strict";function Q(s,t){var t=t||{};this._capacity=t.capacity,this._head=0,this._tail=0,Array.isArray(s)?this._fromArray(s):(this._capacityMask=3,this._list=new Array(4))}Q.prototype.peekAt=function(e){var t=e;if(t===(t|0)){var r=this.size();if(!(t>=r||t<-r))return t<0&&(t+=r),t=this._head+t&this._capacityMask,this._list[t]}};Q.prototype.get=function(e){return this.peekAt(e)};Q.prototype.peek=function(){if(this._head!==this._tail)return this._list[this._head]};Q.prototype.peekFront=function(){return this.peek()};Q.prototype.peekBack=function(){return this.peekAt(-1)};Object.defineProperty(Q.prototype,"length",{get:function(){return this.size()}});Q.prototype.size=function(){return this._head===this._tail?0:this._headthis._capacity&&this.pop(),this._head1e4&&this._tail<=this._list.length>>>2&&this._shrinkArray(),t}};Q.prototype.push=function(e){if(arguments.length===0)return this.size();var t=this._tail;return this._list[t]=e,this._tail=t+1&this._capacityMask,this._tail===this._head&&this._growArray(),this._capacity&&this.size()>this._capacity&&this.shift(),this._head1e4&&e<=t>>>2&&this._shrinkArray(),r}};Q.prototype.removeOne=function(e){var t=e;if(t===(t|0)&&this._head!==this._tail){var r=this.size(),n=this._list.length;if(!(t>=r||t<-r)){t<0&&(t+=r),t=this._head+t&this._capacityMask;var i=this._list[t],o;if(e0;o--)this._list[t]=this._list[t=t-1+n&this._capacityMask];this._list[t]=void 0,this._head=this._head+1+n&this._capacityMask}else{for(o=r-1-e;o>0;o--)this._list[t]=this._list[t=t+1+n&this._capacityMask];this._list[t]=void 0,this._tail=this._tail-1+n&this._capacityMask}return i}}};Q.prototype.remove=function(e,t){var r=e,n,i=t;if(r===(r|0)&&this._head!==this._tail){var o=this.size(),a=this._list.length;if(!(r>=o||r<-o||t<1)){if(r<0&&(r+=o),t===1||!t)return n=new Array(1),n[0]=this.removeOne(r),n;if(r===0&&r+t>=o)return n=this.toArray(),this.clear(),n;r+t>o&&(t=o-r);var c;for(n=new Array(t),c=0;c0;c--)this._list[r=r+1+a&this._capacityMask]=void 0;return n}if(e===0){for(this._head=this._head+t+a&this._capacityMask,c=t-1;c>0;c--)this._list[r=r+1+a&this._capacityMask]=void 0;return n}if(r0;c--)this.unshift(this._list[r=r-1+a&this._capacityMask]);for(r=this._head-1+a&this._capacityMask;i>0;)this._list[r=r-1+a&this._capacityMask]=void 0,i--;e<0&&(this._tail=r)}else{for(this._tail=r,r=r+t+a&this._capacityMask,c=o-(t+e);c>0;c--)this.push(this._list[r++]);for(r=this._tail;i>0;)this._list[r=r+1+a&this._capacityMask]=void 0,i--}return this._head<2&&this._tail>1e4&&this._tail<=a>>>2&&this._shrinkArray(),n}}};Q.prototype.splice=function(e,t){var r=e;if(r===(r|0)){var n=this.size();if(r<0&&(r+=n),!(r>n))if(arguments.length>2){var i,o,a,c=arguments.length,f=this._list.length,l=2;if(!n||r0&&(this._head=this._head+r+f&this._capacityMask)):(a=this.remove(r,t),this._head=this._head+r+f&this._capacityMask);c>l;)this.unshift(arguments[--c]);for(i=r;i>0;i--)this.unshift(o[i-1])}else{o=new Array(n-(r+t));var u=o.length;for(i=0;ithis._tail){for(c=this._head;c>>=1,this._capacityMask>>>=1};Q.prototype._nextPowerOf2=function(e){var t=Math.log(e)/Math.log(2),r=1<{"use strict";var Xf="[object ArrayBuffer]",yt=class s{static isArrayBuffer(e){return Object.prototype.toString.call(e)===Xf}static toArrayBuffer(e){return this.isArrayBuffer(e)?e:e.byteLength===e.buffer.byteLength||e.byteOffset===0&&e.byteLength===e.buffer.byteLength?e.buffer:this.toUint8Array(e.buffer).slice(e.byteOffset,e.byteOffset+e.byteLength).buffer}static toUint8Array(e){return this.toView(e,Uint8Array)}static toView(e,t){if(e.constructor===t)return e;if(this.isArrayBuffer(e))return new t(e);if(this.isArrayBufferView(e))return new t(e.buffer,e.byteOffset,e.byteLength);throw new TypeError("The provided value is not of type '(ArrayBuffer or ArrayBufferView)'")}static isBufferSource(e){return this.isArrayBufferView(e)||this.isArrayBuffer(e)}static isArrayBufferView(e){return ArrayBuffer.isView(e)||e&&this.isArrayBuffer(e.buffer)}static isEqual(e,t){let r=s.toUint8Array(e),n=s.toUint8Array(t);if(r.length!==n.byteLength)return!1;for(let i=0;in.byteLength).reduce((n,i)=>n+i),t=new Uint8Array(e),r=0;return s.map(n=>new Uint8Array(n)).forEach(n=>{for(let i of n)t[r++]=i}),t.buffer}function rd(s,e){if(!(s&&e)||s.byteLength!==e.byteLength)return!1;let t=new Uint8Array(s),r=new Uint8Array(e);for(let n=0;nqn,gossipsub:()=>Ep,multicodec:()=>xp});var Fo=Symbol.for("@libp2p/peer-id");var qt="StrictSign",rs="StrictNoSign",Be;(function(s){s.Accept="accept",s.Ignore="ignore",s.Reject="reject"})(Be||(Be={}));var T=class extends Error{code;props;constructor(e,t,r){super(e),this.code=t,this.name=r?.name??"CodeError",this.props=r??{}}};var Ho=(s,...e)=>{try{[...e]}catch{}};var br=class extends EventTarget{#e=new Map;constructor(){super(),Ho(1/0,this)}listenerCount(e){let t=this.#e.get(e);return t==null?0:t.length}addEventListener(e,t,r){super.addEventListener(e,t,r);let n=this.#e.get(e);n==null&&(n=[],this.#e.set(e,n)),n.push({callback:t,once:(r!==!0&&r!==!1&&r?.once)??!1})}removeEventListener(e,t,r){super.removeEventListener(e.toString(),t??null,r);let n=this.#e.get(e);n!=null&&(n=n.filter(({callback:i})=>i!==t),this.#e.set(e,n))}dispatchEvent(e){let t=super.dispatchEvent(e),r=this.#e.get(e.type);return r==null||(r=r.filter(({once:n})=>!n),this.#e.set(e.type,r)),t}safeDispatchEvent(e,t={}){return this.dispatchEvent(new su(e,t))}},Zn=class extends Event{detail;constructor(e,t){super(e,t),this.detail=t?.detail}},su=globalThis.CustomEvent??Zn;var Go=Symbol.for("@libp2p/service-capabilities"),Ko=Symbol.for("@libp2p/service-dependencies");var ei={};ue(ei,{base58btc:()=>me,base58flickr:()=>cu});var eg=new Uint8Array(0);function zo(s,e){if(s===e)return!0;if(s.byteLength!==e.byteLength)return!1;for(let t=0;t=255)throw new TypeError("Alphabet too long");for(var t=new Uint8Array(256),r=0;r>>0,A=new Uint8Array(w);b!==_;){for(var y=g[b],x=0,E=w-1;(y!==0||x>>0,A[E]=y%a>>>0,y=y/a>>>0;if(y!==0)throw new Error("Non-zero carry");m=x,b++}for(var B=w-m;B!==w&&A[B]===0;)B++;for(var D=c.repeat(d);B>>0,w=new Uint8Array(_);g[d];){var A=t[g.charCodeAt(d)];if(A===255)return;for(var y=0,x=_-1;(A!==0||y>>0,w[x]=A%256>>>0,A=A/256>>>0;if(A!==0)throw new Error("Non-zero carry");b=y,d++}if(g[d]!==" "){for(var E=_-b;E!==_&&w[E]===0;)E++;for(var B=new Uint8Array(m+(_-E)),D=m;E!==_;)B[D++]=w[E++];return B}}}function p(g){var d=h(g);if(d)return d;throw new Error(`Non-${e} character`)}return{encode:u,decodeUnsafe:h,decode:p}}var nu=ru,iu=nu,jo=iu;var Yn=class{name;prefix;baseEncode;constructor(e,t,r){this.name=e,this.prefix=t,this.baseEncode=r}encode(e){if(e instanceof Uint8Array)return`${this.prefix}${this.baseEncode(e)}`;throw Error("Unknown type, must be binary type")}},Xn=class{name;prefix;baseDecode;prefixCodePoint;constructor(e,t,r){if(this.name=e,this.prefix=t,t.codePointAt(0)===void 0)throw new Error("Invalid prefix character");this.prefixCodePoint=t.codePointAt(0),this.baseDecode=r}decode(e){if(typeof e=="string"){if(e.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify(e)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode(e.slice(this.prefix.length))}else throw Error("Can only multibase decode strings")}or(e){return Zo(this,e)}},Jn=class{decoders;constructor(e){this.decoders=e}or(e){return Zo(this,e)}decode(e){let t=e[0],r=this.decoders[t];if(r!=null)return r.decode(e);throw RangeError(`Unable to decode multibase string ${JSON.stringify(e)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}};function Zo(s,e){return new Jn({...s.decoders??{[s.prefix]:s},...e.decoders??{[e.prefix]:e}})}var Qn=class{name;prefix;baseEncode;baseDecode;encoder;decoder;constructor(e,t,r,n){this.name=e,this.prefix=t,this.baseEncode=r,this.baseDecode=n,this.encoder=new Yn(e,t,r),this.decoder=new Xn(e,t,n)}encode(e){return this.encoder.encode(e)}decode(e){return this.decoder.decode(e)}};function ns({name:s,prefix:e,encode:t,decode:r}){return new Qn(s,e,t,r)}function St({name:s,prefix:e,alphabet:t}){let{encode:r,decode:n}=jo(t,s);return ns({prefix:e,name:s,encode:r,decode:i=>at(n(i))})}function ou(s,e,t,r){let n={};for(let l=0;l=8&&(a-=8,o[f++]=255&c>>a)}if(a>=t||255&c<<8-a)throw new SyntaxError("Unexpected end of data");return o}function au(s,e,t){let r=e[e.length-1]==="=",n=(1<t;)o-=t,i+=e[n&a>>o];if(o!==0&&(i+=e[n&a<lu});var lu=St({prefix:"9",name:"base10",alphabet:"0123456789"});var si={};ue(si,{base16:()=>uu,base16upper:()=>hu});var uu=te({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),hu=te({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4});var ri={};ue(ri,{base2:()=>fu});var fu=te({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1});var ni={};ue(ni,{base256emoji:()=>bu});var Yo=Array.from("\u{1F680}\u{1FA90}\u2604\u{1F6F0}\u{1F30C}\u{1F311}\u{1F312}\u{1F313}\u{1F314}\u{1F315}\u{1F316}\u{1F317}\u{1F318}\u{1F30D}\u{1F30F}\u{1F30E}\u{1F409}\u2600\u{1F4BB}\u{1F5A5}\u{1F4BE}\u{1F4BF}\u{1F602}\u2764\u{1F60D}\u{1F923}\u{1F60A}\u{1F64F}\u{1F495}\u{1F62D}\u{1F618}\u{1F44D}\u{1F605}\u{1F44F}\u{1F601}\u{1F525}\u{1F970}\u{1F494}\u{1F496}\u{1F499}\u{1F622}\u{1F914}\u{1F606}\u{1F644}\u{1F4AA}\u{1F609}\u263A\u{1F44C}\u{1F917}\u{1F49C}\u{1F614}\u{1F60E}\u{1F607}\u{1F339}\u{1F926}\u{1F389}\u{1F49E}\u270C\u2728\u{1F937}\u{1F631}\u{1F60C}\u{1F338}\u{1F64C}\u{1F60B}\u{1F497}\u{1F49A}\u{1F60F}\u{1F49B}\u{1F642}\u{1F493}\u{1F929}\u{1F604}\u{1F600}\u{1F5A4}\u{1F603}\u{1F4AF}\u{1F648}\u{1F447}\u{1F3B6}\u{1F612}\u{1F92D}\u2763\u{1F61C}\u{1F48B}\u{1F440}\u{1F62A}\u{1F611}\u{1F4A5}\u{1F64B}\u{1F61E}\u{1F629}\u{1F621}\u{1F92A}\u{1F44A}\u{1F973}\u{1F625}\u{1F924}\u{1F449}\u{1F483}\u{1F633}\u270B\u{1F61A}\u{1F61D}\u{1F634}\u{1F31F}\u{1F62C}\u{1F643}\u{1F340}\u{1F337}\u{1F63B}\u{1F613}\u2B50\u2705\u{1F97A}\u{1F308}\u{1F608}\u{1F918}\u{1F4A6}\u2714\u{1F623}\u{1F3C3}\u{1F490}\u2639\u{1F38A}\u{1F498}\u{1F620}\u261D\u{1F615}\u{1F33A}\u{1F382}\u{1F33B}\u{1F610}\u{1F595}\u{1F49D}\u{1F64A}\u{1F639}\u{1F5E3}\u{1F4AB}\u{1F480}\u{1F451}\u{1F3B5}\u{1F91E}\u{1F61B}\u{1F534}\u{1F624}\u{1F33C}\u{1F62B}\u26BD\u{1F919}\u2615\u{1F3C6}\u{1F92B}\u{1F448}\u{1F62E}\u{1F646}\u{1F37B}\u{1F343}\u{1F436}\u{1F481}\u{1F632}\u{1F33F}\u{1F9E1}\u{1F381}\u26A1\u{1F31E}\u{1F388}\u274C\u270A\u{1F44B}\u{1F630}\u{1F928}\u{1F636}\u{1F91D}\u{1F6B6}\u{1F4B0}\u{1F353}\u{1F4A2}\u{1F91F}\u{1F641}\u{1F6A8}\u{1F4A8}\u{1F92C}\u2708\u{1F380}\u{1F37A}\u{1F913}\u{1F619}\u{1F49F}\u{1F331}\u{1F616}\u{1F476}\u{1F974}\u25B6\u27A1\u2753\u{1F48E}\u{1F4B8}\u2B07\u{1F628}\u{1F31A}\u{1F98B}\u{1F637}\u{1F57A}\u26A0\u{1F645}\u{1F61F}\u{1F635}\u{1F44E}\u{1F932}\u{1F920}\u{1F927}\u{1F4CC}\u{1F535}\u{1F485}\u{1F9D0}\u{1F43E}\u{1F352}\u{1F617}\u{1F911}\u{1F30A}\u{1F92F}\u{1F437}\u260E\u{1F4A7}\u{1F62F}\u{1F486}\u{1F446}\u{1F3A4}\u{1F647}\u{1F351}\u2744\u{1F334}\u{1F4A3}\u{1F438}\u{1F48C}\u{1F4CD}\u{1F940}\u{1F922}\u{1F445}\u{1F4A1}\u{1F4A9}\u{1F450}\u{1F4F8}\u{1F47B}\u{1F910}\u{1F92E}\u{1F3BC}\u{1F975}\u{1F6A9}\u{1F34E}\u{1F34A}\u{1F47C}\u{1F48D}\u{1F4E3}\u{1F942}"),du=Yo.reduce((s,e,t)=>(s[t]=e,s),[]),pu=Yo.reduce((s,e,t)=>(s[e.codePointAt(0)]=t,s),[]);function gu(s){return s.reduce((e,t)=>(e+=du[t],e),"")}function mu(s){let e=[];for(let t of s){let r=pu[t.codePointAt(0)];if(r===void 0)throw new Error(`Non-base256emoji character: ${t}`);e.push(r)}return new Uint8Array(e)}var bu=ns({prefix:"\u{1F680}",name:"base256emoji",encode:gu,decode:mu});var ii={};ue(ii,{base32:()=>Wt,base32hex:()=>xu,base32hexpad:()=>_u,base32hexpadupper:()=>Bu,base32hexupper:()=>Eu,base32pad:()=>wu,base32padupper:()=>vu,base32upper:()=>yu,base32z:()=>Su});var Wt=te({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),yu=te({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),wu=te({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),vu=te({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),xu=te({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),Eu=te({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),_u=te({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),Bu=te({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),Su=te({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5});var oi={};ue(oi,{base36:()=>Iu,base36upper:()=>Au});var Iu=St({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),Au=St({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"});var ci={};ue(ci,{base64:()=>ai,base64pad:()=>ku,base64url:()=>Tu,base64urlpad:()=>Pu});var ai=te({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),ku=te({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),Tu=te({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),Pu=te({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6});var li={};ue(li,{base8:()=>Ru});var Ru=te({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3});var ui={};ue(ui,{identity:()=>Mu});var Mu=ns({prefix:"\0",name:"identity",encode:s=>Wo(s),decode:s=>qo(s)});var mg=new TextEncoder,bg=new TextDecoder;var fi={};ue(fi,{identity:()=>ls});var Cu=Qo,Xo=128,Lu=127,Uu=~Lu,Vu=Math.pow(2,31);function Qo(s,e,t){e=e||[],t=t||0;for(var r=t;s>=Vu;)e[t++]=s&255|Xo,s/=128;for(;s&Uu;)e[t++]=s&255|Xo,s>>>=7;return e[t]=s|0,Qo.bytes=t-r+1,e}var Ou=hi,Fu=128,Jo=127;function hi(s,r){var t=0,r=r||0,n=0,i=r,o,a=s.length;do{if(i>=a)throw hi.bytes=0,new RangeError("Could not decode varint");o=s[i++],t+=n<28?(o&Jo)<=Fu);return hi.bytes=i-r,t}var Hu=Math.pow(2,7),Gu=Math.pow(2,14),Ku=Math.pow(2,21),zu=Math.pow(2,28),qu=Math.pow(2,35),Wu=Math.pow(2,42),$u=Math.pow(2,49),ju=Math.pow(2,56),Zu=Math.pow(2,63),Yu=function(s){return sce,sha512:()=>th});function pi({name:s,code:e,encode:t}){return new di(s,e,t)}var di=class{name;code;encode;constructor(e,t,r){this.name=e,this.code=t,this.encode=r}digest(e){if(e instanceof Uint8Array){let t=this.encode(e);return t instanceof Uint8Array?It(this.code,t):t.then(r=>It(this.code,r))}else throw Error("Unknown type, must be binary type")}};function na(s){return async e=>new Uint8Array(await crypto.subtle.digest(s,e))}var ce=pi({name:"sha2-256",code:18,encode:na("SHA-256")}),th=pi({name:"sha2-512",code:19,encode:na("SHA-512")});function ia(s,e){let{bytes:t,version:r}=s;switch(r){case 0:return rh(t,mi(s),e??me.encoder);default:return nh(t,mi(s),e??Wt.encoder)}}var oa=new WeakMap;function mi(s){let e=oa.get(s);if(e==null){let t=new Map;return oa.set(s,t),t}return e}var At=class s{code;version;multihash;bytes;"/";constructor(e,t,r,n){this.code=t,this.version=e,this.multihash=r,this.bytes=n,this["/"]=n}get asCID(){return this}get byteOffset(){return this.bytes.byteOffset}get byteLength(){return this.bytes.byteLength}toV0(){switch(this.version){case 0:return this;case 1:{let{code:e,multihash:t}=this;if(e!==Ks)throw new Error("Cannot convert a non dag-pb CID to CIDv0");if(t.code!==ih)throw new Error("Cannot convert non sha2-256 multihash CID to CIDv0");return s.createV0(t)}default:throw Error(`Can not convert CID version ${this.version} to version 0. This is a bug please report`)}}toV1(){switch(this.version){case 0:{let{code:e,digest:t}=this.multihash,r=It(e,t);return s.createV1(this.code,r)}case 1:return this;default:throw Error(`Can not convert CID version ${this.version} to version 1. This is a bug please report`)}}equals(e){return s.equals(this,e)}static equals(e,t){let r=t;return r!=null&&e.code===r.code&&e.version===r.version&&ea(e.multihash,r.multihash)}toString(e){return ia(this,e)}toJSON(){return{"/":ia(this)}}link(){return this}[Symbol.toStringTag]="CID";[Symbol.for("nodejs.util.inspect.custom")](){return`CID(${this.toString()})`}static asCID(e){if(e==null)return null;let t=e;if(t instanceof s)return t;if(t["/"]!=null&&t["/"]===t.bytes||t.asCID===t){let{version:r,code:n,multihash:i,bytes:o}=t;return new s(r,n,i,o??aa(r,n,i.bytes))}else if(t[oh]===!0){let{version:r,multihash:n,code:i}=t,o=cs(n);return s.create(r,i,o)}else return null}static create(e,t,r){if(typeof t!="number")throw new Error("String codecs are no longer supported");if(!(r.bytes instanceof Uint8Array))throw new Error("Invalid digest");switch(e){case 0:{if(t!==Ks)throw new Error(`Version 0 CID must use dag-pb (code: ${Ks}) block encoding`);return new s(e,t,r,r.bytes)}case 1:{let n=aa(e,t,r.bytes);return new s(e,t,r,n)}default:throw new Error("Invalid version")}}static createV0(e){return s.create(0,Ks,e)}static createV1(e,t){return s.create(1,e,t)}static decode(e){let[t,r]=s.decodeFirst(e);if(r.length!==0)throw new Error("Incorrect length");return t}static decodeFirst(e){let t=s.inspectBytes(e),r=t.size-t.multihashSize,n=at(e.subarray(r,r+t.multihashSize));if(n.byteLength!==t.multihashSize)throw new Error("Incorrect length");let i=n.subarray(t.multihashSize-t.digestSize),o=new as(t.multihashCode,t.digestSize,i,n);return[t.version===0?s.createV0(o):s.createV1(t.codec,o),e.subarray(t.size)]}static inspectBytes(e){let t=0,r=()=>{let[u,h]=Gs(e.subarray(t));return t+=h,u},n=r(),i=Ks;if(n===18?(n=0,t=0):i=r(),n!==0&&n!==1)throw new RangeError(`Invalid CID version ${n}`);let o=t,a=r(),c=r(),f=t+c,l=f-o;return{version:n,codec:i,multihashCode:a,digestSize:c,multihashSize:l,size:f}}static parse(e,t){let[r,n]=sh(e,t),i=s.decode(n);if(i.version===0&&e[0]!=="Q")throw Error("Version 0 CID string must not include multibase prefix");return mi(i).set(r,e),i}};function sh(s,e){switch(s[0]){case"Q":{let t=e??me;return[me.prefix,t.decode(`${me.prefix}${s}`)]}case me.prefix:{let t=e??me;return[me.prefix,t.decode(s)]}case Wt.prefix:{let t=e??Wt;return[Wt.prefix,t.decode(s)]}default:{if(e==null)throw Error("To parse non base32 or base58btc encoded CID multibase decoder must be provided");return[s[0],e.decode(s)]}}}function rh(s,e,t){let{prefix:r}=t;if(r!==me.prefix)throw Error(`Cannot string encode V0 in ${t.name} encoding`);let n=e.get(r);if(n==null){let i=t.encode(s).slice(1);return e.set(r,i),i}else return n}function nh(s,e,t){let{prefix:r}=t,n=e.get(r);if(n==null){let i=t.encode(s);return e.set(r,i),i}else return n}var Ks=112,ih=18;function aa(s,e,t){let r=os(s),n=r+os(e),i=new Uint8Array(n+t.byteLength);return is(s,i,0),is(e,i,r),i.set(t,n),i}var oh=Symbol.for("@ipld/js-cid/CID");var kt={...ui,...ri,...li,...ti,...si,...ii,...oi,...ei,...ci,...ni},Vg={...gi,...fi};function be(s,e){if(s===e)return!0;if(s.byteLength!==e.byteLength)return!1;for(let t=0;ts.decoder).reduce((s,e)=>s.or(e),kt.identity.decoder),la=114,ua=36,ha=37,zs=class{type;multihash;privateKey;publicKey;string;constructor(e){this.type=e.type,this.multihash=e.multihash,this.privateKey=e.privateKey,Object.defineProperty(this,"string",{enumerable:!1,writable:!0})}get[Symbol.toStringTag](){return`PeerId(${this.toString()})`}[Fo]=!0;toString(){return this.string==null&&(this.string=me.encode(this.multihash.bytes).slice(1)),this.string}toCID(){return At.createV1(la,this.multihash)}toBytes(){return this.multihash.bytes}toJSON(){return this.toString()}equals(e){if(e==null)return!1;if(e instanceof Uint8Array)return be(this.multihash.bytes,e);if(typeof e=="string")return ct(e).equals(this);if(e?.multihash?.bytes!=null)return be(this.multihash.bytes,e.multihash.bytes);throw new Error("not valid Id")}[ah](){return`PeerId(${this.toString()})`}},qs=class extends zs{type="RSA";publicKey;constructor(e){super({...e,type:"RSA"}),this.publicKey=e.publicKey}},Ws=class extends zs{type="Ed25519";publicKey;constructor(e){super({...e,type:"Ed25519"}),this.publicKey=e.multihash.digest}},$s=class extends zs{type="secp256k1";publicKey;constructor(e){super({...e,type:"secp256k1"}),this.publicKey=e.multihash.digest}};function ct(s,e){if(e=e??ca,s.charAt(0)==="1"||s.charAt(0)==="Q"){let t=cs(me.decode(`z${s}`));return s.startsWith("12D")?new Ws({multihash:t}):s.startsWith("16U")?new $s({multihash:t}):new qs({multihash:t})}return js(ca.decode(s))}function js(s){try{let e=cs(s);if(e.code===ls.code){if(e.digest.length===ua)return new Ws({multihash:e});if(e.digest.length===ha)return new $s({multihash:e})}if(e.code===ce.code)return new qs({multihash:e})}catch{return ch(At.decode(s))}throw new Error("Supplied PeerID CID is invalid")}function ch(s){if(s==null||s.multihash==null||s.version==null||s.version===1&&s.code!==la)throw new Error("Supplied PeerID CID is invalid");let e=s.multihash;if(e.code===ce.code)return new qs({multihash:s.multihash});if(e.code===ls.code){if(e.digest.length===ua)return new Ws({multihash:s.multihash});if(e.digest.length===ha)return new $s({multihash:s.multihash})}throw new Error("Supplied PeerID CID is invalid")}function lt(s=0){return new Uint8Array(s)}function ye(s=0){return new Uint8Array(s)}var lh=Math.pow(2,7),uh=Math.pow(2,14),hh=Math.pow(2,21),bi=Math.pow(2,28),yi=Math.pow(2,35),wi=Math.pow(2,42),vi=Math.pow(2,49),q=128,we=127;function Se(s){if(sNumber.MAX_SAFE_INTEGER)throw new RangeError("Could not encode varint");return 8}function xi(s,e,t=0){switch(Se(s)){case 8:e[t++]=s&255|q,s/=128;case 7:e[t++]=s&255|q,s/=128;case 6:e[t++]=s&255|q,s/=128;case 5:e[t++]=s&255|q,s/=128;case 4:e[t++]=s&255|q,s>>>=7;case 3:e[t++]=s&255|q,s>>>=7;case 2:e[t++]=s&255|q,s>>>=7;case 1:{e[t++]=s&255,s>>>=7;break}default:throw new Error("unreachable")}return e}function fh(s,e,t=0){switch(Se(s)){case 8:e.set(t++,s&255|q),s/=128;case 7:e.set(t++,s&255|q),s/=128;case 6:e.set(t++,s&255|q),s/=128;case 5:e.set(t++,s&255|q),s/=128;case 4:e.set(t++,s&255|q),s>>>=7;case 3:e.set(t++,s&255|q),s>>>=7;case 2:e.set(t++,s&255|q),s>>>=7;case 1:{e.set(t++,s&255),s>>>=7;break}default:throw new Error("unreachable")}return e}function Ei(s,e){let t=s[e],r=0;if(r+=t&we,tn+i.length,0));let t=ye(e),r=0;for(let n of s)t.set(n,r),r+=n.length;return t}var da=Symbol.for("@achingbrain/uint8arraylist");function fa(s,e){if(e==null||e<0)throw new RangeError("index is out of bounds");let t=0;for(let r of s){let n=t+r.byteLength;if(e0&&this.appendAll(e)}*[Symbol.iterator](){yield*this.bufs}get byteLength(){return this.length}append(...e){this.appendAll(e)}appendAll(e){let t=0;for(let r of e)if(r instanceof Uint8Array)t+=r.byteLength,this.bufs.push(r);else if(wr(r))t+=r.byteLength,this.bufs.push(...r.bufs);else throw new Error("Could not append value, must be an Uint8Array or a Uint8ArrayList");this.length+=t}prepend(...e){this.prependAll(e)}prependAll(e){let t=0;for(let r of e.reverse())if(r instanceof Uint8Array)t+=r.byteLength,this.bufs.unshift(r);else if(wr(r))t+=r.byteLength,this.bufs.unshift(...r.bufs);else throw new Error("Could not prepend value, must be an Uint8Array or a Uint8ArrayList");this.length+=t}get(e){let t=fa(this.bufs,e);return t.buf[t.index]}set(e,t){let r=fa(this.bufs,e);r.buf[r.index]=t}write(e,t=0){if(e instanceof Uint8Array)for(let r=0;r0;)if(e>=this.bufs[0].byteLength)e-=this.bufs[0].byteLength,this.length-=this.bufs[0].byteLength,this.bufs.shift();else{this.bufs[0]=this.bufs[0].subarray(e),this.length-=e;break}}}slice(e,t){let{bufs:r,length:n}=this._subList(e,t);return Ye(r,n)}subarray(e,t){let{bufs:r,length:n}=this._subList(e,t);return r.length===1?r[0]:Ye(r,n)}sublist(e,t){let{bufs:r,length:n}=this._subList(e,t),i=new s;return i.length=n,i.bufs=[...r],i}_subList(e,t){if(e=e??0,t=t??this.length,e<0&&(e=this.length+e),t<0&&(t=this.length+t),e<0||t>this.length)throw new RangeError("index is out of bounds");if(e===t)return{bufs:[],length:0};if(e===0&&t===this.length)return{bufs:this.bufs,length:this.length};let r=[],n=0;for(let i=0;i=c)continue;let f=e>=a&&ea&&t<=c;if(f&&l){if(e===a&&t===c){r.push(o);break}let u=e-a;r.push(o.subarray(u,u+(t-e)));break}if(f){if(e===0){r.push(o);continue}r.push(o.subarray(e-a));continue}if(l){if(t===c){r.push(o);break}r.push(o.subarray(0,t-a));break}r.push(o)}return{bufs:r,length:t-e}}indexOf(e,t=0){if(!wr(e)&&!(e instanceof Uint8Array))throw new TypeError('The "value" argument must be a Uint8ArrayList or Uint8Array');let r=e instanceof Uint8Array?e:e.subarray();if(t=Number(t??0),isNaN(t)&&(t=0),t<0&&(t=this.length+t),t<0&&(t=0),e.length===0)return t>this.length?this.length:t;let n=r.byteLength;if(n===0)throw new TypeError("search must be at least 1 byte long");let i=256,o=new Int32Array(i);for(let u=0;u=0;h--){let p=this.get(u+h);if(r[h]!==p){l=Math.max(1,h-a[p]);break}}if(l===0)return u}return-1}getInt8(e){let t=this.subarray(e,e+1);return new DataView(t.buffer,t.byteOffset,t.byteLength).getInt8(0)}setInt8(e,t){let r=ye(1);new DataView(r.buffer,r.byteOffset,r.byteLength).setInt8(0,t),this.write(r,e)}getInt16(e,t){let r=this.subarray(e,e+2);return new DataView(r.buffer,r.byteOffset,r.byteLength).getInt16(0,t)}setInt16(e,t,r){let n=lt(2);new DataView(n.buffer,n.byteOffset,n.byteLength).setInt16(0,t,r),this.write(n,e)}getInt32(e,t){let r=this.subarray(e,e+4);return new DataView(r.buffer,r.byteOffset,r.byteLength).getInt32(0,t)}setInt32(e,t,r){let n=lt(4);new DataView(n.buffer,n.byteOffset,n.byteLength).setInt32(0,t,r),this.write(n,e)}getBigInt64(e,t){let r=this.subarray(e,e+8);return new DataView(r.buffer,r.byteOffset,r.byteLength).getBigInt64(0,t)}setBigInt64(e,t,r){let n=lt(8);new DataView(n.buffer,n.byteOffset,n.byteLength).setBigInt64(0,t,r),this.write(n,e)}getUint8(e){let t=this.subarray(e,e+1);return new DataView(t.buffer,t.byteOffset,t.byteLength).getUint8(0)}setUint8(e,t){let r=ye(1);new DataView(r.buffer,r.byteOffset,r.byteLength).setUint8(0,t),this.write(r,e)}getUint16(e,t){let r=this.subarray(e,e+2);return new DataView(r.buffer,r.byteOffset,r.byteLength).getUint16(0,t)}setUint16(e,t,r){let n=lt(2);new DataView(n.buffer,n.byteOffset,n.byteLength).setUint16(0,t,r),this.write(n,e)}getUint32(e,t){let r=this.subarray(e,e+4);return new DataView(r.buffer,r.byteOffset,r.byteLength).getUint32(0,t)}setUint32(e,t,r){let n=lt(4);new DataView(n.buffer,n.byteOffset,n.byteLength).setUint32(0,t,r),this.write(n,e)}getBigUint64(e,t){let r=this.subarray(e,e+8);return new DataView(r.buffer,r.byteOffset,r.byteLength).getBigUint64(0,t)}setBigUint64(e,t,r){let n=lt(8);new DataView(n.buffer,n.byteOffset,n.byteLength).setBigUint64(0,t,r),this.write(n,e)}getFloat32(e,t){let r=this.subarray(e,e+4);return new DataView(r.buffer,r.byteOffset,r.byteLength).getFloat32(0,t)}setFloat32(e,t,r){let n=lt(4);new DataView(n.buffer,n.byteOffset,n.byteLength).setFloat32(0,t,r),this.write(n,e)}getFloat64(e,t){let r=this.subarray(e,e+8);return new DataView(r.buffer,r.byteOffset,r.byteLength).getFloat64(0,t)}setFloat64(e,t,r){let n=lt(8);new DataView(n.buffer,n.byteOffset,n.byteLength).setFloat64(0,t,r),this.write(n,e)}equals(e){if(e==null||!(e instanceof s)||e.bufs.length!==this.bufs.length)return!1;for(let t=0;tn+i.byteLength,0)),r.length=t,r}};function vr(s){return s[Symbol.asyncIterator]!=null}var xr=s=>{let e=Se(s),t=ye(e);return _i(s,t),xr.bytes=e,t};xr.bytes=0;function fs(s,e){e=e??{};let t=e.lengthEncoder??xr;function*r(n){let i=t(n.byteLength);i instanceof Uint8Array?yield i:yield*i,n instanceof Uint8Array?yield n:yield*n}return vr(s)?async function*(){for await(let n of s)yield*r(n)}():function*(){for(let n of s)yield*r(n)}()}fs.single=(s,e)=>{e=e??{};let t=e.lengthEncoder??xr;return new hs(t(s.byteLength),s)};var ds=jn(ma(),1);var gh=8,mh=1024*1024*4,jt;(function(s){s[s.LENGTH=0]="LENGTH",s[s.DATA=1]="DATA"})(jt||(jt={}));var Si=s=>{let e=us(s);return Si.bytes=Se(e),e};Si.bytes=0;function Zs(s,e){let t=new hs,r=jt.LENGTH,n=-1,i=e?.lengthDecoder??Si,o=e?.maxLengthLength??gh,a=e?.maxDataLength??mh;function*c(){for(;t.byteLength>0;){if(r===jt.LENGTH)try{if(n=i(t),n<0)throw(0,ds.default)(new Error("invalid message length"),"ERR_INVALID_MSG_LENGTH");if(n>a)throw(0,ds.default)(new Error("message length too long"),"ERR_MSG_DATA_TOO_LONG");let f=i.bytes;t.consume(f),e?.onLength!=null&&e.onLength(n),r=jt.DATA}catch(f){if(f instanceof RangeError){if(t.byteLength>o)throw(0,ds.default)(new Error("message length length too long"),"ERR_MSG_LENGTH_TOO_LONG");break}throw f}if(r===jt.DATA){if(t.byteLength0)throw(0,ds.default)(new Error("unexpected end of input"),"ERR_UNEXPECTED_EOF")}():function*(){for(let f of s)t.append(f),yield*c();if(t.byteLength>0)throw(0,ds.default)(new Error("unexpected end of input"),"ERR_UNEXPECTED_EOF")}()}Zs.fromReader=(s,e)=>{let t=1,r=async function*(){for(;;)try{let{done:i,value:o}=await s.next(t);if(i===!0)return;o!=null&&(yield o)}catch(i){if(i.code==="ERR_UNDER_READ")return{done:!0,value:null};throw i}finally{t=1}}();return Zs(r,{...e??{},onLength:i=>{t=i}})};function Er(){let s={};return s.promise=new Promise((e,t)=>{s.resolve=e,s.reject=t}),s}var _r=class{buffer;mask;top;btm;next;constructor(e){if(!(e>0)||e-1&e)throw new Error("Max size for a FixedFIFO should be a power of two");this.buffer=new Array(e),this.mask=e-1,this.top=0,this.btm=0,this.next=null}push(e){return this.buffer[this.top]!==void 0?!1:(this.buffer[this.top]=e,this.top=this.top+1&this.mask,!0)}shift(){let e=this.buffer[this.btm];if(e!==void 0)return this.buffer[this.btm]=void 0,this.btm=this.btm+1&this.mask,e}isEmpty(){return this.buffer[this.btm]===void 0}},ps=class{size;hwm;head;tail;constructor(e={}){this.hwm=e.splitLimit??16,this.head=new _r(this.hwm),this.tail=this.head,this.size=0}calculateSize(e){return e?.byteLength!=null?e.byteLength:1}push(e){if(e?.value!=null&&(this.size+=this.calculateSize(e.value)),!this.head.push(e)){let t=this.head;this.head=t.next=new _r(2*this.head.buffer.length),this.head.push(e)}}shift(){let e=this.tail.shift();if(e===void 0&&this.tail.next!=null){let t=this.tail.next;this.tail.next=null,this.tail=t,e=this.tail.shift()}return e?.value!=null&&(this.size-=this.calculateSize(e.value)),e}isEmpty(){return this.head.isEmpty()}};var Ii=class extends Error{type;code;constructor(e,t){super(e??"The operation was aborted"),this.type="aborted",this.code=t??"ABORT_ERR"}};function ut(s={}){return bh(t=>{let r=t.shift();if(r==null)return{done:!0};if(r.error!=null)throw r.error;return{done:r.done===!0,value:r.value}},s)}function bh(s,e){e=e??{};let t=e.onEnd,r=new ps,n,i,o,a=Er(),c=async()=>{try{return r.isEmpty()?o?{done:!0}:await new Promise((m,b)=>{i=_=>{i=null,r.push(_);try{m(s(r))}catch(w){b(w)}return n}}):s(r)}finally{r.isEmpty()&&queueMicrotask(()=>{a.resolve(),a=Er()})}},f=m=>i!=null?i(m):(r.push(m),n),l=m=>(r=new ps,i!=null?i({error:m}):(r.push({error:m}),n)),u=m=>{if(o)return n;if(e?.objectMode!==!0&&m?.byteLength==null)throw new Error("objectMode was not true but tried to push non-Uint8Array value");return f({done:!1,value:m})},h=m=>o?n:(o=!0,m!=null?l(m):f({done:!0})),p=()=>(r=new ps,h(),{done:!0}),g=m=>(h(m),{done:!0});if(n={[Symbol.asyncIterator](){return this},next:c,return:p,throw:g,push:u,end:h,get readableLength(){return r.size},onEmpty:async m=>{let b=m?.signal;if(b?.throwIfAborted(),r.isEmpty())return;let _,w;b!=null&&(_=new Promise((A,y)=>{w=()=>{y(new Ii)},b.addEventListener("abort",w)}));try{await Promise.race([a.promise,_])}finally{w!=null&&b!=null&&b?.removeEventListener("abort",w)}}},t==null)return n;let d=n;return n={[Symbol.asyncIterator](){return this},next(){return d.next()},throw(m){return d.throw(m),t!=null&&(t(m),t=void 0),{done:!0}},return(){return d.return(),t!=null&&(t(),t=void 0),{done:!0}},push:u,end(m){return d.end(m),t!=null&&(t(m),t=void 0),n},get readableLength(){return d.readableLength},onEmpty:m=>d.onEmpty(m)},n}function yh(s){return s[Symbol.asyncIterator]!=null}function wh(...s){let e=[];for(let t of s)yh(t)||e.push(t);return e.length===s.length?function*(){for(let t of e)yield*t}():async function*(){let t=ut({objectMode:!0});Promise.resolve().then(async()=>{try{await Promise.all(s.map(async r=>{for await(let n of r)t.push(n)})),t.end()}catch(r){t.end(r)}}),yield*t}()}var ba=wh;function gs(s,...e){if(s==null)throw new Error("Empty pipeline");if(Ai(s)){let r=s;s=()=>r.source}else if(wa(s)||ya(s)){let r=s;s=()=>r}let t=[s,...e];if(t.length>1&&Ai(t[t.length-1])&&(t[t.length-1]=t[t.length-1].sink),t.length>2)for(let r=1;r{let e;for(;s.length>0;)e=s.shift()(e);return e},ya=s=>s?.[Symbol.asyncIterator]!=null,wa=s=>s?.[Symbol.iterator]!=null,Ai=s=>s==null?!1:s.sink!=null&&s.source!=null,xh=s=>e=>{let t=s.sink(e);if(t?.then!=null){let r=ut({objectMode:!0});t.then(()=>{r.end()},o=>{r.end(o)});let n,i=s.source;if(ya(i))n=async function*(){yield*i,r.end()};else if(wa(i))n=function*(){yield*i,r.end()};else throw new Error("Unknown duplex source type - must be Iterable or AsyncIterable");return ba(r,n())}return s.source};var ki="/floodsub/1.0.0",Ti="/meshsub/1.0.0",Br="/meshsub/1.1.0";var va="ERR_TOPIC_VALIDATOR_REJECT",xa="ERR_TOPIC_VALIDATOR_IGNORE";var Ea={maxSubscriptions:1/0,maxMessages:1/0,maxIhaveMessageIDs:1/0,maxIwantMessageIDs:1/0,maxControlMessages:1/0,maxPeerInfos:1/0};var Pi=new Float32Array([-0]),Tt=new Uint8Array(Pi.buffer);function _a(s,e,t){Pi[0]=s,e[t]=Tt[0],e[t+1]=Tt[1],e[t+2]=Tt[2],e[t+3]=Tt[3]}function Ba(s,e){return Tt[0]=s[e],Tt[1]=s[e+1],Tt[2]=s[e+2],Tt[3]=s[e+3],Pi[0]}var Ri=new Float64Array([-0]),ve=new Uint8Array(Ri.buffer);function Sa(s,e,t){Ri[0]=s,e[t]=ve[0],e[t+1]=ve[1],e[t+2]=ve[2],e[t+3]=ve[3],e[t+4]=ve[4],e[t+5]=ve[5],e[t+6]=ve[6],e[t+7]=ve[7]}function Ia(s,e){return ve[0]=s[e],ve[1]=s[e+1],ve[2]=s[e+2],ve[3]=s[e+3],ve[4]=s[e+4],ve[5]=s[e+5],ve[6]=s[e+6],ve[7]=s[e+7],Ri[0]}var _h=BigInt(Number.MAX_SAFE_INTEGER),Bh=BigInt(Number.MIN_SAFE_INTEGER),Ce=class s{lo;hi;constructor(e,t){this.lo=e|0,this.hi=t|0}toNumber(e=!1){if(!e&&this.hi>>>31>0){let t=~this.lo+1>>>0,r=~this.hi>>>0;return t===0&&(r=r+1>>>0),-(t+r*4294967296)}return this.lo+this.hi*4294967296}toBigInt(e=!1){if(e)return BigInt(this.lo>>>0)+(BigInt(this.hi>>>0)<<32n);if(this.hi>>>31){let t=~this.lo+1>>>0,r=~this.hi>>>0;return t===0&&(r=r+1>>>0),-(BigInt(t)+(BigInt(r)<<32n))}return BigInt(this.lo>>>0)+(BigInt(this.hi>>>0)<<32n)}toString(e=!1){return this.toBigInt(e).toString()}zzEncode(){let e=this.hi>>31;return this.hi=((this.hi<<1|this.lo>>>31)^e)>>>0,this.lo=(this.lo<<1^e)>>>0,this}zzDecode(){let e=-(this.lo&1);return this.lo=((this.lo>>>1|this.hi<<31)^e)>>>0,this.hi=(this.hi>>>1^e)>>>0,this}length(){let e=this.lo,t=(this.lo>>>28|this.hi<<4)>>>0,r=this.hi>>>24;return r===0?t===0?e<16384?e<128?1:2:e<2097152?3:4:t<16384?t<128?5:6:t<2097152?7:8:r<128?9:10}static fromBigInt(e){if(e===0n)return Zt;if(e<_h&&e>Bh)return this.fromNumber(Number(e));let t=e<0n;t&&(e=-e);let r=e>>32n,n=e-(r<<32n);return t&&(r=~r|0n,n=~n|0n,++n>Aa&&(n=0n,++r>Aa&&(r=0n))),new s(Number(n),Number(r))}static fromNumber(e){if(e===0)return Zt;let t=e<0;t&&(e=-e);let r=e>>>0,n=(e-r)/4294967296>>>0;return t&&(n=~n>>>0,r=~r>>>0,++r>4294967295&&(r=0,++n>4294967295&&(n=0))),new s(r,n)}static from(e){return typeof e=="number"?s.fromNumber(e):typeof e=="bigint"?s.fromBigInt(e):typeof e=="string"?s.fromBigInt(BigInt(e)):e.low!=null||e.high!=null?new s(e.low>>>0,e.high>>>0):Zt}},Zt=new Ce(0,0);Zt.toBigInt=function(){return 0n};Zt.zzEncode=Zt.zzDecode=function(){return this};Zt.length=function(){return 1};var Aa=4294967296n;function ka(s){let e=0,t=0;for(let r=0;r191&&a<224?i[o++]=(a&31)<<6|s[e++]&63:a>239&&a<365?(a=((a&7)<<18|(s[e++]&63)<<12|(s[e++]&63)<<6|s[e++]&63)-65536,i[o++]=55296+(a>>10),i[o++]=56320+(a&1023)):i[o++]=(a&15)<<12|(s[e++]&63)<<6|s[e++]&63,o>8191&&((n??(n=[])).push(String.fromCharCode.apply(String,i)),o=0);return n!=null?(o>0&&n.push(String.fromCharCode.apply(String,i.slice(0,o))),n.join("")):String.fromCharCode.apply(String,i.slice(0,o))}function Mi(s,e,t){let r=t,n,i;for(let o=0;o>6|192,e[t++]=n&63|128):(n&64512)===55296&&((i=s.charCodeAt(o+1))&64512)===56320?(n=65536+((n&1023)<<10)+(i&1023),++o,e[t++]=n>>18|240,e[t++]=n>>12&63|128,e[t++]=n>>6&63|128,e[t++]=n&63|128):(e[t++]=n>>12|224,e[t++]=n>>6&63|128,e[t++]=n&63|128);return t-r}function Ke(s,e){return RangeError(`index out of range: ${s.pos} + ${e??1} > ${s.len}`)}function Sr(s,e){return(s[e-4]|s[e-3]<<8|s[e-2]<<16|s[e-1]<<24)>>>0}var Di=class{buf;pos;len;_slice=Uint8Array.prototype.subarray;constructor(e){this.buf=e,this.pos=0,this.len=e.length}uint32(){let e=4294967295;if(e=(this.buf[this.pos]&127)>>>0,this.buf[this.pos++]<128||(e=(e|(this.buf[this.pos]&127)<<7)>>>0,this.buf[this.pos++]<128)||(e=(e|(this.buf[this.pos]&127)<<14)>>>0,this.buf[this.pos++]<128)||(e=(e|(this.buf[this.pos]&127)<<21)>>>0,this.buf[this.pos++]<128)||(e=(e|(this.buf[this.pos]&15)<<28)>>>0,this.buf[this.pos++]<128))return e;if((this.pos+=5)>this.len)throw this.pos=this.len,Ke(this,10);return e}int32(){return this.uint32()|0}sint32(){let e=this.uint32();return e>>>1^-(e&1)|0}bool(){return this.uint32()!==0}fixed32(){if(this.pos+4>this.len)throw Ke(this,4);return Sr(this.buf,this.pos+=4)}sfixed32(){if(this.pos+4>this.len)throw Ke(this,4);return Sr(this.buf,this.pos+=4)|0}float(){if(this.pos+4>this.len)throw Ke(this,4);let e=Ba(this.buf,this.pos);return this.pos+=4,e}double(){if(this.pos+8>this.len)throw Ke(this,4);let e=Ia(this.buf,this.pos);return this.pos+=8,e}bytes(){let e=this.uint32(),t=this.pos,r=this.pos+e;if(r>this.len)throw Ke(this,e);return this.pos+=e,t===r?new Uint8Array(0):this.buf.subarray(t,r)}string(){let e=this.bytes();return Ta(e,0,e.length)}skip(e){if(typeof e=="number"){if(this.pos+e>this.len)throw Ke(this,e);this.pos+=e}else do if(this.pos>=this.len)throw Ke(this);while(this.buf[this.pos++]&128);return this}skipType(e){switch(e){case 0:this.skip();break;case 1:this.skip(8);break;case 2:this.skip(this.uint32());break;case 3:for(;(e=this.uint32()&7)!==4;)this.skipType(e);break;case 5:this.skip(4);break;default:throw Error(`invalid wire type ${e} at offset ${this.pos}`)}return this}readLongVarint(){let e=new Ce(0,0),t=0;if(this.len-this.pos>4){for(;t<4;++t)if(e.lo=(e.lo|(this.buf[this.pos]&127)<>>0,this.buf[this.pos++]<128)return e;if(e.lo=(e.lo|(this.buf[this.pos]&127)<<28)>>>0,e.hi=(e.hi|(this.buf[this.pos]&127)>>4)>>>0,this.buf[this.pos++]<128)return e;t=0}else{for(;t<3;++t){if(this.pos>=this.len)throw Ke(this);if(e.lo=(e.lo|(this.buf[this.pos]&127)<>>0,this.buf[this.pos++]<128)return e}return e.lo=(e.lo|(this.buf[this.pos++]&127)<>>0,e}if(this.len-this.pos>4){for(;t<5;++t)if(e.hi=(e.hi|(this.buf[this.pos]&127)<>>0,this.buf[this.pos++]<128)return e}else for(;t<5;++t){if(this.pos>=this.len)throw Ke(this);if(e.hi=(e.hi|(this.buf[this.pos]&127)<>>0,this.buf[this.pos++]<128)return e}throw Error("invalid varint encoding")}readFixed64(){if(this.pos+8>this.len)throw Ke(this,8);let e=Sr(this.buf,this.pos+=4),t=Sr(this.buf,this.pos+=4);return new Ce(e,t)}int64(){return this.readLongVarint().toBigInt()}int64Number(){return this.readLongVarint().toNumber()}int64String(){return this.readLongVarint().toString()}uint64(){return this.readLongVarint().toBigInt(!0)}uint64Number(){let e=Ei(this.buf,this.pos);return this.pos+=Se(e),e}uint64String(){return this.readLongVarint().toString(!0)}sint64(){return this.readLongVarint().zzDecode().toBigInt()}sint64Number(){return this.readLongVarint().zzDecode().toNumber()}sint64String(){return this.readLongVarint().zzDecode().toString()}fixed64(){return this.readFixed64().toBigInt()}fixed64Number(){return this.readFixed64().toNumber()}fixed64String(){return this.readFixed64().toString()}sfixed64(){return this.readFixed64().toBigInt()}sfixed64Number(){return this.readFixed64().toNumber()}sfixed64String(){return this.readFixed64().toString()}};function Ni(s){return new Di(s instanceof Uint8Array?s:s.subarray())}function Re(s,e,t){let r=Ni(s);return e.decode(r,void 0,t)}function Ma(s,e,t,r){return{name:s,prefix:e,encoder:{name:s,prefix:e,encode:t},decoder:{decode:r}}}var Ra=Ma("utf8","u",s=>"u"+new TextDecoder("utf8").decode(s),s=>new TextEncoder().encode(s.substring(1))),Ci=Ma("ascii","a",s=>{let e="a";for(let t=0;t{s=s.substring(1);let e=ye(s.length);for(let t=0;t>>1,r,n=e;return function(o){if(o<1||o>t)return ye(o);n+o>e&&(r=ye(e),n=0);let a=r.subarray(n,n+=o);return n&7&&(n=(n|7)+1),a}}var Yt=class{fn;len;next;val;constructor(e,t,r){this.fn=e,this.len=t,this.next=void 0,this.val=r}};function Ui(){}var Oi=class{head;tail;len;next;constructor(e){this.head=e.head,this.tail=e.tail,this.len=e.len,this.next=e.states}},Ih=Li();function Ah(s){return globalThis.Buffer!=null?ye(s):Ih(s)}var Xs=class{len;head;tail;states;constructor(){this.len=0,this.head=new Yt(Ui,0,0),this.tail=this.head,this.states=null}_push(e,t,r){return this.tail=this.tail.next=new Yt(e,t,r),this.len+=t,this}uint32(e){return this.len+=(this.tail=this.tail.next=new Fi((e=e>>>0)<128?1:e<16384?2:e<2097152?3:e<268435456?4:5,e)).len,this}int32(e){return e<0?this._push(Ar,10,Ce.fromNumber(e)):this.uint32(e)}sint32(e){return this.uint32((e<<1^e>>31)>>>0)}uint64(e){let t=Ce.fromBigInt(e);return this._push(Ar,t.length(),t)}uint64Number(e){return this._push(xi,Se(e),e)}uint64String(e){return this.uint64(BigInt(e))}int64(e){return this.uint64(e)}int64Number(e){return this.uint64Number(e)}int64String(e){return this.uint64String(e)}sint64(e){let t=Ce.fromBigInt(e).zzEncode();return this._push(Ar,t.length(),t)}sint64Number(e){let t=Ce.fromNumber(e).zzEncode();return this._push(Ar,t.length(),t)}sint64String(e){return this.sint64(BigInt(e))}bool(e){return this._push(Vi,1,e?1:0)}fixed32(e){return this._push(Ys,4,e>>>0)}sfixed32(e){return this.fixed32(e)}fixed64(e){let t=Ce.fromBigInt(e);return this._push(Ys,4,t.lo)._push(Ys,4,t.hi)}fixed64Number(e){let t=Ce.fromNumber(e);return this._push(Ys,4,t.lo)._push(Ys,4,t.hi)}fixed64String(e){return this.fixed64(BigInt(e))}sfixed64(e){return this.fixed64(e)}sfixed64Number(e){return this.fixed64Number(e)}sfixed64String(e){return this.fixed64String(e)}float(e){return this._push(_a,4,e)}double(e){return this._push(Sa,8,e)}bytes(e){let t=e.length>>>0;return t===0?this._push(Vi,1,0):this.uint32(t)._push(Th,t,e)}string(e){let t=ka(e);return t!==0?this.uint32(t)._push(Mi,t,e):this._push(Vi,1,0)}fork(){return this.states=new Oi(this),this.head=this.tail=new Yt(Ui,0,0),this.len=0,this}reset(){return this.states!=null?(this.head=this.states.head,this.tail=this.states.tail,this.len=this.states.len,this.states=this.states.next):(this.head=this.tail=new Yt(Ui,0,0),this.len=0),this}ldelim(){let e=this.head,t=this.tail,r=this.len;return this.reset().uint32(r),r!==0&&(this.tail.next=e.next,this.tail=t,this.len+=r),this}finish(){let e=this.head.next,t=Ah(this.len),r=0;for(;e!=null;)e.fn(e.val,t,r),r+=e.len,e=e.next;return t}};function Vi(s,e,t){e[t]=s&255}function kh(s,e,t){for(;s>127;)e[t++]=s&127|128,s>>>=7;e[t]=s}var Fi=class extends Yt{next;constructor(e,t){super(kh,e,t),this.next=void 0}};function Ar(s,e,t){for(;s.hi!==0;)e[t++]=s.lo&127|128,s.lo=(s.lo>>>7|s.hi<<25)>>>0,s.hi>>>=7;for(;s.lo>127;)e[t++]=s.lo&127|128,s.lo=s.lo>>>7;e[t++]=s.lo}function Ys(s,e,t){e[t]=s&255,e[t+1]=s>>>8&255,e[t+2]=s>>>16&255,e[t+3]=s>>>24}function Th(s,e,t){e.set(s,t)}globalThis.Buffer!=null&&(Xs.prototype.bytes=function(s){let e=s.length>>>0;return this.uint32(e),e>0&&this._push(Ph,e,s),this},Xs.prototype.string=function(s){let e=globalThis.Buffer.byteLength(s);return this.uint32(e),e>0&&this._push(Rh,e,s),this});function Ph(s,e,t){e.set(s,t)}function Rh(s,e,t){s.length<40?Mi(s,e,t):e.utf8Write!=null?e.utf8Write(s,t):e.set(Z(s),t)}function Hi(){return new Xs}function Me(s,e){let t=Hi();return e.encode(s,t,{lengthDelimited:!1}),t.finish()}var ms;(function(s){s[s.VARINT=0]="VARINT",s[s.BIT64=1]="BIT64",s[s.LENGTH_DELIMITED=2]="LENGTH_DELIMITED",s[s.START_GROUP=3]="START_GROUP",s[s.END_GROUP=4]="END_GROUP",s[s.BIT32=5]="BIT32"})(ms||(ms={}));function kr(s,e,t,r){return{name:s,type:e,encode:t,decode:r}}function Gi(s){function e(n){if(s[n.toString()]==null)throw new Error("Invalid enum value");return s[n]}let t=function(i,o){let a=e(i);o.int32(a)},r=function(i){let o=i.int32();return e(o)};return kr("enum",ms.VARINT,t,r)}function De(s,e){return kr("message",ms.LENGTH_DELIMITED,s,e)}var Oe=class extends Error{code;constructor(e,t,r){super(e,r),this.code=t}};var ht;(function(s){let e;(function(l){let u;l.codec=()=>(u==null&&(u=De((h,p,g={})=>{g.lengthDelimited!==!1&&p.fork(),h.subscribe!=null&&(p.uint32(8),p.bool(h.subscribe)),h.topic!=null&&(p.uint32(18),p.string(h.topic)),g.lengthDelimited!==!1&&p.ldelim()},(h,p,g={})=>{let d={},m=p==null?h.len:h.pos+p;for(;h.pos>>3){case 1:{d.subscribe=h.bool();break}case 2:{d.topic=h.string();break}default:{h.skipType(b&7);break}}}return d})),u),l.encode=h=>Me(h,l.codec()),l.decode=(h,p)=>Re(h,l.codec(),p)})(e=s.SubOpts||(s.SubOpts={}));let t;(function(l){let u;l.codec=()=>(u==null&&(u=De((h,p,g={})=>{g.lengthDelimited!==!1&&p.fork(),h.from!=null&&(p.uint32(10),p.bytes(h.from)),h.data!=null&&(p.uint32(18),p.bytes(h.data)),h.seqno!=null&&(p.uint32(26),p.bytes(h.seqno)),h.topic!=null&&h.topic!==""&&(p.uint32(34),p.string(h.topic)),h.signature!=null&&(p.uint32(42),p.bytes(h.signature)),h.key!=null&&(p.uint32(50),p.bytes(h.key)),g.lengthDelimited!==!1&&p.ldelim()},(h,p,g={})=>{let d={topic:""},m=p==null?h.len:h.pos+p;for(;h.pos>>3){case 1:{d.from=h.bytes();break}case 2:{d.data=h.bytes();break}case 3:{d.seqno=h.bytes();break}case 4:{d.topic=h.string();break}case 5:{d.signature=h.bytes();break}case 6:{d.key=h.bytes();break}default:{h.skipType(b&7);break}}}return d})),u),l.encode=h=>Me(h,l.codec()),l.decode=(h,p)=>Re(h,l.codec(),p)})(t=s.Message||(s.Message={}));let r;(function(l){let u;l.codec=()=>(u==null&&(u=De((h,p,g={})=>{if(g.lengthDelimited!==!1&&p.fork(),h.ihave!=null)for(let d of h.ihave)p.uint32(10),s.ControlIHave.codec().encode(d,p);if(h.iwant!=null)for(let d of h.iwant)p.uint32(18),s.ControlIWant.codec().encode(d,p);if(h.graft!=null)for(let d of h.graft)p.uint32(26),s.ControlGraft.codec().encode(d,p);if(h.prune!=null)for(let d of h.prune)p.uint32(34),s.ControlPrune.codec().encode(d,p);g.lengthDelimited!==!1&&p.ldelim()},(h,p,g={})=>{let d={ihave:[],iwant:[],graft:[],prune:[]},m=p==null?h.len:h.pos+p;for(;h.pos>>3){case 1:{if(g.limits?.ihave!=null&&d.ihave.length===g.limits.ihave)throw new Oe('decode error - map field "ihave" had too many elements',"ERR_MAX_LENGTH");d.ihave.push(s.ControlIHave.codec().decode(h,h.uint32()));break}case 2:{if(g.limits?.iwant!=null&&d.iwant.length===g.limits.iwant)throw new Oe('decode error - map field "iwant" had too many elements',"ERR_MAX_LENGTH");d.iwant.push(s.ControlIWant.codec().decode(h,h.uint32()));break}case 3:{if(g.limits?.graft!=null&&d.graft.length===g.limits.graft)throw new Oe('decode error - map field "graft" had too many elements',"ERR_MAX_LENGTH");d.graft.push(s.ControlGraft.codec().decode(h,h.uint32()));break}case 4:{if(g.limits?.prune!=null&&d.prune.length===g.limits.prune)throw new Oe('decode error - map field "prune" had too many elements',"ERR_MAX_LENGTH");d.prune.push(s.ControlPrune.codec().decode(h,h.uint32()));break}default:{h.skipType(b&7);break}}}return d})),u),l.encode=h=>Me(h,l.codec()),l.decode=(h,p)=>Re(h,l.codec(),p)})(r=s.ControlMessage||(s.ControlMessage={}));let n;(function(l){let u;l.codec=()=>(u==null&&(u=De((h,p,g={})=>{if(g.lengthDelimited!==!1&&p.fork(),h.topicID!=null&&(p.uint32(10),p.string(h.topicID)),h.messageIDs!=null)for(let d of h.messageIDs)p.uint32(18),p.bytes(d);g.lengthDelimited!==!1&&p.ldelim()},(h,p,g={})=>{let d={messageIDs:[]},m=p==null?h.len:h.pos+p;for(;h.pos>>3){case 1:{d.topicID=h.string();break}case 2:{if(g.limits?.messageIDs!=null&&d.messageIDs.length===g.limits.messageIDs)throw new Oe('decode error - map field "messageIDs" had too many elements',"ERR_MAX_LENGTH");d.messageIDs.push(h.bytes());break}default:{h.skipType(b&7);break}}}return d})),u),l.encode=h=>Me(h,l.codec()),l.decode=(h,p)=>Re(h,l.codec(),p)})(n=s.ControlIHave||(s.ControlIHave={}));let i;(function(l){let u;l.codec=()=>(u==null&&(u=De((h,p,g={})=>{if(g.lengthDelimited!==!1&&p.fork(),h.messageIDs!=null)for(let d of h.messageIDs)p.uint32(10),p.bytes(d);g.lengthDelimited!==!1&&p.ldelim()},(h,p,g={})=>{let d={messageIDs:[]},m=p==null?h.len:h.pos+p;for(;h.pos>>3){case 1:{if(g.limits?.messageIDs!=null&&d.messageIDs.length===g.limits.messageIDs)throw new Oe('decode error - map field "messageIDs" had too many elements',"ERR_MAX_LENGTH");d.messageIDs.push(h.bytes());break}default:{h.skipType(b&7);break}}}return d})),u),l.encode=h=>Me(h,l.codec()),l.decode=(h,p)=>Re(h,l.codec(),p)})(i=s.ControlIWant||(s.ControlIWant={}));let o;(function(l){let u;l.codec=()=>(u==null&&(u=De((h,p,g={})=>{g.lengthDelimited!==!1&&p.fork(),h.topicID!=null&&(p.uint32(10),p.string(h.topicID)),g.lengthDelimited!==!1&&p.ldelim()},(h,p,g={})=>{let d={},m=p==null?h.len:h.pos+p;for(;h.pos>>3){case 1:{d.topicID=h.string();break}default:{h.skipType(b&7);break}}}return d})),u),l.encode=h=>Me(h,l.codec()),l.decode=(h,p)=>Re(h,l.codec(),p)})(o=s.ControlGraft||(s.ControlGraft={}));let a;(function(l){let u;l.codec=()=>(u==null&&(u=De((h,p,g={})=>{if(g.lengthDelimited!==!1&&p.fork(),h.topicID!=null&&(p.uint32(10),p.string(h.topicID)),h.peers!=null)for(let d of h.peers)p.uint32(18),s.PeerInfo.codec().encode(d,p);h.backoff!=null&&(p.uint32(24),p.uint64Number(h.backoff)),g.lengthDelimited!==!1&&p.ldelim()},(h,p,g={})=>{let d={peers:[]},m=p==null?h.len:h.pos+p;for(;h.pos>>3){case 1:{d.topicID=h.string();break}case 2:{if(g.limits?.peers!=null&&d.peers.length===g.limits.peers)throw new Oe('decode error - map field "peers" had too many elements',"ERR_MAX_LENGTH");d.peers.push(s.PeerInfo.codec().decode(h,h.uint32()));break}case 3:{d.backoff=h.uint64Number();break}default:{h.skipType(b&7);break}}}return d})),u),l.encode=h=>Me(h,l.codec()),l.decode=(h,p)=>Re(h,l.codec(),p)})(a=s.ControlPrune||(s.ControlPrune={}));let c;(function(l){let u;l.codec=()=>(u==null&&(u=De((h,p,g={})=>{g.lengthDelimited!==!1&&p.fork(),h.peerID!=null&&(p.uint32(10),p.bytes(h.peerID)),h.signedPeerRecord!=null&&(p.uint32(18),p.bytes(h.signedPeerRecord)),g.lengthDelimited!==!1&&p.ldelim()},(h,p,g={})=>{let d={},m=p==null?h.len:h.pos+p;for(;h.pos>>3){case 1:{d.peerID=h.bytes();break}case 2:{d.signedPeerRecord=h.bytes();break}default:{h.skipType(b&7);break}}}return d})),u),l.encode=h=>Me(h,l.codec()),l.decode=(h,p)=>Re(h,l.codec(),p)})(c=s.PeerInfo||(s.PeerInfo={}));let f;s.codec=()=>(f==null&&(f=De((l,u,h={})=>{if(h.lengthDelimited!==!1&&u.fork(),l.subscriptions!=null)for(let p of l.subscriptions)u.uint32(10),s.SubOpts.codec().encode(p,u);if(l.messages!=null)for(let p of l.messages)u.uint32(18),s.Message.codec().encode(p,u);l.control!=null&&(u.uint32(26),s.ControlMessage.codec().encode(l.control,u)),h.lengthDelimited!==!1&&u.ldelim()},(l,u,h={})=>{let p={subscriptions:[],messages:[]},g=u==null?l.len:l.pos+u;for(;l.pos>>3){case 1:{if(h.limits?.subscriptions!=null&&p.subscriptions.length===h.limits.subscriptions)throw new Oe('decode error - map field "subscriptions" had too many elements',"ERR_MAX_LENGTH");p.subscriptions.push(s.SubOpts.codec().decode(l,l.uint32()));break}case 2:{if(h.limits?.messages!=null&&p.messages.length===h.limits.messages)throw new Oe('decode error - map field "messages" had too many elements',"ERR_MAX_LENGTH");p.messages.push(s.Message.codec().decode(l,l.uint32()));break}case 3:{p.control=s.ControlMessage.codec().decode(l,l.uint32());break}default:{l.skipType(d&7);break}}}return p})),f),s.encode=l=>Me(l,s.codec()),s.decode=(l,u)=>Re(l,s.codec(),u)})(ht||(ht={}));var Tr=class{gossip;msgs=new Map;msgIdToStrFn;history=[];notValidatedCount=0;constructor(e,t,r){this.gossip=e,this.msgIdToStrFn=r;for(let n=0;n{if((this.msgs.get(n.msgIdStr)?.validated??!1)&&e.has(n.topic)){let o=t.get(n.topic);o==null&&(o=[],t.set(n.topic,o)),o.push(n.msgId)}});return t}validate(e){let t=this.msgs.get(e);if(t==null)return null;t.validated||this.notValidatedCount--;let{message:r,originatingPeers:n}=t;return t.validated=!0,t.originatingPeers=new Set,{message:r,originatingPeers:n}}shift(){this.history[this.history.length-1].forEach(t=>{let r=this.msgs.get(t.msgIdStr);r!=null&&(this.msgs.delete(t.msgIdStr),r.validated||this.notValidatedCount--)}),this.history.pop(),this.history.unshift([])}remove(e){let t=this.msgs.get(e);return t==null?null:(this.msgs.delete(e),t)}};var Da;(function(s){s.StrictSign="StrictSign",s.StrictNoSign="StrictNoSign"})(Da||(Da={}));var Pt;(function(s){s[s.Signing=0]="Signing",s[s.Anonymous=1]="Anonymous"})(Pt||(Pt={}));var Ie;(function(s){s.Error="error",s.Ignore="ignore",s.Reject="reject",s.Blacklisted="blacklisted"})(Ie||(Ie={}));var xe;(function(s){s.InvalidSignature="invalid_signature",s.InvalidSeqno="invalid_seqno",s.InvalidPeerId="invalid_peerid",s.SignaturePresent="signature_present",s.SeqnoPresent="seqno_present",s.FromPresent="from_present",s.TransformFailed="transform_failed"})(xe||(xe={}));var Ee;(function(s){s.duplicate="duplicate",s.invalid="invalid",s.valid="valid"})(Ee||(Ee={}));function Ki(s){switch(s){case Be.Ignore:return Ie.Ignore;case Be.Reject:return Ie.Reject;default:throw new Error("Unreachable")}}var Na;(function(s){s.forward="forward",s.publish="publish"})(Na||(Na={}));var Ae;(function(s){s.Fanout="fanout",s.Random="random",s.Subscribed="subscribed",s.Outbound="outbound",s.NotEnough="not_enough",s.Opportunistic="opportunistic"})(Ae||(Ae={}));var ze;(function(s){s.Dc="disconnected",s.BadScore="bad_score",s.Prune="prune",s.Excess="excess"})(ze||(ze={}));var ys;(function(s){s.GraftBackoff="graft_backoff",s.BrokenPromise="broken_promise",s.MessageDeficit="message_deficit",s.IPColocation="IP_colocation"})(ys||(ys={}));var ws;(function(s){s.LowScore="low_score",s.MaxIhave="max_ihave",s.MaxIasked="max_iasked"})(ws||(ws={}));var bs;(function(s){s.graylist="graylist",s.publish="publish",s.gossip="gossip",s.mesh="mesh"})(bs||(bs={}));function Ca(s,e,t){return{protocolsEnabled:s.gauge({name:"gossipsub_protocol",help:"Status of enabled protocols",labelNames:["protocol"]}),topicSubscriptionStatus:s.gauge({name:"gossipsub_topic_subscription_status",help:"Status of our subscription to this topic",labelNames:["topicStr"]}),topicPeersCount:s.gauge({name:"gossipsub_topic_peer_count",help:"Number of peers subscribed to each topic",labelNames:["topicStr"]}),meshPeerCounts:s.gauge({name:"gossipsub_mesh_peer_count",help:"Number of peers in our mesh",labelNames:["topicStr"]}),meshPeerInclusionEventsFanout:s.gauge({name:"gossipsub_mesh_peer_inclusion_events_fanout_total",help:"Number of times we include peers in a topic mesh for fanout reasons",labelNames:["topic"]}),meshPeerInclusionEventsRandom:s.gauge({name:"gossipsub_mesh_peer_inclusion_events_random_total",help:"Number of times we include peers in a topic mesh for random reasons",labelNames:["topic"]}),meshPeerInclusionEventsSubscribed:s.gauge({name:"gossipsub_mesh_peer_inclusion_events_subscribed_total",help:"Number of times we include peers in a topic mesh for subscribed reasons",labelNames:["topic"]}),meshPeerInclusionEventsOutbound:s.gauge({name:"gossipsub_mesh_peer_inclusion_events_outbound_total",help:"Number of times we include peers in a topic mesh for outbound reasons",labelNames:["topic"]}),meshPeerInclusionEventsNotEnough:s.gauge({name:"gossipsub_mesh_peer_inclusion_events_not_enough_total",help:"Number of times we include peers in a topic mesh for not_enough reasons",labelNames:["topic"]}),meshPeerInclusionEventsOpportunistic:s.gauge({name:"gossipsub_mesh_peer_inclusion_events_opportunistic_total",help:"Number of times we include peers in a topic mesh for opportunistic reasons",labelNames:["topic"]}),meshPeerInclusionEventsUnknown:s.gauge({name:"gossipsub_mesh_peer_inclusion_events_unknown_total",help:"Number of times we include peers in a topic mesh for unknown reasons",labelNames:["topic"]}),meshPeerChurnEventsDisconnected:s.gauge({name:"gossipsub_peer_churn_events_disconnected_total",help:"Number of times we remove peers in a topic mesh for disconnected reasons",labelNames:["topic"]}),meshPeerChurnEventsBadScore:s.gauge({name:"gossipsub_peer_churn_events_bad_score_total",help:"Number of times we remove peers in a topic mesh for bad_score reasons",labelNames:["topic"]}),meshPeerChurnEventsPrune:s.gauge({name:"gossipsub_peer_churn_events_prune_total",help:"Number of times we remove peers in a topic mesh for prune reasons",labelNames:["topic"]}),meshPeerChurnEventsExcess:s.gauge({name:"gossipsub_peer_churn_events_excess_total",help:"Number of times we remove peers in a topic mesh for excess reasons",labelNames:["topic"]}),meshPeerChurnEventsUnknown:s.gauge({name:"gossipsub_peer_churn_events_unknown_total",help:"Number of times we remove peers in a topic mesh for unknown reasons",labelNames:["topic"]}),peersPerProtocol:s.gauge({name:"gossipsub_peers_per_protocol_count",help:"Peers connected for each topic",labelNames:["protocol"]}),heartbeatDuration:s.histogram({name:"gossipsub_heartbeat_duration_seconds",help:"The time it takes to complete one iteration of the heartbeat",buckets:[.01,.1,1]}),heartbeatSkipped:s.gauge({name:"gossipsub_heartbeat_skipped",help:"Heartbeat run took longer than heartbeat interval so next is skipped"}),acceptedMessagesTotal:s.gauge({name:"gossipsub_accepted_messages_total",help:"Total accepted messages for each topic",labelNames:["topic"]}),ignoredMessagesTotal:s.gauge({name:"gossipsub_ignored_messages_total",help:"Total ignored messages for each topic",labelNames:["topic"]}),rejectedMessagesTotal:s.gauge({name:"gossipsub_rejected_messages_total",help:"Total rejected messages for each topic",labelNames:["topic"]}),unknownValidationResultsTotal:s.gauge({name:"gossipsub_unknown_validation_results_total",help:"Total unknown validation results for each topic",labelNames:["topic"]}),asyncValidationMcacheHit:s.gauge({name:"gossipsub_async_validation_mcache_hit_total",help:"Async validation result reported by the user layer",labelNames:["hit"]}),asyncValidationDelayFromFirstSeenSec:s.histogram({name:"gossipsub_async_validation_delay_from_first_seen",help:"Async validation report delay from first seen in second",buckets:[.01,.03,.1,.3,1,3,10]}),asyncValidationUnknownFirstSeen:s.gauge({name:"gossipsub_async_validation_unknown_first_seen_count_total",help:"Async validation report unknown first seen value for message"}),peerReadStreamError:s.gauge({name:"gossipsub_peer_read_stream_err_count_total",help:"Peer read stream error"}),rpcRecvBytes:s.gauge({name:"gossipsub_rpc_recv_bytes_total",help:"RPC recv"}),rpcRecvCount:s.gauge({name:"gossipsub_rpc_recv_count_total",help:"RPC recv"}),rpcRecvSubscription:s.gauge({name:"gossipsub_rpc_recv_subscription_total",help:"RPC recv"}),rpcRecvMessage:s.gauge({name:"gossipsub_rpc_recv_message_total",help:"RPC recv"}),rpcRecvControl:s.gauge({name:"gossipsub_rpc_recv_control_total",help:"RPC recv"}),rpcRecvIHave:s.gauge({name:"gossipsub_rpc_recv_ihave_total",help:"RPC recv"}),rpcRecvIWant:s.gauge({name:"gossipsub_rpc_recv_iwant_total",help:"RPC recv"}),rpcRecvGraft:s.gauge({name:"gossipsub_rpc_recv_graft_total",help:"RPC recv"}),rpcRecvPrune:s.gauge({name:"gossipsub_rpc_recv_prune_total",help:"RPC recv"}),rpcDataError:s.gauge({name:"gossipsub_rpc_data_err_count_total",help:"RPC data error"}),rpcRecvError:s.gauge({name:"gossipsub_rpc_recv_err_count_total",help:"RPC recv error"}),rpcRecvNotAccepted:s.gauge({name:"gossipsub_rpc_rcv_not_accepted_total",help:"Total count of RPC dropped because acceptFrom() == false"}),rpcSentBytes:s.gauge({name:"gossipsub_rpc_sent_bytes_total",help:"RPC sent"}),rpcSentCount:s.gauge({name:"gossipsub_rpc_sent_count_total",help:"RPC sent"}),rpcSentSubscription:s.gauge({name:"gossipsub_rpc_sent_subscription_total",help:"RPC sent"}),rpcSentMessage:s.gauge({name:"gossipsub_rpc_sent_message_total",help:"RPC sent"}),rpcSentControl:s.gauge({name:"gossipsub_rpc_sent_control_total",help:"RPC sent"}),rpcSentIHave:s.gauge({name:"gossipsub_rpc_sent_ihave_total",help:"RPC sent"}),rpcSentIWant:s.gauge({name:"gossipsub_rpc_sent_iwant_total",help:"RPC sent"}),rpcSentGraft:s.gauge({name:"gossipsub_rpc_sent_graft_total",help:"RPC sent"}),rpcSentPrune:s.gauge({name:"gossipsub_rpc_sent_prune_total",help:"RPC sent"}),msgPublishCount:s.gauge({name:"gossipsub_msg_publish_count_total",help:"Total count of msg published by topic",labelNames:["topic"]}),msgPublishPeersByTopic:s.gauge({name:"gossipsub_msg_publish_peers_total",help:"Total count of peers that we publish a msg to",labelNames:["topic"]}),directPeersPublishedTotal:s.gauge({name:"gossipsub_direct_peers_published_total",help:"Total direct peers that we publish a msg to",labelNames:["topic"]}),floodsubPeersPublishedTotal:s.gauge({name:"gossipsub_floodsub_peers_published_total",help:"Total floodsub peers that we publish a msg to",labelNames:["topic"]}),meshPeersPublishedTotal:s.gauge({name:"gossipsub_mesh_peers_published_total",help:"Total mesh peers that we publish a msg to",labelNames:["topic"]}),fanoutPeersPublishedTotal:s.gauge({name:"gossipsub_fanout_peers_published_total",help:"Total fanout peers that we publish a msg to",labelNames:["topic"]}),msgPublishBytes:s.gauge({name:"gossipsub_msg_publish_bytes_total",help:"Total count of msg publish data.length bytes",labelNames:["topic"]}),msgPublishTime:s.histogram({name:"gossipsub_msg_publish_seconds",help:"Total time in seconds to publish a message",buckets:[.001,.002,.005,.01,.1,.5,1],labelNames:["topic"]}),msgForwardCount:s.gauge({name:"gossipsub_msg_forward_count_total",help:"Total count of msg forwarded by topic",labelNames:["topic"]}),msgForwardPeers:s.gauge({name:"gossipsub_msg_forward_peers_total",help:"Total count of peers that we forward a msg to",labelNames:["topic"]}),msgReceivedPreValidation:s.gauge({name:"gossipsub_msg_received_prevalidation_total",help:"Total count of recv msgs before any validation",labelNames:["topic"]}),msgReceivedError:s.gauge({name:"gossipsub_msg_received_error_total",help:"Total count of recv msgs error",labelNames:["topic"]}),prevalidationInvalidTotal:s.gauge({name:"gossipsub_pre_validation_invalid_total",help:"Total count of invalid messages received",labelNames:["topic"]}),prevalidationValidTotal:s.gauge({name:"gossipsub_pre_validation_valid_total",help:"Total count of valid messages received",labelNames:["topic"]}),prevalidationDuplicateTotal:s.gauge({name:"gossipsub_pre_validation_duplicate_total",help:"Total count of duplicate messages received",labelNames:["topic"]}),prevalidationUnknownTotal:s.gauge({name:"gossipsub_pre_validation_unknown_status_total",help:"Total count of unknown_status messages received",labelNames:["topic"]}),msgReceivedInvalid:s.gauge({name:"gossipsub_msg_received_invalid_total",help:"Tracks specific reason of invalid",labelNames:["error"]}),msgReceivedInvalidByTopic:s.gauge({name:"gossipsub_msg_received_invalid_by_topic_total",help:"Tracks specific invalid message by topic",labelNames:["topic"]}),duplicateMsgDeliveryDelay:s.histogram({name:"gossisub_duplicate_msg_delivery_delay_seconds",help:"Time since the 1st duplicated message validated",labelNames:["topic"],buckets:[.25*t.maxMeshMessageDeliveriesWindowSec,.5*t.maxMeshMessageDeliveriesWindowSec,Number(t.maxMeshMessageDeliveriesWindowSec),2*t.maxMeshMessageDeliveriesWindowSec,4*t.maxMeshMessageDeliveriesWindowSec]}),duplicateMsgLateDelivery:s.gauge({name:"gossisub_duplicate_msg_late_delivery_total",help:"Total count of late duplicate message delivery by topic, which triggers P3 penalty",labelNames:["topic"]}),duplicateMsgIgnored:s.gauge({name:"gossisub_ignored_published_duplicate_msgs_total",help:"Total count of published duplicate message ignored by topic",labelNames:["topic"]}),scoreFnCalls:s.gauge({name:"gossipsub_score_fn_calls_total",help:"Total times score() is called"}),scoreFnRuns:s.gauge({name:"gossipsub_score_fn_runs_total",help:"Total times score() call actually computed computeScore(), no cache"}),scoreCachedDelta:s.histogram({name:"gossipsub_score_cache_delta",help:"Delta of score between cached values that expired",buckets:[10,100,1e3]}),peersByScoreThreshold:s.gauge({name:"gossipsub_peers_by_score_threshold_count",help:"Current count of peers by score threshold",labelNames:["threshold"]}),score:s.avgMinMax({name:"gossipsub_score",help:"Avg min max of gossip scores"}),scoreWeights:s.avgMinMax({name:"gossipsub_score_weights",help:"Separate score weights",labelNames:["topic","p"]}),scorePerMesh:s.avgMinMax({name:"gossipsub_score_per_mesh",help:"Histogram of the scores for each mesh topic",labelNames:["topic"]}),scoringPenalties:s.gauge({name:"gossipsub_scoring_penalties_total",help:"A counter of the kind of penalties being applied to peers",labelNames:["penalty"]}),behaviourPenalty:s.histogram({name:"gossipsub_peer_stat_behaviour_penalty",help:"Current peer stat behaviour_penalty at each scrape",buckets:[.25*t.behaviourPenaltyThreshold,.5*t.behaviourPenaltyThreshold,Number(t.behaviourPenaltyThreshold),2*t.behaviourPenaltyThreshold,4*t.behaviourPenaltyThreshold]}),ihaveRcvIgnored:s.gauge({name:"gossipsub_ihave_rcv_ignored_total",help:"Total received IHAVE messages that we ignore for some reason",labelNames:["reason"]}),ihaveRcvMsgids:s.gauge({name:"gossipsub_ihave_rcv_msgids_total",help:"Total received IHAVE messages by topic",labelNames:["topic"]}),ihaveRcvNotSeenMsgids:s.gauge({name:"gossipsub_ihave_rcv_not_seen_msgids_total",help:"Total messages per topic we do not have, not actual requests",labelNames:["topic"]}),iwantRcvMsgids:s.gauge({name:"gossipsub_iwant_rcv_msgids_total",help:"Total received IWANT messages by topic",labelNames:["topic"]}),iwantRcvDonthaveMsgids:s.gauge({name:"gossipsub_iwant_rcv_dont_have_msgids_total",help:"Total requested messageIDs that we do not have"}),iwantPromiseStarted:s.gauge({name:"gossipsub_iwant_promise_sent_total",help:"Total count of started IWANT promises"}),iwantPromiseResolved:s.gauge({name:"gossipsub_iwant_promise_resolved_total",help:"Total count of resolved IWANT promises"}),iwantPromiseResolvedFromDuplicate:s.gauge({name:"gossipsub_iwant_promise_resolved_from_duplicate_total",help:"Total count of resolved IWANT promises from duplicate messages"}),iwantPromiseResolvedPeers:s.gauge({name:"gossipsub_iwant_promise_resolved_peers",help:"Total count of peers we have asked IWANT promises that are resolved"}),iwantPromiseBroken:s.gauge({name:"gossipsub_iwant_promise_broken",help:"Total count of broken IWANT promises"}),iwantMessagePruned:s.gauge({name:"gossipsub_iwant_message_pruned",help:"Total count of pruned IWANT messages"}),iwantPromiseDeliveryTime:s.histogram({name:"gossipsub_iwant_promise_delivery_seconds",help:"Histogram of delivery time of resolved IWANT promises",buckets:[.5*t.gossipPromiseExpireSec,Number(t.gossipPromiseExpireSec),2*t.gossipPromiseExpireSec,4*t.gossipPromiseExpireSec]}),iwantPromiseUntracked:s.gauge({name:"gossip_iwant_promise_untracked",help:"Total count of untracked IWANT promise"}),connectedPeersBackoffSec:s.histogram({name:"gossipsub_connected_peers_backoff_seconds",help:"Backoff time in seconds",buckets:[1,2,4,10,20,60,120]}),cacheSize:s.gauge({name:"gossipsub_cache_size",help:"Unbounded cache sizes",labelNames:["cache"]}),mcacheSize:s.gauge({name:"gossipsub_mcache_size",help:"Current mcache msg count"}),mcacheNotValidatedCount:s.gauge({name:"gossipsub_mcache_not_validated_count",help:"Current mcache msg count not validated"}),fastMsgIdCacheCollision:s.gauge({name:"gossipsub_fastmsgid_cache_collision_total",help:"Total count of key collisions on fastmsgid cache put"}),newConnectionCount:s.gauge({name:"gossipsub_new_connection_total",help:"Total new connection by status",labelNames:["status"]}),topicStrToLabel:e,toTopic(r){return this.topicStrToLabel.get(r)??r},onJoin(r){this.topicSubscriptionStatus.set({topicStr:r},1),this.meshPeerCounts.set({topicStr:r},0)},onLeave(r){this.topicSubscriptionStatus.set({topicStr:r},0),this.meshPeerCounts.set({topicStr:r},0)},onAddToMesh(r,n,i){let o=this.toTopic(r);switch(n){case Ae.Fanout:this.meshPeerInclusionEventsFanout.inc({topic:o},i);break;case Ae.Random:this.meshPeerInclusionEventsRandom.inc({topic:o},i);break;case Ae.Subscribed:this.meshPeerInclusionEventsSubscribed.inc({topic:o},i);break;case Ae.Outbound:this.meshPeerInclusionEventsOutbound.inc({topic:o},i);break;case Ae.NotEnough:this.meshPeerInclusionEventsNotEnough.inc({topic:o},i);break;case Ae.Opportunistic:this.meshPeerInclusionEventsOpportunistic.inc({topic:o},i);break;default:this.meshPeerInclusionEventsUnknown.inc({topic:o},i);break}},onRemoveFromMesh(r,n,i){let o=this.toTopic(r);switch(n){case ze.Dc:this.meshPeerChurnEventsDisconnected.inc({topic:o},i);break;case ze.BadScore:this.meshPeerChurnEventsBadScore.inc({topic:o},i);break;case ze.Prune:this.meshPeerChurnEventsPrune.inc({topic:o},i);break;case ze.Excess:this.meshPeerChurnEventsExcess.inc({topic:o},i);break;default:this.meshPeerChurnEventsUnknown.inc({topic:o},i);break}},onReportValidation(r,n,i){if(this.asyncValidationMcacheHit.inc({hit:r!=null?"hit":"miss"}),r!=null){let o=this.toTopic(r.message.topic);switch(n){case Be.Accept:this.acceptedMessagesTotal.inc({topic:o});break;case Be.Ignore:this.ignoredMessagesTotal.inc({topic:o});break;case Be.Reject:this.rejectedMessagesTotal.inc({topic:o});break;default:this.unknownValidationResultsTotal.inc({topic:o});break}}i!=null?this.asyncValidationDelayFromFirstSeenSec.observe((Date.now()-i)/1e3):this.asyncValidationUnknownFirstSeen.inc()},onScorePenalty(r){this.scoringPenalties.inc({penalty:r},1)},onIhaveRcv(r,n,i){let o=this.toTopic(r);this.ihaveRcvMsgids.inc({topic:o},n),this.ihaveRcvNotSeenMsgids.inc({topic:o},i)},onIwantRcv(r,n){for(let[i,o]of r){let a=this.toTopic(i);this.iwantRcvMsgids.inc({topic:a},o)}this.iwantRcvDonthaveMsgids.inc(n)},onForwardMsg(r,n){let i=this.toTopic(r);this.msgForwardCount.inc({topic:i},1),this.msgForwardPeers.inc({topic:i},n)},onPublishMsg(r,n,i,o,a){let c=this.toTopic(r);this.msgPublishCount.inc({topic:c},1),this.msgPublishBytes.inc({topic:c},i*o),this.msgPublishPeersByTopic.inc({topic:c},i),this.directPeersPublishedTotal.inc({topic:c},n.direct),this.floodsubPeersPublishedTotal.inc({topic:c},n.floodsub),this.meshPeersPublishedTotal.inc({topic:c},n.mesh),this.fanoutPeersPublishedTotal.inc({topic:c},n.fanout),this.msgPublishTime.observe({topic:c},a/1e3)},onMsgRecvPreValidation(r){let n=this.toTopic(r);this.msgReceivedPreValidation.inc({topic:n},1)},onMsgRecvError(r){let n=this.toTopic(r);this.msgReceivedError.inc({topic:n},1)},onPrevalidationResult(r,n){let i=this.toTopic(r);switch(n){case Ee.duplicate:this.prevalidationDuplicateTotal.inc({topic:i});break;case Ee.invalid:this.prevalidationInvalidTotal.inc({topic:i});break;case Ee.valid:this.prevalidationValidTotal.inc({topic:i});break;default:this.prevalidationUnknownTotal.inc({topic:i});break}},onMsgRecvInvalid(r,n){let i=this.toTopic(r),o=n.reason===Ie.Error?n.error:n.reason;this.msgReceivedInvalid.inc({error:o},1),this.msgReceivedInvalidByTopic.inc({topic:i},1)},onDuplicateMsgDelivery(r,n,i){let o=this.toTopic(r);this.duplicateMsgDeliveryDelay.observe({topic:o},n/1e3),i&&this.duplicateMsgLateDelivery.inc({topic:o},1)},onPublishDuplicateMsg(r){let n=this.toTopic(r);this.duplicateMsgIgnored.inc({topic:n},1)},onPeerReadStreamError(){this.peerReadStreamError.inc(1)},onRpcRecvError(){this.rpcRecvError.inc(1)},onRpcDataError(){this.rpcDataError.inc(1)},onRpcRecv(r,n){this.rpcRecvBytes.inc(n),this.rpcRecvCount.inc(1),r.subscriptions!=null&&this.rpcRecvSubscription.inc(r.subscriptions.length),r.messages!=null&&this.rpcRecvMessage.inc(r.messages.length),r.control!=null&&(this.rpcRecvControl.inc(1),r.control.ihave!=null&&this.rpcRecvIHave.inc(r.control.ihave.length),r.control.iwant!=null&&this.rpcRecvIWant.inc(r.control.iwant.length),r.control.graft!=null&&this.rpcRecvGraft.inc(r.control.graft.length),r.control.prune!=null&&this.rpcRecvPrune.inc(r.control.prune.length))},onRpcSent(r,n){if(this.rpcSentBytes.inc(n),this.rpcSentCount.inc(1),r.subscriptions!=null&&this.rpcSentSubscription.inc(r.subscriptions.length),r.messages!=null&&this.rpcSentMessage.inc(r.messages.length),r.control!=null){let i=r.control.ihave?.length??0,o=r.control.iwant?.length??0,a=r.control.graft?.length??0,c=r.control.prune?.length??0;i>0&&this.rpcSentIHave.inc(i),o>0&&this.rpcSentIWant.inc(o),a>0&&this.rpcSentGraft.inc(a),c>0&&this.rpcSentPrune.inc(c),(i>0||o>0||a>0||c>0)&&this.rpcSentControl.inc(1)}},registerScores(r,n){let i=0,o=0,a=0,c=0;for(let f of r)f>=n.graylistThreshold&&i++,f>=n.publishThreshold&&o++,f>=n.gossipThreshold&&a++,f>=0&&c++;this.peersByScoreThreshold.set({threshold:bs.graylist},i),this.peersByScoreThreshold.set({threshold:bs.publish},o),this.peersByScoreThreshold.set({threshold:bs.gossip},a),this.peersByScoreThreshold.set({threshold:bs.mesh},c),this.score.set(r)},registerScoreWeights(r){for(let[n,i]of r.byTopic)this.scoreWeights.set({topic:n,p:"p1"},i.p1w),this.scoreWeights.set({topic:n,p:"p2"},i.p2w),this.scoreWeights.set({topic:n,p:"p3"},i.p3w),this.scoreWeights.set({topic:n,p:"p3b"},i.p3bw),this.scoreWeights.set({topic:n,p:"p4"},i.p4w);this.scoreWeights.set({p:"p5"},r.p5w),this.scoreWeights.set({p:"p6"},r.p6w),this.scoreWeights.set({p:"p7"},r.p7w)},registerScorePerMesh(r,n){let i=new Map;r.forEach((o,a)=>{let c=this.topicStrToLabel.get(a)??"unknown",f=i.get(c);f==null&&(f=new Set,i.set(c,f)),o.forEach(l=>f?.add(l))});for(let[o,a]of i){let c=[];a.forEach(f=>{c.push(n.get(f)??0)}),this.scorePerMesh.set({topic:o},c)}}}}var $="ERR_INVALID_PEER_SCORE_PARAMS";var Mh={topics:{},topicScoreCap:10,appSpecificScore:()=>0,appSpecificWeight:10,IPColocationFactorWeight:-5,IPColocationFactorThreshold:10,IPColocationFactorWhitelist:new Set,behaviourPenaltyWeight:-10,behaviourPenaltyThreshold:0,behaviourPenaltyDecay:.2,decayInterval:1e3,decayToZero:.1,retainScore:3600*1e3},Dh={topicWeight:.5,timeInMeshWeight:1,timeInMeshQuantum:1,timeInMeshCap:3600,firstMessageDeliveriesWeight:1,firstMessageDeliveriesDecay:.5,firstMessageDeliveriesCap:2e3,meshMessageDeliveriesWeight:-1,meshMessageDeliveriesDecay:.5,meshMessageDeliveriesCap:100,meshMessageDeliveriesThreshold:20,meshMessageDeliveriesWindow:10,meshMessageDeliveriesActivation:5e3,meshFailurePenaltyWeight:-1,meshFailurePenaltyDecay:.5,invalidMessageDeliveriesWeight:-1,invalidMessageDeliveriesDecay:.3};function La(s={}){return{...Mh,...s,topics:s.topics!=null?Object.entries(s.topics).reduce((e,[t,r])=>(e[t]=Nh(r),e),{}):{}}}function Nh(s={}){return{...Dh,...s}}function Ua(s){for(let[e,t]of Object.entries(s.topics))try{Ch(t)}catch(r){throw new T(`invalid score parameters for topic ${e}: ${r.message}`,$)}if(s.topicScoreCap<0)throw new T("invalid topic score cap; must be positive (or 0 for no cap)",$);if(s.appSpecificScore===null||s.appSpecificScore===void 0)throw new T("missing application specific score function",$);if(s.IPColocationFactorWeight>0)throw new T("invalid IPColocationFactorWeight; must be negative (or 0 to disable)",$);if(s.IPColocationFactorWeight!==0&&s.IPColocationFactorThreshold<1)throw new T("invalid IPColocationFactorThreshold; must be at least 1",$);if(s.behaviourPenaltyWeight>0)throw new T("invalid BehaviourPenaltyWeight; must be negative (or 0 to disable)",$);if(s.behaviourPenaltyWeight!==0&&(s.behaviourPenaltyDecay<=0||s.behaviourPenaltyDecay>=1))throw new T("invalid BehaviourPenaltyDecay; must be between 0 and 1",$);if(s.decayInterval<1e3)throw new T("invalid DecayInterval; must be at least 1s",$);if(s.decayToZero<=0||s.decayToZero>=1)throw new T("invalid DecayToZero; must be between 0 and 1",$)}function Ch(s){if(s.topicWeight<0)throw new T("invalid topic weight; must be >= 0",$);if(s.timeInMeshQuantum===0)throw new T("invalid TimeInMeshQuantum; must be non zero",$);if(s.timeInMeshWeight<0)throw new T("invalid TimeInMeshWeight; must be positive (or 0 to disable)",$);if(s.timeInMeshWeight!==0&&s.timeInMeshQuantum<=0)throw new T("invalid TimeInMeshQuantum; must be positive",$);if(s.timeInMeshWeight!==0&&s.timeInMeshCap<=0)throw new T("invalid TimeInMeshCap; must be positive",$);if(s.firstMessageDeliveriesWeight<0)throw new T("invallid FirstMessageDeliveriesWeight; must be positive (or 0 to disable)",$);if(s.firstMessageDeliveriesWeight!==0&&(s.firstMessageDeliveriesDecay<=0||s.firstMessageDeliveriesDecay>=1))throw new T("invalid FirstMessageDeliveriesDecay; must be between 0 and 1",$);if(s.firstMessageDeliveriesWeight!==0&&s.firstMessageDeliveriesCap<=0)throw new T("invalid FirstMessageDeliveriesCap; must be positive",$);if(s.meshMessageDeliveriesWeight>0)throw new T("invalid MeshMessageDeliveriesWeight; must be negative (or 0 to disable)",$);if(s.meshMessageDeliveriesWeight!==0&&(s.meshMessageDeliveriesDecay<=0||s.meshMessageDeliveriesDecay>=1))throw new T("invalid MeshMessageDeliveriesDecay; must be between 0 and 1",$);if(s.meshMessageDeliveriesWeight!==0&&s.meshMessageDeliveriesCap<=0)throw new T("invalid MeshMessageDeliveriesCap; must be positive",$);if(s.meshMessageDeliveriesWeight!==0&&s.meshMessageDeliveriesThreshold<=0)throw new T("invalid MeshMessageDeliveriesThreshold; must be positive",$);if(s.meshMessageDeliveriesWindow<0)throw new T("invalid MeshMessageDeliveriesWindow; must be non-negative",$);if(s.meshMessageDeliveriesWeight!==0&&s.meshMessageDeliveriesActivation<1e3)throw new T("invalid MeshMessageDeliveriesActivation; must be at least 1s",$);if(s.meshFailurePenaltyWeight>0)throw new T("invalid MeshFailurePenaltyWeight; must be negative (or 0 to disable)",$);if(s.meshFailurePenaltyWeight!==0&&(s.meshFailurePenaltyDecay<=0||s.meshFailurePenaltyDecay>=1))throw new T("invalid MeshFailurePenaltyDecay; must be between 0 and 1",$);if(s.invalidMessageDeliveriesWeight>0)throw new T("invalid InvalidMessageDeliveriesWeight; must be negative (or 0 to disable)",$);if(s.invalidMessageDeliveriesDecay<=0||s.invalidMessageDeliveriesDecay>=1)throw new T("invalid InvalidMessageDeliveriesDecay; must be between 0 and 1",$)}var Lh={gossipThreshold:-10,publishThreshold:-50,graylistThreshold:-80,acceptPXThreshold:10,opportunisticGraftThreshold:20};function Va(s={}){return{...Lh,...s}}function Rr(s,e,t=()=>!0){let r=new Set;if(e<=0)return r;for(let n of s){if(r.size>=e)break;t(n)&&(r.add(n),s.delete(n))}return r}function Oa(s,e){return Rr(s,e,()=>!0)}var Pr=class extends Map{getDefault;constructor(e){super(),this.getDefault=e}getOrDefault(e){let t=super.get(e);return t===void 0&&(t=this.getDefault(),this.set(e,t)),t}};function Fa(s,e,t,r){let n=0;Object.entries(e.topics).forEach(([o,a])=>{let c=t.topics[o];if(c===void 0)return;let f=0;if(a.inMesh){let p=a.meshTime/c.timeInMeshQuantum;p>c.timeInMeshCap&&(p=c.timeInMeshCap),f+=p*c.timeInMeshWeight}let l=a.firstMessageDeliveries;if(l>c.firstMessageDeliveriesCap&&(l=c.firstMessageDeliveriesCap),f+=l*c.firstMessageDeliveriesWeight,a.meshMessageDeliveriesActive&&a.meshMessageDeliveries0&&n>t.topicScoreCap&&(n=t.topicScoreCap);let i=t.appSpecificScore(s);if(n+=i*t.appSpecificWeight,e.knownIPs.forEach(o=>{if(t.IPColocationFactorWhitelist.has(o))return;let a=r.get(o),c=a!=null?a.size:0;if(c>t.IPColocationFactorThreshold){let f=c-t.IPColocationFactorThreshold,l=f*f;n+=l*t.IPColocationFactorWeight}}),e.behaviourPenalty>t.behaviourPenaltyThreshold){let o=e.behaviourPenalty-t.behaviourPenaltyThreshold,a=o*o;n+=a*t.behaviourPenaltyWeight}return n}var Ka=jn(Ga(),1);var ke;(function(s){s[s.unknown=0]="unknown",s[s.valid=1]="valid",s[s.invalid=2]="invalid",s[s.ignored=3]="ignored"})(ke||(ke={}));var Mr=class{records;queue;constructor(){this.records=new Map,this.queue=new Ka.default}getRecord(e){return this.records.get(e)}ensureRecord(e){let t=this.records.get(e);if(t!=null)return t;t={status:ke.unknown,firstSeenTsMs:Date.now(),validated:0,peers:new Set},this.records.set(e,t);let r={msgId:e,expire:Date.now()+12e4};return this.queue.push(r),t}gc(){let e=Date.now(),t=this.queue.peekFront();for(;t!=null&&t.expirenew Set);scoreCache=new Map;deliveryRecords=new Mr;_backgroundInterval;scoreCacheValidityMs;computeScore;log;constructor(e,t,r,n){this.params=e,this.metrics=t,Ua(e),this.scoreCacheValidityMs=n.scoreCacheValidityMs,this.computeScore=n.computeScore??Fa,this.log=r.forComponent("libp2p:gossipsub:score")}get size(){return this.peerStats.size}start(){if(this._backgroundInterval!=null){this.log("Peer score already running");return}this._backgroundInterval=setInterval(()=>{this.background()},this.params.decayInterval),this.log("started")}stop(){if(this._backgroundInterval==null){this.log("Peer score already stopped");return}clearInterval(this._backgroundInterval),delete this._backgroundInterval,this.peerIPs.clear(),this.peerStats.clear(),this.deliveryRecords.clear(),this.log("stopped")}background(){this.refreshScores(),this.deliveryRecords.gc()}dumpPeerScoreStats(){return Object.fromEntries(Array.from(this.peerStats.entries()).map(([e,t])=>[e,t]))}messageFirstSeenTimestampMs(e){let t=this.deliveryRecords.getRecord(e);return t!=null?t.firstSeenTsMs:null}refreshScores(){let e=Date.now(),t=this.params.decayToZero;this.peerStats.forEach((r,n)=>{if(!r.connected){e>r.expire&&(this.removeIPsForPeer(n,r.knownIPs),this.peerStats.delete(n),this.scoreCache.delete(n));return}Object.entries(r.topics).forEach(([i,o])=>{let a=this.params.topics[i];a!==void 0&&(o.firstMessageDeliveries*=a.firstMessageDeliveriesDecay,o.firstMessageDeliveriesa.meshMessageDeliveriesActivation&&(o.meshMessageDeliveriesActive=!0)))}),r.behaviourPenalty*=this.params.behaviourPenaltyDecay,r.behaviourPenaltyr)return n.score;this.metrics?.scoreFnRuns.inc();let i=this.computeScore(e,t,this.params,this.peerIPs),o=r+this.scoreCacheValidityMs;return n!=null?(this.metrics?.scoreCachedDelta.observe(Math.abs(i-n.score)),n.score=i,n.cacheUntil=o):this.scoreCache.set(e,{score:i,cacheUntil:o}),i}addPenalty(e,t,r){let n=this.peerStats.get(e);n!=null&&(n.behaviourPenalty+=t,this.metrics?.onScorePenalty(r))}addPeer(e){let t={connected:!0,expire:0,topics:{},knownIPs:new Set,behaviourPenalty:0};this.peerStats.set(e,t)}addIP(e,t){let r=this.peerStats.get(e);r?.knownIPs.add(t),this.peerIPs.getOrDefault(t).add(e)}removeIP(e,t){let r=this.peerStats.get(e);r?.knownIPs.delete(t);let n=this.peerIPs.get(t);n!=null&&(n.delete(e),n.size===0&&this.peerIPs.delete(t))}removePeer(e){let t=this.peerStats.get(e);if(t!=null){if(this.score(e)>0){this.removeIPsForPeer(e,t.knownIPs),this.peerStats.delete(e);return}Object.entries(t.topics).forEach(([r,n])=>{n.firstMessageDeliveries=0;let i=this.params.topics[r].meshMessageDeliveriesThreshold;if(n.inMesh&&n.meshMessageDeliveriesActive&&n.meshMessageDeliveries{o!==e.toString()&&this.markDuplicateMessageDelivery(o,r)})}rejectInvalidMessage(e,t){this.markInvalidMessageDelivery(e,t)}rejectMessage(e,t,r,n){switch(n){case Ie.Error:this.markInvalidMessageDelivery(e,r);return;case Ie.Blacklisted:return}let i=this.deliveryRecords.ensureRecord(t);if(i.status!==ke.unknown){this.log("unexpected rejection: message from %s was first seen %s ago and has delivery status %d",e,Date.now()-i.firstSeenTsMs,ke[i.status]);return}if(n===Ie.Ignore){i.status=ke.ignored,i.peers.clear();return}i.status=ke.invalid,this.markInvalidMessageDelivery(e,r),i.peers.forEach(o=>{this.markInvalidMessageDelivery(o,r)}),i.peers.clear()}duplicateMessage(e,t,r){let n=this.deliveryRecords.ensureRecord(t);if(!n.peers.has(e))switch(n.status){case ke.unknown:n.peers.add(e);break;case ke.valid:n.peers.add(e),this.markDuplicateMessageDelivery(e,r,n.validated);break;case ke.invalid:this.markInvalidMessageDelivery(e,r);break;case ke.ignored:break}}markInvalidMessageDelivery(e,t){let r=this.peerStats.get(e);if(r!=null){let n=this.getPtopicStats(r,t);n!=null&&(n.invalidMessageDeliveries+=1)}}markFirstMessageDelivery(e,t){let r=this.peerStats.get(e);if(r!=null){let n=this.getPtopicStats(r,t);if(n!=null){let i=this.params.topics[t].firstMessageDeliveriesCap;n.firstMessageDeliveries=Math.min(i,n.firstMessageDeliveries+1),n.inMesh&&(i=this.params.topics[t].meshMessageDeliveriesCap,n.meshMessageDeliveries=Math.min(i,n.meshMessageDeliveries+1))}}}markDuplicateMessageDelivery(e,t,r){let n=this.peerStats.get(e);if(n!=null){let i=r!==void 0?Date.now():0,o=this.getPtopicStats(n,t);if(o!=null&&o.inMesh){let a=this.params.topics[t];if(r!==void 0){let f=i-r,l=f>a.meshMessageDeliveriesWindow;if(this.metrics?.onDuplicateMsgDelivery(t,f,l),l)return}let c=a.meshMessageDeliveriesCap;o.meshMessageDeliveries=Math.min(c,o.meshMessageDeliveries+1)}}}removeIPsForPeer(e,t){for(let r of t){let n=this.peerIPs.get(r);n!=null&&(n.delete(e),n.size===0&&this.peerIPs.delete(r))}}getPtopicStats(e,t){let r=e.topics[t];return r!==void 0?r:this.params.topics[t]!==void 0?(r={inMesh:!1,graftTime:0,meshTime:0,firstMessageDeliveries:0,meshMessageDeliveries:0,meshMessageDeliveriesActive:!1,meshFailurePenalty:0,invalidMessageDeliveries:0},e.topics[t]=r,r):null}};function Uh(s,e,t,r,n){let i=0,o=new Map;if(Object.entries(e.topics).forEach(([h,p])=>{let g=n.get(h)??"unknown",d=t.topics[h];if(d===void 0)return;let m=o.get(g);m==null&&(m={p1w:0,p2w:0,p3w:0,p3bw:0,p4w:0},o.set(g,m));let b=0,_=0,w=0,A=0,y=0;if(p.inMesh){let D=Math.max(p.meshTime/d.timeInMeshQuantum,d.timeInMeshCap);b+=D*d.timeInMeshWeight}let x=p.firstMessageDeliveries;if(x>d.firstMessageDeliveriesCap&&(x=d.firstMessageDeliveriesCap),_+=x*d.firstMessageDeliveriesWeight,p.meshMessageDeliveriesActive&&p.meshMessageDeliveries0&&i>t.topicScoreCap){i=t.topicScoreCap;let h=t.topicScoreCap/i;for(let p of o.values())p.p1w*=h,p.p2w*=h,p.p3w*=h,p.p3bw*=h,p.p4w*=h}let a=0,c=0,f=0,l=t.appSpecificScore(s);a+=l*t.appSpecificWeight,e.knownIPs.forEach(h=>{if(t.IPColocationFactorWhitelist.has(h))return;let p=r.get(h),g=p!=null?p.size:0;if(g>t.IPColocationFactorThreshold){let d=g-t.IPColocationFactorThreshold,m=d*d;c+=m*t.IPColocationFactorWeight}});let u=e.behaviourPenalty*e.behaviourPenalty;return f+=u*t.behaviourPenaltyWeight,i+=a+c+f,{byTopic:o,p5w:a,p6w:c,p7w:f,score:i}}function za(s,e,t,r,n){let i={byTopic:new Map,p5w:[],p6w:[],p7w:[],score:[]};for(let o of s){let a=e.get(o);if(a!=null){let c=Uh(o,a,t,r,n);for(let[f,l]of c.byTopic){let u=i.byTopic.get(f);u==null&&(u={p1w:[],p2w:[],p3w:[],p3bw:[],p4w:[]},i.byTopic.set(f,u)),u.p1w.push(l.p1w),u.p2w.push(l.p2w),u.p3w.push(l.p3w),u.p3bw.push(l.p3bw),u.p4w.push(l.p4w)}i.p5w.push(c.p5w),i.p6w.push(c.p6w),i.p7w.push(c.p7w),i.score.push(c.score)}else i.p5w.push(0),i.p6w.push(0),i.p7w.push(0),i.score.push(0)}return i}var Nr=class{rawStream;pushable;closeController;maxBufferSize;constructor(e,t,r){this.rawStream=e,this.pushable=ut(),this.closeController=new AbortController,this.maxBufferSize=r.maxBufferSize??1/0,this.closeController.signal.addEventListener("abort",()=>{e.close().catch(n=>{e.abort(n)})}),gs(this.pushable,this.rawStream).catch(t)}get protocol(){return this.rawStream.protocol}push(e){if(this.pushable.readableLength>this.maxBufferSize)throw Error(`OutboundStream buffer full, size > ${this.maxBufferSize}`);this.pushable.push(fs.single(e))}pushPrefixed(e){if(this.pushable.readableLength>this.maxBufferSize)throw Error(`OutboundStream buffer full, size > ${this.maxBufferSize}`);this.pushable.push(e)}async close(){this.closeController.abort(),await this.pushable.return()}},Cr=class{source;rawStream;closeController;constructor(e,t={}){this.rawStream=e,this.closeController=new AbortController,this.closeController.signal.addEventListener("abort",()=>{e.close().catch(r=>{e.abort(r)})}),this.source=gs(this.rawStream,r=>Zs(r,t))}async close(){this.closeController.abort()}};var Lr=class{gossipsubIWantFollowupMs;msgIdToStrFn;metrics;promises=new Map;requestMsByMsg=new Map;requestMsByMsgExpire;constructor(e,t,r){this.gossipsubIWantFollowupMs=e,this.msgIdToStrFn=t,this.metrics=r,this.requestMsByMsgExpire=10*e}get size(){return this.promises.size}get requestMsByMsgSize(){return this.requestMsByMsg.size}addPromise(e,t){let r=Math.floor(Math.random()*t.length),n=t[r],i=this.msgIdToStrFn(n),o=this.promises.get(i);o==null&&(o=new Map,this.promises.set(i,o));let a=Date.now();o.has(e)||(o.set(e,a+this.gossipsubIWantFollowupMs),this.metrics!=null&&(this.metrics.iwantPromiseStarted.inc(1),this.requestMsByMsg.has(i)||this.requestMsByMsg.set(i,a)))}getBrokenPromises(){let e=Date.now(),t=new Map,r=0;return this.promises.forEach((n,i)=>{n.forEach((o,a)=>{oes,Ed25519PublicKey:()=>er,generateKeyPair:()=>jf,generateKeyPairFromSeed:()=>bc,unmarshalEd25519PrivateKey:()=>Wf,unmarshalEd25519PublicKey:()=>$f});function Fe(s){return s==null?!1:typeof s.then=="function"&&typeof s.catch=="function"&&typeof s.finally=="function"}function vs(s){if(!Number.isSafeInteger(s)||s<0)throw new Error(`positive integer expected, not ${s}`)}function Vh(s){return s instanceof Uint8Array||s!=null&&typeof s=="object"&&s.constructor.name==="Uint8Array"}function xs(s,...e){if(!Vh(s))throw new Error("Uint8Array expected");if(e.length>0&&!e.includes(s.length))throw new Error(`Uint8Array expected of length ${e}, not of length=${s.length}`)}function Ur(s){if(typeof s!="function"||typeof s.create!="function")throw new Error("Hash should be wrapped by utils.wrapConstructor");vs(s.outputLen),vs(s.blockLen)}function Es(s,e=!0){if(s.destroyed)throw new Error("Hash instance has been destroyed");if(e&&s.finished)throw new Error("Hash#digest() has already been called")}function qa(s,e){xs(s);let t=e.outputLen;if(s.lengthnew DataView(s.buffer,s.byteOffset,s.byteLength),qe=(s,e)=>s<<32-e|s>>>e;var Y0=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;var Oh=async()=>{};async function Wa(s,e,t){let r=Date.now();for(let n=0;n=0&&is().update(Rt(r)).digest(),t=s();return e.outputLen=t.outputLen,e.blockLen=t.blockLen,e.create=()=>s(),e}function Ss(s=32){if(Vr&&typeof Vr.getRandomValues=="function")return Vr.getRandomValues(new Uint8Array(s));throw new Error("crypto.getRandomValues must be defined")}function Hh(s,e,t,r){if(typeof s.setBigUint64=="function")return s.setBigUint64(e,t,r);let n=BigInt(32),i=BigInt(4294967295),o=Number(t>>n&i),a=Number(t&i),c=r?4:0,f=r?0:4;s.setUint32(e+c,o,r),s.setUint32(e+f,a,r)}var ja=(s,e,t)=>s&e^~s&t,Za=(s,e,t)=>s&e^s&t^e&t,Is=class extends _s{constructor(e,t,r,n){super(),this.blockLen=e,this.outputLen=t,this.padOffset=r,this.isLE=n,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(e),this.view=Bs(this.buffer)}update(e){Es(this);let{view:t,buffer:r,blockLen:n}=this;e=Rt(e);let i=e.length;for(let o=0;on-o&&(this.process(r,0),o=0);for(let u=o;ul.length)throw new Error("_sha2: outputLen bigger than state");for(let u=0;u>qi&Hr)}:{h:Number(s>>qi&Hr)|0,l:Number(s&Hr)|0}}function Gh(s,e=!1){let t=new Uint32Array(s.length),r=new Uint32Array(s.length);for(let n=0;nBigInt(s>>>0)<>>0),zh=(s,e,t)=>s>>>t,qh=(s,e,t)=>s<<32-t|e>>>t,Wh=(s,e,t)=>s>>>t|e<<32-t,$h=(s,e,t)=>s<<32-t|e>>>t,jh=(s,e,t)=>s<<64-t|e>>>t-32,Zh=(s,e,t)=>s>>>t-32|e<<64-t,Yh=(s,e)=>e,Xh=(s,e)=>s,Jh=(s,e,t)=>s<>>32-t,Qh=(s,e,t)=>e<>>32-t,ef=(s,e,t)=>e<>>64-t,tf=(s,e,t)=>s<>>64-t;function sf(s,e,t,r){let n=(e>>>0)+(r>>>0);return{h:s+t+(n/2**32|0)|0,l:n|0}}var rf=(s,e,t)=>(s>>>0)+(e>>>0)+(t>>>0),nf=(s,e,t,r)=>e+t+r+(s/2**32|0)|0,of=(s,e,t,r)=>(s>>>0)+(e>>>0)+(t>>>0)+(r>>>0),af=(s,e,t,r,n)=>e+t+r+n+(s/2**32|0)|0,cf=(s,e,t,r,n)=>(s>>>0)+(e>>>0)+(t>>>0)+(r>>>0)+(n>>>0),lf=(s,e,t,r,n,i)=>e+t+r+n+i+(s/2**32|0)|0;var uf={fromBig:Ya,split:Gh,toBig:Kh,shrSH:zh,shrSL:qh,rotrSH:Wh,rotrSL:$h,rotrBH:jh,rotrBL:Zh,rotr32H:Yh,rotr32L:Xh,rotlSH:Jh,rotlSL:Qh,rotlBH:ef,rotlBL:tf,add:sf,add3L:rf,add3H:nf,add4L:of,add4H:af,add5H:lf,add5L:cf},U=uf;var[hf,ff]=U.split(["0x428a2f98d728ae22","0x7137449123ef65cd","0xb5c0fbcfec4d3b2f","0xe9b5dba58189dbbc","0x3956c25bf348b538","0x59f111f1b605d019","0x923f82a4af194f9b","0xab1c5ed5da6d8118","0xd807aa98a3030242","0x12835b0145706fbe","0x243185be4ee4b28c","0x550c7dc3d5ffb4e2","0x72be5d74f27b896f","0x80deb1fe3b1696b1","0x9bdc06a725c71235","0xc19bf174cf692694","0xe49b69c19ef14ad2","0xefbe4786384f25e3","0x0fc19dc68b8cd5b5","0x240ca1cc77ac9c65","0x2de92c6f592b0275","0x4a7484aa6ea6e483","0x5cb0a9dcbd41fbd4","0x76f988da831153b5","0x983e5152ee66dfab","0xa831c66d2db43210","0xb00327c898fb213f","0xbf597fc7beef0ee4","0xc6e00bf33da88fc2","0xd5a79147930aa725","0x06ca6351e003826f","0x142929670a0e6e70","0x27b70a8546d22ffc","0x2e1b21385c26c926","0x4d2c6dfc5ac42aed","0x53380d139d95b3df","0x650a73548baf63de","0x766a0abb3c77b2a8","0x81c2c92e47edaee6","0x92722c851482353b","0xa2bfe8a14cf10364","0xa81a664bbc423001","0xc24b8b70d0f89791","0xc76c51a30654be30","0xd192e819d6ef5218","0xd69906245565a910","0xf40e35855771202a","0x106aa07032bbd1b8","0x19a4c116b8d2d0c8","0x1e376c085141ab53","0x2748774cdf8eeb99","0x34b0bcb5e19b48a8","0x391c0cb3c5c95a63","0x4ed8aa4ae3418acb","0x5b9cca4f7763e373","0x682e6ff3d6b2b8a3","0x748f82ee5defb2fc","0x78a5636f43172f60","0x84c87814a1f0ab72","0x8cc702081a6439ec","0x90befffa23631e28","0xa4506cebde82bde9","0xbef9a3f7b2c67915","0xc67178f2e372532b","0xca273eceea26619c","0xd186b8c721c0c207","0xeada7dd6cde0eb1e","0xf57d4f7fee6ed178","0x06f067aa72176fba","0x0a637dc5a2c898a6","0x113f9804bef90dae","0x1b710b35131c471b","0x28db77f523047d84","0x32caab7b40c72493","0x3c9ebe0a15c9bebc","0x431d67c49c100d4c","0x4cc5d4becb3e42b6","0x597f299cfc657e2a","0x5fcb6fab3ad6faec","0x6c44198c4a475817"].map(s=>BigInt(s))),Mt=new Uint32Array(80),Dt=new Uint32Array(80),Wi=class extends Is{constructor(){super(128,64,16,!1),this.Ah=1779033703,this.Al=-205731576,this.Bh=-1150833019,this.Bl=-2067093701,this.Ch=1013904242,this.Cl=-23791573,this.Dh=-1521486534,this.Dl=1595750129,this.Eh=1359893119,this.El=-1377402159,this.Fh=-1694144372,this.Fl=725511199,this.Gh=528734635,this.Gl=-79577749,this.Hh=1541459225,this.Hl=327033209}get(){let{Ah:e,Al:t,Bh:r,Bl:n,Ch:i,Cl:o,Dh:a,Dl:c,Eh:f,El:l,Fh:u,Fl:h,Gh:p,Gl:g,Hh:d,Hl:m}=this;return[e,t,r,n,i,o,a,c,f,l,u,h,p,g,d,m]}set(e,t,r,n,i,o,a,c,f,l,u,h,p,g,d,m){this.Ah=e|0,this.Al=t|0,this.Bh=r|0,this.Bl=n|0,this.Ch=i|0,this.Cl=o|0,this.Dh=a|0,this.Dl=c|0,this.Eh=f|0,this.El=l|0,this.Fh=u|0,this.Fl=h|0,this.Gh=p|0,this.Gl=g|0,this.Hh=d|0,this.Hl=m|0}process(e,t){for(let w=0;w<16;w++,t+=4)Mt[w]=e.getUint32(t),Dt[w]=e.getUint32(t+=4);for(let w=16;w<80;w++){let A=Mt[w-15]|0,y=Dt[w-15]|0,x=U.rotrSH(A,y,1)^U.rotrSH(A,y,8)^U.shrSH(A,y,7),E=U.rotrSL(A,y,1)^U.rotrSL(A,y,8)^U.shrSL(A,y,7),B=Mt[w-2]|0,D=Dt[w-2]|0,N=U.rotrSH(B,D,19)^U.rotrBH(B,D,61)^U.shrSH(B,D,6),L=U.rotrSL(B,D,19)^U.rotrBL(B,D,61)^U.shrSL(B,D,6),ne=U.add4L(E,L,Dt[w-7],Dt[w-16]),re=U.add4H(ne,x,N,Mt[w-7],Mt[w-16]);Mt[w]=re|0,Dt[w]=ne|0}let{Ah:r,Al:n,Bh:i,Bl:o,Ch:a,Cl:c,Dh:f,Dl:l,Eh:u,El:h,Fh:p,Fl:g,Gh:d,Gl:m,Hh:b,Hl:_}=this;for(let w=0;w<80;w++){let A=U.rotrSH(u,h,14)^U.rotrSH(u,h,18)^U.rotrBH(u,h,41),y=U.rotrSL(u,h,14)^U.rotrSL(u,h,18)^U.rotrBL(u,h,41),x=u&p^~u&d,E=h&g^~h&m,B=U.add5L(_,y,E,ff[w],Dt[w]),D=U.add5H(B,b,A,x,hf[w],Mt[w]),N=B|0,L=U.rotrSH(r,n,28)^U.rotrBH(r,n,34)^U.rotrBH(r,n,39),ne=U.rotrSL(r,n,28)^U.rotrBL(r,n,34)^U.rotrBL(r,n,39),re=r&i^r&a^i&a,Ve=n&o^n&c^o&c;b=d|0,_=m|0,d=p|0,m=g|0,p=u|0,g=h|0,{h:u,l:h}=U.add(f|0,l|0,D|0,N|0),f=a|0,l=c|0,a=i|0,c=o|0,i=r|0,o=n|0;let S=U.add3L(N,ne,Ve);r=U.add3H(S,D,L,re),n=S|0}({h:r,l:n}=U.add(this.Ah|0,this.Al|0,r|0,n|0)),{h:i,l:o}=U.add(this.Bh|0,this.Bl|0,i|0,o|0),{h:a,l:c}=U.add(this.Ch|0,this.Cl|0,a|0,c|0),{h:f,l}=U.add(this.Dh|0,this.Dl|0,f|0,l|0),{h:u,l:h}=U.add(this.Eh|0,this.El|0,u|0,h|0),{h:p,l:g}=U.add(this.Fh|0,this.Fl|0,p|0,g|0),{h:d,l:m}=U.add(this.Gh|0,this.Gl|0,d|0,m|0),{h:b,l:_}=U.add(this.Hh|0,this.Hl|0,b|0,_|0),this.set(r,n,i,o,a,c,f,l,u,h,p,g,d,m,b,_)}roundClean(){Mt.fill(0),Dt.fill(0)}destroy(){this.buffer.fill(0),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}};var As=Fr(()=>new Wi);var Kr={};ue(Kr,{abytes:()=>ks,bitGet:()=>wf,bitLen:()=>yf,bitMask:()=>Js,bitSet:()=>vf,bytesToHex:()=>dt,bytesToNumberBE:()=>pt,bytesToNumberLE:()=>Ct,concatBytes:()=>gt,createHmacDrbg:()=>Zi,ensureBytes:()=>se,equalBytes:()=>mf,hexToBytes:()=>Xt,hexToNumber:()=>ji,isBytes:()=>Nt,numberToBytesBE:()=>Lt,numberToBytesLE:()=>Jt,numberToHexUnpadded:()=>ec,numberToVarBytesBE:()=>gf,utf8ToBytes:()=>bf,validateObject:()=>Xe});var Qa=BigInt(0),Gr=BigInt(1),df=BigInt(2);function Nt(s){return s instanceof Uint8Array||s!=null&&typeof s=="object"&&s.constructor.name==="Uint8Array"}function ks(s){if(!Nt(s))throw new Error("Uint8Array expected")}var pf=Array.from({length:256},(s,e)=>e.toString(16).padStart(2,"0"));function dt(s){ks(s);let e="";for(let t=0;t=ft._0&&s<=ft._9)return s-ft._0;if(s>=ft._A&&s<=ft._F)return s-(ft._A-10);if(s>=ft._a&&s<=ft._f)return s-(ft._a-10)}function Xt(s){if(typeof s!="string")throw new Error("hex string expected, got "+typeof s);let e=s.length,t=e/2;if(e%2)throw new Error("padded hex string expected, got unpadded hex of length "+e);let r=new Uint8Array(t);for(let n=0,i=0;nQa;s>>=Gr,e+=1);return e}function wf(s,e){return s>>BigInt(e)&Gr}function vf(s,e,t){return s|(t?Gr:Qa)<(df<new Uint8Array(s),Ja=s=>Uint8Array.from(s);function Zi(s,e,t){if(typeof s!="number"||s<2)throw new Error("hashLen must be a number");if(typeof e!="number"||e<2)throw new Error("qByteLen must be a number");if(typeof t!="function")throw new Error("hmacFn must be a function");let r=$i(s),n=$i(s),i=0,o=()=>{r.fill(1),n.fill(0),i=0},a=(...u)=>t(n,r,...u),c=(u=$i())=>{n=a(Ja([0]),u),r=a(),u.length!==0&&(n=a(Ja([1]),u),r=a())},f=()=>{if(i++>=1e3)throw new Error("drbg: tried 1000 values");let u=0,h=[];for(;u{o(),c(u);let p;for(;!(p=h(f()));)c();return o(),p}}var xf={bigint:s=>typeof s=="bigint",function:s=>typeof s=="function",boolean:s=>typeof s=="boolean",string:s=>typeof s=="string",stringOrUint8Array:s=>typeof s=="string"||Nt(s),isSafeInteger:s=>Number.isSafeInteger(s),array:s=>Array.isArray(s),field:(s,e)=>e.Fp.isValid(s),hash:s=>typeof s=="function"&&Number.isSafeInteger(s.outputLen)};function Xe(s,e,t={}){let r=(n,i,o)=>{let a=xf[i];if(typeof a!="function")throw new Error(`Invalid validator "${i}", expected function`);let c=s[n];if(!(o&&c===void 0)&&!a(c,s))throw new Error(`Invalid param ${String(n)}=${c} (${typeof c}), expected ${i}`)};for(let[n,i]of Object.entries(e))r(n,i,!1);for(let[n,i]of Object.entries(t))r(n,i,!0);return s}var le=BigInt(0),Y=BigInt(1),Qt=BigInt(2),Ef=BigInt(3),Yi=BigInt(4),tc=BigInt(5),sc=BigInt(8),_f=BigInt(9),Bf=BigInt(16);function j(s,e){let t=s%e;return t>=le?t:e+t}function Sf(s,e,t){if(t<=le||e 0");if(t===Y)return le;let r=Y;for(;e>le;)e&Y&&(r=r*s%t),s=s*s%t,e>>=Y;return r}function X(s,e,t){let r=s;for(;e-- >le;)r*=r,r%=t;return r}function zr(s,e){if(s===le||e<=le)throw new Error(`invert: expected positive integers, got n=${s} mod=${e}`);let t=j(s,e),r=e,n=le,i=Y,o=Y,a=le;for(;t!==le;){let f=r/t,l=r%t,u=n-o*f,h=i-a*f;r=t,t=l,n=o,i=a,o=u,a=h}if(r!==Y)throw new Error("invert: does not exist");return j(n,e)}function If(s){let e=(s-Y)/Qt,t,r,n;for(t=s-Y,r=0;t%Qt===le;t/=Qt,r++);for(n=Qt;n(j(s,e)&Y)===Y,kf=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function Xi(s){let e={ORDER:"bigint",MASK:"bigint",BYTES:"isSafeInteger",BITS:"isSafeInteger"},t=kf.reduce((r,n)=>(r[n]="function",r),e);return Xe(s,t)}function Tf(s,e,t){if(t 0");if(t===le)return s.ONE;if(t===Y)return e;let r=s.ONE,n=e;for(;t>le;)t&Y&&(r=s.mul(r,n)),n=s.sqr(n),t>>=Y;return r}function Pf(s,e){let t=new Array(e.length),r=e.reduce((i,o,a)=>s.is0(o)?i:(t[a]=i,s.mul(i,o)),s.ONE),n=s.inv(r);return e.reduceRight((i,o,a)=>s.is0(o)?i:(t[a]=s.mul(i,t[a]),s.mul(i,o)),n),t}function Ji(s,e){let t=e!==void 0?e:s.toString(2).length,r=Math.ceil(t/8);return{nBitLength:t,nByteLength:r}}function qr(s,e,t=!1,r={}){if(s<=le)throw new Error(`Expected Field ORDER > 0, got ${s}`);let{nBitLength:n,nByteLength:i}=Ji(s,e);if(i>2048)throw new Error("Field lengths over 2048 bytes are not supported");let o=Af(s),a=Object.freeze({ORDER:s,BITS:n,BYTES:i,MASK:Js(n),ZERO:le,ONE:Y,create:c=>j(c,s),isValid:c=>{if(typeof c!="bigint")throw new Error(`Invalid field element: expected bigint, got ${typeof c}`);return le<=c&&cc===le,isOdd:c=>(c&Y)===Y,neg:c=>j(-c,s),eql:(c,f)=>c===f,sqr:c=>j(c*c,s),add:(c,f)=>j(c+f,s),sub:(c,f)=>j(c-f,s),mul:(c,f)=>j(c*f,s),pow:(c,f)=>Tf(a,c,f),div:(c,f)=>j(c*zr(f,s),s),sqrN:c=>c*c,addN:(c,f)=>c+f,subN:(c,f)=>c-f,mulN:(c,f)=>c*f,inv:c=>zr(c,s),sqrt:r.sqrt||(c=>o(a,c)),invertBatch:c=>Pf(a,c),cmov:(c,f,l)=>l?f:c,toBytes:c=>t?Jt(c,i):Lt(c,i),fromBytes:c=>{if(c.length!==i)throw new Error(`Fp.fromBytes: expected ${i}, got ${c.length}`);return t?Ct(c):pt(c)}});return Object.freeze(a)}function nc(s,e){if(!s.isOdd)throw new Error("Field doesn't have isOdd");let t=s.sqrt(e);return s.isOdd(t)?s.neg(t):t}function ic(s){if(typeof s!="bigint")throw new Error("field order must be bigint");let e=s.toString(2).length;return Math.ceil(e/8)}function Qi(s){let e=ic(s);return e+Math.ceil(e/2)}function oc(s,e,t=!1){let r=s.length,n=ic(e),i=Qi(e);if(r<16||r1024)throw new Error(`expected ${i}-1024 bytes of input, got ${r}`);let o=t?pt(s):Ct(s),a=j(o,e-Y)+Y;return t?Jt(a,n):Lt(a,n)}var Mf=BigInt(0),eo=BigInt(1);function Wr(s,e){let t=(n,i)=>{let o=i.negate();return n?o:i},r=n=>{let i=Math.ceil(e/n)+1,o=2**(n-1);return{windows:i,windowSize:o}};return{constTimeNegate:t,unsafeLadder(n,i){let o=s.ZERO,a=n;for(;i>Mf;)i&eo&&(o=o.add(a)),a=a.double(),i>>=eo;return o},precomputeWindow(n,i){let{windows:o,windowSize:a}=r(i),c=[],f=n,l=f;for(let u=0;u>=p,m>c&&(m-=h,o+=eo);let b=d,_=d+Math.abs(m)-1,w=g%2!==0,A=m<0;m===0?l=l.add(t(w,i[b])):f=f.add(t(A,i[_]))}return{p:f,f:l}},wNAFCached(n,i,o,a){let c=n._WINDOW_SIZE||1,f=i.get(n);return f||(f=this.precomputeWindow(n,c),c!==1&&i.set(n,a(f))),this.wNAF(c,f,o)}}}function Qs(s){return Xi(s.Fp),Xe(s,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),Object.freeze({...Ji(s.n,s.nBitLength),...s,p:s.Fp.ORDER})}var We=BigInt(0),Le=BigInt(1),$r=BigInt(2),Df=BigInt(8),Nf={zip215:!0};function Cf(s){let e=Qs(s);return Xe(s,{hash:"function",a:"bigint",d:"bigint",randomBytes:"function"},{adjustScalarBytes:"function",domain:"function",uvRatio:"function",mapToCurve:"function"}),Object.freeze({...e})}function jr(s){let e=Cf(s),{Fp:t,n:r,prehash:n,hash:i,randomBytes:o,nByteLength:a,h:c}=e,f=$r<{try{return{isValid:!0,value:t.sqrt(I*t.inv(v))}}catch{return{isValid:!1,value:We}}}),h=e.adjustScalarBytes||(I=>I),p=e.domain||((I,v,P)=>{if(v.length||P)throw new Error("Contexts/pre-hash are not supported");return I}),g=I=>typeof I=="bigint"&&Weg(I)&&g(v)&&II===We||d(I,f);function b(I,v){if(d(I,v))return I;throw new Error(`Expected valid scalar < ${v}, got ${typeof I} ${I}`)}function _(I){return I===We?I:b(I,r)}let w=new Map;function A(I){if(!(I instanceof y))throw new Error("ExtendedPoint expected")}class y{constructor(v,P,M,C){if(this.ex=v,this.ey=P,this.ez=M,this.et=C,!m(v))throw new Error("x required");if(!m(P))throw new Error("y required");if(!m(M))throw new Error("z required");if(!m(C))throw new Error("t required")}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static fromAffine(v){if(v instanceof y)throw new Error("extended point not allowed");let{x:P,y:M}=v||{};if(!m(P)||!m(M))throw new Error("invalid affine point");return new y(P,M,Le,l(P*M))}static normalizeZ(v){let P=t.invertBatch(v.map(M=>M.ez));return v.map((M,C)=>M.toAffine(P[C])).map(y.fromAffine)}_setWindowSize(v){this._WINDOW_SIZE=v,w.delete(this)}assertValidity(){let{a:v,d:P}=e;if(this.is0())throw new Error("bad point: ZERO");let{ex:M,ey:C,ez:O,et:F}=this,z=l(M*M),G=l(C*C),K=l(O*O),ie=l(K*K),ee=l(z*v),fe=l(K*l(ee+G)),de=l(ie+l(P*l(z*G)));if(fe!==de)throw new Error("bad point: equation left != right (1)");let ae=l(M*C),ge=l(O*F);if(ae!==ge)throw new Error("bad point: equation left != right (2)")}equals(v){A(v);let{ex:P,ey:M,ez:C}=this,{ex:O,ey:F,ez:z}=v,G=l(P*z),K=l(O*C),ie=l(M*z),ee=l(F*C);return G===K&&ie===ee}is0(){return this.equals(y.ZERO)}negate(){return new y(l(-this.ex),this.ey,this.ez,l(-this.et))}double(){let{a:v}=e,{ex:P,ey:M,ez:C}=this,O=l(P*P),F=l(M*M),z=l($r*l(C*C)),G=l(v*O),K=P+M,ie=l(l(K*K)-O-F),ee=G+F,fe=ee-z,de=G-F,ae=l(ie*fe),ge=l(ee*de),ot=l(ie*de),zt=l(fe*ee);return new y(ae,ge,zt,ot)}add(v){A(v);let{a:P,d:M}=e,{ex:C,ey:O,ez:F,et:z}=this,{ex:G,ey:K,ez:ie,et:ee}=v;if(P===BigInt(-1)){let Mo=l((O-C)*(K+G)),Do=l((O+C)*(K-G)),Wn=l(Do-Mo);if(Wn===We)return this.double();let No=l(F*$r*ee),Co=l(z*$r*ie),Lo=Co+No,Uo=Do+Mo,Vo=Co-No,Wl=l(Lo*Wn),$l=l(Uo*Vo),jl=l(Lo*Vo),Zl=l(Wn*Uo);return new y(Wl,$l,Zl,jl)}let fe=l(C*G),de=l(O*K),ae=l(z*M*ee),ge=l(F*ie),ot=l((C+O)*(G+K)-fe-de),zt=ge-ae,Fs=ge+ae,Ro=l(de-P*fe),Gl=l(ot*zt),Kl=l(Fs*Ro),zl=l(ot*Ro),ql=l(zt*Fs);return new y(Gl,Kl,ql,zl)}subtract(v){return this.add(v.negate())}wNAF(v){return B.wNAFCached(this,w,v,y.normalizeZ)}multiply(v){let{p:P,f:M}=this.wNAF(b(v,r));return y.normalizeZ([P,M])[0]}multiplyUnsafe(v){let P=_(v);return P===We?E:this.equals(E)||P===Le?this:this.equals(x)?this.wNAF(P).p:B.unsafeLadder(this,P)}isSmallOrder(){return this.multiplyUnsafe(c).is0()}isTorsionFree(){return B.unsafeLadder(this,r).is0()}toAffine(v){let{ex:P,ey:M,ez:C}=this,O=this.is0();v==null&&(v=O?Df:t.inv(C));let F=l(P*v),z=l(M*v),G=l(C*v);if(O)return{x:We,y:Le};if(G!==Le)throw new Error("invZ was invalid");return{x:F,y:z}}clearCofactor(){let{h:v}=e;return v===Le?this:this.multiplyUnsafe(v)}static fromHex(v,P=!1){let{d:M,a:C}=e,O=t.BYTES;v=se("pointHex",v,O);let F=v.slice(),z=v[O-1];F[O-1]=z&-129;let G=Ct(F);G===We||(P?b(G,f):b(G,t.ORDER));let K=l(G*G),ie=l(K-Le),ee=l(M*K-C),{isValid:fe,value:de}=u(ie,ee);if(!fe)throw new Error("Point.fromHex: invalid y coordinate");let ae=(de&Le)===Le,ge=(z&128)!==0;if(!P&&de===We&&ge)throw new Error("Point.fromHex: x=0 and x_0=1");return ge!==ae&&(de=l(-de)),y.fromAffine({x:de,y:G})}static fromPrivateKey(v){return L(v).point}toRawBytes(){let{x:v,y:P}=this.toAffine(),M=Jt(P,t.BYTES);return M[M.length-1]|=v&Le?128:0,M}toHex(){return dt(this.toRawBytes())}}y.BASE=new y(e.Gx,e.Gy,Le,l(e.Gx*e.Gy)),y.ZERO=new y(We,Le,Le,We);let{BASE:x,ZERO:E}=y,B=Wr(y,a*8);function D(I){return j(I,r)}function N(I){return D(Ct(I))}function L(I){let v=a;I=se("private key",I,v);let P=se("hashed private key",i(I),2*v),M=h(P.slice(0,v)),C=P.slice(v,2*v),O=N(M),F=x.multiply(O),z=F.toRawBytes();return{head:M,prefix:C,scalar:O,point:F,pointBytes:z}}function ne(I){return L(I).pointBytes}function re(I=new Uint8Array,...v){let P=gt(...v);return N(i(p(P,se("context",I),!!n)))}function Ve(I,v,P={}){I=se("message",I),n&&(I=n(I));let{prefix:M,scalar:C,pointBytes:O}=L(v),F=re(P.context,M,I),z=x.multiply(F).toRawBytes(),G=re(P.context,z,O,I),K=D(F+G*C);_(K);let ie=gt(z,Jt(K,t.BYTES));return se("result",ie,a*2)}let S=Nf;function R(I,v,P,M=S){let{context:C,zip215:O}=M,F=t.BYTES;I=se("signature",I,2*F),v=se("message",v),n&&(v=n(v));let z=Ct(I.slice(F,2*F)),G,K,ie;try{G=y.fromHex(P,O),K=y.fromHex(I.slice(0,F),O),ie=x.multiplyUnsafe(z)}catch{return!1}if(!O&&G.isSmallOrder())return!1;let ee=re(C,K.toRawBytes(),G.toRawBytes(),v);return K.add(G.multiplyUnsafe(ee)).subtract(ie).clearCofactor().equals(y.ZERO)}return x._setWindowSize(8),{CURVE:e,getPublicKey:ne,sign:Ve,verify:R,ExtendedPoint:y,utils:{getExtendedPublicKey:L,randomPrivateKey:()=>o(t.BYTES),precompute(I=8,v=y.BASE){return v._setWindowSize(I),v.multiply(BigInt(3)),v}}}}var so=BigInt("57896044618658097711785492504343953926634992332820282019728792003956564819949"),ac=BigInt("19681161376707505956807079304988542015446066515923890162744021073123829784752"),yb=BigInt(0),Lf=BigInt(1),to=BigInt(2),Uf=BigInt(5),cc=BigInt(10),Vf=BigInt(20),Of=BigInt(40),lc=BigInt(80);function Ff(s){let e=so,r=s*s%e*s%e,n=X(r,to,e)*r%e,i=X(n,Lf,e)*s%e,o=X(i,Uf,e)*i%e,a=X(o,cc,e)*o%e,c=X(a,Vf,e)*a%e,f=X(c,Of,e)*c%e,l=X(f,lc,e)*f%e,u=X(l,lc,e)*f%e,h=X(u,cc,e)*o%e;return{pow_p_5_8:X(h,to,e)*s%e,b2:r}}function Hf(s){return s[0]&=248,s[31]&=127,s[31]|=64,s}function Gf(s,e){let t=so,r=j(e*e*e,t),n=j(r*r*e,t),i=Ff(s*n).pow_p_5_8,o=j(s*r*i,t),a=j(e*o*o,t),c=o,f=j(o*ac,t),l=a===s,u=a===j(-s,t),h=a===j(-s*ac,t);return l&&(o=c),(u||h)&&(o=f),rc(o,t)&&(o=j(-o,t)),{isValid:l||u,value:o}}var mt=qr(so,void 0,!0),ro={a:BigInt(-1),d:BigInt("37095705934669439343138083508754565189542113879843219016388785533085940283555"),Fp:mt,n:BigInt("7237005577332262213973186563042994240857116359379907606001950938285454250989"),h:BigInt(8),Gx:BigInt("15112221349535400772501151409588531511454012693041857206046113283949847762202"),Gy:BigInt("46316835694926478169428394003475163141307993866256225615783033603165251855960"),hash:As,randomBytes:Ss,adjustScalarBytes:Hf,uvRatio:Gf},Ts=jr(ro);function uc(s,e,t){if(e.length>255)throw new Error("Context is too big");return Or(zi("SigEd25519 no Ed25519 collisions"),new Uint8Array([t?1:0,e.length]),e,s)}var wb=jr({...ro,domain:uc}),vb=jr({...ro,domain:uc,prehash:As});var Kf=(mt.ORDER+BigInt(3))/BigInt(8),xb=mt.pow(to,Kf),Eb=mt.sqrt(mt.neg(mt.ONE)),_b=(mt.ORDER-BigInt(5))/BigInt(8),Bb=BigInt(486662);var Sb=nc(mt,mt.neg(BigInt(486664)));var Ib=BigInt("25063068953384623474111414158702152701244531502492656460079210482610430750235"),Ab=BigInt("54469307008909316920995813868745141605393597292927456921205312896311721017578"),kb=BigInt("1159843021668779879193775521855586647937357759715417654439879720876111806838"),Tb=BigInt("40440834346308536858101042469323190826248399146238708352240133220865137265952");var Pb=BigInt("0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");var Ps=32,bt=64,Zr=32;function hc(){let s=Ts.utils.randomPrivateKey(),e=Ts.getPublicKey(s);return{privateKey:gc(s,e),publicKey:e}}function fc(s){if(s.length!==Zr)throw new TypeError('"seed" must be 32 bytes in length.');if(!(s instanceof Uint8Array))throw new TypeError('"seed" must be a node.js Buffer, or Uint8Array.');let e=s,t=Ts.getPublicKey(e);return{privateKey:gc(e,t),publicKey:t}}function dc(s,e){let t=s.subarray(0,Zr);return Ts.sign(e instanceof Uint8Array?e:e.subarray(),t)}function pc(s,e,t){return Ts.verify(e,t instanceof Uint8Array?t:t.subarray(),s)}function gc(s,e){let t=new Uint8Array(bt);for(let r=0;rGi(io)})(J||(J={}));var Je;(function(s){let e;s.codec=()=>(e==null&&(e=De((t,r,n={})=>{n.lengthDelimited!==!1&&r.fork(),t.Type!=null&&(r.uint32(8),J.codec().encode(t.Type,r)),t.Data!=null&&(r.uint32(18),r.bytes(t.Data)),n.lengthDelimited!==!1&&r.ldelim()},(t,r)=>{let n={},i=r==null?t.len:t.pos+r;for(;t.pos>>3){case 1:n.Type=J.codec().decode(t);break;case 2:n.Data=t.bytes();break;default:t.skipType(o&7);break}}return n})),e),s.encode=t=>Me(t,s.codec()),s.decode=t=>Re(t,s.codec())})(Je||(Je={}));var Qe;(function(s){let e;s.codec=()=>(e==null&&(e=De((t,r,n={})=>{n.lengthDelimited!==!1&&r.fork(),t.Type!=null&&(r.uint32(8),J.codec().encode(t.Type,r)),t.Data!=null&&(r.uint32(18),r.bytes(t.Data)),n.lengthDelimited!==!1&&r.ldelim()},(t,r)=>{let n={},i=r==null?t.len:t.pos+r;for(;t.pos>>3){case 1:n.Type=J.codec().decode(t);break;case 2:n.Data=t.bytes();break;default:t.skipType(o&7);break}}return n})),e),s.encode=t=>Me(t,s.codec()),s.decode=t=>Re(t,s.codec())})(Qe||(Qe={}));var er=class{_key;constructor(e){this._key=Ms(e,Ps)}verify(e,t){return pc(this._key,t,e)}marshal(){return this._key}get bytes(){return Je.encode({Type:J.Ed25519,Data:this.marshal()}).subarray()}equals(e){return be(this.bytes,e.bytes)}hash(){let e=ce.digest(this.bytes);return Fe(e)?e.then(({bytes:t})=>t):e.bytes}},es=class{_key;_publicKey;constructor(e,t){this._key=Ms(e,bt),this._publicKey=Ms(t,Ps)}sign(e){return dc(this._key,e)}get public(){return new er(this._publicKey)}marshal(){return this._key}get bytes(){return Qe.encode({Type:J.Ed25519,Data:this.marshal()}).subarray()}equals(e){return be(this.bytes,e.bytes)}async hash(){let e=ce.digest(this.bytes),t;return Fe(e)?{bytes:t}=await e:t=e.bytes,t}async id(){let e=ls.digest(this.public.bytes);return me.encode(e.bytes).substring(1)}async export(e,t="libp2p-key"){if(t==="libp2p-key")return Rs(this.bytes,e);throw new T(`export format '${t}' is not supported`,"ERR_INVALID_EXPORT_FORMAT")}};function Wf(s){if(s.length>bt){s=Ms(s,bt+Ps);let r=s.subarray(0,bt),n=s.subarray(bt,s.length);return new es(r,n)}s=Ms(s,bt);let e=s.subarray(0,bt),t=s.subarray(Ps);return new es(e,t)}function $f(s){return s=Ms(s,Ps),new er(s)}async function jf(){let{privateKey:s,publicKey:e}=hc();return new es(s,e)}async function bc(s){let{privateKey:e,publicKey:t}=fc(s);return new es(e,t)}function Ms(s,e){if(s=Uint8Array.from(s??[]),s.length!==e)throw new T(`Key must be a Uint8Array of length ${e}, got ${s.length}`,"ERR_INVALID_KEY_TYPE");return s}function W(s,e="utf8"){let t=Ir[e];if(t==null)throw new Error(`Unsupported encoding "${e}"`);return t.encoder.encode(s).substring(1)}var bo={};ue(bo,{MAX_RSA_KEY_SIZE:()=>fr,RsaPrivateKey:()=>Us,RsaPublicKey:()=>hr,fromJwk:()=>xd,generateKeyPair:()=>Ed,unmarshalRsaPrivateKey:()=>go,unmarshalRsaPublicKey:()=>vd});function et(s){if(isNaN(s)||s<=0)throw new T("random bytes length must be a Number bigger than 0","ERR_INVALID_LENGTH");return Ss(s)}var Ft={};ue(Ft,{exportToPem:()=>gd,importFromPem:()=>md,jwkToPkcs1:()=>hd,jwkToPkix:()=>dd,pkcs1ToJwk:()=>ud,pkixToJwk:()=>fd});var Xr=class extends _s{constructor(e,t){super(),this.finished=!1,this.destroyed=!1,Ur(e);let r=Rt(t);if(this.iHash=e.create(),typeof this.iHash.update!="function")throw new Error("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;let n=this.blockLen,i=new Uint8Array(n);i.set(r.length>n?e.create().update(r).digest():r);for(let o=0;onew Xr(s,e).update(t).digest();tr.create=(s,e)=>new Xr(s,e);function Zf(s,e,t,r){Ur(s);let n=$a({dkLen:32,asyncTick:10},r),{c:i,dkLen:o,asyncTick:a}=n;if(vs(i),vs(o),vs(a),i<1)throw new Error("PBKDF2: iterations (c) should be >= 1");let c=Rt(e),f=Rt(t),l=new Uint8Array(o),u=tr.create(s,c),h=u._cloneInto().update(f);return{c:i,dkLen:o,asyncTick:a,DK:l,PRF:u,PRFSalt:h}}function Yf(s,e,t,r,n){return s.destroy(),e.destroy(),r&&r.destroy(),n.fill(0),t}async function ao(s,e,t,r){let{c:n,dkLen:i,asyncTick:o,DK:a,PRF:c,PRFSalt:f}=Zf(s,e,t,r),l,u=new Uint8Array(4),h=Bs(u),p=new Uint8Array(c.outputLen);for(let g=1,d=0;d{c._cloneInto(l).update(p).digestInto(p);for(let b=0;b=0;r--)t+=s[s.length-1-r]*Math.pow(2,e*r);return t}function Ut(s,e,t=-1){let r=t,n=s,i=0,o=Math.pow(2,e);for(let a=1;a<8;a++){if(s=0;l--){let u=Math.pow(2,l*e);f[i-l-1]=Math.floor(n/u),n-=f[i-l-1]*u}return c}o*=Math.pow(2,e)}return new ArrayBuffer(0)}function en(...s){let e=0,t=0;for(let i of s)e+=i.length;let r=new ArrayBuffer(e),n=new Uint8Array(r);for(let i of s)n.set(i,t),t+=i.length;return n}function lo(){let s=new Uint8Array(this.valueHex);if(this.valueHex.byteLength>=2){let a=s[0]===255&&s[1]&128,c=s[0]===0&&(s[1]&128)===0;(a||c)&&this.warnings.push("Needlessly long format")}let e=new ArrayBuffer(this.valueHex.byteLength),t=new Uint8Array(e);for(let a=0;a"u")throw new Error("BigInt is not defined. Your environment doesn't implement BigInt.")}function uo(s){let e=0,t=0;for(let n=0;n=i.length)return this.error="End of input reached before message was fully decoded",-1;if(c===l){l+=255;let h=new Uint8Array(l);for(let p=0;p8)return this.error="Too big integer",-1;if(o+1>i.length)return this.error="End of input reached before message was fully decoded",-1;let a=t+1,c=n.subarray(a,a+o);return c[o-1]===0&&this.warnings.push("Needlessly long encoded length"),this.length=ts(c,8),this.longFormUsed&&this.length<=127&&this.warnings.push("Unnecessary usage of long length form"),this.blockLength=o+1,t+this.blockLength}toBER(e=!1){let t,r;if(this.length>127&&(this.longFormUsed=!0),this.isIndefiniteForm)return t=new ArrayBuffer(1),e===!1&&(r=new Uint8Array(t),r[0]=128),t;if(this.longFormUsed){let n=Ut(this.length,8);if(n.byteLength>127)return this.error="Too big length",je;if(t=new ArrayBuffer(n.byteLength+1),e)return t;let i=new Uint8Array(n);r=new Uint8Array(t),r[0]=n.byteLength|128;for(let o=0;o=37&&n.idBlock.isHexOnly===!1)return n.error="UNIVERSAL 37 and upper tags are reserved by ASN.1 standard",{offset:-1,result:n};switch(n.idBlock.tagNumber){case 0:if(n.idBlock.isConstructed&&n.lenBlock.length>0)return n.error="Type [UNIVERSAL 0] is reserved",{offset:-1,result:n};c=k.EndOfContent;break;case 1:c=k.Boolean;break;case 2:c=k.Integer;break;case 3:c=k.BitString;break;case 4:c=k.OctetString;break;case 5:c=k.Null;break;case 6:c=k.ObjectIdentifier;break;case 10:c=k.Enumerated;break;case 12:c=k.Utf8String;break;case 13:c=k.RelativeObjectIdentifier;break;case 14:c=k.TIME;break;case 15:return n.error="[UNIVERSAL 15] is reserved by ASN.1 standard",{offset:-1,result:n};case 16:c=k.Sequence;break;case 17:c=k.Set;break;case 18:c=k.NumericString;break;case 19:c=k.PrintableString;break;case 20:c=k.TeletexString;break;case 21:c=k.VideotexString;break;case 22:c=k.IA5String;break;case 23:c=k.UTCTime;break;case 24:c=k.GeneralizedTime;break;case 25:c=k.GraphicString;break;case 26:c=k.VisibleString;break;case 27:c=k.GeneralString;break;case 28:c=k.UniversalString;break;case 29:c=k.CharacterString;break;case 30:c=k.BmpString;break;case 31:c=k.DATE;break;case 32:c=k.TimeOfDay;break;case 33:c=k.DateTime;break;case 34:c=k.Duration;break;default:{let f=n.idBlock.isConstructed?new k.Constructed:new k.Primitive;f.idBlock=n.idBlock,f.lenBlock=n.lenBlock,f.warnings=n.warnings,n=f}}break;case 2:case 3:case 4:default:c=n.idBlock.isConstructed?k.Constructed:k.Primitive}return n=id(n,c),a=n.fromBER(s,e,n.lenBlock.isIndefiniteForm?t:n.lenBlock.length),n.valueBeforeDecodeView=s.subarray(r,r+n.blockLength),{offset:a,result:n}}function Ls(s){if(!s.byteLength){let e=new pe({},_e);return e.error="Input buffer has zero length",{offset:-1,result:e}}return Fn(H.BufferSourceConverter.toUint8Array(s).slice(),0,s.byteLength)}function od(s,e){return s?1:e}var tt=class extends _e{constructor({value:e=[],isIndefiniteForm:t=!1,...r}={}){super(r),this.value=e,this.isIndefiniteForm=t}fromBER(e,t,r){let n=H.BufferSourceConverter.toUint8Array(e);if(!Et(this,n,t,r))return-1;if(this.valueBeforeDecodeView=n.subarray(t,t+r),this.valueBeforeDecodeView.length===0)return this.warnings.push("Zero buffer length"),t;let i=t;for(;od(this.isIndefiniteForm,r)>0;){let o=Fn(n,i,r);if(o.offset===-1)return this.error=o.result.error,this.warnings.concat(o.result.warnings),-1;if(i=o.offset,this.blockLength+=o.result.blockLength,r-=o.result.blockLength,this.value.push(o.result),this.isIndefiniteForm&&o.result.constructor.NAME===nr)break}return this.isIndefiniteForm&&(this.value[this.value.length-1].constructor.NAME===nr?this.value.pop():this.warnings.push("No EndOfContent block encoded")),i}toBER(e,t){let r=t||new rr;for(let n=0;n{var Rl=Object.create;var rr=Object.defineProperty;var Ll=Object.getOwnPropertyDescriptor;var Ul=Object.getOwnPropertyNames;var Fl=Object.getPrototypeOf,Vl=Object.prototype.hasOwnProperty;var Po=(s,e)=>()=>(e||s((e={exports:{}}).exports,e),e.exports),ve=(s,e)=>{for(var t in e)rr(s,t,{get:e[t],enumerable:!0})},Do=(s,e,t,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of Ul(e))!Vl.call(s,n)&&n!==t&&rr(s,n,{get:()=>e[n],enumerable:!(r=Ll(e,n))||r.enumerable});return s};var Co=(s,e,t)=>(t=s!=null?Rl(Fl(s)):{},Do(e||!s||!s.__esModule?rr(t,"default",{value:s,enumerable:!0}):t,s)),Hl=s=>Do(rr({},"__esModule",{value:!0}),s);var Na=Po(ds=>{"use strict";var ff="[object ArrayBuffer]",ut=class s{static isArrayBuffer(e){return Object.prototype.toString.call(e)===ff}static toArrayBuffer(e){return this.isArrayBuffer(e)?e:e.byteLength===e.buffer.byteLength||e.byteOffset===0&&e.byteLength===e.buffer.byteLength?e.buffer:this.toUint8Array(e.buffer).slice(e.byteOffset,e.byteOffset+e.byteLength).buffer}static toUint8Array(e){return this.toView(e,Uint8Array)}static toView(e,t){if(e.constructor===t)return e;if(this.isArrayBuffer(e))return new t(e);if(this.isArrayBufferView(e))return new t(e.buffer,e.byteOffset,e.byteLength);throw new TypeError("The provided value is not of type '(ArrayBuffer or ArrayBufferView)'")}static isBufferSource(e){return this.isArrayBufferView(e)||this.isArrayBuffer(e)}static isArrayBufferView(e){return ArrayBuffer.isView(e)||e&&this.isArrayBuffer(e.buffer)}static isEqual(e,t){let r=s.toUint8Array(e),n=s.toUint8Array(t);if(r.length!==n.byteLength)return!1;for(let i=0;in.byteLength).reduce((n,i)=>n+i),t=new Uint8Array(e),r=0;return s.map(n=>new Uint8Array(n)).forEach(n=>{for(let i of n)t[r++]=i}),t.buffer}function yf(s,e){if(!(s&&e)||s.byteLength!==e.byteLength)return!1;let t=new Uint8Array(s),r=new Uint8Array(e);for(let n=0;n{"use strict";function Y(s,t){var t=t||{};this._capacity=t.capacity,this._head=0,this._tail=0,Array.isArray(s)?this._fromArray(s):(this._capacityMask=3,this._list=new Array(4))}Y.prototype.peekAt=function(e){var t=e;if(t===(t|0)){var r=this.size();if(!(t>=r||t<-r))return t<0&&(t+=r),t=this._head+t&this._capacityMask,this._list[t]}};Y.prototype.get=function(e){return this.peekAt(e)};Y.prototype.peek=function(){if(this._head!==this._tail)return this._list[this._head]};Y.prototype.peekFront=function(){return this.peek()};Y.prototype.peekBack=function(){return this.peekAt(-1)};Object.defineProperty(Y.prototype,"length",{get:function(){return this.size()}});Y.prototype.size=function(){return this._head===this._tail?0:this._headthis._capacity&&this.pop(),this._head1e4&&this._tail<=this._list.length>>>2&&this._shrinkArray(),t}};Y.prototype.push=function(e){if(arguments.length===0)return this.size();var t=this._tail;return this._list[t]=e,this._tail=t+1&this._capacityMask,this._tail===this._head&&this._growArray(),this._capacity&&this.size()>this._capacity&&this.shift(),this._head1e4&&e<=t>>>2&&this._shrinkArray(),r}};Y.prototype.removeOne=function(e){var t=e;if(t===(t|0)&&this._head!==this._tail){var r=this.size(),n=this._list.length;if(!(t>=r||t<-r)){t<0&&(t+=r),t=this._head+t&this._capacityMask;var i=this._list[t],o;if(e0;o--)this._list[t]=this._list[t=t-1+n&this._capacityMask];this._list[t]=void 0,this._head=this._head+1+n&this._capacityMask}else{for(o=r-1-e;o>0;o--)this._list[t]=this._list[t=t+1+n&this._capacityMask];this._list[t]=void 0,this._tail=this._tail-1+n&this._capacityMask}return i}}};Y.prototype.remove=function(e,t){var r=e,n,i=t;if(r===(r|0)&&this._head!==this._tail){var o=this.size(),a=this._list.length;if(!(r>=o||r<-o||t<1)){if(r<0&&(r+=o),t===1||!t)return n=new Array(1),n[0]=this.removeOne(r),n;if(r===0&&r+t>=o)return n=this.toArray(),this.clear(),n;r+t>o&&(t=o-r);var c;for(n=new Array(t),c=0;c0;c--)this._list[r=r+1+a&this._capacityMask]=void 0;return n}if(e===0){for(this._head=this._head+t+a&this._capacityMask,c=t-1;c>0;c--)this._list[r=r+1+a&this._capacityMask]=void 0;return n}if(r0;c--)this.unshift(this._list[r=r-1+a&this._capacityMask]);for(r=this._head-1+a&this._capacityMask;i>0;)this._list[r=r-1+a&this._capacityMask]=void 0,i--;e<0&&(this._tail=r)}else{for(this._tail=r,r=r+t+a&this._capacityMask,c=o-(t+e);c>0;c--)this.push(this._list[r++]);for(r=this._tail;i>0;)this._list[r=r+1+a&this._capacityMask]=void 0,i--}return this._head<2&&this._tail>1e4&&this._tail<=a>>>2&&this._shrinkArray(),n}}};Y.prototype.splice=function(e,t){var r=e;if(r===(r|0)){var n=this.size();if(r<0&&(r+=n),!(r>n))if(arguments.length>2){var i,o,a,c=arguments.length,f=this._list.length,u=2;if(!n||r0&&(this._head=this._head+r+f&this._capacityMask)):(a=this.remove(r,t),this._head=this._head+r+f&this._capacityMask);c>u;)this.unshift(arguments[--c]);for(i=r;i>0;i--)this.unshift(o[i-1])}else{o=new Array(n-(r+t));var h=o.length;for(i=0;ithis._tail){for(c=this._head;c>>=1,this._capacityMask>>>=1};Y.prototype._nextPowerOf2=function(e){var t=Math.log(e)/Math.log(2),r=1<On,gossipsub:()=>Fd,multicodec:()=>Ud});var Gn=Symbol.for("@libp2p/peer-id");var Ft="StrictSign",Xt="StrictNoSign",xe;(function(s){s.Accept="accept",s.Ignore="ignore",s.Reject="reject"})(xe||(xe={}));var ce=class extends Error{constructor(e="Invalid parameters"){super(e),this.name="InvalidParametersError"}},Yt=class extends Error{constructor(e="Invalid public key"){super(e),this.name="InvalidPublicKeyError"}};var nr=class extends Error{constructor(e="Invalid Multihash"){super(e),this.name="InvalidMultihashError"}};var Qt=class extends Error{constructor(e="Unsupported key type"){super(e),this.name="UnsupportedKeyTypeError"}};var No=(s,...e)=>{try{[...e]}catch{}};var ir=class extends EventTarget{#e=new Map;constructor(){super(),No(1/0,this)}listenerCount(e){let t=this.#e.get(e);return t==null?0:t.length}addEventListener(e,t,r){super.addEventListener(e,t,r);let n=this.#e.get(e);n==null&&(n=[],this.#e.set(e,n)),n.push({callback:t,once:(r!==!0&&r!==!1&&r?.once)??!1})}removeEventListener(e,t,r){super.removeEventListener(e.toString(),t??null,r);let n=this.#e.get(e);n!=null&&(n=n.filter(({callback:i})=>i!==t),this.#e.set(e,n))}dispatchEvent(e){let t=super.dispatchEvent(e),r=this.#e.get(e.type);return r==null||(r=r.filter(({once:n})=>!n),this.#e.set(e.type,r)),t}safeDispatchEvent(e,t={}){return this.dispatchEvent(new CustomEvent(e,t))}};var Ro=Symbol.for("@libp2p/service-capabilities"),Lo=Symbol.for("@libp2p/service-dependencies");var jn={};ve(jn,{base58btc:()=>te,base58flickr:()=>Wl});var mp=new Uint8Array(0);function Uo(s,e){if(s===e)return!0;if(s.byteLength!==e.byteLength)return!1;for(let t=0;t=255)throw new TypeError("Alphabet too long");for(var t=new Uint8Array(256),r=0;r>>0,I=new Uint8Array(y);b!==S;){for(var v=m[b],B=0,x=y-1;(v!==0||B>>0,I[x]=v%a>>>0,v=v/a>>>0;if(v!==0)throw new Error("Non-zero carry");g=B,b++}for(var _=y-g;_!==y&&I[_]===0;)_++;for(var k=c.repeat(p);_>>0,y=new Uint8Array(S);m[p];){var I=t[m.charCodeAt(p)];if(I===255)return;for(var v=0,B=S-1;(I!==0||v>>0,y[B]=I%256>>>0,I=I/256>>>0;if(I!==0)throw new Error("Non-zero carry");b=v,p++}if(m[p]!==" "){for(var x=S-b;x!==S&&y[x]===0;)x++;for(var _=new Uint8Array(g+(S-x)),k=g;x!==S;)_[k++]=y[x++];return _}}}function d(m){var p=l(m);if(p)return p;throw new Error(`Non-${e} character`)}return{encode:h,decodeUnsafe:l,decode:d}}var zl=Ol,Gl=zl,Oo=Gl;var qn=class{name;prefix;baseEncode;constructor(e,t,r){this.name=e,this.prefix=t,this.baseEncode=r}encode(e){if(e instanceof Uint8Array)return`${this.prefix}${this.baseEncode(e)}`;throw Error("Unknown type, must be binary type")}},Kn=class{name;prefix;baseDecode;prefixCodePoint;constructor(e,t,r){if(this.name=e,this.prefix=t,t.codePointAt(0)===void 0)throw new Error("Invalid prefix character");this.prefixCodePoint=t.codePointAt(0),this.baseDecode=r}decode(e){if(typeof e=="string"){if(e.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify(e)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode(e.slice(this.prefix.length))}else throw Error("Can only multibase decode strings")}or(e){return zo(this,e)}},Wn=class{decoders;constructor(e){this.decoders=e}or(e){return zo(this,e)}decode(e){let t=e[0],r=this.decoders[t];if(r!=null)return r.decode(e);throw RangeError(`Unable to decode multibase string ${JSON.stringify(e)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}};function zo(s,e){return new Wn({...s.decoders??{[s.prefix]:s},...e.decoders??{[e.prefix]:e}})}var $n=class{name;prefix;baseEncode;baseDecode;encoder;decoder;constructor(e,t,r,n){this.name=e,this.prefix=t,this.baseEncode=r,this.baseDecode=n,this.encoder=new qn(e,t,r),this.decoder=new Kn(e,t,n)}encode(e){return this.encoder.encode(e)}decode(e){return this.decoder.decode(e)}};function es({name:s,prefix:e,encode:t,decode:r}){return new $n(s,e,t,r)}function vt({name:s,prefix:e,alphabet:t}){let{encode:r,decode:n}=Oo(t,s);return es({prefix:e,name:s,encode:r,decode:i=>rt(n(i))})}function ql(s,e,t,r){let n={};for(let u=0;u=8&&(a-=8,o[f++]=255&c>>a)}if(a>=t||255&c<<8-a)throw new SyntaxError("Unexpected end of data");return o}function Kl(s,e,t){let r=e[e.length-1]==="=",n=(1<t;)o-=t,i+=e[n&a>>o];if(o!==0&&(i+=e[n&a<Vt,base32hex:()=>Jl,base32hexpad:()=>Yl,base32hexpadupper:()=>Ql,base32hexupper:()=>Xl,base32pad:()=>jl,base32padupper:()=>Zl,base32upper:()=>$l,base32z:()=>eu});var Vt=Q({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),$l=Q({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),jl=Q({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),Zl=Q({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),Jl=Q({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),Xl=Q({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),Yl=Q({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),Ql=Q({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),eu=Q({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5});var tu=Ko,Go=128,su=127,ru=~su,nu=Math.pow(2,31);function Ko(s,e,t){e=e||[],t=t||0;for(var r=t;s>=nu;)e[t++]=s&255|Go,s/=128;for(;s&ru;)e[t++]=s&255|Go,s>>>=7;return e[t]=s|0,Ko.bytes=t-r+1,e}var iu=Jn,ou=128,qo=127;function Jn(s,r){var t=0,r=r||0,n=0,i=r,o,a=s.length;do{if(i>=a)throw Jn.bytes=0,new RangeError("Could not decode varint");o=s[i++],t+=n<28?(o&qo)<=ou);return Jn.bytes=i-r,t}var au=Math.pow(2,7),cu=Math.pow(2,14),lu=Math.pow(2,21),uu=Math.pow(2,28),hu=Math.pow(2,35),fu=Math.pow(2,42),du=Math.pow(2,49),pu=Math.pow(2,56),gu=Math.pow(2,63),mu=function(s){return s{let[h,l]=Ps(e.subarray(t));return t+=l,h},n=r(),i=Ds;if(n===18?(n=0,t=0):i=r(),n!==0&&n!==1)throw new RangeError(`Invalid CID version ${n}`);let o=t,a=r(),c=r(),f=t+c,u=f-o;return{version:n,codec:i,multihashCode:a,digestSize:c,multihashSize:u,size:f}}static parse(e,t){let[r,n]=wu(e,t),i=s.decode(n);if(i.version===0&&e[0]!=="Q")throw Error("Version 0 CID string must not include multibase prefix");return Xn(i).set(r,e),i}};function wu(s,e){switch(s[0]){case"Q":{let t=e??te;return[te.prefix,t.decode(`${te.prefix}${s}`)]}case te.prefix:{let t=e??te;return[te.prefix,t.decode(s)]}case Vt.prefix:{let t=e??Vt;return[Vt.prefix,t.decode(s)]}default:{if(e==null)throw Error("To parse non base32 or base58btc encoded CID multibase decoder must be provided");return[s[0],e.decode(s)]}}}function vu(s,e,t){let{prefix:r}=t;if(r!==te.prefix)throw Error(`Cannot string encode V0 in ${t.name} encoding`);let n=e.get(r);if(n==null){let i=t.encode(s).slice(1);return e.set(r,i),i}else return n}function xu(s,e,t){let{prefix:r}=t,n=e.get(r);if(n==null){let i=t.encode(s);return e.set(r,i),i}else return n}var Ds=112,Eu=18;function Zo(s,e,t){let r=ss(s),n=r+ss(e),i=new Uint8Array(n+t.byteLength);return ts(s,i,0),ts(e,i,r),i.set(t,n),i}var Su=Symbol.for("@ipld/js-cid/CID");var Yn={};ve(Yn,{identity:()=>nt});var Jo=0,Bu="identity",Xo=rt;function Iu(s){return He(Jo,Xo(s))}var nt={code:Jo,name:Bu,encode:Xo,digest:Iu};function Ue(s,e){if(s===e)return!0;if(s.byteLength!==e.byteLength)return!1;for(let t=0;t0&&!e.includes(s.length))throw new Error(`Uint8Array expected of length ${e}, not of length=${s.length}`)}function Qo(s){if(typeof s!="function"||typeof s.create!="function")throw new Error("Hash should be wrapped by utils.wrapConstructor");Yo(s.outputLen),Yo(s.blockLen)}function is(s,e=!0){if(s.destroyed)throw new Error("Hash instance has been destroyed");if(e&&s.finished)throw new Error("Hash#digest() has already been called")}function ea(s,e){ns(s);let t=e.outputLen;if(s.lengthnew DataView(s.buffer,s.byteOffset,s.byteLength),ze=(s,e)=>s<<32-e|s>>>e;var Up=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;function ta(s){if(typeof s!="string")throw new Error(`utf8ToBytes expected string, got ${typeof s}`);return new Uint8Array(new TextEncoder().encode(s))}function Cs(s){return typeof s=="string"&&(s=ta(s)),ns(s),s}function Qn(...s){let e=0;for(let r=0;rs().update(Cs(r)).digest(),t=s();return e.outputLen=t.outputLen,e.blockLen=t.blockLen,e.create=()=>s(),e}function as(s=32){if(Ht&&typeof Ht.getRandomValues=="function")return Ht.getRandomValues(new Uint8Array(s));if(Ht&&typeof Ht.randomBytes=="function")return Ht.randomBytes(s);throw new Error("crypto.getRandomValues must be defined")}function Au(s,e,t,r){if(typeof s.setBigUint64=="function")return s.setBigUint64(e,t,r);let n=BigInt(32),i=BigInt(4294967295),o=Number(t>>n&i),a=Number(t&i),c=r?4:0,f=r?0:4;s.setUint32(e+c,o,r),s.setUint32(e+f,a,r)}var sa=(s,e,t)=>s&e^~s&t,ra=(s,e,t)=>s&e^s&t^e&t,cs=class extends os{constructor(e,t,r,n){super(),this.blockLen=e,this.outputLen=t,this.padOffset=r,this.isLE=n,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(e),this.view=ar(this.buffer)}update(e){is(this);let{view:t,buffer:r,blockLen:n}=this;e=Cs(e);let i=e.length;for(let o=0;on-o&&(this.process(r,0),o=0);for(let h=o;hu.length)throw new Error("_sha2: outputLen bigger than state");for(let h=0;h>ei&lr)}:{h:Number(s>>ei&lr)|0,l:Number(s&lr)|0}}function ku(s,e=!1){let t=new Uint32Array(s.length),r=new Uint32Array(s.length);for(let n=0;nBigInt(s>>>0)<>>0),Mu=(s,e,t)=>s>>>t,Pu=(s,e,t)=>s<<32-t|e>>>t,Du=(s,e,t)=>s>>>t|e<<32-t,Cu=(s,e,t)=>s<<32-t|e>>>t,Nu=(s,e,t)=>s<<64-t|e>>>t-32,Ru=(s,e,t)=>s>>>t-32|e<<64-t,Lu=(s,e)=>e,Uu=(s,e)=>s,Fu=(s,e,t)=>s<>>32-t,Vu=(s,e,t)=>e<>>32-t,Hu=(s,e,t)=>e<>>64-t,Ou=(s,e,t)=>s<>>64-t;function zu(s,e,t,r){let n=(e>>>0)+(r>>>0);return{h:s+t+(n/2**32|0)|0,l:n|0}}var Gu=(s,e,t)=>(s>>>0)+(e>>>0)+(t>>>0),qu=(s,e,t,r)=>e+t+r+(s/2**32|0)|0,Ku=(s,e,t,r)=>(s>>>0)+(e>>>0)+(t>>>0)+(r>>>0),Wu=(s,e,t,r,n)=>e+t+r+n+(s/2**32|0)|0,$u=(s,e,t,r,n)=>(s>>>0)+(e>>>0)+(t>>>0)+(r>>>0)+(n>>>0),ju=(s,e,t,r,n,i)=>e+t+r+n+i+(s/2**32|0)|0;var Zu={fromBig:na,split:ku,toBig:Tu,shrSH:Mu,shrSL:Pu,rotrSH:Du,rotrSL:Cu,rotrBH:Nu,rotrBL:Ru,rotr32H:Lu,rotr32L:Uu,rotlSH:Fu,rotlSL:Vu,rotlBH:Hu,rotlBL:Ou,add:zu,add3L:Gu,add3H:qu,add4L:Ku,add4H:Wu,add5H:ju,add5L:$u},R=Zu;var[Ju,Xu]=R.split(["0x428a2f98d728ae22","0x7137449123ef65cd","0xb5c0fbcfec4d3b2f","0xe9b5dba58189dbbc","0x3956c25bf348b538","0x59f111f1b605d019","0x923f82a4af194f9b","0xab1c5ed5da6d8118","0xd807aa98a3030242","0x12835b0145706fbe","0x243185be4ee4b28c","0x550c7dc3d5ffb4e2","0x72be5d74f27b896f","0x80deb1fe3b1696b1","0x9bdc06a725c71235","0xc19bf174cf692694","0xe49b69c19ef14ad2","0xefbe4786384f25e3","0x0fc19dc68b8cd5b5","0x240ca1cc77ac9c65","0x2de92c6f592b0275","0x4a7484aa6ea6e483","0x5cb0a9dcbd41fbd4","0x76f988da831153b5","0x983e5152ee66dfab","0xa831c66d2db43210","0xb00327c898fb213f","0xbf597fc7beef0ee4","0xc6e00bf33da88fc2","0xd5a79147930aa725","0x06ca6351e003826f","0x142929670a0e6e70","0x27b70a8546d22ffc","0x2e1b21385c26c926","0x4d2c6dfc5ac42aed","0x53380d139d95b3df","0x650a73548baf63de","0x766a0abb3c77b2a8","0x81c2c92e47edaee6","0x92722c851482353b","0xa2bfe8a14cf10364","0xa81a664bbc423001","0xc24b8b70d0f89791","0xc76c51a30654be30","0xd192e819d6ef5218","0xd69906245565a910","0xf40e35855771202a","0x106aa07032bbd1b8","0x19a4c116b8d2d0c8","0x1e376c085141ab53","0x2748774cdf8eeb99","0x34b0bcb5e19b48a8","0x391c0cb3c5c95a63","0x4ed8aa4ae3418acb","0x5b9cca4f7763e373","0x682e6ff3d6b2b8a3","0x748f82ee5defb2fc","0x78a5636f43172f60","0x84c87814a1f0ab72","0x8cc702081a6439ec","0x90befffa23631e28","0xa4506cebde82bde9","0xbef9a3f7b2c67915","0xc67178f2e372532b","0xca273eceea26619c","0xd186b8c721c0c207","0xeada7dd6cde0eb1e","0xf57d4f7fee6ed178","0x06f067aa72176fba","0x0a637dc5a2c898a6","0x113f9804bef90dae","0x1b710b35131c471b","0x28db77f523047d84","0x32caab7b40c72493","0x3c9ebe0a15c9bebc","0x431d67c49c100d4c","0x4cc5d4becb3e42b6","0x597f299cfc657e2a","0x5fcb6fab3ad6faec","0x6c44198c4a475817"].map(s=>BigInt(s))),xt=new Uint32Array(80),Et=new Uint32Array(80),ti=class extends cs{constructor(){super(128,64,16,!1),this.Ah=1779033703,this.Al=-205731576,this.Bh=-1150833019,this.Bl=-2067093701,this.Ch=1013904242,this.Cl=-23791573,this.Dh=-1521486534,this.Dl=1595750129,this.Eh=1359893119,this.El=-1377402159,this.Fh=-1694144372,this.Fl=725511199,this.Gh=528734635,this.Gl=-79577749,this.Hh=1541459225,this.Hl=327033209}get(){let{Ah:e,Al:t,Bh:r,Bl:n,Ch:i,Cl:o,Dh:a,Dl:c,Eh:f,El:u,Fh:h,Fl:l,Gh:d,Gl:m,Hh:p,Hl:g}=this;return[e,t,r,n,i,o,a,c,f,u,h,l,d,m,p,g]}set(e,t,r,n,i,o,a,c,f,u,h,l,d,m,p,g){this.Ah=e|0,this.Al=t|0,this.Bh=r|0,this.Bl=n|0,this.Ch=i|0,this.Cl=o|0,this.Dh=a|0,this.Dl=c|0,this.Eh=f|0,this.El=u|0,this.Fh=h|0,this.Fl=l|0,this.Gh=d|0,this.Gl=m|0,this.Hh=p|0,this.Hl=g|0}process(e,t){for(let y=0;y<16;y++,t+=4)xt[y]=e.getUint32(t),Et[y]=e.getUint32(t+=4);for(let y=16;y<80;y++){let I=xt[y-15]|0,v=Et[y-15]|0,B=R.rotrSH(I,v,1)^R.rotrSH(I,v,8)^R.shrSH(I,v,7),x=R.rotrSL(I,v,1)^R.rotrSL(I,v,8)^R.shrSL(I,v,7),_=xt[y-2]|0,k=Et[y-2]|0,z=R.rotrSH(_,k,19)^R.rotrBH(_,k,61)^R.shrSH(_,k,6),L=R.rotrSL(_,k,19)^R.rotrBL(_,k,61)^R.shrSL(_,k,6),U=R.add4L(x,L,Et[y-7],Et[y-16]),se=R.add4H(U,B,z,xt[y-7],xt[y-16]);xt[y]=se|0,Et[y]=U|0}let{Ah:r,Al:n,Bh:i,Bl:o,Ch:a,Cl:c,Dh:f,Dl:u,Eh:h,El:l,Fh:d,Fl:m,Gh:p,Gl:g,Hh:b,Hl:S}=this;for(let y=0;y<80;y++){let I=R.rotrSH(h,l,14)^R.rotrSH(h,l,18)^R.rotrBH(h,l,41),v=R.rotrSL(h,l,14)^R.rotrSL(h,l,18)^R.rotrBL(h,l,41),B=h&d^~h&p,x=l&m^~l&g,_=R.add5L(S,v,x,Xu[y],Et[y]),k=R.add5H(_,b,I,B,Ju[y],xt[y]),z=_|0,L=R.rotrSH(r,n,28)^R.rotrBH(r,n,34)^R.rotrBH(r,n,39),U=R.rotrSL(r,n,28)^R.rotrBL(r,n,34)^R.rotrBL(r,n,39),se=r&i^r&a^i&a,T=n&o^n&c^o&c;b=p|0,S=g|0,p=d|0,g=m|0,d=h|0,m=l|0,{h,l}=R.add(f|0,u|0,k|0,z|0),f=a|0,u=c|0,a=i|0,c=o|0,i=r|0,o=n|0;let P=R.add3L(z,U,T);r=R.add3H(P,k,L,se),n=P|0}({h:r,l:n}=R.add(this.Ah|0,this.Al|0,r|0,n|0)),{h:i,l:o}=R.add(this.Bh|0,this.Bl|0,i|0,o|0),{h:a,l:c}=R.add(this.Ch|0,this.Cl|0,a|0,c|0),{h:f,l:u}=R.add(this.Dh|0,this.Dl|0,f|0,u|0),{h,l}=R.add(this.Eh|0,this.El|0,h|0,l|0),{h:d,l:m}=R.add(this.Fh|0,this.Fl|0,d|0,m|0),{h:p,l:g}=R.add(this.Gh|0,this.Gl|0,p|0,g|0),{h:b,l:S}=R.add(this.Hh|0,this.Hl|0,b|0,S|0),this.set(r,n,i,o,a,c,f,u,h,l,d,m,p,g,b,S)}roundClean(){xt.fill(0),Et.fill(0)}destroy(){this.buffer.fill(0),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}};var ia=cr(()=>new ti);var hr={};ve(hr,{aInRange:()=>Te,abool:()=>Ge,abytes:()=>ls,bitGet:()=>rh,bitLen:()=>oi,bitMask:()=>Rs,bitSet:()=>nh,bytesToHex:()=>ot,bytesToNumberBE:()=>at,bytesToNumberLE:()=>Bt,concatBytes:()=>ct,createHmacDrbg:()=>ai,ensureBytes:()=>ee,equalBytes:()=>th,hexToBytes:()=>zt,hexToNumber:()=>ii,inRange:()=>Ns,isBytes:()=>St,memoized:()=>qt,notImplemented:()=>oh,numberToBytesBE:()=>It,numberToBytesLE:()=>Gt,numberToHexUnpadded:()=>Ot,numberToVarBytesBE:()=>eh,utf8ToBytes:()=>sh,validateObject:()=>Ze});var ni=BigInt(0),ur=BigInt(1),Yu=BigInt(2);function St(s){return s instanceof Uint8Array||s!=null&&typeof s=="object"&&s.constructor.name==="Uint8Array"}function ls(s){if(!St(s))throw new Error("Uint8Array expected")}function Ge(s,e){if(typeof e!="boolean")throw new Error(`${s} must be valid boolean, got "${e}".`)}var Qu=Array.from({length:256},(s,e)=>e.toString(16).padStart(2,"0"));function ot(s){ls(s);let e="";for(let t=0;t=it._0&&s<=it._9)return s-it._0;if(s>=it._A&&s<=it._F)return s-(it._A-10);if(s>=it._a&&s<=it._f)return s-(it._a-10)}function zt(s){if(typeof s!="string")throw new Error("hex string expected, got "+typeof s);let e=s.length,t=e/2;if(e%2)throw new Error("padded hex string expected, got unpadded hex of length "+e);let r=new Uint8Array(t);for(let n=0,i=0;ntypeof s=="bigint"&&ni<=s;function Ns(s,e,t){return si(s)&&si(e)&&si(t)&&e<=s&&sni;s>>=ur,e+=1);return e}function rh(s,e){return s>>BigInt(e)&ur}function nh(s,e,t){return s|(t?ur:ni)<(Yu<new Uint8Array(s),aa=s=>Uint8Array.from(s);function ai(s,e,t){if(typeof s!="number"||s<2)throw new Error("hashLen must be a number");if(typeof e!="number"||e<2)throw new Error("qByteLen must be a number");if(typeof t!="function")throw new Error("hmacFn must be a function");let r=ri(s),n=ri(s),i=0,o=()=>{r.fill(1),n.fill(0),i=0},a=(...h)=>t(n,r,...h),c=(h=ri())=>{n=a(aa([0]),h),r=a(),h.length!==0&&(n=a(aa([1]),h),r=a())},f=()=>{if(i++>=1e3)throw new Error("drbg: tried 1000 values");let h=0,l=[];for(;h{o(),c(h);let d;for(;!(d=l(f()));)c();return o(),d}}var ih={bigint:s=>typeof s=="bigint",function:s=>typeof s=="function",boolean:s=>typeof s=="boolean",string:s=>typeof s=="string",stringOrUint8Array:s=>typeof s=="string"||St(s),isSafeInteger:s=>Number.isSafeInteger(s),array:s=>Array.isArray(s),field:(s,e)=>e.Fp.isValid(s),hash:s=>typeof s=="function"&&Number.isSafeInteger(s.outputLen)};function Ze(s,e,t={}){let r=(n,i,o)=>{let a=ih[i];if(typeof a!="function")throw new Error(`Invalid validator "${i}", expected function`);let c=s[n];if(!(o&&c===void 0)&&!a(c,s))throw new Error(`Invalid param ${String(n)}=${c} (${typeof c}), expected ${i}`)};for(let[n,i]of Object.entries(e))r(n,i,!1);for(let[n,i]of Object.entries(t))r(n,i,!0);return s}var oh=()=>{throw new Error("not implemented")};function qt(s){let e=new WeakMap;return(t,...r)=>{let n=e.get(t);if(n!==void 0)return n;let i=s(t,...r);return e.set(t,i),i}}var ne=BigInt(0),Z=BigInt(1),Kt=BigInt(2),ah=BigInt(3),ci=BigInt(4),ca=BigInt(5),la=BigInt(8),ch=BigInt(9),lh=BigInt(16);function W(s,e){let t=s%e;return t>=ne?t:e+t}function uh(s,e,t){if(t<=ne||e 0");if(t===Z)return ne;let r=Z;for(;e>ne;)e&Z&&(r=r*s%t),s=s*s%t,e>>=Z;return r}function J(s,e,t){let r=s;for(;e-- >ne;)r*=r,r%=t;return r}function fr(s,e){if(s===ne||e<=ne)throw new Error(`invert: expected positive integers, got n=${s} mod=${e}`);let t=W(s,e),r=e,n=ne,i=Z,o=Z,a=ne;for(;t!==ne;){let f=r/t,u=r%t,h=n-o*f,l=i-a*f;r=t,t=u,n=o,i=a,o=h,a=l}if(r!==Z)throw new Error("invert: does not exist");return W(n,e)}function hh(s){let e=(s-Z)/Kt,t,r,n;for(t=s-Z,r=0;t%Kt===ne;t/=Kt,r++);for(n=Kt;n(W(s,e)&Z)===Z,dh=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function li(s){let e={ORDER:"bigint",MASK:"bigint",BYTES:"isSafeInteger",BITS:"isSafeInteger"},t=dh.reduce((r,n)=>(r[n]="function",r),e);return Ze(s,t)}function ph(s,e,t){if(t 0");if(t===ne)return s.ONE;if(t===Z)return e;let r=s.ONE,n=e;for(;t>ne;)t&Z&&(r=s.mul(r,n)),n=s.sqr(n),t>>=Z;return r}function gh(s,e){let t=new Array(e.length),r=e.reduce((i,o,a)=>s.is0(o)?i:(t[a]=i,s.mul(i,o)),s.ONE),n=s.inv(r);return e.reduceRight((i,o,a)=>s.is0(o)?i:(t[a]=s.mul(i,t[a]),s.mul(i,o)),n),t}function ui(s,e){let t=e!==void 0?e:s.toString(2).length,r=Math.ceil(t/8);return{nBitLength:t,nByteLength:r}}function _t(s,e,t=!1,r={}){if(s<=ne)throw new Error(`Expected Field ORDER > 0, got ${s}`);let{nBitLength:n,nByteLength:i}=ui(s,e);if(i>2048)throw new Error("Field lengths over 2048 bytes are not supported");let o=fh(s),a=Object.freeze({ORDER:s,BITS:n,BYTES:i,MASK:Rs(n),ZERO:ne,ONE:Z,create:c=>W(c,s),isValid:c=>{if(typeof c!="bigint")throw new Error(`Invalid field element: expected bigint, got ${typeof c}`);return ne<=c&&cc===ne,isOdd:c=>(c&Z)===Z,neg:c=>W(-c,s),eql:(c,f)=>c===f,sqr:c=>W(c*c,s),add:(c,f)=>W(c+f,s),sub:(c,f)=>W(c-f,s),mul:(c,f)=>W(c*f,s),pow:(c,f)=>ph(a,c,f),div:(c,f)=>W(c*fr(f,s),s),sqrN:c=>c*c,addN:(c,f)=>c+f,subN:(c,f)=>c-f,mulN:(c,f)=>c*f,inv:c=>fr(c,s),sqrt:r.sqrt||(c=>o(a,c)),invertBatch:c=>gh(a,c),cmov:(c,f,u)=>u?f:c,toBytes:c=>t?Gt(c,i):It(c,i),fromBytes:c=>{if(c.length!==i)throw new Error(`Fp.fromBytes: expected ${i}, got ${c.length}`);return t?Bt(c):at(c)}});return Object.freeze(a)}function ha(s){if(typeof s!="bigint")throw new Error("field order must be bigint");let e=s.toString(2).length;return Math.ceil(e/8)}function hi(s){let e=ha(s);return e+Math.ceil(e/2)}function fa(s,e,t=!1){let r=s.length,n=ha(e),i=hi(e);if(r<16||r1024)throw new Error(`expected ${i}-1024 bytes of input, got ${r}`);let o=t?at(s):Bt(s),a=W(o,e-Z)+Z;return t?Gt(a,n):It(a,n)}var bh=BigInt(0),fi=BigInt(1),di=new WeakMap,da=new WeakMap;function dr(s,e){let t=(i,o)=>{let a=o.negate();return i?a:o},r=i=>{if(!Number.isSafeInteger(i)||i<=0||i>e)throw new Error(`Wrong window size=${i}, should be [1..${e}]`)},n=i=>{r(i);let o=Math.ceil(e/i)+1,a=2**(i-1);return{windows:o,windowSize:a}};return{constTimeNegate:t,unsafeLadder(i,o){let a=s.ZERO,c=i;for(;o>bh;)o&fi&&(a=a.add(c)),c=c.double(),o>>=fi;return a},precomputeWindow(i,o){let{windows:a,windowSize:c}=n(o),f=[],u=i,h=u;for(let l=0;l>=m,b>f&&(b-=d,a+=fi);let S=g,y=g+Math.abs(b)-1,I=p%2!==0,v=b<0;b===0?h=h.add(t(I,o[S])):u=u.add(t(v,o[y]))}return{p:u,f:h}},wNAFCached(i,o,a){let c=da.get(i)||1,f=di.get(i);return f||(f=this.precomputeWindow(i,c),c!==1&&di.set(i,a(f))),this.wNAF(c,f,o)},setWindowSize(i,o){r(o),da.set(i,o),di.delete(i)}}}function pr(s,e,t,r){if(!Array.isArray(t)||!Array.isArray(r)||r.length!==t.length)throw new Error("arrays of points and scalars must have equal length");r.forEach((u,h)=>{if(!e.isValid(u))throw new Error(`wrong scalar at index ${h}`)}),t.forEach((u,h)=>{if(!(u instanceof s))throw new Error(`wrong point at index ${h}`)});let n=oi(BigInt(t.length)),i=n>12?n-3:n>4?n-2:n?2:1,o=(1<=0;u-=i){a.fill(s.ZERO);for(let l=0;l>BigInt(u)&BigInt(o));a[m]=a[m].add(t[l])}let h=s.ZERO;for(let l=a.length-1,d=s.ZERO;l>0;l--)d=d.add(a[l]),h=h.add(d);if(f=f.add(h),u!==0)for(let l=0;l{try{return{isValid:!0,value:t.sqrt(E*t.inv(w))}}catch{return{isValid:!1,value:qe}}}),d=e.adjustScalarBytes||(E=>E),m=e.domain||((E,w,A)=>{if(Ge("phflag",A),w.length||A)throw new Error("Contexts/pre-hash are not supported");return E});function p(E,w){Te("coordinate "+E,w,qe,f)}function g(E){if(!(E instanceof y))throw new Error("ExtendedPoint expected")}let b=qt((E,w)=>{let{ex:A,ey:D,ez:C}=E,N=E.is0();w==null&&(w=N?yh:t.inv(C));let F=u(A*w),O=u(D*w),V=u(C*w);if(N)return{x:qe,y:Me};if(V!==Me)throw new Error("invZ was invalid");return{x:F,y:O}}),S=qt(E=>{let{a:w,d:A}=e;if(E.is0())throw new Error("bad point: ZERO");let{ex:D,ey:C,ez:N,et:F}=E,O=u(D*D),V=u(C*C),K=u(N*N),j=u(K*K),oe=u(O*w),ae=u(K*u(oe+V)),ue=u(j+u(A*u(O*V)));if(ae!==ue)throw new Error("bad point: equation left != right (1)");let we=u(D*C),re=u(N*F);if(we!==re)throw new Error("bad point: equation left != right (2)");return!0});class y{constructor(w,A,D,C){this.ex=w,this.ey=A,this.ez=D,this.et=C,p("x",w),p("y",A),p("z",D),p("t",C),Object.freeze(this)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static fromAffine(w){if(w instanceof y)throw new Error("extended point not allowed");let{x:A,y:D}=w||{};return p("x",A),p("y",D),new y(A,D,Me,u(A*D))}static normalizeZ(w){let A=t.invertBatch(w.map(D=>D.ez));return w.map((D,C)=>D.toAffine(A[C])).map(y.fromAffine)}static msm(w,A){return pr(y,h,w,A)}_setWindowSize(w){B.setWindowSize(this,w)}assertValidity(){S(this)}equals(w){g(w);let{ex:A,ey:D,ez:C}=this,{ex:N,ey:F,ez:O}=w,V=u(A*O),K=u(N*C),j=u(D*O),oe=u(F*C);return V===K&&j===oe}is0(){return this.equals(y.ZERO)}negate(){return new y(u(-this.ex),this.ey,this.ez,u(-this.et))}double(){let{a:w}=e,{ex:A,ey:D,ez:C}=this,N=u(A*A),F=u(D*D),O=u(gr*u(C*C)),V=u(w*N),K=A+D,j=u(u(K*K)-N-F),oe=V+F,ae=oe-O,ue=V-F,we=u(j*ae),re=u(oe*ue),Ae=u(j*ue),st=u(ae*oe);return new y(we,re,st,Ae)}add(w){g(w);let{a:A,d:D}=e,{ex:C,ey:N,ez:F,et:O}=this,{ex:V,ey:K,ez:j,et:oe}=w;if(A===BigInt(-1)){let Bo=u((N-C)*(K+V)),Io=u((N+C)*(K-V)),zn=u(Io-Bo);if(zn===qe)return this.double();let _o=u(F*gr*oe),Ao=u(O*gr*j),ko=Ao+_o,To=Io+Bo,Mo=Ao-_o,Pl=u(ko*zn),Dl=u(To*Mo),Cl=u(ko*Mo),Nl=u(zn*To);return new y(Pl,Dl,Nl,Cl)}let ae=u(C*V),ue=u(N*K),we=u(O*D*oe),re=u(F*j),Ae=u((C+N)*(V+K)-ae-ue),st=re-we,ks=re+we,Ts=u(ue-A*ae),Al=u(Ae*st),kl=u(ks*Ts),Tl=u(Ae*Ts),Ml=u(st*ks);return new y(Al,kl,Ml,Tl)}subtract(w){return this.add(w.negate())}wNAF(w){return B.wNAFCached(this,w,y.normalizeZ)}multiply(w){let A=w;Te("scalar",A,Me,r);let{p:D,f:C}=this.wNAF(A);return y.normalizeZ([D,C])[0]}multiplyUnsafe(w){let A=w;return Te("scalar",A,qe,r),A===qe?v:this.equals(v)||A===Me?this:this.equals(I)?this.wNAF(A).p:B.unsafeLadder(this,A)}isSmallOrder(){return this.multiplyUnsafe(c).is0()}isTorsionFree(){return B.unsafeLadder(this,r).is0()}toAffine(w){return b(this,w)}clearCofactor(){let{h:w}=e;return w===Me?this:this.multiplyUnsafe(w)}static fromHex(w,A=!1){let{d:D,a:C}=e,N=t.BYTES;w=ee("pointHex",w,N),Ge("zip215",A);let F=w.slice(),O=w[N-1];F[N-1]=O&-129;let V=Bt(F),K=A?f:t.ORDER;Te("pointHex.y",V,qe,K);let j=u(V*V),oe=u(j-Me),ae=u(D*j-C),{isValid:ue,value:we}=l(oe,ae);if(!ue)throw new Error("Point.fromHex: invalid y coordinate");let re=(we&Me)===Me,Ae=(O&128)!==0;if(!A&&we===qe&&Ae)throw new Error("Point.fromHex: x=0 and x_0=1");return Ae!==re&&(we=u(-we)),y.fromAffine({x:we,y:V})}static fromPrivateKey(w){return k(w).point}toRawBytes(){let{x:w,y:A}=this.toAffine(),D=Gt(A,t.BYTES);return D[D.length-1]|=w&Me?128:0,D}toHex(){return ot(this.toRawBytes())}}y.BASE=new y(e.Gx,e.Gy,Me,u(e.Gx*e.Gy)),y.ZERO=new y(qe,Me,Me,qe);let{BASE:I,ZERO:v}=y,B=dr(y,a*8);function x(E){return W(E,r)}function _(E){return x(Bt(E))}function k(E){let w=a;E=ee("private key",E,w);let A=ee("hashed private key",i(E),2*w),D=d(A.slice(0,w)),C=A.slice(w,2*w),N=_(D),F=I.multiply(N),O=F.toRawBytes();return{head:D,prefix:C,scalar:N,point:F,pointBytes:O}}function z(E){return k(E).pointBytes}function L(E=new Uint8Array,...w){let A=ct(...w);return _(i(m(A,ee("context",E),!!n)))}function U(E,w,A={}){E=ee("message",E),n&&(E=n(E));let{prefix:D,scalar:C,pointBytes:N}=k(w),F=L(A.context,D,E),O=I.multiply(F).toRawBytes(),V=L(A.context,O,N,E),K=x(F+V*C);Te("signature.s",K,qe,r);let j=ct(O,Gt(K,t.BYTES));return ee("result",j,a*2)}let se=wh;function T(E,w,A,D=se){let{context:C,zip215:N}=D,F=t.BYTES;E=ee("signature",E,2*F),w=ee("message",w),N!==void 0&&Ge("zip215",N),n&&(w=n(w));let O=Bt(E.slice(F,2*F)),V,K,j;try{V=y.fromHex(A,N),K=y.fromHex(E.slice(0,F),N),j=I.multiplyUnsafe(O)}catch{return!1}if(!N&&V.isSmallOrder())return!1;let oe=L(C,K.toRawBytes(),V.toRawBytes(),w);return K.add(V.multiplyUnsafe(oe)).subtract(j).clearCofactor().equals(y.ZERO)}return I._setWindowSize(8),{CURVE:e,getPublicKey:z,sign:U,verify:T,ExtendedPoint:y,utils:{getExtendedPublicKey:k,randomPrivateKey:()=>o(t.BYTES),precompute(E=8,w=y.BASE){return w._setWindowSize(E),w.multiply(BigInt(3)),w}}}}var pi=BigInt("57896044618658097711785492504343953926634992332820282019728792003956564819949"),ga=BigInt("19681161376707505956807079304988542015446066515923890162744021073123829784752"),ag=BigInt(0),xh=BigInt(1),ma=BigInt(2),cg=BigInt(3),Eh=BigInt(5),Sh=BigInt(8);function Bh(s){let e=BigInt(10),t=BigInt(20),r=BigInt(40),n=BigInt(80),i=pi,a=s*s%i*s%i,c=J(a,ma,i)*a%i,f=J(c,xh,i)*s%i,u=J(f,Eh,i)*f%i,h=J(u,e,i)*u%i,l=J(h,t,i)*h%i,d=J(l,r,i)*l%i,m=J(d,n,i)*d%i,p=J(m,n,i)*d%i,g=J(p,e,i)*u%i;return{pow_p_5_8:J(g,ma,i)*s%i,b2:a}}function Ih(s){return s[0]&=248,s[31]&=127,s[31]|=64,s}function _h(s,e){let t=pi,r=W(e*e*e,t),n=W(r*r*e,t),i=Bh(s*n).pow_p_5_8,o=W(s*r*i,t),a=W(e*o*o,t),c=o,f=W(o*ga,t),u=a===s,h=a===W(-s,t),l=a===W(-s*ga,t);return u&&(o=c),(h||l)&&(o=f),ua(o,t)&&(o=W(-o,t)),{isValid:u||h,value:o}}var Ah=_t(pi,void 0,!0),kh={a:BigInt(-1),d:BigInt("37095705934669439343138083508754565189542113879843219016388785533085940283555"),Fp:Ah,n:BigInt("7237005577332262213973186563042994240857116359379907606001950938285454250989"),h:Sh,Gx:BigInt("15112221349535400772501151409588531511454012693041857206046113283949847762202"),Gy:BigInt("46316835694926478169428394003475163141307993866256225615783033603165251855960"),hash:ia,randomBytes:as,adjustScalarBytes:Ih,uvRatio:_h},ba=pa(kh);var mr=32;function ya(s,e,t){return ba.verify(e,t instanceof Uint8Array?t:t.subarray(),s)}var br=class{type="Ed25519";raw;constructor(e){this.raw=gi(e,mr)}toMultihash(){return nt.digest(At(this))}toCID(){return ke.createV1(114,this.toMultihash())}toString(){return te.encode(this.toMultihash().bytes).substring(1)}equals(e){return e==null||!(e.raw instanceof Uint8Array)?!1:Ue(this.raw,e.raw)}verify(e,t){return ya(this.raw,t,e)}};function mi(s){return s=gi(s,mr),new br(s)}function gi(s,e){if(s=Uint8Array.from(s??[]),s.length!==e)throw new ce(`Key must be a Uint8Array of length ${e}, got ${s.length}`);return s}function lt(s=0){return new Uint8Array(s)}function de(s=0){return new Uint8Array(s)}var Mh=Math.pow(2,7),Ph=Math.pow(2,14),Dh=Math.pow(2,21),bi=Math.pow(2,28),yi=Math.pow(2,35),wi=Math.pow(2,42),vi=Math.pow(2,49),G=128,pe=127;function Ee(s){if(sNumber.MAX_SAFE_INTEGER)throw new RangeError("Could not encode varint");return 8}function xi(s,e,t=0){switch(Ee(s)){case 8:e[t++]=s&255|G,s/=128;case 7:e[t++]=s&255|G,s/=128;case 6:e[t++]=s&255|G,s/=128;case 5:e[t++]=s&255|G,s/=128;case 4:e[t++]=s&255|G,s>>>=7;case 3:e[t++]=s&255|G,s>>>=7;case 2:e[t++]=s&255|G,s>>>=7;case 1:{e[t++]=s&255,s>>>=7;break}default:throw new Error("unreachable")}return e}function Ch(s,e,t=0){switch(Ee(s)){case 8:e.set(t++,s&255|G),s/=128;case 7:e.set(t++,s&255|G),s/=128;case 6:e.set(t++,s&255|G),s/=128;case 5:e.set(t++,s&255|G),s/=128;case 4:e.set(t++,s&255|G),s>>>=7;case 3:e.set(t++,s&255|G),s>>>=7;case 2:e.set(t++,s&255|G),s>>>=7;case 1:{e.set(t++,s&255),s>>>=7;break}default:throw new Error("unreachable")}return e}function Ei(s,e){let t=s[e],r=0;if(r+=t&pe,t>>31>0){let t=~this.lo+1>>>0,r=~this.hi>>>0;return t===0&&(r=r+1>>>0),-(t+r*4294967296)}return this.lo+this.hi*4294967296}toBigInt(e=!1){if(e)return BigInt(this.lo>>>0)+(BigInt(this.hi>>>0)<<32n);if(this.hi>>>31){let t=~this.lo+1>>>0,r=~this.hi>>>0;return t===0&&(r=r+1>>>0),-(BigInt(t)+(BigInt(r)<<32n))}return BigInt(this.lo>>>0)+(BigInt(this.hi>>>0)<<32n)}toString(e=!1){return this.toBigInt(e).toString()}zzEncode(){let e=this.hi>>31;return this.hi=((this.hi<<1|this.lo>>>31)^e)>>>0,this.lo=(this.lo<<1^e)>>>0,this}zzDecode(){let e=-(this.lo&1);return this.lo=((this.lo>>>1|this.hi<<31)^e)>>>0,this.hi=(this.hi>>>1^e)>>>0,this}length(){let e=this.lo,t=(this.lo>>>28|this.hi<<4)>>>0,r=this.hi>>>24;return r===0?t===0?e<16384?e<128?1:2:e<2097152?3:4:t<16384?t<128?5:6:t<2097152?7:8:r<128?9:10}static fromBigInt(e){if(e===0n)return Wt;if(eLh)return this.fromNumber(Number(e));let t=e<0n;t&&(e=-e);let r=e>>32n,n=e-(r<<32n);return t&&(r=~r|0n,n=~n|0n,++n>Ba&&(n=0n,++r>Ba&&(r=0n))),new s(Number(n),Number(r))}static fromNumber(e){if(e===0)return Wt;let t=e<0;t&&(e=-e);let r=e>>>0,n=(e-r)/4294967296>>>0;return t&&(n=~n>>>0,r=~r>>>0,++r>4294967295&&(r=0,++n>4294967295&&(n=0))),new s(r,n)}static from(e){return typeof e=="number"?s.fromNumber(e):typeof e=="bigint"?s.fromBigInt(e):typeof e=="string"?s.fromBigInt(BigInt(e)):e.low!=null||e.high!=null?new s(e.low>>>0,e.high>>>0):Wt}},Wt=new Re(0,0);Wt.toBigInt=function(){return 0n};Wt.zzEncode=Wt.zzDecode=function(){return this};Wt.length=function(){return 1};var Ba=4294967296n;function Ia(s){let e=0,t=0;for(let r=0;r191&&a<224?i[o++]=(a&31)<<6|s[e++]&63:a>239&&a<365?(a=((a&7)<<18|(s[e++]&63)<<12|(s[e++]&63)<<6|s[e++]&63)-65536,i[o++]=55296+(a>>10),i[o++]=56320+(a&1023)):i[o++]=(a&15)<<12|(s[e++]&63)<<6|s[e++]&63,o>8191&&((n??(n=[])).push(String.fromCharCode.apply(String,i)),o=0);return n!=null?(o>0&&n.push(String.fromCharCode.apply(String,i.slice(0,o))),n.join("")):String.fromCharCode.apply(String,i.slice(0,o))}function Ai(s,e,t){let r=t,n,i;for(let o=0;o>6|192,e[t++]=n&63|128):(n&64512)===55296&&((i=s.charCodeAt(o+1))&64512)===56320?(n=65536+((n&1023)<<10)+(i&1023),++o,e[t++]=n>>18|240,e[t++]=n>>12&63|128,e[t++]=n>>6&63|128,e[t++]=n&63|128):(e[t++]=n>>12|224,e[t++]=n>>6&63|128,e[t++]=n&63|128);return t-r}function Ke(s,e){return RangeError(`index out of range: ${s.pos} + ${e??1} > ${s.len}`)}function yr(s,e){return(s[e-4]|s[e-3]<<8|s[e-2]<<16|s[e-1]<<24)>>>0}var ki=class{buf;pos;len;_slice=Uint8Array.prototype.subarray;constructor(e){this.buf=e,this.pos=0,this.len=e.length}uint32(){let e=4294967295;if(e=(this.buf[this.pos]&127)>>>0,this.buf[this.pos++]<128||(e=(e|(this.buf[this.pos]&127)<<7)>>>0,this.buf[this.pos++]<128)||(e=(e|(this.buf[this.pos]&127)<<14)>>>0,this.buf[this.pos++]<128)||(e=(e|(this.buf[this.pos]&127)<<21)>>>0,this.buf[this.pos++]<128)||(e=(e|(this.buf[this.pos]&15)<<28)>>>0,this.buf[this.pos++]<128))return e;if((this.pos+=5)>this.len)throw this.pos=this.len,Ke(this,10);return e}int32(){return this.uint32()|0}sint32(){let e=this.uint32();return e>>>1^-(e&1)|0}bool(){return this.uint32()!==0}fixed32(){if(this.pos+4>this.len)throw Ke(this,4);return yr(this.buf,this.pos+=4)}sfixed32(){if(this.pos+4>this.len)throw Ke(this,4);return yr(this.buf,this.pos+=4)|0}float(){if(this.pos+4>this.len)throw Ke(this,4);let e=xa(this.buf,this.pos);return this.pos+=4,e}double(){if(this.pos+8>this.len)throw Ke(this,4);let e=Sa(this.buf,this.pos);return this.pos+=8,e}bytes(){let e=this.uint32(),t=this.pos,r=this.pos+e;if(r>this.len)throw Ke(this,e);return this.pos+=e,t===r?new Uint8Array(0):this.buf.subarray(t,r)}string(){let e=this.bytes();return _a(e,0,e.length)}skip(e){if(typeof e=="number"){if(this.pos+e>this.len)throw Ke(this,e);this.pos+=e}else do if(this.pos>=this.len)throw Ke(this);while(this.buf[this.pos++]&128);return this}skipType(e){switch(e){case 0:this.skip();break;case 1:this.skip(8);break;case 2:this.skip(this.uint32());break;case 3:for(;(e=this.uint32()&7)!==4;)this.skipType(e);break;case 5:this.skip(4);break;default:throw Error(`invalid wire type ${e} at offset ${this.pos}`)}return this}readLongVarint(){let e=new Re(0,0),t=0;if(this.len-this.pos>4){for(;t<4;++t)if(e.lo=(e.lo|(this.buf[this.pos]&127)<>>0,this.buf[this.pos++]<128)return e;if(e.lo=(e.lo|(this.buf[this.pos]&127)<<28)>>>0,e.hi=(e.hi|(this.buf[this.pos]&127)>>4)>>>0,this.buf[this.pos++]<128)return e;t=0}else{for(;t<3;++t){if(this.pos>=this.len)throw Ke(this);if(e.lo=(e.lo|(this.buf[this.pos]&127)<>>0,this.buf[this.pos++]<128)return e}return e.lo=(e.lo|(this.buf[this.pos++]&127)<>>0,e}if(this.len-this.pos>4){for(;t<5;++t)if(e.hi=(e.hi|(this.buf[this.pos]&127)<>>0,this.buf[this.pos++]<128)return e}else for(;t<5;++t){if(this.pos>=this.len)throw Ke(this);if(e.hi=(e.hi|(this.buf[this.pos]&127)<>>0,this.buf[this.pos++]<128)return e}throw Error("invalid varint encoding")}readFixed64(){if(this.pos+8>this.len)throw Ke(this,8);let e=yr(this.buf,this.pos+=4),t=yr(this.buf,this.pos+=4);return new Re(e,t)}int64(){return this.readLongVarint().toBigInt()}int64Number(){return this.readLongVarint().toNumber()}int64String(){return this.readLongVarint().toString()}uint64(){return this.readLongVarint().toBigInt(!0)}uint64Number(){let e=Ei(this.buf,this.pos);return this.pos+=Ee(e),e}uint64String(){return this.readLongVarint().toString(!0)}sint64(){return this.readLongVarint().zzDecode().toBigInt()}sint64Number(){return this.readLongVarint().zzDecode().toNumber()}sint64String(){return this.readLongVarint().zzDecode().toString()}fixed64(){return this.readFixed64().toBigInt()}fixed64Number(){return this.readFixed64().toNumber()}fixed64String(){return this.readFixed64().toString()}sfixed64(){return this.readFixed64().toBigInt()}sfixed64Number(){return this.readFixed64().toNumber()}sfixed64String(){return this.readFixed64().toString()}};function Ti(s){return new ki(s instanceof Uint8Array?s:s.subarray())}function Pe(s,e,t){let r=Ti(s);return e.decode(r,void 0,t)}var Mi={};ve(Mi,{base10:()=>Uh});var Uh=vt({prefix:"9",name:"base10",alphabet:"0123456789"});var Pi={};ve(Pi,{base16:()=>Fh,base16upper:()=>Vh});var Fh=Q({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),Vh=Q({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4});var Di={};ve(Di,{base2:()=>Hh});var Hh=Q({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1});var Ci={};ve(Ci,{base256emoji:()=>Kh});var ka=Array.from("\u{1F680}\u{1FA90}\u2604\u{1F6F0}\u{1F30C}\u{1F311}\u{1F312}\u{1F313}\u{1F314}\u{1F315}\u{1F316}\u{1F317}\u{1F318}\u{1F30D}\u{1F30F}\u{1F30E}\u{1F409}\u2600\u{1F4BB}\u{1F5A5}\u{1F4BE}\u{1F4BF}\u{1F602}\u2764\u{1F60D}\u{1F923}\u{1F60A}\u{1F64F}\u{1F495}\u{1F62D}\u{1F618}\u{1F44D}\u{1F605}\u{1F44F}\u{1F601}\u{1F525}\u{1F970}\u{1F494}\u{1F496}\u{1F499}\u{1F622}\u{1F914}\u{1F606}\u{1F644}\u{1F4AA}\u{1F609}\u263A\u{1F44C}\u{1F917}\u{1F49C}\u{1F614}\u{1F60E}\u{1F607}\u{1F339}\u{1F926}\u{1F389}\u{1F49E}\u270C\u2728\u{1F937}\u{1F631}\u{1F60C}\u{1F338}\u{1F64C}\u{1F60B}\u{1F497}\u{1F49A}\u{1F60F}\u{1F49B}\u{1F642}\u{1F493}\u{1F929}\u{1F604}\u{1F600}\u{1F5A4}\u{1F603}\u{1F4AF}\u{1F648}\u{1F447}\u{1F3B6}\u{1F612}\u{1F92D}\u2763\u{1F61C}\u{1F48B}\u{1F440}\u{1F62A}\u{1F611}\u{1F4A5}\u{1F64B}\u{1F61E}\u{1F629}\u{1F621}\u{1F92A}\u{1F44A}\u{1F973}\u{1F625}\u{1F924}\u{1F449}\u{1F483}\u{1F633}\u270B\u{1F61A}\u{1F61D}\u{1F634}\u{1F31F}\u{1F62C}\u{1F643}\u{1F340}\u{1F337}\u{1F63B}\u{1F613}\u2B50\u2705\u{1F97A}\u{1F308}\u{1F608}\u{1F918}\u{1F4A6}\u2714\u{1F623}\u{1F3C3}\u{1F490}\u2639\u{1F38A}\u{1F498}\u{1F620}\u261D\u{1F615}\u{1F33A}\u{1F382}\u{1F33B}\u{1F610}\u{1F595}\u{1F49D}\u{1F64A}\u{1F639}\u{1F5E3}\u{1F4AB}\u{1F480}\u{1F451}\u{1F3B5}\u{1F91E}\u{1F61B}\u{1F534}\u{1F624}\u{1F33C}\u{1F62B}\u26BD\u{1F919}\u2615\u{1F3C6}\u{1F92B}\u{1F448}\u{1F62E}\u{1F646}\u{1F37B}\u{1F343}\u{1F436}\u{1F481}\u{1F632}\u{1F33F}\u{1F9E1}\u{1F381}\u26A1\u{1F31E}\u{1F388}\u274C\u270A\u{1F44B}\u{1F630}\u{1F928}\u{1F636}\u{1F91D}\u{1F6B6}\u{1F4B0}\u{1F353}\u{1F4A2}\u{1F91F}\u{1F641}\u{1F6A8}\u{1F4A8}\u{1F92C}\u2708\u{1F380}\u{1F37A}\u{1F913}\u{1F619}\u{1F49F}\u{1F331}\u{1F616}\u{1F476}\u{1F974}\u25B6\u27A1\u2753\u{1F48E}\u{1F4B8}\u2B07\u{1F628}\u{1F31A}\u{1F98B}\u{1F637}\u{1F57A}\u26A0\u{1F645}\u{1F61F}\u{1F635}\u{1F44E}\u{1F932}\u{1F920}\u{1F927}\u{1F4CC}\u{1F535}\u{1F485}\u{1F9D0}\u{1F43E}\u{1F352}\u{1F617}\u{1F911}\u{1F30A}\u{1F92F}\u{1F437}\u260E\u{1F4A7}\u{1F62F}\u{1F486}\u{1F446}\u{1F3A4}\u{1F647}\u{1F351}\u2744\u{1F334}\u{1F4A3}\u{1F438}\u{1F48C}\u{1F4CD}\u{1F940}\u{1F922}\u{1F445}\u{1F4A1}\u{1F4A9}\u{1F450}\u{1F4F8}\u{1F47B}\u{1F910}\u{1F92E}\u{1F3BC}\u{1F975}\u{1F6A9}\u{1F34E}\u{1F34A}\u{1F47C}\u{1F48D}\u{1F4E3}\u{1F942}"),Oh=ka.reduce((s,e,t)=>(s[t]=e,s),[]),zh=ka.reduce((s,e,t)=>(s[e.codePointAt(0)]=t,s),[]);function Gh(s){return s.reduce((e,t)=>(e+=Oh[t],e),"")}function qh(s){let e=[];for(let t of s){let r=zh[t.codePointAt(0)];if(r===void 0)throw new Error(`Non-base256emoji character: ${t}`);e.push(r)}return new Uint8Array(e)}var Kh=es({prefix:"\u{1F680}",name:"base256emoji",encode:Gh,decode:qh});var Ni={};ve(Ni,{base36:()=>Wh,base36upper:()=>$h});var Wh=vt({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),$h=vt({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"});var Ri={};ve(Ri,{base64:()=>jh,base64pad:()=>Zh,base64url:()=>Jh,base64urlpad:()=>Xh});var jh=Q({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),Zh=Q({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),Jh=Q({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),Xh=Q({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6});var Li={};ve(Li,{base8:()=>Yh});var Yh=Q({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3});var Ui={};ve(Ui,{identity:()=>Qh});var Qh=es({prefix:"\0",name:"identity",encode:s=>Vo(s),decode:s=>Fo(s)});var Kg=new TextEncoder,Wg=new TextDecoder;var Hi={};ve(Hi,{sha256:()=>Tt,sha512:()=>sf});function Vi({name:s,code:e,encode:t}){return new Fi(s,e,t)}var Fi=class{name;code;encode;constructor(e,t,r){this.name=e,this.code=t,this.encode=r}digest(e){if(e instanceof Uint8Array){let t=this.encode(e);return t instanceof Uint8Array?He(this.code,t):t.then(r=>He(this.code,r))}else throw Error("Unknown type, must be binary type")}};function Ma(s){return async e=>new Uint8Array(await crypto.subtle.digest(s,e))}var Tt=Vi({name:"sha2-256",code:18,encode:Ma("SHA-256")}),sf=Vi({name:"sha2-512",code:19,encode:Ma("SHA-512")});var Us={...Ui,...Di,...Li,...Mi,...Pi,...Zn,...Ni,...jn,...Ri,...Ci},nm={...Hi,...Yn};function Da(s,e,t,r){return{name:s,prefix:e,encoder:{name:s,prefix:e,encode:t},decoder:{decode:r}}}var Pa=Da("utf8","u",s=>"u"+new TextDecoder("utf8").decode(s),s=>new TextEncoder().encode(s.substring(1))),Oi=Da("ascii","a",s=>{let e="a";for(let t=0;t{s=s.substring(1);let e=de(s.length);for(let t=0;t>>1,r,n=e;return function(o){if(o<1||o>t)return de(o);n+o>e&&(r=de(e),n=0);let a=r.subarray(n,n+=o);return n&7&&(n=(n|7)+1),a}}var $t=class{fn;len;next;val;constructor(e,t,r){this.fn=e,this.len=t,this.next=void 0,this.val=r}};function Gi(){}var Ki=class{head;tail;len;next;constructor(e){this.head=e.head,this.tail=e.tail,this.len=e.len,this.next=e.states}},nf=zi();function of(s){return globalThis.Buffer!=null?de(s):nf(s)}var Vs=class{len;head;tail;states;constructor(){this.len=0,this.head=new $t(Gi,0,0),this.tail=this.head,this.states=null}_push(e,t,r){return this.tail=this.tail.next=new $t(e,t,r),this.len+=t,this}uint32(e){return this.len+=(this.tail=this.tail.next=new Wi((e=e>>>0)<128?1:e<16384?2:e<2097152?3:e<268435456?4:5,e)).len,this}int32(e){return e<0?this._push(vr,10,Re.fromNumber(e)):this.uint32(e)}sint32(e){return this.uint32((e<<1^e>>31)>>>0)}uint64(e){let t=Re.fromBigInt(e);return this._push(vr,t.length(),t)}uint64Number(e){return this._push(xi,Ee(e),e)}uint64String(e){return this.uint64(BigInt(e))}int64(e){return this.uint64(e)}int64Number(e){return this.uint64Number(e)}int64String(e){return this.uint64String(e)}sint64(e){let t=Re.fromBigInt(e).zzEncode();return this._push(vr,t.length(),t)}sint64Number(e){let t=Re.fromNumber(e).zzEncode();return this._push(vr,t.length(),t)}sint64String(e){return this.sint64(BigInt(e))}bool(e){return this._push(qi,1,e?1:0)}fixed32(e){return this._push(Fs,4,e>>>0)}sfixed32(e){return this.fixed32(e)}fixed64(e){let t=Re.fromBigInt(e);return this._push(Fs,4,t.lo)._push(Fs,4,t.hi)}fixed64Number(e){let t=Re.fromNumber(e);return this._push(Fs,4,t.lo)._push(Fs,4,t.hi)}fixed64String(e){return this.fixed64(BigInt(e))}sfixed64(e){return this.fixed64(e)}sfixed64Number(e){return this.fixed64Number(e)}sfixed64String(e){return this.fixed64String(e)}float(e){return this._push(va,4,e)}double(e){return this._push(Ea,8,e)}bytes(e){let t=e.length>>>0;return t===0?this._push(qi,1,0):this.uint32(t)._push(cf,t,e)}string(e){let t=Ia(e);return t!==0?this.uint32(t)._push(Ai,t,e):this._push(qi,1,0)}fork(){return this.states=new Ki(this),this.head=this.tail=new $t(Gi,0,0),this.len=0,this}reset(){return this.states!=null?(this.head=this.states.head,this.tail=this.states.tail,this.len=this.states.len,this.states=this.states.next):(this.head=this.tail=new $t(Gi,0,0),this.len=0),this}ldelim(){let e=this.head,t=this.tail,r=this.len;return this.reset().uint32(r),r!==0&&(this.tail.next=e.next,this.tail=t,this.len+=r),this}finish(){let e=this.head.next,t=of(this.len),r=0;for(;e!=null;)e.fn(e.val,t,r),r+=e.len,e=e.next;return t}};function qi(s,e,t){e[t]=s&255}function af(s,e,t){for(;s>127;)e[t++]=s&127|128,s>>>=7;e[t]=s}var Wi=class extends $t{next;constructor(e,t){super(af,e,t),this.next=void 0}};function vr(s,e,t){for(;s.hi!==0;)e[t++]=s.lo&127|128,s.lo=(s.lo>>>7|s.hi<<25)>>>0,s.hi>>>=7;for(;s.lo>127;)e[t++]=s.lo&127|128,s.lo=s.lo>>>7;e[t++]=s.lo}function Fs(s,e,t){e[t]=s&255,e[t+1]=s>>>8&255,e[t+2]=s>>>16&255,e[t+3]=s>>>24}function cf(s,e,t){e.set(s,t)}globalThis.Buffer!=null&&(Vs.prototype.bytes=function(s){let e=s.length>>>0;return this.uint32(e),e>0&&this._push(lf,e,s),this},Vs.prototype.string=function(s){let e=globalThis.Buffer.byteLength(s);return this.uint32(e),e>0&&this._push(uf,e,s),this});function lf(s,e,t){e.set(s,t)}function uf(s,e,t){s.length<40?Ai(s,e,t):e.utf8Write!=null?e.utf8Write(s,t):e.set(X(s),t)}function $i(){return new Vs}function De(s,e){let t=$i();return e.encode(s,t,{lengthDelimited:!1}),t.finish()}var hs;(function(s){s[s.VARINT=0]="VARINT",s[s.BIT64=1]="BIT64",s[s.LENGTH_DELIMITED=2]="LENGTH_DELIMITED",s[s.START_GROUP=3]="START_GROUP",s[s.END_GROUP=4]="END_GROUP",s[s.BIT32=5]="BIT32"})(hs||(hs={}));function xr(s,e,t,r){return{name:s,type:e,encode:t,decode:r}}function ji(s){function e(n){if(s[n.toString()]==null)throw new Error("Invalid enum value");return s[n]}let t=function(i,o){let a=e(i);o.int32(a)},r=function(i){let o=i.int32();return e(o)};return xr("enum",hs.VARINT,t,r)}function Ce(s,e){return xr("message",hs.LENGTH_DELIMITED,s,e)}var Fe=class extends Error{code="ERR_MAX_LENGTH";name="MaxLengthError"};var ie;(function(s){s.RSA="RSA",s.Ed25519="Ed25519",s.secp256k1="secp256k1"})(ie||(ie={}));var Zi;(function(s){s[s.RSA=0]="RSA",s[s.Ed25519=1]="Ed25519",s[s.secp256k1=2]="secp256k1"})(Zi||(Zi={}));(function(s){s.codec=()=>ji(Zi)})(ie||(ie={}));var Je;(function(s){let e;s.codec=()=>(e==null&&(e=Ce((t,r,n={})=>{n.lengthDelimited!==!1&&r.fork(),t.Type!=null&&(r.uint32(8),ie.codec().encode(t.Type,r)),t.Data!=null&&(r.uint32(18),r.bytes(t.Data)),n.lengthDelimited!==!1&&r.ldelim()},(t,r,n={})=>{let i={},o=r==null?t.len:t.pos+r;for(;t.pos>>3){case 1:{i.Type=ie.codec().decode(t);break}case 2:{i.Data=t.bytes();break}default:{t.skipType(a&7);break}}}return i})),e),s.encode=t=>De(t,s.codec()),s.decode=(t,r)=>Pe(t,s.codec(),r)})(Je||(Je={}));var Ji;(function(s){let e;s.codec=()=>(e==null&&(e=Ce((t,r,n={})=>{n.lengthDelimited!==!1&&r.fork(),t.Type!=null&&(r.uint32(8),ie.codec().encode(t.Type,r)),t.Data!=null&&(r.uint32(18),r.bytes(t.Data)),n.lengthDelimited!==!1&&r.ldelim()},(t,r,n={})=>{let i={},o=r==null?t.len:t.pos+r;for(;t.pos>>3){case 1:{i.Type=ie.codec().decode(t);break}case 2:{i.Data=t.bytes();break}default:{t.skipType(a&7);break}}}return i})),e),s.encode=t=>De(t,s.codec()),s.decode=(t,r)=>Pe(t,s.codec(),r)})(Ji||(Ji={}));var Zs={};ve(Zs,{MAX_RSA_KEY_SIZE:()=>pn,generateRSAKeyPair:()=>Tc,jwkToJWKKeyPair:()=>Mc,jwkToPkcs1:()=>_f,jwkToPkix:()=>io,jwkToRSAPrivateKey:()=>kc,pkcs1ToJwk:()=>Ic,pkcs1ToRSAPrivateKey:()=>Ac,pkixToJwk:()=>_c,pkixToRSAPublicKey:()=>oo});var hf=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),Mt=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),Pt=new Uint32Array(64),Xi=class extends cs{constructor(){super(64,32,8,!1),this.A=Mt[0]|0,this.B=Mt[1]|0,this.C=Mt[2]|0,this.D=Mt[3]|0,this.E=Mt[4]|0,this.F=Mt[5]|0,this.G=Mt[6]|0,this.H=Mt[7]|0}get(){let{A:e,B:t,C:r,D:n,E:i,F:o,G:a,H:c}=this;return[e,t,r,n,i,o,a,c]}set(e,t,r,n,i,o,a,c){this.A=e|0,this.B=t|0,this.C=r|0,this.D=n|0,this.E=i|0,this.F=o|0,this.G=a|0,this.H=c|0}process(e,t){for(let h=0;h<16;h++,t+=4)Pt[h]=e.getUint32(t,!1);for(let h=16;h<64;h++){let l=Pt[h-15],d=Pt[h-2],m=ze(l,7)^ze(l,18)^l>>>3,p=ze(d,17)^ze(d,19)^d>>>10;Pt[h]=p+Pt[h-7]+m+Pt[h-16]|0}let{A:r,B:n,C:i,D:o,E:a,F:c,G:f,H:u}=this;for(let h=0;h<64;h++){let l=ze(a,6)^ze(a,11)^ze(a,25),d=u+l+sa(a,c,f)+hf[h]+Pt[h]|0,p=(ze(r,2)^ze(r,13)^ze(r,22))+ra(r,n,i)|0;u=f,f=c,c=a,a=o+d|0,o=i,i=n,n=r,r=d+p|0}r=r+this.A|0,n=n+this.B|0,i=i+this.C|0,o=o+this.D|0,a=a+this.E|0,c=c+this.F|0,f=f+this.G|0,u=u+this.H|0,this.set(r,n,i,o,a,c,f,u)}roundClean(){Pt.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}};var fs=cr(()=>new Xi);var H=Co(Na());function jt(s,e){let t=0;if(s.length===1)return s[0];for(let r=s.length-1;r>=0;r--)t+=s[s.length-1-r]*Math.pow(2,e*r);return t}function Dt(s,e,t=-1){let r=t,n=s,i=0,o=Math.pow(2,e);for(let a=1;a<8;a++){if(s=0;u--){let h=Math.pow(2,u*e);f[i-u-1]=Math.floor(n/h),n-=f[i-u-1]*h}return c}o*=Math.pow(2,e)}return new ArrayBuffer(0)}function Br(...s){let e=0,t=0;for(let i of s)e+=i.length;let r=new ArrayBuffer(e),n=new Uint8Array(r);for(let i of s)n.set(i,t),t+=i.length;return n}function Qi(){let s=new Uint8Array(this.valueHex);if(this.valueHex.byteLength>=2){let a=s[0]===255&&s[1]&128,c=s[0]===0&&(s[1]&128)===0;(a||c)&&this.warnings.push("Needlessly long format")}let e=new ArrayBuffer(this.valueHex.byteLength),t=new Uint8Array(e);for(let a=0;a"u")throw new Error("BigInt is not defined. Your environment doesn't implement BigInt.")}function eo(s){let e=0,t=0;for(let n=0;n=i.length)return this.error="End of input reached before message was fully decoded",-1;if(c===u){u+=255;let l=new Uint8Array(u);for(let d=0;d8)return this.error="Too big integer",-1;if(o+1>i.length)return this.error="End of input reached before message was fully decoded",-1;let a=t+1,c=n.subarray(a,a+o);return c[o-1]===0&&this.warnings.push("Needlessly long encoded length"),this.length=jt(c,8),this.longFormUsed&&this.length<=127&&this.warnings.push("Unnecessary usage of long length form"),this.blockLength=o+1,t+this.blockLength}toBER(e=!1){let t,r;if(this.length>127&&(this.longFormUsed=!0),this.isIndefiniteForm)return t=new ArrayBuffer(1),e===!1&&(r=new Uint8Array(t),r[0]=128),t;if(this.longFormUsed){let n=Dt(this.length,8);if(n.byteLength>127)return this.error="Too big length",We;if(t=new ArrayBuffer(n.byteLength+1),e)return t;let i=new Uint8Array(n);r=new Uint8Array(t),r[0]=n.byteLength|128;for(let o=0;o=37&&n.idBlock.isHexOnly===!1)return n.error="UNIVERSAL 37 and upper tags are reserved by ASN.1 standard",{offset:-1,result:n};switch(n.idBlock.tagNumber){case 0:if(n.idBlock.isConstructed&&n.lenBlock.length>0)return n.error="Type [UNIVERSAL 0] is reserved",{offset:-1,result:n};c=M.EndOfContent;break;case 1:c=M.Boolean;break;case 2:c=M.Integer;break;case 3:c=M.BitString;break;case 4:c=M.OctetString;break;case 5:c=M.Null;break;case 6:c=M.ObjectIdentifier;break;case 10:c=M.Enumerated;break;case 12:c=M.Utf8String;break;case 13:c=M.RelativeObjectIdentifier;break;case 14:c=M.TIME;break;case 15:return n.error="[UNIVERSAL 15] is reserved by ASN.1 standard",{offset:-1,result:n};case 16:c=M.Sequence;break;case 17:c=M.Set;break;case 18:c=M.NumericString;break;case 19:c=M.PrintableString;break;case 20:c=M.TeletexString;break;case 21:c=M.VideotexString;break;case 22:c=M.IA5String;break;case 23:c=M.UTCTime;break;case 24:c=M.GeneralizedTime;break;case 25:c=M.GraphicString;break;case 26:c=M.VisibleString;break;case 27:c=M.GeneralString;break;case 28:c=M.UniversalString;break;case 29:c=M.CharacterString;break;case 30:c=M.BmpString;break;case 31:c=M.DATE;break;case 32:c=M.TimeOfDay;break;case 33:c=M.DateTime;break;case 34:c=M.Duration;break;default:{let f=n.idBlock.isConstructed?new M.Constructed:new M.Primitive;f.idBlock=n.idBlock,f.lenBlock=n.lenBlock,f.warnings=n.warnings,n=f}}break;case 2:case 3:case 4:default:c=n.idBlock.isConstructed?M.Constructed:M.Primitive}return n=vf(n,c),a=n.fromBER(s,e,n.lenBlock.isIndefiniteForm?t:n.lenBlock.length),n.valueBeforeDecodeView=s.subarray(r,r+n.blockLength),{offset:a,result:n}}function so(s){if(!s.byteLength){let e=new he({},me);return e.error="Input buffer has zero length",{offset:-1,result:e}}return hn(H.BufferSourceConverter.toUint8Array(s).slice(),0,s.byteLength)}function xf(s,e){return s?1:e}var Xe=class extends me{constructor({value:e=[],isIndefiniteForm:t=!1,...r}={}){super(r),this.value=e,this.isIndefiniteForm=t}fromBER(e,t,r){let n=H.BufferSourceConverter.toUint8Array(e);if(!pt(this,n,t,r))return-1;if(this.valueBeforeDecodeView=n.subarray(t,t+r),this.valueBeforeDecodeView.length===0)return this.warnings.push("Zero buffer length"),t;let i=t;for(;xf(this.isIndefiniteForm,r)>0;){let o=hn(n,i,r);if(o.offset===-1)return this.error=o.result.error,this.warnings.concat(o.result.warnings),-1;if(i=o.offset,this.blockLength+=o.result.blockLength,r-=o.result.blockLength,this.value.push(o.result),this.isIndefiniteForm&&o.result.constructor.NAME===zs)break}return this.isIndefiniteForm&&(this.value[this.value.length-1].constructor.NAME===zs?this.value.pop():this.warnings.push("No EndOfContent block encoded")),i}toBER(e,t){let r=t||new Os;for(let n=0;n` ${n}`).join(` + `));let t=this.idBlock.tagClass===3?`[${this.idBlock.tagNumber}]`:this.constructor.NAME;return e.length?`${t} : + ${e.join(` +-`)}`:`${t} :`}};Ac=Vt;k.Constructed=Ac;Vt.NAME="CONSTRUCTED";var cn=class extends _e{fromBER(e,t,r){return t}toBER(e){return je}};cn.override="EndOfContentValueBlock";var kc,ln=class extends pe{constructor(e={}){super(e,cn),this.idBlock.tagClass=1,this.idBlock.tagNumber=0}};kc=ln;k.EndOfContent=kc;ln.NAME=nr;var Tc,Ot=class extends pe{constructor(e={}){super(e,_e),this.idBlock.tagClass=1,this.idBlock.tagNumber=5}fromBER(e,t,r){return this.lenBlock.length>0&&this.warnings.push("Non-zero length of value block for Null type"),this.idBlock.error.length||(this.blockLength+=this.idBlock.blockLength),this.lenBlock.error.length||(this.blockLength+=this.lenBlock.blockLength),this.blockLength+=r,t+r>e.byteLength?(this.error="End of input reached before message was fully decoded (inconsistent offset and length values)",-1):t+r}toBER(e,t){let r=new ArrayBuffer(2);if(!e){let n=new Uint8Array(r);n[0]=5,n[1]=0}return t&&t.write(r),r}onAsciiEncoding(){return`${this.constructor.NAME}`}};Tc=Ot;k.Null=Tc;Ot.NAME="NULL";var un=class extends _t(_e){constructor({value:e,...t}={}){super(t),t.valueHex?this.valueHexView=H.BufferSourceConverter.toUint8Array(t.valueHex):this.valueHexView=new Uint8Array(1),e&&(this.value=e)}get value(){for(let e of this.valueHexView)if(e>0)return!0;return!1}set value(e){this.valueHexView[0]=e?255:0}fromBER(e,t,r){let n=H.BufferSourceConverter.toUint8Array(e);return Et(this,n,t,r)?(this.valueHexView=n.subarray(t,t+r),r>1&&this.warnings.push("Boolean value encoded in more then 1 octet"),this.isHexOnly=!0,lo.call(this),this.blockLength=r,t+r):-1}toBER(){return this.valueHexView.slice()}toJSON(){return{...super.toJSON(),value:this.value}}};un.NAME="BooleanValueBlock";var Pc,hn=class extends pe{constructor(e={}){super(e,un),this.idBlock.tagClass=1,this.idBlock.tagNumber=1}getValue(){return this.valueBlock.value}setValue(e){this.valueBlock.value=e}onAsciiEncoding(){return`${this.constructor.NAME} : ${this.getValue}`}};Pc=hn;k.Boolean=Pc;hn.NAME="BOOLEAN";var fn=class extends _t(tt){constructor({isConstructed:e=!1,...t}={}){super(t),this.isConstructed=e}fromBER(e,t,r){let n=0;if(this.isConstructed){if(this.isHexOnly=!1,n=tt.prototype.fromBER.call(this,e,t,r),n===-1)return n;for(let i=0;i0&&f.unusedBits>0)return this.error='Using of "unused bits" inside constructive BIT STRING allowed for least one only',-1;this.unusedBits=f.unusedBits}return n}let i=H.BufferSourceConverter.toUint8Array(e);if(!Et(this,i,t,r))return-1;let o=i.subarray(t,t+r);if(this.unusedBits=o[0],this.unusedBits>7)return this.error="Unused bits for BitString must be in range 0-7",-1;if(!this.unusedBits){let a=o.subarray(1);try{if(a.byteLength){let c=Fn(a,0,a.byteLength);c.offset!==-1&&c.offset===r-1&&(this.value=[c.result])}}catch{}}return this.valueHexView=o.subarray(1),this.blockLength=o.length,t+r}toBER(e,t){if(this.isConstructed)return tt.prototype.toBER.call(this,e,t);if(e)return new ArrayBuffer(this.valueHexView.byteLength+1);if(!this.valueHexView.byteLength)return je;let r=new Uint8Array(this.valueHexView.length+1);return r[0]=this.unusedBits,r.set(this.valueHexView,1),r.buffer}toJSON(){return{...super.toJSON(),unusedBits:this.unusedBits,isConstructed:this.isConstructed}}};dn.NAME="BitStringValueBlock";var Mc,Ns=class extends pe{constructor({idBlock:e={},lenBlock:t={},...r}={}){var n,i;(n=r.isConstructed)!==null&&n!==void 0||(r.isConstructed=!!(!((i=r.value)===null||i===void 0)&&i.length)),super({idBlock:{isConstructed:r.isConstructed,...e},lenBlock:{...t,isIndefiniteForm:!!r.isIndefiniteForm},...r},dn),this.idBlock.tagClass=1,this.idBlock.tagNumber=3}fromBER(e,t,r){return this.valueBlock.isConstructed=this.idBlock.isConstructed,this.valueBlock.isIndefiniteForm=this.lenBlock.isIndefiniteForm,super.fromBER(e,t,r)}onAsciiEncoding(){if(this.valueBlock.isConstructed||this.valueBlock.value&&this.valueBlock.value.length)return Vt.prototype.onAsciiEncoding.call(this);{let e=[],t=this.valueBlock.valueHexView;for(let n of t)e.push(n.toString(2).padStart(8,"0"));let r=e.join("");return`${this.constructor.NAME} : ${r.substring(0,r.length-this.valueBlock.unusedBits)}`}}};Mc=Ns;k.BitString=Mc;Ns.NAME=Bc;var Dc;function ad(s,e){let t=new Uint8Array([0]),r=new Uint8Array(s),n=new Uint8Array(e),i=r.slice(0),o=i.length-1,a=n.slice(0),c=a.length-1,f=0,l=c=0;h--,u++){switch(!0){case u=i.length:i=en(new Uint8Array([f%10]),i);break;default:i[o-u]=f%10}}return t[0]>0&&(i=en(t,i)),i}function Ec(s){if(s>=sr.length)for(let e=sr.length;e<=s;e++){let t=new Uint8Array([0]),r=sr[e-1].slice(0);for(let n=r.length-1;n>=0;n--){let i=new Uint8Array([(r[n]<<1)+t[0]]);t[0]=i[0]/10,r[n]=i[0]%10}t[0]>0&&(r=en(t,r)),sr.push(r)}return sr[s]}function cd(s,e){let t=0,r=new Uint8Array(s),n=new Uint8Array(e),i=r.slice(0),o=i.length-1,a=n.slice(0),c=a.length-1,f,l=0;for(let u=c;u>=0;u--,l++)switch(f=i[o-l]-a[c-l]-t,!0){case f<0:t=1,i[o-l]=f+10;break;default:t=0,i[o-l]=f}if(t>0)for(let u=o-c+1;u>=0;u--,l++)if(f=i[o-l]-t,f<0)t=1,i[o-l]=f+10;else{t=0,i[o-l]=f;break}return i.slice()}var ir=class extends _t(_e){constructor({value:e,...t}={}){super(t),this._valueDec=0,t.valueHex&&this.setValueHex(),e!==void 0&&(this.valueDec=e)}setValueHex(){this.valueHexView.length>=4?(this.warnings.push("Too big Integer for decoding, hex only"),this.isHexOnly=!0,this._valueDec=0):(this.isHexOnly=!1,this.valueHexView.length>0&&(this._valueDec=lo.call(this)))}set valueDec(e){this._valueDec=e,this.isHexOnly=!1,this.valueHexView=new Uint8Array(wc(e))}get valueDec(){return this._valueDec}fromDER(e,t,r,n=0){let i=this.fromBER(e,t,r);if(i===-1)return i;let o=this.valueHexView;return o[0]===0&&o[1]&128?this.valueHexView=o.subarray(1):n!==0&&o.length1&&(n=o.length+1),this.valueHexView=o.subarray(n-o.length)),i}toDER(e=!1){let t=this.valueHexView;switch(!0){case(t[0]&128)!==0:{let r=new Uint8Array(this.valueHexView.length+1);r[0]=0,r.set(t,1),this.valueHexView=r}break;case(t[0]===0&&(t[1]&128)===0):this.valueHexView=this.valueHexView.subarray(1);break}return this.toBER(e)}fromBER(e,t,r){let n=super.fromBER(e,t,r);return n===-1||this.setValueHex(),n}toBER(e){return e?new ArrayBuffer(this.valueHexView.length):this.valueHexView.slice().buffer}toJSON(){return{...super.toJSON(),valueDec:this.valueDec}}toString(){let e=this.valueHexView.length*8-1,t=new Uint8Array(this.valueHexView.length*8/3),r=0,n,i=this.valueHexView,o="",a=!1;for(let c=i.byteLength-1;c>=0;c--){n=i[c];for(let f=0;f<8;f++){if((n&1)===1)switch(r){case e:t=cd(Ec(r),t),o="-";break;default:t=ad(t,Ec(r))}r++,n>>=1}}for(let c=0;c0;){let i=new or;if(n=i.fromBER(e,n,r),n===-1)return this.blockLength=0,this.error=i.error,n;this.value.length===0&&(i.isFirstSid=!0),this.blockLength+=i.blockLength,r-=i.blockLength,this.value.push(i)}return n}toBER(e){let t=[];for(let r=0;rNumber.MAX_SAFE_INTEGER){tn();let a=BigInt(n);o.valueBigInt=a}else if(o.valueDec=parseInt(n,10),isNaN(o.valueDec))return;this.value.length||(o.isFirstSid=!0,i=!0),this.value.push(o)}while(r!==-1)}toString(){let e="",t=!1;for(let r=0;r0;){let i=new ar;if(n=i.fromBER(e,n,r),n===-1)return this.blockLength=0,this.error=i.error,n;this.blockLength+=i.blockLength,r-=i.blockLength,this.value.push(i)}return n}toBER(e,t){let r=[];for(let n=0;n4)continue;let a=4-o.length;for(let c=o.length-1;c>=0;c--)r[n*4+c+a]=o[c]}this.valueBlock.value=e}};Bn.NAME="UniversalStringValueBlock";var Gc,Sn=class extends Bn{constructor({...e}={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=28}};Gc=Sn;k.UniversalString=Gc;Sn.NAME="UniversalString";var Kc,In=class extends Pe{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=18}};Kc=In;k.NumericString=Kc;In.NAME="NumericString";var zc,An=class extends Pe{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=19}};zc=An;k.PrintableString=zc;An.NAME="PrintableString";var qc,kn=class extends Pe{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=20}};qc=kn;k.TeletexString=qc;kn.NAME="TeletexString";var Wc,Tn=class extends Pe{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=21}};Wc=Tn;k.VideotexString=Wc;Tn.NAME="VideotexString";var $c,Pn=class extends Pe{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=22}};$c=Pn;k.IA5String=$c;Pn.NAME="IA5String";var jc,Rn=class extends Pe{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=25}};jc=Rn;k.GraphicString=jc;Rn.NAME="GraphicString";var Zc,cr=class extends Pe{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=26}};Zc=cr;k.VisibleString=Zc;cr.NAME="VisibleString";var Yc,Mn=class extends Pe{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=27}};Yc=Mn;k.GeneralString=Yc;Mn.NAME="GeneralString";var Xc,Dn=class extends Pe{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=29}};Xc=Dn;k.CharacterString=Xc;Dn.NAME="CharacterString";var Jc,lr=class extends cr{constructor({value:e,valueDate:t,...r}={}){if(super(r),this.year=0,this.month=0,this.day=0,this.hour=0,this.minute=0,this.second=0,e){this.fromString(e),this.valueBlock.valueHexView=new Uint8Array(e.length);for(let n=0;n=50?this.year=1900+n:this.year=2e3+n,this.month=parseInt(r[2],10),this.day=parseInt(r[3],10),this.hour=parseInt(r[4],10),this.minute=parseInt(r[5],10),this.second=parseInt(r[6],10)}toString(e="iso"){if(e==="iso"){let t=new Array(7);return t[0]=Ne(this.year<2e3?this.year-1900:this.year-2e3,2),t[1]=Ne(this.month,2),t[2]=Ne(this.day,2),t[3]=Ne(this.hour,2),t[4]=Ne(this.minute,2),t[5]=Ne(this.second,2),t[6]="Z",t.join("")}return super.toString(e)}onAsciiEncoding(){return`${this.constructor.NAME} : ${this.toDate().toISOString()}`}toJSON(){return{...super.toJSON(),year:this.year,month:this.month,day:this.day,hour:this.hour,minute:this.minute,second:this.second}}};Jc=lr;k.UTCTime=Jc;lr.NAME="UTCTime";var Qc,Nn=class extends lr{constructor(e={}){var t;super(e),(t=this.millisecond)!==null&&t!==void 0||(this.millisecond=0),this.idBlock.tagClass=1,this.idBlock.tagNumber=24}fromDate(e){super.fromDate(e),this.millisecond=e.getUTCMilliseconds()}toDate(){return new Date(Date.UTC(this.year,this.month-1,this.day,this.hour,this.minute,this.second,this.millisecond))}fromString(e){let t=!1,r="",n="",i=0,o,a=0,c=0;if(e[e.length-1]==="Z")r=e.substring(0,e.length-1),t=!0;else{let u=new Number(e[e.length-1]);if(isNaN(u.valueOf()))throw new Error("Wrong input string for conversion");r=e}if(t){if(r.indexOf("+")!==-1)throw new Error("Wrong input string for conversion");if(r.indexOf("-")!==-1)throw new Error("Wrong input string for conversion")}else{let u=1,h=r.indexOf("+"),p="";if(h===-1&&(h=r.indexOf("-"),u=-1),h!==-1){if(p=r.substring(h+1),r=r.substring(0,h),p.length!==2&&p.length!==4)throw new Error("Wrong input string for conversion");let g=parseInt(p.substring(0,2),10);if(isNaN(g.valueOf()))throw new Error("Wrong input string for conversion");if(a=u*g,p.length===4){if(g=parseInt(p.substring(2,4),10),isNaN(g.valueOf()))throw new Error("Wrong input string for conversion");c=u*g}}}let f=r.indexOf(".");if(f===-1&&(f=r.indexOf(",")),f!==-1){let u=new Number(`0${r.substring(f)}`);if(isNaN(u.valueOf()))throw new Error("Wrong input string for conversion");i=u.valueOf(),n=r.substring(0,f)}else n=r;switch(!0){case n.length===8:if(o=/(\d{4})(\d{2})(\d{2})/ig,f!==-1)throw new Error("Wrong input string for conversion");break;case n.length===10:if(o=/(\d{4})(\d{2})(\d{2})(\d{2})/ig,f!==-1){let u=60*i;this.minute=Math.floor(u),u=60*(u-this.minute),this.second=Math.floor(u),u=1e3*(u-this.second),this.millisecond=Math.floor(u)}break;case n.length===12:if(o=/(\d{4})(\d{2})(\d{2})(\d{2})(\d{2})/ig,f!==-1){let u=60*i;this.second=Math.floor(u),u=1e3*(u-this.second),this.millisecond=Math.floor(u)}break;case n.length===14:if(o=/(\d{4})(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})/ig,f!==-1){let u=1e3*i;this.millisecond=Math.floor(u)}break;default:throw new Error("Wrong input string for conversion")}let l=o.exec(n);if(l===null)throw new Error("Wrong input string for conversion");for(let u=1;u0&&(e=`0${e}`);let t=e.length/2,r=new Uint8Array(t),n=0,i=0;for(;n0&&(r=`0${r}`),e.push(r)}),BigInt("0x"+e.join(""))}var pd=16,fo=32,po=1e4;async function gd(s,e){let t=Te.get(),n=new he({value:[new oe({value:0}),new he({value:[new $e({value:"1.2.840.113549.1.1.1"}),new Ot]}),new vt({valueHex:s.marshal()})]}).toBER(),i=new Uint8Array(n,0,n.byteLength),o=et(pd),a=await ao(As,e,o,{c:po,dkLen:fo}),c=et(16),f=await t.subtle.importKey("raw",a,"AES-CBC",!1,["encrypt"]),l=await t.subtle.encrypt({name:"AES-CBC",iv:c},f,i),u=new he({value:[new vt({valueHex:o}),new oe({value:po}),new oe({value:fo}),new he({value:[new $e({value:"1.2.840.113549.2.11"}),new Ot]})]}),h=new he({value:[new $e({value:"1.2.840.113549.1.5.13"}),new he({value:[new he({value:[new $e({value:"1.2.840.113549.1.5.12"}),u]}),new he({value:[new $e({value:"2.16.840.1.101.3.4.1.42"}),new vt({valueHex:c})]})]})]}),g=new he({value:[h,new vt({valueHex:l})]}).toBER(),d=new Uint8Array(g,0,g.byteLength);return["-----BEGIN ENCRYPTED PRIVATE KEY-----",...W(d,"base64pad").split(/(.{64})/).filter(Boolean),"-----END ENCRYPTED PRIVATE KEY-----"].join(` +-`)}async function md(s,e){let t=Te.get(),r;if(s.includes("-----BEGIN ENCRYPTED PRIVATE KEY-----")){let n=Z(s.replace("-----BEGIN ENCRYPTED PRIVATE KEY-----","").replace("-----END ENCRYPTED PRIVATE KEY-----","").replace(/\n/g,"").trim(),"base64pad"),{result:i}=Ls(n),{iv:o,salt:a,iterations:c,keySize:f,cipherText:l}=bd(i),u=await ao(As,e,a,{c,dkLen:f}),h=await t.subtle.importKey("raw",u,"AES-CBC",!1,["decrypt"]),p=ur(await t.subtle.decrypt({name:"AES-CBC",iv:o},h,l)),{result:g}=Ls(p);r=il(g)}else if(s.includes("-----BEGIN PRIVATE KEY-----")){let n=Z(s.replace("-----BEGIN PRIVATE KEY-----","").replace("-----END PRIVATE KEY-----","").replace(/\n/g,"").trim(),"base64pad"),{result:i}=Ls(n);r=il(i)}else throw new T("Could not parse private key from PEM data","ERR_INVALID_PARAMETERS");return go(r)}function bd(s){let e=s.valueBlock.value[0];if(e.valueBlock.value[0].toString()!=="OBJECT IDENTIFIER : 1.2.840.113549.1.5.13")throw new T("Only pkcs5PBES2 encrypted private keys are supported","ERR_INVALID_PARAMS");let r=e.valueBlock.value[1].valueBlock.value[0];if(r.valueBlock.value[0].toString()!=="OBJECT IDENTIFIER : 1.2.840.113549.1.5.12")throw new T("Only pkcs5PBKDF2 key derivation functions are supported","ERR_INVALID_PARAMS");let i=r.valueBlock.value[1],o=ur(i.valueBlock.value[0].getValue()),a=po,c=fo;if(i.valueBlock.value.length===3)a=Number(i.valueBlock.value[1].toBigInt()),c=Number(i.valueBlock.value[2].toBigInt());else if(i.valueBlock.value.length===2)throw new T("Could not derive key size and iterations from PEM file - please use @libp2p/rsa to re-import your key","ERR_INVALID_PARAMS");let f=e.valueBlock.value[1].valueBlock.value[1],l=f.valueBlock.value[0].toString();if(l!=="OBJECT IDENTIFIER : 1.2.840.113549.3.7"){if(l!=="OBJECT IDENTIFIER : 1.3.14.3.2.7"){if(l!=="OBJECT IDENTIFIER : 2.16.840.1.101.3.4.1.2"){if(l!=="OBJECT IDENTIFIER : 2.16.840.1.101.3.4.1.22"){if(l!=="OBJECT IDENTIFIER : 2.16.840.1.101.3.4.1.42")throw new T("Only AES-CBC encryption schemes are supported","ERR_INVALID_PARAMS")}}}}let u=ur(f.valueBlock.value[1].getValue());return{cipherText:ur(s.valueBlock.value[1].getValue()),salt:o,iterations:a,keySize:c,iv:u}}function il(s){return ur(s.valueBlock.value[2].getValue())}function ur(s){return new Uint8Array(s,0,s.byteLength)}async function ol(s){let e=await Te.get().subtle.generateKey({name:"RSASSA-PKCS1-v1_5",modulusLength:s,publicExponent:new Uint8Array([1,0,1]),hash:{name:"SHA-256"}},!0,["sign","verify"]),t=await ll(e);return{privateKey:t[0],publicKey:t[1]}}async function mo(s){let t=[await Te.get().subtle.importKey("jwk",s,{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-256"}},!0,["sign"]),await yd(s)],r=await ll({privateKey:t[0],publicKey:t[1]});return{privateKey:r[0],publicKey:r[1]}}async function al(s,e){let t=await Te.get().subtle.importKey("jwk",s,{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-256"}},!1,["sign"]),r=await Te.get().subtle.sign({name:"RSASSA-PKCS1-v1_5"},t,e instanceof Uint8Array?e:e.subarray());return new Uint8Array(r,0,r.byteLength)}async function cl(s,e,t){let r=await Te.get().subtle.importKey("jwk",s,{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-256"}},!1,["verify"]);return Te.get().subtle.verify({name:"RSASSA-PKCS1-v1_5"},r,e,t instanceof Uint8Array?t:t.subarray())}async function ll(s){if(s.privateKey==null||s.publicKey==null)throw new T("Private and public key are required","ERR_INVALID_PARAMETERS");return Promise.all([Te.get().subtle.exportKey("jwk",s.privateKey),Te.get().subtle.exportKey("jwk",s.publicKey)])}async function yd(s){return Te.get().subtle.importKey("jwk",{kty:s.kty,n:s.n,e:s.e},{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-256"}},!0,["verify"])}function Hn(s){if(s.kty!=="RSA")throw new T("invalid key type","ERR_INVALID_KEY_TYPE");if(s.n==null)throw new T("invalid key modulus","ERR_INVALID_KEY_MODULUS");return Z(s.n,"base64url").length*8}var fr=8192,hr=class{_key;constructor(e){this._key=e}verify(e,t){return cl(this._key,t,e)}marshal(){return Ft.jwkToPkix(this._key)}get bytes(){return Je.encode({Type:J.RSA,Data:this.marshal()}).subarray()}equals(e){return be(this.bytes,e.bytes)}hash(){let e=ce.digest(this.bytes);return Fe(e)?e.then(({bytes:t})=>t):e.bytes}},Us=class{_key;_publicKey;constructor(e,t){this._key=e,this._publicKey=t}genSecret(){return et(16)}sign(e){return al(this._key,e)}get public(){if(this._publicKey==null)throw new T("public key not provided","ERR_PUBKEY_NOT_PROVIDED");return new hr(this._publicKey)}marshal(){return Ft.jwkToPkcs1(this._key)}get bytes(){return Qe.encode({Type:J.RSA,Data:this.marshal()}).subarray()}equals(e){return be(this.bytes,e.bytes)}hash(){let e=ce.digest(this.bytes);return Fe(e)?e.then(({bytes:t})=>t):e.bytes}async id(){let e=await this.public.hash();return W(e,"base58btc")}async export(e,t="pkcs-8"){if(t==="pkcs-8")return Ft.exportToPem(this,e);if(t==="libp2p-key")return Rs(this.bytes,e);throw new T(`export format '${t}' is not supported`,"ERR_INVALID_EXPORT_FORMAT")}};async function go(s){let e=Ft.pkcs1ToJwk(s);if(Hn(e)>fr)throw new T("key size is too large","ERR_KEY_SIZE_TOO_LARGE");let t=await mo(e);return new Us(t.privateKey,t.publicKey)}function vd(s){let e=Ft.pkixToJwk(s);if(Hn(e)>fr)throw new T("key size is too large","ERR_KEY_SIZE_TOO_LARGE");return new hr(e)}async function xd(s){if(Hn(s)>fr)throw new T("key size is too large","ERR_KEY_SIZE_TOO_LARGE");let e=await mo(s);return new Us(e.privateKey,e.publicKey)}async function Ed(s){if(s>fr)throw new T("key size is too large","ERR_KEY_SIZE_TOO_LARGE");let e=await ol(s);return new Us(e.privateKey,e.publicKey)}var Eo={};ue(Eo,{Secp256k1PrivateKey:()=>pr,Secp256k1PublicKey:()=>dr,generateKeyPair:()=>Cd,unmarshalSecp256k1PrivateKey:()=>Dd,unmarshalSecp256k1PublicKey:()=>Nd});var _d=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),Ht=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),Gt=new Uint32Array(64),yo=class extends Is{constructor(){super(64,32,8,!1),this.A=Ht[0]|0,this.B=Ht[1]|0,this.C=Ht[2]|0,this.D=Ht[3]|0,this.E=Ht[4]|0,this.F=Ht[5]|0,this.G=Ht[6]|0,this.H=Ht[7]|0}get(){let{A:e,B:t,C:r,D:n,E:i,F:o,G:a,H:c}=this;return[e,t,r,n,i,o,a,c]}set(e,t,r,n,i,o,a,c){this.A=e|0,this.B=t|0,this.C=r|0,this.D=n|0,this.E=i|0,this.F=o|0,this.G=a|0,this.H=c|0}process(e,t){for(let u=0;u<16;u++,t+=4)Gt[u]=e.getUint32(t,!1);for(let u=16;u<64;u++){let h=Gt[u-15],p=Gt[u-2],g=qe(h,7)^qe(h,18)^h>>>3,d=qe(p,17)^qe(p,19)^p>>>10;Gt[u]=d+Gt[u-7]+g+Gt[u-16]|0}let{A:r,B:n,C:i,D:o,E:a,F:c,G:f,H:l}=this;for(let u=0;u<64;u++){let h=qe(a,6)^qe(a,11)^qe(a,25),p=l+h+ja(a,c,f)+_d[u]+Gt[u]|0,d=(qe(r,2)^qe(r,13)^qe(r,22))+Za(r,n,i)|0;l=f,f=c,c=a,a=o+p|0,o=i,i=n,n=r,r=p+d|0}r=r+this.A|0,n=n+this.B|0,i=i+this.C|0,o=o+this.D|0,a=a+this.E|0,c=c+this.F|0,f=f+this.G|0,l=l+this.H|0,this.set(r,n,i,o,a,c,f,l)}roundClean(){Gt.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}};var ul=Fr(()=>new yo);function Bd(s){let e=Qs(s);Xe(e,{a:"field",b:"field"},{allowedPrivateKeyLengths:"array",wrapPrivateKey:"boolean",isTorsionFree:"function",clearCofactor:"function",allowInfinityPoint:"boolean",fromBytes:"function",toBytes:"function"});let{endo:t,Fp:r,a:n}=e;if(t){if(!r.eql(n,r.ZERO))throw new Error("Endomorphism can only be defined for Koblitz curves that have a=0");if(typeof t!="object"||typeof t.beta!="bigint"||typeof t.splitScalar!="function")throw new Error("Expected endomorphism with beta: bigint and splitScalar: function")}return Object.freeze({...e})}var{bytesToNumberBE:Sd,hexToBytes:Id}=Kr,ss={Err:class extends Error{constructor(e=""){super(e)}},_parseInt(s){let{Err:e}=ss;if(s.length<2||s[0]!==2)throw new e("Invalid signature integer tag");let t=s[1],r=s.subarray(2,t+2);if(!t||r.length!==t)throw new e("Invalid signature integer: wrong length");if(r[0]&128)throw new e("Invalid signature integer: negative");if(r[0]===0&&!(r[1]&128))throw new e("Invalid signature integer: unnecessary leading zero");return{d:Sd(r),l:s.subarray(t+2)}},toSig(s){let{Err:e}=ss,t=typeof s=="string"?Id(s):s;ks(t);let r=t.length;if(r<2||t[0]!=48)throw new e("Invalid signature tag");if(t[1]!==r-2)throw new e("Invalid signature: incorrect length");let{d:n,l:i}=ss._parseInt(t.subarray(2)),{d:o,l:a}=ss._parseInt(i);if(a.length)throw new e("Invalid signature: left bytes after parsing");return{r:n,s:o}},hexFromSig(s){let e=f=>Number.parseInt(f[0],16)&8?"00"+f:f,t=f=>{let l=f.toString(16);return l.length&1?`0${l}`:l},r=e(t(s.s)),n=e(t(s.r)),i=r.length/2,o=n.length/2,a=t(i),c=t(o);return`30${t(o+i+4)}02${c}${n}02${a}${r}`}},Bt=BigInt(0),Ge=BigInt(1),Ry=BigInt(2),hl=BigInt(3),My=BigInt(4);function Ad(s){let e=Bd(s),{Fp:t}=e,r=e.toBytes||((g,d,m)=>{let b=d.toAffine();return gt(Uint8Array.from([4]),t.toBytes(b.x),t.toBytes(b.y))}),n=e.fromBytes||(g=>{let d=g.subarray(1),m=t.fromBytes(d.subarray(0,t.BYTES)),b=t.fromBytes(d.subarray(t.BYTES,2*t.BYTES));return{x:m,y:b}});function i(g){let{a:d,b:m}=e,b=t.sqr(g),_=t.mul(b,g);return t.add(t.add(_,t.mul(g,d)),m)}if(!t.eql(t.sqr(e.Gy),i(e.Gx)))throw new Error("bad generator point: equation left != right");function o(g){return typeof g=="bigint"&&Btt.eql(w,t.ZERO);return _(m)&&_(b)?u.ZERO:new u(m,b,t.ONE)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static normalizeZ(d){let m=t.invertBatch(d.map(b=>b.pz));return d.map((b,_)=>b.toAffine(m[_])).map(u.fromAffine)}static fromHex(d){let m=u.fromAffine(n(se("pointHex",d)));return m.assertValidity(),m}static fromPrivateKey(d){return u.BASE.multiply(c(d))}_setWindowSize(d){this._WINDOW_SIZE=d,f.delete(this)}assertValidity(){if(this.is0()){if(e.allowInfinityPoint&&!t.is0(this.py))return;throw new Error("bad point: ZERO")}let{x:d,y:m}=this.toAffine();if(!t.isValid(d)||!t.isValid(m))throw new Error("bad point: x or y not FE");let b=t.sqr(m),_=i(d);if(!t.eql(b,_))throw new Error("bad point: equation left != right");if(!this.isTorsionFree())throw new Error("bad point: not in prime-order subgroup")}hasEvenY(){let{y:d}=this.toAffine();if(t.isOdd)return!t.isOdd(d);throw new Error("Field doesn't support isOdd")}equals(d){l(d);let{px:m,py:b,pz:_}=this,{px:w,py:A,pz:y}=d,x=t.eql(t.mul(m,y),t.mul(w,_)),E=t.eql(t.mul(b,y),t.mul(A,_));return x&&E}negate(){return new u(this.px,t.neg(this.py),this.pz)}double(){let{a:d,b:m}=e,b=t.mul(m,hl),{px:_,py:w,pz:A}=this,y=t.ZERO,x=t.ZERO,E=t.ZERO,B=t.mul(_,_),D=t.mul(w,w),N=t.mul(A,A),L=t.mul(_,w);return L=t.add(L,L),E=t.mul(_,A),E=t.add(E,E),y=t.mul(d,E),x=t.mul(b,N),x=t.add(y,x),y=t.sub(D,x),x=t.add(D,x),x=t.mul(y,x),y=t.mul(L,y),E=t.mul(b,E),N=t.mul(d,N),L=t.sub(B,N),L=t.mul(d,L),L=t.add(L,E),E=t.add(B,B),B=t.add(E,B),B=t.add(B,N),B=t.mul(B,L),x=t.add(x,B),N=t.mul(w,A),N=t.add(N,N),B=t.mul(N,L),y=t.sub(y,B),E=t.mul(N,D),E=t.add(E,E),E=t.add(E,E),new u(y,x,E)}add(d){l(d);let{px:m,py:b,pz:_}=this,{px:w,py:A,pz:y}=d,x=t.ZERO,E=t.ZERO,B=t.ZERO,D=e.a,N=t.mul(e.b,hl),L=t.mul(m,w),ne=t.mul(b,A),re=t.mul(_,y),Ve=t.add(m,b),S=t.add(w,A);Ve=t.mul(Ve,S),S=t.add(L,ne),Ve=t.sub(Ve,S),S=t.add(m,_);let R=t.add(w,y);return S=t.mul(S,R),R=t.add(L,re),S=t.sub(S,R),R=t.add(b,_),x=t.add(A,y),R=t.mul(R,x),x=t.add(ne,re),R=t.sub(R,x),B=t.mul(D,S),x=t.mul(N,re),B=t.add(x,B),x=t.sub(ne,B),B=t.add(ne,B),E=t.mul(x,B),ne=t.add(L,L),ne=t.add(ne,L),re=t.mul(D,re),S=t.mul(N,S),ne=t.add(ne,re),re=t.sub(L,re),re=t.mul(D,re),S=t.add(S,re),L=t.mul(ne,S),E=t.add(E,L),L=t.mul(R,S),x=t.mul(Ve,x),x=t.sub(x,L),L=t.mul(Ve,ne),B=t.mul(R,B),B=t.add(B,L),new u(x,E,B)}subtract(d){return this.add(d.negate())}is0(){return this.equals(u.ZERO)}wNAF(d){return p.wNAFCached(this,f,d,m=>{let b=t.invertBatch(m.map(_=>_.pz));return m.map((_,w)=>_.toAffine(b[w])).map(u.fromAffine)})}multiplyUnsafe(d){let m=u.ZERO;if(d===Bt)return m;if(a(d),d===Ge)return this;let{endo:b}=e;if(!b)return p.unsafeLadder(this,d);let{k1neg:_,k1:w,k2neg:A,k2:y}=b.splitScalar(d),x=m,E=m,B=this;for(;w>Bt||y>Bt;)w&Ge&&(x=x.add(B)),y&Ge&&(E=E.add(B)),B=B.double(),w>>=Ge,y>>=Ge;return _&&(x=x.negate()),A&&(E=E.negate()),E=new u(t.mul(E.px,b.beta),E.py,E.pz),x.add(E)}multiply(d){a(d);let m=d,b,_,{endo:w}=e;if(w){let{k1neg:A,k1:y,k2neg:x,k2:E}=w.splitScalar(m),{p:B,f:D}=this.wNAF(y),{p:N,f:L}=this.wNAF(E);B=p.constTimeNegate(A,B),N=p.constTimeNegate(x,N),N=new u(t.mul(N.px,w.beta),N.py,N.pz),b=B.add(N),_=D.add(L)}else{let{p:A,f:y}=this.wNAF(m);b=A,_=y}return u.normalizeZ([b,_])[0]}multiplyAndAddUnsafe(d,m,b){let _=u.BASE,w=(y,x)=>x===Bt||x===Ge||!y.equals(_)?y.multiplyUnsafe(x):y.multiply(x),A=w(this,m).add(w(d,b));return A.is0()?void 0:A}toAffine(d){let{px:m,py:b,pz:_}=this,w=this.is0();d==null&&(d=w?t.ONE:t.inv(_));let A=t.mul(m,d),y=t.mul(b,d),x=t.mul(_,d);if(w)return{x:t.ZERO,y:t.ZERO};if(!t.eql(x,t.ONE))throw new Error("invZ was invalid");return{x:A,y}}isTorsionFree(){let{h:d,isTorsionFree:m}=e;if(d===Ge)return!0;if(m)return m(u,this);throw new Error("isTorsionFree() has not been declared for the elliptic curve")}clearCofactor(){let{h:d,clearCofactor:m}=e;return d===Ge?this:m?m(u,this):this.multiplyUnsafe(e.h)}toRawBytes(d=!0){return this.assertValidity(),r(u,this,d)}toHex(d=!0){return dt(this.toRawBytes(d))}}u.BASE=new u(e.Gx,e.Gy,t.ONE),u.ZERO=new u(t.ZERO,t.ONE,t.ZERO);let h=e.nBitLength,p=Wr(u,e.endo?Math.ceil(h/2):h);return{CURVE:e,ProjectivePoint:u,normPrivateKeyToScalar:c,weierstrassEquation:i,isWithinCurveOrder:o}}function kd(s){let e=Qs(s);return Xe(e,{hash:"hash",hmac:"function",randomBytes:"function"},{bits2int:"function",bits2int_modN:"function",lowS:"boolean"}),Object.freeze({lowS:!0,...e})}function fl(s){let e=kd(s),{Fp:t,n:r}=e,n=t.BYTES+1,i=2*t.BYTES+1;function o(S){return Btdt(Lt(S,e.nByteLength));function g(S){let R=r>>Ge;return S>R}function d(S){return g(S)?a(-S):S}let m=(S,R,V)=>pt(S.slice(R,V));class b{constructor(R,V,I){this.r=R,this.s=V,this.recovery=I,this.assertValidity()}static fromCompact(R){let V=e.nByteLength;return R=se("compactSignature",R,V*2),new b(m(R,0,V),m(R,V,2*V))}static fromDER(R){let{r:V,s:I}=ss.toSig(se("DER",R));return new b(V,I)}assertValidity(){if(!h(this.r))throw new Error("r must be 0 < r < CURVE.n");if(!h(this.s))throw new Error("s must be 0 < s < CURVE.n")}addRecoveryBit(R){return new b(this.r,this.s,R)}recoverPublicKey(R){let{r:V,s:I,recovery:v}=this,P=E(se("msgHash",R));if(v==null||![0,1,2,3].includes(v))throw new Error("recovery id invalid");let M=v===2||v===3?V+e.n:V;if(M>=t.ORDER)throw new Error("recovery id 2 or 3 invalid");let C=v&1?"03":"02",O=f.fromHex(C+p(M)),F=c(M),z=a(-P*F),G=a(I*F),K=f.BASE.multiplyAndAddUnsafe(O,z,G);if(!K)throw new Error("point at infinify");return K.assertValidity(),K}hasHighS(){return g(this.s)}normalizeS(){return this.hasHighS()?new b(this.r,a(-this.s),this.recovery):this}toDERRawBytes(){return Xt(this.toDERHex())}toDERHex(){return ss.hexFromSig({r:this.r,s:this.s})}toCompactRawBytes(){return Xt(this.toCompactHex())}toCompactHex(){return p(this.r)+p(this.s)}}let _={isValidPrivateKey(S){try{return l(S),!0}catch{return!1}},normPrivateKeyToScalar:l,randomPrivateKey:()=>{let S=Qi(e.n);return oc(e.randomBytes(S),e.n)},precompute(S=8,R=f.BASE){return R._setWindowSize(S),R.multiply(BigInt(3)),R}};function w(S,R=!0){return f.fromPrivateKey(S).toRawBytes(R)}function A(S){let R=Nt(S),V=typeof S=="string",I=(R||V)&&S.length;return R?I===n||I===i:V?I===2*n||I===2*i:S instanceof f}function y(S,R,V=!0){if(A(S))throw new Error("first arg must be private key");if(!A(R))throw new Error("second arg must be public key");return f.fromHex(R).multiply(l(S)).toRawBytes(V)}let x=e.bits2int||function(S){let R=pt(S),V=S.length*8-e.nBitLength;return V>0?R>>BigInt(V):R},E=e.bits2int_modN||function(S){return a(x(S))},B=Js(e.nBitLength);function D(S){if(typeof S!="bigint")throw new Error("bigint expected");if(!(Bt<=S&&See in V))throw new Error("sign() legacy options not supported");let{hash:I,randomBytes:v}=e,{lowS:P,prehash:M,extraEntropy:C}=V;P==null&&(P=!0),S=se("msgHash",S),M&&(S=se("prehashed msgHash",I(S)));let O=E(S),F=l(R),z=[D(F),D(O)];if(C!=null&&C!==!1){let ee=C===!0?v(t.BYTES):C;z.push(se("extraEntropy",ee))}let G=gt(...z),K=O;function ie(ee){let fe=x(ee);if(!h(fe))return;let de=c(fe),ae=f.BASE.multiply(fe).toAffine(),ge=a(ae.x);if(ge===Bt)return;let ot=a(de*a(K+ge*F));if(ot===Bt)return;let zt=(ae.x===ge?0:2)|Number(ae.y&Ge),Fs=ot;return P&&g(ot)&&(Fs=d(ot),zt^=1),new b(ge,Fs,zt)}return{seed:G,k2sig:ie}}let L={lowS:e.lowS,prehash:!1},ne={lowS:e.lowS,prehash:!1};function re(S,R,V=L){let{seed:I,k2sig:v}=N(S,R,V),P=e;return Zi(P.hash.outputLen,P.nByteLength,P.hmac)(I,v)}f.BASE._setWindowSize(8);function Ve(S,R,V,I=ne){let v=S;if(R=se("msgHash",R),V=se("publicKey",V),"strict"in I)throw new Error("options.strict was renamed to lowS");let{lowS:P,prehash:M}=I,C,O;try{if(typeof v=="string"||Nt(v))try{C=b.fromDER(v)}catch(ae){if(!(ae instanceof ss.Err))throw ae;C=b.fromCompact(v)}else if(typeof v=="object"&&typeof v.r=="bigint"&&typeof v.s=="bigint"){let{r:ae,s:ge}=v;C=new b(ae,ge)}else throw new Error("PARSE");O=f.fromHex(V)}catch(ae){if(ae.message==="PARSE")throw new Error("signature must be Signature instance, Uint8Array or hex string");return!1}if(P&&C.hasHighS())return!1;M&&(R=e.hash(R));let{r:F,s:z}=C,G=E(R),K=c(z),ie=a(G*K),ee=a(F*K),fe=f.BASE.multiplyAndAddUnsafe(O,ie,ee)?.toAffine();return fe?a(fe.x)===F:!1}return{CURVE:e,getPublicKey:w,getSharedSecret:y,sign:re,verify:Ve,ProjectivePoint:f,Signature:b,utils:_}}function Td(s){return{hash:s,hmac:(e,...t)=>tr(s,e,Or(...t)),randomBytes:Ss}}function dl(s,e){let t=r=>fl({...s,...Td(r)});return Object.freeze({...t(e),create:t})}var ml=BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),pl=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),Pd=BigInt(1),wo=BigInt(2),gl=(s,e)=>(s+e/wo)/e;function Rd(s){let e=ml,t=BigInt(3),r=BigInt(6),n=BigInt(11),i=BigInt(22),o=BigInt(23),a=BigInt(44),c=BigInt(88),f=s*s*s%e,l=f*f*s%e,u=X(l,t,e)*l%e,h=X(u,t,e)*l%e,p=X(h,wo,e)*f%e,g=X(p,n,e)*p%e,d=X(g,i,e)*g%e,m=X(d,a,e)*d%e,b=X(m,c,e)*m%e,_=X(b,a,e)*d%e,w=X(_,t,e)*l%e,A=X(w,o,e)*g%e,y=X(A,r,e)*f%e,x=X(y,wo,e);if(!vo.eql(vo.sqr(x),s))throw new Error("Cannot find square root");return x}var vo=qr(ml,void 0,void 0,{sqrt:Rd}),Ze=dl({a:BigInt(0),b:BigInt(7),Fp:vo,n:pl,Gx:BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"),Gy:BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"),h:BigInt(1),lowS:!0,endo:{beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),splitScalar:s=>{let e=pl,t=BigInt("0x3086d221a7d46bcde86c90e49284eb15"),r=-Pd*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),n=BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),i=t,o=BigInt("0x100000000000000000000000000000000"),a=gl(i*s,e),c=gl(-r*s,e),f=j(s-a*t-c*n,e),l=j(-a*r-c*i,e),u=f>o,h=l>o;if(u&&(f=e-f),h&&(l=e-l),f>o||l>o)throw new Error("splitScalar: Endomorphism failed, k="+s);return{k1neg:u,k1:f,k2neg:h,k2:l}}}},ul),Hy=BigInt(0);var Gy=Ze.ProjectivePoint;function bl(){return Ze.utils.randomPrivateKey()}function yl(s,e){let t=ce.digest(e instanceof Uint8Array?e:e.subarray());if(Fe(t))return t.then(({digest:r})=>Ze.sign(r,s).toDERRawBytes()).catch(r=>{throw new T(String(r),"ERR_INVALID_INPUT")});try{return Ze.sign(t.digest,s).toDERRawBytes()}catch(r){throw new T(String(r),"ERR_INVALID_INPUT")}}function wl(s,e,t){let r=ce.digest(t instanceof Uint8Array?t:t.subarray());if(Fe(r))return r.then(({digest:n})=>Ze.verify(e,n,s)).catch(n=>{throw new T(String(n),"ERR_INVALID_INPUT")});try{return Ze.verify(e,r.digest,s)}catch(n){throw new T(String(n),"ERR_INVALID_INPUT")}}function vl(s){return Ze.ProjectivePoint.fromHex(s).toRawBytes(!0)}function xl(s){try{Ze.getPublicKey(s,!0)}catch(e){throw new T(String(e),"ERR_INVALID_PRIVATE_KEY")}}function xo(s){try{Ze.ProjectivePoint.fromHex(s)}catch(e){throw new T(String(e),"ERR_INVALID_PUBLIC_KEY")}}function El(s){try{return Ze.getPublicKey(s,!0)}catch(e){throw new T(String(e),"ERR_INVALID_PRIVATE_KEY")}}var dr=class{_key;constructor(e){xo(e),this._key=e}verify(e,t){return wl(this._key,t,e)}marshal(){return vl(this._key)}get bytes(){return Je.encode({Type:J.Secp256k1,Data:this.marshal()}).subarray()}equals(e){return be(this.bytes,e.bytes)}async hash(){let e=ce.digest(this.bytes),t;return Fe(e)?{bytes:t}=await e:t=e.bytes,t}},pr=class{_key;_publicKey;constructor(e,t){this._key=e,this._publicKey=t??El(e),xl(this._key),xo(this._publicKey)}sign(e){return yl(this._key,e)}get public(){return new dr(this._publicKey)}marshal(){return this._key}get bytes(){return Qe.encode({Type:J.Secp256k1,Data:this.marshal()}).subarray()}equals(e){return be(this.bytes,e.bytes)}hash(){let e=ce.digest(this.bytes);return Fe(e)?e.then(({bytes:t})=>t):e.bytes}async id(){let e=await this.public.hash();return W(e,"base58btc")}async export(e,t="libp2p-key"){if(t==="libp2p-key")return Rs(this.bytes,e);throw new T(`export format '${t}' is not supported`,"ERR_INVALID_EXPORT_FORMAT")}};function Dd(s){return new pr(s)}function Nd(s){return new dr(s)}async function Cd(){let s=bl();return new pr(s)}var Kt={rsa:bo,ed25519:oo,secp256k1:Eo};function _o(s){let e=Object.keys(Kt).join(" / ");return new T(`invalid or unsupported key type ${s}. Must be ${e}`,"ERR_UNSUPPORTED_KEY_TYPE")}function Ld(s){if(s=s.toLowerCase(),s==="rsa"||s==="ed25519"||s==="secp256k1")return Kt[s];throw _o(s)}function Bo(s){let e=Je.decode(s),t=e.Data??new Uint8Array;switch(e.Type){case J.RSA:return Kt.rsa.unmarshalRsaPublicKey(t);case J.Ed25519:return Kt.ed25519.unmarshalEd25519PublicKey(t);case J.Secp256k1:return Kt.secp256k1.unmarshalSecp256k1PublicKey(t);default:throw _o(e.Type??"unknown")}}function _l(s,e){return e=(e??"rsa").toLowerCase(),Ld(e),s.bytes}async function Bl(s){let e=Qe.decode(s),t=e.Data??new Uint8Array;switch(e.Type){case J.RSA:return Kt.rsa.unmarshalRsaPrivateKey(t);case J.Ed25519:return Kt.ed25519.unmarshalEd25519PrivateKey(t);case J.Secp256k1:return Kt.secp256k1.unmarshalSecp256k1PrivateKey(t);default:throw _o(e.Type??"RSA")}}var Sl=Z("libp2p-pubsub:");async function Il(s,e,t,r){switch(s.type){case Pt.Signing:{let n={from:s.author.toBytes(),data:r,seqno:et(8),topic:e,signature:void 0,key:void 0},i=Ye([Sl,ht.Message.encode(n)]);n.signature=await s.privateKey.sign(i),n.key=s.key;let o={type:"signed",from:s.author,data:t,sequenceNumber:BigInt(`0x${W(n.seqno,"base16")}`),topic:e,signature:n.signature,key:n.key};return{raw:n,msg:o}}case Pt.Anonymous:return{raw:{from:void 0,data:r,seqno:void 0,topic:e,signature:void 0,key:void 0},msg:{type:"unsigned",data:t,topic:e}};default:throw new Error("Unreachable")}}async function Al(s,e){switch(s){case rs:return e.signature!=null?{valid:!1,error:xe.SignaturePresent}:e.seqno!=null?{valid:!1,error:xe.SeqnoPresent}:e.key!=null?{valid:!1,error:xe.FromPresent}:{valid:!0,message:{type:"unsigned",topic:e.topic,data:e.data??new Uint8Array(0)}};case qt:{if(e.seqno==null)return{valid:!1,error:xe.InvalidSeqno};if(e.seqno.length!==8)return{valid:!1,error:xe.InvalidSeqno};if(e.signature==null)return{valid:!1,error:xe.InvalidSignature};if(e.from==null)return{valid:!1,error:xe.InvalidPeerId};let t;try{t=js(e.from)}catch{return{valid:!1,error:xe.InvalidPeerId}}let r;if(e.key!=null){if(r=Bo(e.key),t.publicKey!==void 0&&!be(r.bytes,t.publicKey))return{valid:!1,error:xe.InvalidPeerId}}else{if(t.publicKey==null)return{valid:!1,error:xe.InvalidPeerId};r=Bo(t.publicKey)}let n={from:e.from,data:e.data,seqno:e.seqno,topic:e.topic,signature:void 0,key:void 0},i=Ye([Sl,ht.Message.encode(n)]);return await r.verify(i,e.signature)?{valid:!0,message:{type:"signed",from:t,data:e.data??new Uint8Array(0),sequenceNumber:BigInt(`0x${W(e.seqno,"base16")}`),topic:e.topic,signature:e.signature,key:e.key??_l(r)}}:{valid:!1,error:xe.InvalidSignature}}default:throw new Error("Unreachable")}}function nt(s=[],e){return{subscriptions:[],messages:s,control:e!==void 0?{graft:e.graft??[],prune:e.prune??[],ihave:e.ihave??[],iwant:e.iwant??[]}:void 0}}function So(s){return s.control===void 0&&(s.control={graft:[],prune:[],ihave:[],iwant:[]}),s}function it(s){if(s.length<=1)return s;let e=()=>Math.floor(Math.random()*Math.floor(s.length));for(let t=0;t{let t=Z(e.toString(16).padStart(16,"0"),"base16"),r=new Uint8Array(s.length+t.length);return r.set(s,0),r.set(t,s.length),r};function Rl(s){if(s.type!=="signed")throw new Error("expected signed message type");if(s.sequenceNumber==null)throw Error("missing seqno field");return Pl(s.from.toBytes(),s.sequenceNumber)}async function Ml(s){return ce.encode(s.data)}var Gn=class{index=0;input="";new(e){return this.index=0,this.input=e,this}readAtomically(e){let t=this.index,r=e();return r===void 0&&(this.index=t),r}parseWith(e){let t=e();if(this.index===this.input.length)return t}peekChar(){if(!(this.index>=this.input.length))return this.input[this.index]}readChar(){if(!(this.index>=this.input.length))return this.input[this.index++]}readGivenChar(e){return this.readAtomically(()=>{let t=this.readChar();if(t===e)return t})}readSeparator(e,t,r){return this.readAtomically(()=>{if(!(t>0&&this.readGivenChar(e)===void 0))return r()})}readNumber(e,t,r,n){return this.readAtomically(()=>{let i=0,o=0,a=this.peekChar();if(a===void 0)return;let c=a==="0",f=2**(8*n)-1;for(;;){let l=this.readAtomically(()=>{let u=this.readChar();if(u===void 0)return;let h=Number.parseInt(u,e);if(!Number.isNaN(h))return h});if(l===void 0)break;if(i*=e,i+=l,i>f||(o+=1,t!==void 0&&o>t))return}if(o!==0)return!r&&c&&o>1?void 0:i})}readIPv4Addr(){return this.readAtomically(()=>{let e=new Uint8Array(4);for(let t=0;tthis.readNumber(10,3,!1,1));if(r===void 0)return;e[t]=r}return e})}readIPv6Addr(){let e=t=>{for(let r=0;rthis.readIPv4Addr());if(o!==void 0)return t[n]=o[0],t[n+1]=o[1],t[n+2]=o[2],t[n+3]=o[3],[n+4,!0]}let i=this.readSeparator(":",r,()=>this.readNumber(16,4,!0,2));if(i===void 0)return[n,!1];t[n]=i>>8,t[n+1]=i&255}return[t.length,!1]};return this.readAtomically(()=>{let t=new Uint8Array(16),[r,n]=e(t);if(r===16)return t;if(n||this.readGivenChar(":")===void 0||this.readGivenChar(":")===void 0)return;let i=new Uint8Array(14),o=16-(r+2),[a]=e(i.subarray(0,o));return t.set(i.subarray(0,a),16-a),t})}readIPAddr(){return this.readIPv4Addr()??this.readIPv6Addr()}};var Ud=45;var Dl=new Gn;function Kn(s){if(s.includes("%")&&(s=s.split("%")[0]),!(s.length>Ud))return Dl.new(s).parseWith(()=>Dl.readIPAddr())}var Ow=parseInt("0xFFFF",16),Fw=new Uint8Array([0,0,0,0,0,0,0,0,0,0,255,255]);function Io(s){return!!Kn(s)}var Ll=function(s,e=0,t){e=~~e,t=t??s.length-e;let r=new DataView(s.buffer);if(t===4){let n=[];for(let i=0;i{let e=Wd(...s);ko[e.code]=e,Ao[e.name]=e});function Wd(s,e,t,r,n){return{code:s,size:e,name:t,resolvable:!!r,path:!!n}}function gr(s){if(typeof s=="number"){if(ko[s]!=null)return ko[s];throw new Error(`no protocol with code: ${s}`)}else if(typeof s=="string"){if(Ao[s]!=null)return Ao[s];throw new Error(`no protocol with name: ${s}`)}throw new Error(`invalid protocol id type: ${typeof s}`)}var Iv=gr("ip4"),Av=gr("ip6"),kv=gr("ipcidr");function Vl(s,e){switch(gr(s).code){case 4:case 41:return $d(e);case 42:return Po(e);case 6:case 273:case 33:case 132:return Ol(e).toString();case 53:case 54:case 55:case 56:case 400:case 449:case 777:return Po(e);case 421:return Zd(e);case 444:return Ul(e);case 445:return Ul(e);case 466:return jd(e);case 481:return globalThis.encodeURIComponent(Po(e));default:return W(e,"base16")}}var To=Object.values(kt).map(s=>s.decoder),Tv=function(){let s=To[0].or(To[1]);return To.slice(2).forEach(e=>s=s.or(e)),s}();function $d(s){let e=Ll(s,0,s.length);if(e==null)throw new Error("ipBuff is required");if(!Io(e))throw new Error("invalid ip address");return e}function Ol(s){return new DataView(s.buffer).getUint16(s.byteOffset)}function Po(s){let e=us(s);if(s=s.slice(Se(e)),s.length!==e)throw new Error("inconsistent lengths");return W(s)}function jd(s){let e=us(s),t=s.slice(Se(e));if(t.length!==e)throw new Error("inconsistent lengths");return"u"+W(t,"base64url")}function Zd(s){let e=us(s),t=s.slice(Se(e));if(t.length!==e)throw new Error("inconsistent lengths");return W(t,"base58btc")}function Ul(s){let e=s.slice(0,s.length-2),t=s.slice(s.length-2),r=W(e,"base32"),n=Ol(t);return`${r}:${n}`}var zn;(function(s){s[s.ip4=4]="ip4",s[s.ip6=41]="ip6"})(zn||(zn={}));function Fl(s){for(let e of s.tuples())switch(e[0]){case zn.ip4:case zn.ip6:return Vl(e[0],e[1]);default:break}return null}var Vs=class{entries=new Map;validityMs;constructor(e){this.validityMs=e.validityMs}get size(){return this.entries.size}put(e,t){return this.entries.has(e)?!0:(this.entries.set(e,{value:t,validUntilMs:Date.now()+this.validityMs}),!1)}prune(){let e=Date.now();for(let[t,r]of this.entries.entries())if(r.validUntilMs=Date.now()?t.value:void 0}clear(){this.entries.clear()}};var xp=Br,Ue;(function(s){s[s.started=0]="started",s[s.stopped=1]="stopped"})(Ue||(Ue={}));var qn=class extends br{globalSignaturePolicy;multicodecs=[Br,Ti];publishConfig;dataTransform;peers=new Set;streamsInbound=new Map;streamsOutbound=new Map;outboundInflightQueue=ut({objectMode:!0});direct=new Set;floodsubPeers=new Set;seenCache;acceptFromWhitelist=new Map;topics=new Map;subscriptions=new Set;mesh=new Map;fanout=new Map;fanoutLastpub=new Map;gossip=new Map;control=new Map;peerhave=new Map;iasked=new Map;backoff=new Map;outbound=new Map;msgIdFn;fastMsgIdFn;msgIdToStrFn;fastMsgIdCache;publishedMessageIds;mcache;score;topicValidators=new Map;log;heartbeatTicks=0;gossipTracer;components;directPeerInitial=null;static multicodec=Br;opts;decodeRpcLimits;metrics;status={code:Ue.stopped};maxInboundStreams;maxOutboundStreams;runOnTransientConnection;allowedTopics;heartbeatTimer=null;constructor(e,t={}){super();let r={fallbackToFloodsub:!0,floodPublish:!0,batchPublish:!1,tagMeshPeers:!0,doPX:!1,directPeers:[],D:6,Dlo:4,Dhi:12,Dscore:4,Dout:2,Dlazy:6,heartbeatInterval:1e3,fanoutTTL:6e4,mcacheLength:5,mcacheGossip:3,seenTTL:12e4,gossipsubIWantFollowupMs:3e3,prunePeers:16,pruneBackoff:6e4,unsubcribeBackoff:1e4,graftFloodThreshold:1e4,opportunisticGraftPeers:2,opportunisticGraftTicks:60,directConnectTicks:300,gossipFactor:.25,...t,scoreParams:La(t.scoreParams),scoreThresholds:Va(t.scoreThresholds)};if(this.components=e,this.decodeRpcLimits=r.decodeRpcLimits??Ea,this.globalSignaturePolicy=r.globalSignaturePolicy??qt,r.fallbackToFloodsub&&this.multicodecs.push(ki),this.log=e.logger.forComponent(r.debugName??"libp2p:gossipsub"),this.opts=r,this.direct=new Set(r.directPeers.map(n=>n.id.toString())),this.seenCache=new Vs({validityMs:r.seenTTL}),this.publishedMessageIds=new Vs({validityMs:r.seenTTL}),t.msgIdFn!=null)this.msgIdFn=t.msgIdFn;else switch(this.globalSignaturePolicy){case qt:this.msgIdFn=Rl;break;case rs:this.msgIdFn=Ml;break;default:throw new Error(`Invalid globalSignaturePolicy: ${this.globalSignaturePolicy}`)}if(t.fastMsgIdFn!=null&&(this.fastMsgIdFn=t.fastMsgIdFn,this.fastMsgIdCache=new Vs({validityMs:r.seenTTL})),this.msgIdToStrFn=t.msgIdToStrFn??kl,this.mcache=t.messageCache??new Tr(r.mcacheGossip,r.mcacheLength,this.msgIdToStrFn),t.dataTransform!=null&&(this.dataTransform=t.dataTransform),t.metricsRegister!=null){if(t.metricsTopicStrToLabel==null)throw Error("Must set metricsTopicStrToLabel with metrics");let n=Math.max(...Object.values(r.scoreParams.topics).map(o=>o.meshMessageDeliveriesWindow),1e3),i=Ca(t.metricsRegister,t.metricsTopicStrToLabel,{gossipPromiseExpireSec:this.opts.gossipsubIWantFollowupMs/1e3,behaviourPenaltyThreshold:r.scoreParams.behaviourPenaltyThreshold,maxMeshMessageDeliveriesWindowSec:n/1e3});i.mcacheSize.addCollect(()=>{this.onScrapeMetrics(i)});for(let o of this.multicodecs)i.protocolsEnabled.set({protocol:o},1);this.metrics=i}else this.metrics=null;this.gossipTracer=new Lr(this.opts.gossipsubIWantFollowupMs,this.msgIdToStrFn,this.metrics),this.score=new Dr(this.opts.scoreParams,this.metrics,this.components.logger,{scoreCacheValidityMs:r.heartbeatInterval}),this.maxInboundStreams=t.maxInboundStreams,this.maxOutboundStreams=t.maxOutboundStreams,this.runOnTransientConnection=t.runOnTransientConnection,this.allowedTopics=r.allowedTopics!=null?new Set(r.allowedTopics):null}[Symbol.toStringTag]="@chainsafe/libp2p-gossipsub";[Go]=["@libp2p/pubsub"];[Ko]=["@libp2p/identify"];getPeers(){return[...this.peers.keys()].map(e=>ct(e))}isStarted(){return this.status.code===Ue.started}async start(){if(this.isStarted())return;this.log("starting"),this.publishConfig=await Tl(this.globalSignaturePolicy,this.components.peerId),this.outboundInflightQueue=ut({objectMode:!0}),gs(this.outboundInflightQueue,async i=>{for await(let{peerId:o,connection:a}of i)await this.createOutboundStream(o,a)}).catch(i=>{this.log.error("outbound inflight queue error",i)}),await Promise.all(this.opts.directPeers.map(async i=>{await this.components.peerStore.merge(i.id,{multiaddrs:i.addrs})}));let e=this.components.registrar;await Promise.all(this.multicodecs.map(async i=>e.handle(i,this.onIncomingStream.bind(this),{maxInboundStreams:this.maxInboundStreams,maxOutboundStreams:this.maxOutboundStreams,runOnTransientConnection:this.runOnTransientConnection})));let t={onConnect:this.onPeerConnected.bind(this),onDisconnect:this.onPeerDisconnected.bind(this),notifyOnTransient:this.runOnTransientConnection},r=await Promise.all(this.multicodecs.map(async i=>e.register(i,t))),n=setTimeout(this.runHeartbeat,100);this.status={code:Ue.started,registrarTopologyIds:r,heartbeatTimeout:n,hearbeatStartMs:Date.now()+100},this.score.start(),this.directPeerInitial=setTimeout(()=>{Promise.resolve().then(async()=>{await Promise.all(Array.from(this.direct).map(async i=>this.connect(i)))}).catch(i=>{this.log(i)})},1e3),this.opts.tagMeshPeers&&(this.addEventListener("gossipsub:graft",this.tagMeshPeer),this.addEventListener("gossipsub:prune",this.untagMeshPeer)),this.log("started")}async stop(){if(this.log("stopping"),this.status.code!==Ue.started)return;let{registrarTopologyIds:e}=this.status;this.status={code:Ue.stopped},this.opts.tagMeshPeers&&(this.removeEventListener("gossipsub:graft",this.tagMeshPeer),this.removeEventListener("gossipsub:prune",this.untagMeshPeer));let t=this.components.registrar;await Promise.all(this.multicodecs.map(async n=>t.unhandle(n))),e.forEach(n=>{t.unregister(n)}),this.outboundInflightQueue.end();let r=[];for(let n of this.streamsOutbound.values())r.push(n.close());this.streamsOutbound.clear();for(let n of this.streamsInbound.values())r.push(n.close());this.streamsInbound.clear(),await Promise.all(r),this.peers.clear(),this.subscriptions.clear(),this.heartbeatTimer!=null&&(this.heartbeatTimer.cancel(),this.heartbeatTimer=null),this.score.stop(),this.mesh.clear(),this.fanout.clear(),this.fanoutLastpub.clear(),this.gossip.clear(),this.control.clear(),this.peerhave.clear(),this.iasked.clear(),this.backoff.clear(),this.outbound.clear(),this.gossipTracer.clear(),this.seenCache.clear(),this.fastMsgIdCache!=null&&this.fastMsgIdCache.clear(),this.directPeerInitial!=null&&clearTimeout(this.directPeerInitial),this.log("stopped")}dumpPeerScoreStats(){return this.score.dumpPeerScoreStats()}onIncomingStream({stream:e,connection:t}){if(!this.isStarted())return;let r=t.remotePeer;this.addPeer(r,t.direction,t.remoteAddr),this.createInboundStream(r,e),this.outboundInflightQueue.push({peerId:r,connection:t})}onPeerConnected(e,t){this.metrics?.newConnectionCount.inc({status:t.status}),!(!this.isStarted()||t.status!=="open")&&(this.addPeer(e,t.direction,t.remoteAddr),this.outboundInflightQueue.push({peerId:e,connection:t}))}onPeerDisconnected(e){this.log("connection ended %p",e),this.removePeer(e)}async createOutboundStream(e,t){if(!this.isStarted())return;let r=e.toString();if(this.peers.has(r)&&!this.streamsOutbound.has(r))try{let n=new Nr(await t.newStream(this.multicodecs,{runOnTransientConnection:this.runOnTransientConnection}),o=>{this.log.error("outbound pipe error",o)},{maxBufferSize:this.opts.maxOutboundBufferSize});this.log("create outbound stream %p",e),this.streamsOutbound.set(r,n);let i=n.protocol;i===ki&&this.floodsubPeers.add(r),this.metrics?.peersPerProtocol.inc({protocol:i},1),this.subscriptions.size>0&&(this.log("send subscriptions to",r),this.sendSubscriptions(r,Array.from(this.subscriptions),!0))}catch(n){this.log.error("createOutboundStream error",n)}}createInboundStream(e,t){if(!this.isStarted())return;let r=e.toString();if(!this.peers.has(r))return;let n=this.streamsInbound.get(r);n!==void 0&&(this.log("replacing existing inbound steam %s",r),n.close().catch(o=>{this.log.error(o)})),this.log("create inbound stream %s",r);let i=new Cr(t,{maxDataLength:this.opts.maxInboundDataLength});this.streamsInbound.set(r,i),this.pipePeerReadStream(e,i.source).catch(o=>{this.log(o)})}addPeer(e,t,r){let n=e.toString();if(!this.peers.has(n)){this.log("new peer %p",e),this.peers.add(n),this.score.addPeer(n);let i=Fl(r);i!==null?this.score.addIP(n,i):this.log("Added peer has no IP in current address %s %s",n,r.toString()),this.outbound.has(n)||this.outbound.set(n,t==="outbound")}}removePeer(e){let t=e.toString();if(!this.peers.has(t))return;this.log("delete peer %p",e),this.peers.delete(t);let r=this.streamsOutbound.get(t),n=this.streamsInbound.get(t);r!=null&&this.metrics?.peersPerProtocol.inc({protocol:r.protocol},-1),r?.close().catch(i=>{this.log.error(i)}),n?.close().catch(i=>{this.log.error(i)}),this.streamsOutbound.delete(t),this.streamsInbound.delete(t);for(let i of this.topics.values())i.delete(t);for(let[i,o]of this.mesh)o.delete(t)&&this.metrics?.onRemoveFromMesh(i,ze.Dc,1);for(let i of this.fanout.values())i.delete(t);this.floodsubPeers.delete(t),this.gossip.delete(t),this.control.delete(t),this.outbound.delete(t),this.score.removePeer(t),this.acceptFromWhitelist.delete(t)}get started(){return this.status.code===Ue.started}getMeshPeers(e){let t=this.mesh.get(e);return t!=null?Array.from(t):[]}getSubscribers(e){let t=this.topics.get(e);return(t!=null?Array.from(t):[]).map(r=>ct(r))}getTopics(){return Array.from(this.subscriptions)}async pipePeerReadStream(e,t){try{await gs(t,async r=>{for await(let n of r)try{let i=n.subarray(),o=ht.decode(i,{limits:{subscriptions:this.decodeRpcLimits.maxSubscriptions,messages:this.decodeRpcLimits.maxMessages,control$:{ihave:this.decodeRpcLimits.maxIhaveMessageIDs,iwant:this.decodeRpcLimits.maxIwantMessageIDs,graft:this.decodeRpcLimits.maxControlMessages,prune:this.decodeRpcLimits.maxControlMessages,prune$:{peers:this.decodeRpcLimits.maxPeerInfos}}}});if(this.metrics?.onRpcRecv(o,i.length),this.opts.awaitRpcHandler)try{await this.handleReceivedRpc(e,o)}catch(a){this.metrics?.onRpcRecvError(),this.log(a)}else this.handleReceivedRpc(e,o).catch(a=>{this.metrics?.onRpcRecvError(),this.log(a)})}catch(i){this.metrics?.onRpcDataError(),this.log(i)}})}catch(r){this.metrics?.onPeerReadStreamError(),this.handlePeerReadStreamError(r,e)}}handlePeerReadStreamError(e,t){this.log.error(e),this.onPeerDisconnected(t)}async handleReceivedRpc(e,t){if(!this.acceptFrom(e.toString())){this.log("received message from unacceptable peer %p",e),this.metrics?.rpcRecvNotAccepted.inc();return}let r=t.subscriptions!=null?t.subscriptions.length:0,n=t.messages!=null?t.messages.length:0,i=0,o=0,a=0,c=0;if(t.control!=null&&(t.control.ihave!=null&&(i=t.control.ihave.length),t.control.iwant!=null&&(o=t.control.iwant.length),t.control.graft!=null&&(a=t.control.graft.length),t.control.prune!=null&&(c=t.control.prune.length)),this.log(`rpc.from ${e.toString()} subscriptions ${r} messages ${n} ihave ${i} iwant ${o} graft ${a} prune ${c}`),t.subscriptions!=null&&t.subscriptions.length>0){let f=[];t.subscriptions.forEach(l=>{let u=l.topic,h=l.subscribe===!0;if(u!=null){if(this.allowedTopics!=null&&!this.allowedTopics.has(u))return;this.handleReceivedSubscription(e,u,h),f.push({topic:u,subscribe:h})}}),this.safeDispatchEvent("subscription-change",{detail:{peerId:e,subscriptions:f}})}for(let f of t.messages){if(this.allowedTopics!=null&&!this.allowedTopics.has(f.topic))continue;let l=this.handleReceivedMessage(e,f).catch(u=>{this.metrics?.onMsgRecvError(f.topic),this.log(u)});this.opts.awaitRpcMessageHandler&&await l}t.control!=null&&await this.handleControlMessage(e.toString(),t.control)}handleReceivedSubscription(e,t,r){this.log("subscription update from %p topic %s",e,t);let n=this.topics.get(t);n==null&&(n=new Set,this.topics.set(t,n)),r?n.add(e.toString()):n.delete(e.toString())}async handleReceivedMessage(e,t){this.metrics?.onMsgRecvPreValidation(t.topic);let r=await this.validateReceivedMessage(e,t);this.metrics?.onPrevalidationResult(t.topic,r.code);let n=r.code;switch(n){case Ee.duplicate:this.score.duplicateMessage(e.toString(),r.msgIdStr,t.topic),this.gossipTracer.deliverMessage(r.msgIdStr,!0),this.mcache.observeDuplicate(r.msgIdStr,e.toString());return;case Ee.invalid:if(r.msgIdStr!=null){let i=r.msgIdStr;this.score.rejectMessage(e.toString(),i,t.topic,r.reason),this.gossipTracer.rejectMessage(i,r.reason)}else this.score.rejectInvalidMessage(e.toString(),t.topic);this.metrics?.onMsgRecvInvalid(t.topic,r);return;case Ee.valid:this.score.validateMessage(r.messageId.msgIdStr),this.gossipTracer.deliverMessage(r.messageId.msgIdStr),this.mcache.put(r.messageId,t,!this.opts.asyncValidation),this.subscriptions.has(t.topic)&&(!this.components.peerId.equals(e)||this.opts.emitSelf)&&(super.dispatchEvent(new CustomEvent("gossipsub:message",{detail:{propagationSource:e,msgId:r.messageId.msgIdStr,msg:r.msg}})),super.dispatchEvent(new CustomEvent("message",{detail:r.msg}))),this.opts.asyncValidation||this.forwardMessage(r.messageId.msgIdStr,t,e.toString());break;default:throw new Error(`Invalid validation result: ${n}`)}}async validateReceivedMessage(e,t){let r=this.fastMsgIdFn?.(t),n=r!==void 0?this.fastMsgIdCache?.get(r):void 0;if(n!=null)return{code:Ee.duplicate,msgIdStr:n};let i=await Al(this.globalSignaturePolicy,t);if(!i.valid)return{code:Ee.invalid,reason:Ie.Error,error:i.error};let o=i.message;try{this.dataTransform!=null&&(o.data=this.dataTransform.inboundTransform(t.topic,o.data))}catch(u){return this.log("Invalid message, transform failed",u),{code:Ee.invalid,reason:Ie.Error,error:xe.TransformFailed}}let a=await this.msgIdFn(o),c=this.msgIdToStrFn(a),f={msgId:a,msgIdStr:c};if(r!==void 0&&this.fastMsgIdCache!=null&&this.fastMsgIdCache.put(r,c)&&this.metrics?.fastMsgIdCacheCollision.inc(),this.seenCache.has(c))return{code:Ee.duplicate,msgIdStr:c};this.seenCache.put(c);let l=this.topicValidators.get(t.topic);if(l!=null){let u;try{u=await l(e,o)}catch(h){let p=h.code;p===xa&&(u=Be.Ignore),p===va?u=Be.Reject:u=Be.Ignore}if(u!==Be.Accept)return{code:Ee.invalid,reason:Ki(u),msgIdStr:c}}return{code:Ee.valid,messageId:f,msg:o}}getScore(e){return this.score.score(e)}sendSubscriptions(e,t,r){this.sendRpc(e,{subscriptions:t.map(n=>({topic:n,subscribe:r})),messages:[]})}async handleControlMessage(e,t){if(t===void 0)return;let r=t.ihave!=null?this.handleIHave(e,t.ihave):[],n=t.iwant!=null?this.handleIWant(e,t.iwant):[],i=t.graft!=null?await this.handleGraft(e,t.graft):[];if(t.prune!=null&&await this.handlePrune(e,t.prune),r.length===0&&n.length===0&&i.length===0)return;let o=this.sendRpc(e,nt(n,{iwant:r,prune:i})),a=r[0]?.messageIDs;a!=null&&(o?this.gossipTracer.addPromise(e,a):this.metrics?.iwantPromiseUntracked.inc(1))}acceptFrom(e){if(this.direct.has(e))return!0;let t=Date.now(),r=this.acceptFromWhitelist.get(e);if(r!=null&&r.messagesAccepted<128&&r.acceptUntil>=t)return r.messagesAccepted+=1,!0;let n=this.score.score(e);return n>=0?this.acceptFromWhitelist.set(e,{messagesAccepted:0,acceptUntil:t+1e3}):this.acceptFromWhitelist.delete(e),n>=this.opts.scoreThresholds.graylistThreshold}handleIHave(e,t){if(t.length===0)return[];let r=this.score.score(e);if(r10)return this.log("IHAVE: peer %s has advertised too many times (%d) within this heartbeat interval; ignoring",e,n),this.metrics?.ihaveRcvIgnored.inc({reason:ws.MaxIhave}),[];let i=this.iasked.get(e)??0;if(i>=5e3)return this.log("IHAVE: peer %s has already advertised too many messages (%d); ignoring",e,i),this.metrics?.ihaveRcvIgnored.inc({reason:ws.MaxIasked}),[];let o=new Map;if(t.forEach(({topicID:f,messageIDs:l})=>{if(f==null||l==null||!this.mesh.has(f))return;let u=0;l.forEach(h=>{let p=this.msgIdToStrFn(h);this.seenCache.has(p)||(o.set(p,h),u++)}),this.metrics?.onIhaveRcv(f,l.length,u)}),o.size===0)return[];let a=o.size;a+i>5e3&&(a=5e3-i),this.log("IHAVE: Asking for %d out of %d messages from %s",a,o.size,e);let c=Array.from(o.values());return it(c),c=c.slice(0,a),this.iasked.set(e,i+a),[{messageIDs:c}]}handleIWant(e,t){if(t.length===0)return[];let r=this.score.score(e);if(r{a?.forEach(c=>{let f=this.msgIdToStrFn(c),l=this.mcache.getWithIWantCount(f,e);if(l==null){o++;return}if(i.set(l.msg.topic,1+(i.get(l.msg.topic)??0)),l.count>3){this.log("IWANT: Peer %s has asked for message %s too many times: ignoring request",e,c);return}n.set(f,l.msg)})}),this.metrics?.onIwantRcv(i,o),n.size===0?(this.log("IWANT: Could not provide any wanted messages to %s",e),[]):(this.log("IWANT: Sending %d messages to %s",n.size,e),Array.from(n.values()))}async handleGraft(e,t){let r=[],n=this.score.score(e),i=Date.now(),o=this.opts.doPX;if(t.forEach(({topicID:c})=>{if(c==null)return;let f=this.mesh.get(c);if(f==null){o=!1;return}if(f.has(e))return;let l=this.backoff.get(c)?.get(e);if(this.direct.has(e))this.log("GRAFT: ignoring request from direct peer %s",e),r.push(c),o=!1;else if(typeof l=="number"&&i=this.opts.Dhi&&!(this.outbound.get(e)??!1)?(r.push(c),this.addBackoff(e,c)):(this.log("GRAFT: Add mesh link from %s in %s",e,c),this.score.graft(e,c),f.add(e),this.metrics?.onAddToMesh(c,Ae.Subscribed,1));this.safeDispatchEvent("gossipsub:graft",{detail:{peerId:e,topic:c,direction:"inbound"}})}),r.length===0)return[];let a=!1;return Promise.all(r.map(async c=>this.makePrune(e,c,o,a)))}async handlePrune(e,t){let r=this.score.score(e);for(let{topicID:n,backoff:i,peers:o}of t){if(n==null)continue;let a=this.mesh.get(n);if(a==null)return;this.log("PRUNE: Remove mesh link to %s in %s",e,n),this.score.prune(e,n),a.has(e)&&(a.delete(e),this.metrics?.onRemoveFromMesh(n,ze.Prune,1)),typeof i=="number"&&i>0?this.doAddBackoff(e,n,i*1e3):this.addBackoff(e,n),o!=null&&o.length>0&&(r{this.log("peer %s didn't follow up in %d IWANT requests; adding penalty",t,e),this.score.addPenalty(t,e,ys.BrokenPromise)})}clearBackoff(){if(this.heartbeatTicks%15!==0)return;let e=Date.now();this.backoff.forEach((t,r)=>{t.forEach((n,i)=>{n+1*this.opts.heartbeatInterval{this.streamsOutbound.has(t)||e.push(t)}),await Promise.all(e.map(async t=>this.connect(t)))}async pxConnect(e){e.length>this.opts.prunePeers&&(it(e),e=e.slice(0,this.opts.prunePeers));let t=[];await Promise.all(e.map(async r=>{if(r.peerID==null)return;let n=js(r.peerID),i=n.toString();if(!this.peers.has(i)){if(r.signedPeerRecord==null){t.push(i);return}try{if(!await this.components.peerStore.consumePeerRecord(r.signedPeerRecord,n)){this.log("bogus peer record obtained through px: could not add peer record to address book");return}t.push(i)}catch{this.log("bogus peer record obtained through px: invalid signature or not a peer record")}}})),t.length!==0&&await Promise.all(t.map(async r=>this.connect(r)))}async connect(e){this.log("Initiating connection with %s",e);let t=ct(e),r=await this.components.connectionManager.openConnection(t);for(let n of this.multicodecs)for(let i of this.components.registrar.getTopologies(n))i.onConnect?.(t,r)}subscribe(e){if(this.status.code!==Ue.started)throw new Error("Pubsub has not started");if(!this.subscriptions.has(e)){this.subscriptions.add(e);for(let t of this.peers.keys())this.sendSubscriptions(t,[e],!0)}this.join(e)}unsubscribe(e){if(this.status.code!==Ue.started)throw new Error("Pubsub is not started");let t=this.subscriptions.delete(e);if(this.log("unsubscribe from %s - am subscribed %s",e,t),t)for(let r of this.peers.keys())this.sendSubscriptions(r,[e],!1);this.leave(e)}join(e){if(this.status.code!==Ue.started)throw new Error("Gossipsub has not started");if(this.mesh.has(e))return;this.log("JOIN %s",e),this.metrics?.onJoin(e);let t=new Set,r=this.backoff.get(e),n=this.fanout.get(e);if(n!=null&&(this.fanout.delete(e),this.fanoutLastpub.delete(e),n.forEach(i=>{!this.direct.has(i)&&this.score.score(i)>=0&&(r==null||!r.has(i))&&t.add(i)}),this.metrics?.onAddToMesh(e,Ae.Fanout,t.size)),t.size!t.has(a)&&!this.direct.has(a)&&this.score.score(a)>=0&&(r==null||!r.has(a))).forEach(a=>{t.add(a)}),this.metrics?.onAddToMesh(e,Ae.Random,t.size-i)}this.mesh.set(e,t),t.forEach(i=>{this.log("JOIN: Add mesh link to %s in %s",i,e),this.sendGraft(i,e)})}leave(e){if(this.status.code!==Ue.started)throw new Error("Gossipsub has not started");this.log("LEAVE %s",e),this.metrics?.onLeave(e);let t=this.mesh.get(e);t!=null&&(Promise.all(Array.from(t).map(async r=>{this.log("LEAVE: Remove mesh link to %s in %s",r,e),await this.sendPrune(r,e)})).catch(r=>{this.log("Error sending prunes to mesh peers",r)}),this.mesh.delete(e))}selectPeersToForward(e,t,r){let n=new Set,i=this.topics.get(e);i!=null&&(this.direct.forEach(a=>{i.has(a)&&t!==a&&!(r?.has(a)??!1)&&n.add(a)}),this.floodsubPeers.forEach(a=>{i.has(a)&&t!==a&&!(r?.has(a)??!1)&&this.score.score(a)>=this.opts.scoreThresholds.publishThreshold&&n.add(a)}));let o=this.mesh.get(e);return o!=null&&o.size>0&&o.forEach(a=>{t!==a&&!(r?.has(a)??!1)&&n.add(a)}),n}selectPeersToPublish(e){let t=new Set,r={direct:0,floodsub:0,mesh:0,fanout:0},n=this.topics.get(e);if(n!=null)if(this.opts.floodPublish)n.forEach(i=>{this.direct.has(i)?(t.add(i),r.direct++):this.score.score(i)>=this.opts.scoreThresholds.publishThreshold&&(t.add(i),r.floodsub++)});else{this.direct.forEach(o=>{n.has(o)&&(t.add(o),r.direct++)}),this.floodsubPeers.forEach(o=>{n.has(o)&&this.score.score(o)>=this.opts.scoreThresholds.publishThreshold&&(t.add(o),r.floodsub++)});let i=this.mesh.get(e);if(i!=null&&i.size>0)i.forEach(o=>{t.add(o),r.mesh++}),i.size!i.has(a)&&!this.direct.has(a)&&!this.floodsubPeers.has(a)&&this.score.score(a)>=this.opts.scoreThresholds.publishThreshold).forEach(a=>{t.add(a),r.mesh++});else{let o=this.fanout.get(e);if(o!=null&&o.size>0)o.forEach(a=>{t.add(a),r.fanout++});else{let a=this.getRandomGossipPeers(e,this.opts.D,c=>this.score.score(c)>=this.opts.scoreThresholds.publishThreshold);a.size>0&&(this.fanout.set(e,a),a.forEach(c=>{t.add(c),r.fanout++}))}this.fanoutLastpub.set(e,Date.now())}}return{tosend:t,tosendCount:r}}forwardMessage(e,t,r,n){r!=null&&this.score.deliverMessage(r,e,t.topic);let i=this.selectPeersToForward(t.topic,r,n);i.forEach(o=>{this.sendRpc(o,nt([t]))}),this.metrics?.onForwardMsg(t.topic,i.size)}async publish(e,t,r){let n=Date.now(),i=this.dataTransform!=null?this.dataTransform.outboundTransform(e,t):t;if(this.publishConfig==null)throw Error("PublishError.Uninitialized");let{raw:o,msg:a}=await Il(this.publishConfig,e,t,i),c=await this.msgIdFn(a),f=this.msgIdToStrFn(c),l=r?.ignoreDuplicatePublishError??this.opts.ignoreDuplicatePublishError;if(this.seenCache.has(f)){if(l)return this.metrics?.onPublishDuplicateMsg(e),{recipients:[]};throw Error("PublishError.Duplicate")}let{tosend:u,tosendCount:h}=this.selectPeersToPublish(e),p=this.opts.emitSelf&&this.subscriptions.has(e),g=r?.allowPublishToZeroTopicPeers??this.opts.allowPublishToZeroTopicPeers;if(u.size===0&&!g&&!p)throw Error("PublishError.NoPeersSubscribedToTopic");this.seenCache.put(f),this.mcache.put({msgId:c,msgIdStr:f},o,!0),this.publishedMessageIds.put(f);let d=r?.batchPublish??this.opts.batchPublish,m=nt([o]);if(d)this.sendRpcInBatch(u,m);else for(let _ of u)this.sendRpc(_,m)||u.delete(_);let b=Date.now()-n;return this.metrics?.onPublishMsg(e,h,u.size,o.data!=null?o.data.length:0,b),p&&(u.add(this.components.peerId.toString()),super.dispatchEvent(new CustomEvent("gossipsub:message",{detail:{propagationSource:this.components.peerId,msgId:f,msg:a}})),super.dispatchEvent(new CustomEvent("message",{detail:a}))),{recipients:Array.from(u.values()).map(_=>ct(_))}}sendRpcInBatch(e,t){let r=ht.encode(t),n=fs.single(r);for(let i of e){let o=this.streamsOutbound.get(i);if(o==null){this.log(`Cannot send RPC to ${i} as there is no open stream to it available`),e.delete(i);continue}try{o.pushPrefixed(n)}catch(a){e.delete(i),this.log.error(`Cannot send rpc to ${i}`,a)}this.metrics?.onRpcSent(t,r.length)}}reportMessageValidationResult(e,t,r){let n;if(r===Be.Accept){if(n=this.mcache.validate(e),n!=null){let{message:o,originatingPeers:a}=n;this.score.deliverMessage(t,e,o.topic),this.forwardMessage(e,n.message,t,a)}}else if(n=this.mcache.remove(e),n!=null){let o=Ki(r),{message:a,originatingPeers:c}=n;this.score.rejectMessage(t,e,a.topic,o);for(let f of c)this.score.rejectMessage(f,e,a.topic,o)}let i=this.score.messageFirstSeenTimestampMs(e);this.metrics?.onReportValidation(n,r,i)}sendGraft(e,t){let n=nt([],{graft:[{topicID:t}]});this.sendRpc(e,n)}async sendPrune(e,t){let n=[await this.makePrune(e,t,this.opts.doPX,!0)],i=nt([],{prune:n});this.sendRpc(e,i)}sendRpc(e,t){let r=this.streamsOutbound.get(e);if(r==null)return this.log(`Cannot send RPC to ${e} as there is no open stream to it available`),!1;let n=this.control.get(e);n!=null&&(this.piggybackControl(e,t,n),this.control.delete(e));let i=this.gossip.get(e);i!=null&&(this.piggybackGossip(e,t,i),this.gossip.delete(e));let o=ht.encode(t);try{r.push(o)}catch(a){return this.log.error(`Cannot send rpc to ${e}`,a),n!=null&&this.control.set(e,n),i!=null&&this.gossip.set(e,i),!1}if(this.metrics?.onRpcSent(t,o.length),t.control?.graft!=null)for(let a of t.control?.graft)a.topicID!=null&&this.safeDispatchEvent("gossipsub:graft",{detail:{peerId:e,topic:a.topicID,direction:"outbound"}});if(t.control?.prune!=null)for(let a of t.control?.prune)a.topicID!=null&&this.safeDispatchEvent("gossipsub:prune",{detail:{peerId:e,topic:a.topicID,direction:"outbound"}});return!0}piggybackControl(e,t,r){let n=So(t);for(let i of r.graft)i.topicID!=null&&(this.mesh.get(i.topicID)?.has(e)??!1)&&n.control.graft.push(i);for(let i of r.prune)i.topicID!=null&&!(this.mesh.get(i.topicID)?.has(e)??!1)&&n.control.prune.push(i)}piggybackGossip(e,t,r){let n=So(t);n.control.ihave=r}async sendGraftPrune(e,t,r){let n=this.opts.doPX,i=!1;for(let[o,a]of e){let c=a.map(u=>({topicID:u})),f=[],l=t.get(o);l!=null&&(f=await Promise.all(l.map(async u=>this.makePrune(o,u,n&&!(r.get(o)??!1),i))),t.delete(o)),this.sendRpc(o,nt([],{graft:c,prune:f}))}for(let[o,a]of t){let c=await Promise.all(a.map(async f=>this.makePrune(o,f,n&&!(r.get(o)??!1),i)));this.sendRpc(o,nt([],{prune:c}))}}emitGossip(e){let t=this.mcache.getGossipIDs(new Set(e.keys()));for(let[r,n]of e)this.doEmitGossip(r,n,t.get(r)??[])}doEmitGossip(e,t,r){if(r.length===0||(it(r),r.length>5e3&&this.log("too many messages for gossip; will truncate IHAVE list (%d messages)",r.length),t.size===0))return;let n=this.opts.Dlazy,o=this.opts.gossipFactor*t.size,a=t;o>n&&(n=o),n>a.size?n=a.size:a=it(Array.from(a)).slice(0,n),a.forEach(c=>{let f=r;r.length>5e3&&(f=it(f.slice()).slice(0,5e3)),this.pushGossip(c,{topicID:e,messageIDs:f})})}flush(){for(let[e,t]of this.gossip.entries())this.gossip.delete(e),this.sendRpc(e,nt([],{ihave:t}));for(let[e,t]of this.control.entries()){this.control.delete(e);let r=nt([],{graft:t.graft,prune:t.prune});this.sendRpc(e,r)}}pushGossip(e,t){this.log("Add gossip to %s",e);let r=this.gossip.get(e)??[];this.gossip.set(e,r.concat(t))}async makePrune(e,t,r,n){if(this.score.prune(e,t),this.streamsOutbound.get(e)?.protocol===Ti)return{topicID:t,peers:[]};let i=n?this.opts.unsubcribeBackoff:this.opts.pruneBackoff,o=i/1e3;if(this.doAddBackoff(e,t,i),!r)return{topicID:t,peers:[],backoff:o};let a=this.getRandomGossipPeers(t,this.opts.prunePeers,f=>f!==e&&this.score.score(f)>=0),c=await Promise.all(Array.from(a).map(async f=>{let l=ct(f),u;try{u=await this.components.peerStore.get(l)}catch(h){if(h.code!=="ERR_NOT_FOUND")throw h}return{peerID:l.toBytes(),signedPeerRecord:u?.peerRecordEnvelope}}));return{topicID:t,peers:c,backoff:o}}runHeartbeat=()=>{let e=this.metrics?.heartbeatDuration.startTimer();this.heartbeat().catch(t=>{this.log("Error running heartbeat",t)}).finally(()=>{if(e?.(),this.status.code===Ue.started){clearTimeout(this.status.heartbeatTimeout);let t=this.opts.heartbeatInterval-(Date.now()-this.status.hearbeatStartMs)%this.opts.heartbeatInterval;t{let d=a.get(g);return d===void 0&&(d=this.score.score(g),a.set(g,d)),d},f=new Map,l=new Map,u=new Map;this.clearBackoff(),this.peerhave.clear(),this.metrics?.cacheSize.set({cache:"iasked"},this.iasked.size),this.iasked.clear(),this.applyIwantPenalties(),this.heartbeatTicks%this.opts.directConnectTicks===0&&await this.directConnect(),this.fastMsgIdCache?.prune(),this.seenCache.prune(),this.gossipTracer.prune(),this.publishedMessageIds.prune();let h=new Map;this.mesh.forEach((g,d)=>{let m=this.topics.get(d),b=new Set,_=new Set;if(h.set(d,_),m!=null){let y=it(Array.from(m)),x=this.backoff.get(d);for(let E of y){let B=this.streamsOutbound.get(E);if(B!=null&&this.multicodecs.includes(B.protocol)&&!g.has(E)&&!this.direct.has(E)){let D=c(E);(x==null||!x.has(E))&&D>=0&&b.add(E),D>=this.opts.scoreThresholds.gossipThreshold&&_.add(E)}}}let w=(y,x)=>{this.log("HEARTBEAT: Remove mesh link to %s in %s",y,d),this.addBackoff(y,d),g.delete(y),c(y)>=this.opts.scoreThresholds.gossipThreshold&&_.add(y),this.metrics?.onRemoveFromMesh(d,x,1);let E=l.get(y);E==null?l.set(y,[d]):E.push(d)},A=(y,x)=>{this.log("HEARTBEAT: Add mesh link to %s in %s",y,d),this.score.graft(y,d),g.add(y),_.delete(y),this.metrics?.onAddToMesh(d,x,1);let E=f.get(y);E==null?f.set(y,[d]):E.push(d)};if(g.forEach(y=>{let x=c(y);x<0&&(this.log("HEARTBEAT: Prune peer %s with negative score: score=%d, topic=%s",y,x,d),w(y,ze.BadScore),u.set(y,!0))}),g.size{A(E,Ae.NotEnough)})}if(g.size>r){let y=Array.from(g);y.sort((E,B)=>c(B)-c(E)),y=y.slice(0,n).concat(it(y.slice(n)));let x=0;if(y.slice(0,e).forEach(E=>{(this.outbound.get(E)??!1)&&x++}),x{let N=y[D];for(let L=D;L>0;L--)y[L]=y[L-1];y[0]=N};if(x>0){let D=x;for(let N=1;N0;N++)(this.outbound.get(y[N])??!1)&&(E(N),D--)}let B=e-x;for(let D=e;D0;D++)(this.outbound.get(y[D])??!1)&&(E(D),B--)}y.slice(e).forEach(E=>{w(E,ze.Excess)})}if(g.size>=t){let y=0;if(g.forEach(x=>{(this.outbound.get(x)??!1)&&y++}),ythis.outbound.get(B)===!0).forEach(B=>{A(B,Ae.Outbound)})}}if(this.heartbeatTicks%this.opts.opportunisticGraftTicks===0&&g.size>1){let y=Array.from(g).sort((B,D)=>c(B)-c(D)),x=Math.floor(g.size/2),E=c(y[x]);if(Ec(N)>E);for(let N of D)this.log("HEARTBEAT: Opportunistically graft peer %s on topic %s",N,d),A(N,Ae.Opportunistic)}}});let p=Date.now();this.fanoutLastpub.forEach((g,d)=>{g+o{let m=this.topics.get(d);g.forEach(A=>{(!(m?.has(A)??!1)||c(A)=this.opts.scoreThresholds.publishThreshold&&_.push(y),E>=this.opts.scoreThresholds.gossipThreshold&&w.add(y)}}}if(g.size{g.add(y),w?.delete(y)})}}),this.emitGossip(h),await this.sendGraftPrune(f,l,u),this.flush(),this.mcache.shift(),this.dispatchEvent(new CustomEvent("gossipsub:heartbeat"))}getRandomGossipPeers(e,t,r=()=>!0){let n=this.topics.get(e);if(n==null)return new Set;let i=[];return n.forEach(o=>{let a=this.streamsOutbound.get(o);a!=null&&this.multicodecs.includes(a.protocol)&&r(o)&&i.push(o)}),i=it(i),t>0&&i.length>t&&(i=i.slice(0,t)),new Set(i)}onScrapeMetrics(e){e.mcacheSize.set(this.mcache.size),e.mcacheNotValidatedCount.set(this.mcache.notValidatedCount),e.cacheSize.set({cache:"direct"},this.direct.size),e.cacheSize.set({cache:"seenCache"},this.seenCache.size),e.cacheSize.set({cache:"fastMsgIdCache"},this.fastMsgIdCache?.size??0),e.cacheSize.set({cache:"publishedMessageIds"},this.publishedMessageIds.size),e.cacheSize.set({cache:"mcache"},this.mcache.size),e.cacheSize.set({cache:"score"},this.score.size),e.cacheSize.set({cache:"gossipTracer.promises"},this.gossipTracer.size),e.cacheSize.set({cache:"gossipTracer.requests"},this.gossipTracer.requestMsByMsgSize),e.cacheSize.set({cache:"topics"},this.topics.size),e.cacheSize.set({cache:"subscriptions"},this.subscriptions.size),e.cacheSize.set({cache:"mesh"},this.mesh.size),e.cacheSize.set({cache:"fanout"},this.fanout.size),e.cacheSize.set({cache:"peers"},this.peers.size),e.cacheSize.set({cache:"streamsOutbound"},this.streamsOutbound.size),e.cacheSize.set({cache:"streamsInbound"},this.streamsInbound.size),e.cacheSize.set({cache:"acceptFromWhitelist"},this.acceptFromWhitelist.size),e.cacheSize.set({cache:"gossip"},this.gossip.size),e.cacheSize.set({cache:"control"},this.control.size),e.cacheSize.set({cache:"peerhave"},this.peerhave.size),e.cacheSize.set({cache:"outbound"},this.outbound.size);let t=0,r=Date.now();e.connectedPeersBackoffSec.reset();for(let a of this.backoff.values()){t+=a.size;for(let[c,f]of a.entries())this.peers.has(c)&&e.connectedPeersBackoffSec.observe(Math.max(0,f-r)/1e3)}e.cacheSize.set({cache:"backoff"},t);for(let[a,c]of this.topics)e.topicPeersCount.set({topicStr:a},c.size);for(let[a,c]of this.mesh)e.meshPeerCounts.set({topicStr:a},c.size);let n=[],i=new Map;e.behaviourPenalty.reset();for(let a of this.peers.keys()){let c=this.score.score(a);n.push(c),i.set(a,c),e.behaviourPenalty.observe(this.score.peerStats.get(a)?.behaviourPenalty??0)}e.registerScores(n,this.opts.scoreThresholds),e.registerScorePerMesh(this.mesh,i);let o=za(this.peers.keys(),this.score.peerStats,this.score.params,this.score.peerIPs,e.topicStrToLabel);e.registerScoreWeights(o)}tagMeshPeer=e=>{let{peerId:t,topic:r}=e.detail;this.components.peerStore.merge(ct(t),{tags:{[r]:{value:100}}}).catch(n=>{this.log.error("Error tagging peer %s with topic %s",t,r,n)})};untagMeshPeer=e=>{let{peerId:t,topic:r}=e.detail;this.components.peerStore.merge(ct(t),{tags:{[r]:void 0}}).catch(n=>{this.log.error("Error untagging peer %s with topic %s",t,r,n)})}};function Ep(s={}){return e=>new qn(e,s)}return tu(_p);})(); ++`)}`:`${t} :`}};Ga=Ct;M.Constructed=Ga;Ct.NAME="CONSTRUCTED";var Pr=class extends me{fromBER(e,t,r){return t}toBER(e){return We}};Pr.override="EndOfContentValueBlock";var qa,Dr=class extends he{constructor(e={}){super(e,Pr),this.idBlock.tagClass=1,this.idBlock.tagNumber=0}};qa=Dr;M.EndOfContent=qa;Dr.NAME=zs;var Ka,ps=class extends he{constructor(e={}){super(e,me),this.idBlock.tagClass=1,this.idBlock.tagNumber=5}fromBER(e,t,r){return this.lenBlock.length>0&&this.warnings.push("Non-zero length of value block for Null type"),this.idBlock.error.length||(this.blockLength+=this.idBlock.blockLength),this.lenBlock.error.length||(this.blockLength+=this.lenBlock.blockLength),this.blockLength+=r,t+r>e.byteLength?(this.error="End of input reached before message was fully decoded (inconsistent offset and length values)",-1):t+r}toBER(e,t){let r=new ArrayBuffer(2);if(!e){let n=new Uint8Array(r);n[0]=5,n[1]=0}return t&&t.write(r),r}onAsciiEncoding(){return`${this.constructor.NAME}`}};Ka=ps;M.Null=Ka;ps.NAME="NULL";var Cr=class extends gt(me){constructor({value:e,...t}={}){super(t),t.valueHex?this.valueHexView=H.BufferSourceConverter.toUint8Array(t.valueHex):this.valueHexView=new Uint8Array(1),e&&(this.value=e)}get value(){for(let e of this.valueHexView)if(e>0)return!0;return!1}set value(e){this.valueHexView[0]=e?255:0}fromBER(e,t,r){let n=H.BufferSourceConverter.toUint8Array(e);return pt(this,n,t,r)?(this.valueHexView=n.subarray(t,t+r),r>1&&this.warnings.push("Boolean value encoded in more then 1 octet"),this.isHexOnly=!0,Qi.call(this),this.blockLength=r,t+r):-1}toBER(){return this.valueHexView.slice()}toJSON(){return{...super.toJSON(),value:this.value}}};Cr.NAME="BooleanValueBlock";var Wa,Nr=class extends he{constructor(e={}){super(e,Cr),this.idBlock.tagClass=1,this.idBlock.tagNumber=1}getValue(){return this.valueBlock.value}setValue(e){this.valueBlock.value=e}onAsciiEncoding(){return`${this.constructor.NAME} : ${this.getValue}`}};Wa=Nr;M.Boolean=Wa;Nr.NAME="BOOLEAN";var Rr=class extends gt(Xe){constructor({isConstructed:e=!1,...t}={}){super(t),this.isConstructed=e}fromBER(e,t,r){let n=0;if(this.isConstructed){if(this.isHexOnly=!1,n=Xe.prototype.fromBER.call(this,e,t,r),n===-1)return n;for(let i=0;i0&&f.unusedBits>0)return this.error='Using of "unused bits" inside constructive BIT STRING allowed for least one only',-1;this.unusedBits=f.unusedBits}return n}let i=H.BufferSourceConverter.toUint8Array(e);if(!pt(this,i,t,r))return-1;let o=i.subarray(t,t+r);if(this.unusedBits=o[0],this.unusedBits>7)return this.error="Unused bits for BitString must be in range 0-7",-1;if(!this.unusedBits){let a=o.subarray(1);try{if(a.byteLength){let c=hn(a,0,a.byteLength);c.offset!==-1&&c.offset===r-1&&(this.value=[c.result])}}catch{}}return this.valueHexView=o.subarray(1),this.blockLength=o.length,t+r}toBER(e,t){if(this.isConstructed)return Xe.prototype.toBER.call(this,e,t);if(e)return new ArrayBuffer(this.valueHexView.byteLength+1);if(!this.valueHexView.byteLength)return We;let r=new Uint8Array(this.valueHexView.length+1);return r[0]=this.unusedBits,r.set(this.valueHexView,1),r.buffer}toJSON(){return{...super.toJSON(),unusedBits:this.unusedBits,isConstructed:this.isConstructed}}};Ur.NAME="BitStringValueBlock";var ja,gs=class extends he{constructor({idBlock:e={},lenBlock:t={},...r}={}){var n,i;(n=r.isConstructed)!==null&&n!==void 0||(r.isConstructed=!!(!((i=r.value)===null||i===void 0)&&i.length)),super({idBlock:{isConstructed:r.isConstructed,...e},lenBlock:{...t,isIndefiniteForm:!!r.isIndefiniteForm},...r},Ur),this.idBlock.tagClass=1,this.idBlock.tagNumber=3}fromBER(e,t,r){return this.valueBlock.isConstructed=this.idBlock.isConstructed,this.valueBlock.isIndefiniteForm=this.lenBlock.isIndefiniteForm,super.fromBER(e,t,r)}onAsciiEncoding(){if(this.valueBlock.isConstructed||this.valueBlock.value&&this.valueBlock.value.length)return Ct.prototype.onAsciiEncoding.call(this);{let e=[],t=this.valueBlock.valueHexView;for(let n of t)e.push(n.toString(2).padStart(8,"0"));let r=e.join("");return`${this.constructor.NAME} : ${r.substring(0,r.length-this.valueBlock.unusedBits)}`}}};ja=gs;M.BitString=ja;gs.NAME=Ha;var Za;function Ef(s,e){let t=new Uint8Array([0]),r=new Uint8Array(s),n=new Uint8Array(e),i=r.slice(0),o=i.length-1,a=n.slice(0),c=a.length-1,f=0,u=c=0;l--,h++){switch(!0){case h=i.length:i=Br(new Uint8Array([f%10]),i);break;default:i[o-h]=f%10}}return t[0]>0&&(i=Br(t,i)),i}function Fa(s){if(s>=Hs.length)for(let e=Hs.length;e<=s;e++){let t=new Uint8Array([0]),r=Hs[e-1].slice(0);for(let n=r.length-1;n>=0;n--){let i=new Uint8Array([(r[n]<<1)+t[0]]);t[0]=i[0]/10,r[n]=i[0]%10}t[0]>0&&(r=Br(t,r)),Hs.push(r)}return Hs[s]}function Sf(s,e){let t=0,r=new Uint8Array(s),n=new Uint8Array(e),i=r.slice(0),o=i.length-1,a=n.slice(0),c=a.length-1,f,u=0;for(let h=c;h>=0;h--,u++)switch(f=i[o-u]-a[c-u]-t,!0){case f<0:t=1,i[o-u]=f+10;break;default:t=0,i[o-u]=f}if(t>0)for(let h=o-c+1;h>=0;h--,u++)if(f=i[o-u]-t,f<0)t=1,i[o-u]=f+10;else{t=0,i[o-u]=f;break}return i.slice()}var Gs=class extends gt(me){constructor({value:e,...t}={}){super(t),this._valueDec=0,t.valueHex&&this.setValueHex(),e!==void 0&&(this.valueDec=e)}setValueHex(){this.valueHexView.length>=4?(this.warnings.push("Too big Integer for decoding, hex only"),this.isHexOnly=!0,this._valueDec=0):(this.isHexOnly=!1,this.valueHexView.length>0&&(this._valueDec=Qi.call(this)))}set valueDec(e){this._valueDec=e,this.isHexOnly=!1,this.valueHexView=new Uint8Array(Ra(e))}get valueDec(){return this._valueDec}fromDER(e,t,r,n=0){let i=this.fromBER(e,t,r);if(i===-1)return i;let o=this.valueHexView;return o[0]===0&&o[1]&128?this.valueHexView=o.subarray(1):n!==0&&o.length1&&(n=o.length+1),this.valueHexView=o.subarray(n-o.length)),i}toDER(e=!1){let t=this.valueHexView;switch(!0){case(t[0]&128)!==0:{let r=new Uint8Array(this.valueHexView.length+1);r[0]=0,r.set(t,1),this.valueHexView=r}break;case(t[0]===0&&(t[1]&128)===0):this.valueHexView=this.valueHexView.subarray(1);break}return this.toBER(e)}fromBER(e,t,r){let n=super.fromBER(e,t,r);return n===-1||this.setValueHex(),n}toBER(e){return e?new ArrayBuffer(this.valueHexView.length):this.valueHexView.slice().buffer}toJSON(){return{...super.toJSON(),valueDec:this.valueDec}}toString(){let e=this.valueHexView.length*8-1,t=new Uint8Array(this.valueHexView.length*8/3),r=0,n,i=this.valueHexView,o="",a=!1;for(let c=i.byteLength-1;c>=0;c--){n=i[c];for(let f=0;f<8;f++){if((n&1)===1)switch(r){case e:t=Sf(Fa(r),t),o="-";break;default:t=Ef(t,Fa(r))}r++,n>>=1}}for(let c=0;c0;){let i=new qs;if(n=i.fromBER(e,n,r),n===-1)return this.blockLength=0,this.error=i.error,n;this.value.length===0&&(i.isFirstSid=!0),this.blockLength+=i.blockLength,r-=i.blockLength,this.value.push(i)}return n}toBER(e){let t=[];for(let r=0;rNumber.MAX_SAFE_INTEGER){Ir();let a=BigInt(n);o.valueBigInt=a}else if(o.valueDec=parseInt(n,10),isNaN(o.valueDec))return;this.value.length||(o.isFirstSid=!0,i=!0),this.value.push(o)}while(r!==-1)}toString(){let e="",t=!1;for(let r=0;r0;){let i=new Ks;if(n=i.fromBER(e,n,r),n===-1)return this.blockLength=0,this.error=i.error,n;this.blockLength+=i.blockLength,r-=i.blockLength,this.value.push(i)}return n}toBER(e,t){let r=[];for(let n=0;n4)continue;let a=4-o.length;for(let c=o.length-1;c>=0;c--)r[n*4+c+a]=o[c]}this.valueBlock.value=e}};jr.NAME="UniversalStringValueBlock";var nc,Zr=class extends jr{constructor({...e}={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=28}};nc=Zr;M.UniversalString=nc;Zr.NAME="UniversalString";var ic,Jr=class extends Se{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=18}};ic=Jr;M.NumericString=ic;Jr.NAME="NumericString";var oc,Xr=class extends Se{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=19}};oc=Xr;M.PrintableString=oc;Xr.NAME="PrintableString";var ac,Yr=class extends Se{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=20}};ac=Yr;M.TeletexString=ac;Yr.NAME="TeletexString";var cc,Qr=class extends Se{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=21}};cc=Qr;M.VideotexString=cc;Qr.NAME="VideotexString";var lc,en=class extends Se{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=22}};lc=en;M.IA5String=lc;en.NAME="IA5String";var uc,tn=class extends Se{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=25}};uc=tn;M.GraphicString=uc;tn.NAME="GraphicString";var hc,Ws=class extends Se{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=26}};hc=Ws;M.VisibleString=hc;Ws.NAME="VisibleString";var fc,sn=class extends Se{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=27}};fc=sn;M.GeneralString=fc;sn.NAME="GeneralString";var dc,rn=class extends Se{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=29}};dc=rn;M.CharacterString=dc;rn.NAME="CharacterString";var pc,$s=class extends Ws{constructor({value:e,valueDate:t,...r}={}){if(super(r),this.year=0,this.month=0,this.day=0,this.hour=0,this.minute=0,this.second=0,e){this.fromString(e),this.valueBlock.valueHexView=new Uint8Array(e.length);for(let n=0;n=50?this.year=1900+n:this.year=2e3+n,this.month=parseInt(r[2],10),this.day=parseInt(r[3],10),this.hour=parseInt(r[4],10),this.minute=parseInt(r[5],10),this.second=parseInt(r[6],10)}toString(e="iso"){if(e==="iso"){let t=new Array(7);return t[0]=Ne(this.year<2e3?this.year-1900:this.year-2e3,2),t[1]=Ne(this.month,2),t[2]=Ne(this.day,2),t[3]=Ne(this.hour,2),t[4]=Ne(this.minute,2),t[5]=Ne(this.second,2),t[6]="Z",t.join("")}return super.toString(e)}onAsciiEncoding(){return`${this.constructor.NAME} : ${this.toDate().toISOString()}`}toJSON(){return{...super.toJSON(),year:this.year,month:this.month,day:this.day,hour:this.hour,minute:this.minute,second:this.second}}};pc=$s;M.UTCTime=pc;$s.NAME="UTCTime";var gc,nn=class extends $s{constructor(e={}){var t;super(e),(t=this.millisecond)!==null&&t!==void 0||(this.millisecond=0),this.idBlock.tagClass=1,this.idBlock.tagNumber=24}fromDate(e){super.fromDate(e),this.millisecond=e.getUTCMilliseconds()}toDate(){return new Date(Date.UTC(this.year,this.month-1,this.day,this.hour,this.minute,this.second,this.millisecond))}fromString(e){let t=!1,r="",n="",i=0,o,a=0,c=0;if(e[e.length-1]==="Z")r=e.substring(0,e.length-1),t=!0;else{let h=new Number(e[e.length-1]);if(isNaN(h.valueOf()))throw new Error("Wrong input string for conversion");r=e}if(t){if(r.indexOf("+")!==-1)throw new Error("Wrong input string for conversion");if(r.indexOf("-")!==-1)throw new Error("Wrong input string for conversion")}else{let h=1,l=r.indexOf("+"),d="";if(l===-1&&(l=r.indexOf("-"),h=-1),l!==-1){if(d=r.substring(l+1),r=r.substring(0,l),d.length!==2&&d.length!==4)throw new Error("Wrong input string for conversion");let m=parseInt(d.substring(0,2),10);if(isNaN(m.valueOf()))throw new Error("Wrong input string for conversion");if(a=h*m,d.length===4){if(m=parseInt(d.substring(2,4),10),isNaN(m.valueOf()))throw new Error("Wrong input string for conversion");c=h*m}}}let f=r.indexOf(".");if(f===-1&&(f=r.indexOf(",")),f!==-1){let h=new Number(`0${r.substring(f)}`);if(isNaN(h.valueOf()))throw new Error("Wrong input string for conversion");i=h.valueOf(),n=r.substring(0,f)}else n=r;switch(!0){case n.length===8:if(o=/(\d{4})(\d{2})(\d{2})/ig,f!==-1)throw new Error("Wrong input string for conversion");break;case n.length===10:if(o=/(\d{4})(\d{2})(\d{2})(\d{2})/ig,f!==-1){let h=60*i;this.minute=Math.floor(h),h=60*(h-this.minute),this.second=Math.floor(h),h=1e3*(h-this.second),this.millisecond=Math.floor(h)}break;case n.length===12:if(o=/(\d{4})(\d{2})(\d{2})(\d{2})(\d{2})/ig,f!==-1){let h=60*i;this.second=Math.floor(h),h=1e3*(h-this.second),this.millisecond=Math.floor(h)}break;case n.length===14:if(o=/(\d{4})(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})/ig,f!==-1){let h=1e3*i;this.millisecond=Math.floor(h)}break;default:throw new Error("Wrong input string for conversion")}let u=o.exec(n);if(u===null)throw new Error("Wrong input string for conversion");for(let h=1;h0&&(e=`0${e}`);let t=e.length/2,r=new Uint8Array(t),n=0,i=0;for(;n0&&(r=`0${r}`),e.push(r)}),BigInt("0x"+e.join(""))}function Ac(s){let e=Ic(s);return kc(e)}function oo(s){let e=_c(s);if(ro(e)>pn)throw new Yt("Key size is too large");let t=fs(Je.encode({Type:ie.RSA,Data:s})),r=He(no,t);return new ys(e,r)}function kc(s){if(ro(s)>pn)throw new ce("Key size is too large");let e=Mc(s),t=fs(Je.encode({Type:ie.RSA,Data:io(e.publicKey)})),r=He(no,t);return new Js(e.privateKey,new ys(e.publicKey,r))}async function Tc(s){if(s>pn)throw new ce("Key size is too large");let e=await Ec(s),t=fs(Je.encode({Type:ie.RSA,Data:io(e.publicKey)})),r=He(no,t);return new Js(e.privateKey,new ys(e.publicKey,r))}function Mc(s){if(s==null)throw new ce("Missing key parameter");return{privateKey:s,publicKey:{kty:s.kty,n:s.n,e:s.e}}}var gn=class extends os{constructor(e,t){super(),this.finished=!1,this.destroyed=!1,Qo(e);let r=Cs(t);if(this.iHash=e.create(),typeof this.iHash.update!="function")throw new Error("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;let n=this.blockLen,i=new Uint8Array(n);i.set(r.length>n?e.create().update(r).digest():r);for(let o=0;onew gn(s,e).update(t).digest();ao.create=(s,e)=>new gn(s,e);function Pc(s){s.lowS!==void 0&&Ge("lowS",s.lowS),s.prehash!==void 0&&Ge("prehash",s.prehash)}function Af(s){let e=Ls(s);Ze(e,{a:"field",b:"field"},{allowedPrivateKeyLengths:"array",wrapPrivateKey:"boolean",isTorsionFree:"function",clearCofactor:"function",allowInfinityPoint:"boolean",fromBytes:"function",toBytes:"function"});let{endo:t,Fp:r,a:n}=e;if(t){if(!r.eql(n,r.ZERO))throw new Error("Endomorphism can only be defined for Koblitz curves that have a=0");if(typeof t!="object"||typeof t.beta!="bigint"||typeof t.splitScalar!="function")throw new Error("Expected endomorphism with beta: bigint and splitScalar: function")}return Object.freeze({...e})}var{bytesToNumberBE:kf,hexToBytes:Tf}=hr,mt={Err:class extends Error{constructor(e=""){super(e)}},_tlv:{encode:(s,e)=>{let{Err:t}=mt;if(s<0||s>256)throw new t("tlv.encode: wrong tag");if(e.length&1)throw new t("tlv.encode: unpadded data");let r=e.length/2,n=Ot(r);if(n.length/2&128)throw new t("tlv.encode: long form length too big");let i=r>127?Ot(n.length/2|128):"";return`${Ot(s)}${i}${n}${e}`},decode(s,e){let{Err:t}=mt,r=0;if(s<0||s>256)throw new t("tlv.encode: wrong tag");if(e.length<2||e[r++]!==s)throw new t("tlv.decode: wrong tlv");let n=e[r++],i=!!(n&128),o=0;if(!i)o=n;else{let c=n&127;if(!c)throw new t("tlv.decode(long): indefinite length not supported");if(c>4)throw new t("tlv.decode(long): byte length is too big");let f=e.subarray(r,r+c);if(f.length!==c)throw new t("tlv.decode: length bytes not complete");if(f[0]===0)throw new t("tlv.decode(long): zero leftmost byte");for(let u of f)o=o<<8|u;if(r+=c,o<128)throw new t("tlv.decode(long): not minimal encoding")}let a=e.subarray(r,r+o);if(a.length!==o)throw new t("tlv.decode: wrong value length");return{v:a,l:e.subarray(r+o)}}},_int:{encode(s){let{Err:e}=mt;if(s{let S=g.toAffine();return ct(Uint8Array.from([4]),t.toBytes(S.x),t.toBytes(S.y))}),i=e.fromBytes||(p=>{let g=p.subarray(1),b=t.fromBytes(g.subarray(0,t.BYTES)),S=t.fromBytes(g.subarray(t.BYTES,2*t.BYTES));return{x:b,y:S}});function o(p){let{a:g,b}=e,S=t.sqr(p),y=t.mul(S,p);return t.add(t.add(y,t.mul(p,g)),b)}if(!t.eql(t.sqr(e.Gy),o(e.Gx)))throw new Error("bad generator point: equation left != right");function a(p){return Ns(p,le,e.n)}function c(p){let{allowedPrivateKeyLengths:g,nByteLength:b,wrapPrivateKey:S,n:y}=e;if(g&&typeof p!="bigint"){if(St(p)&&(p=ot(p)),typeof p!="string"||!g.includes(p.length))throw new Error("Invalid key");p=p.padStart(b*2,"0")}let I;try{I=typeof p=="bigint"?p:at(ee("private key",p,b))}catch{throw new Error(`private key must be ${b} bytes, hex or bigint, not ${typeof p}`)}return S&&(I=W(I,y)),Te("private key",I,le,y),I}function f(p){if(!(p instanceof l))throw new Error("ProjectivePoint expected")}let u=qt((p,g)=>{let{px:b,py:S,pz:y}=p;if(t.eql(y,t.ONE))return{x:b,y:S};let I=p.is0();g==null&&(g=I?t.ONE:t.inv(y));let v=t.mul(b,g),B=t.mul(S,g),x=t.mul(y,g);if(I)return{x:t.ZERO,y:t.ZERO};if(!t.eql(x,t.ONE))throw new Error("invZ was invalid");return{x:v,y:B}}),h=qt(p=>{if(p.is0()){if(e.allowInfinityPoint&&!t.is0(p.py))return;throw new Error("bad point: ZERO")}let{x:g,y:b}=p.toAffine();if(!t.isValid(g)||!t.isValid(b))throw new Error("bad point: x or y not FE");let S=t.sqr(b),y=o(g);if(!t.eql(S,y))throw new Error("bad point: equation left != right");if(!p.isTorsionFree())throw new Error("bad point: not in prime-order subgroup");return!0});class l{constructor(g,b,S){if(this.px=g,this.py=b,this.pz=S,g==null||!t.isValid(g))throw new Error("x required");if(b==null||!t.isValid(b))throw new Error("y required");if(S==null||!t.isValid(S))throw new Error("z required");Object.freeze(this)}static fromAffine(g){let{x:b,y:S}=g||{};if(!g||!t.isValid(b)||!t.isValid(S))throw new Error("invalid affine point");if(g instanceof l)throw new Error("projective point not allowed");let y=I=>t.eql(I,t.ZERO);return y(b)&&y(S)?l.ZERO:new l(b,S,t.ONE)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static normalizeZ(g){let b=t.invertBatch(g.map(S=>S.pz));return g.map((S,y)=>S.toAffine(b[y])).map(l.fromAffine)}static fromHex(g){let b=l.fromAffine(i(ee("pointHex",g)));return b.assertValidity(),b}static fromPrivateKey(g){return l.BASE.multiply(c(g))}static msm(g,b){return pr(l,r,g,b)}_setWindowSize(g){m.setWindowSize(this,g)}assertValidity(){h(this)}hasEvenY(){let{y:g}=this.toAffine();if(t.isOdd)return!t.isOdd(g);throw new Error("Field doesn't support isOdd")}equals(g){f(g);let{px:b,py:S,pz:y}=this,{px:I,py:v,pz:B}=g,x=t.eql(t.mul(b,B),t.mul(I,y)),_=t.eql(t.mul(S,B),t.mul(v,y));return x&&_}negate(){return new l(this.px,t.neg(this.py),this.pz)}double(){let{a:g,b}=e,S=t.mul(b,Dc),{px:y,py:I,pz:v}=this,B=t.ZERO,x=t.ZERO,_=t.ZERO,k=t.mul(y,y),z=t.mul(I,I),L=t.mul(v,v),U=t.mul(y,I);return U=t.add(U,U),_=t.mul(y,v),_=t.add(_,_),B=t.mul(g,_),x=t.mul(S,L),x=t.add(B,x),B=t.sub(z,x),x=t.add(z,x),x=t.mul(B,x),B=t.mul(U,B),_=t.mul(S,_),L=t.mul(g,L),U=t.sub(k,L),U=t.mul(g,U),U=t.add(U,_),_=t.add(k,k),k=t.add(_,k),k=t.add(k,L),k=t.mul(k,U),x=t.add(x,k),L=t.mul(I,v),L=t.add(L,L),k=t.mul(L,U),B=t.sub(B,k),_=t.mul(L,z),_=t.add(_,_),_=t.add(_,_),new l(B,x,_)}add(g){f(g);let{px:b,py:S,pz:y}=this,{px:I,py:v,pz:B}=g,x=t.ZERO,_=t.ZERO,k=t.ZERO,z=e.a,L=t.mul(e.b,Dc),U=t.mul(b,I),se=t.mul(S,v),T=t.mul(y,B),P=t.add(b,S),E=t.add(I,v);P=t.mul(P,E),E=t.add(U,se),P=t.sub(P,E),E=t.add(b,y);let w=t.add(I,B);return E=t.mul(E,w),w=t.add(U,T),E=t.sub(E,w),w=t.add(S,y),x=t.add(v,B),w=t.mul(w,x),x=t.add(se,T),w=t.sub(w,x),k=t.mul(z,E),x=t.mul(L,T),k=t.add(x,k),x=t.sub(se,k),k=t.add(se,k),_=t.mul(x,k),se=t.add(U,U),se=t.add(se,U),T=t.mul(z,T),E=t.mul(L,E),se=t.add(se,T),T=t.sub(U,T),T=t.mul(z,T),E=t.add(E,T),U=t.mul(se,E),_=t.add(_,U),U=t.mul(w,E),x=t.mul(P,x),x=t.sub(x,U),U=t.mul(P,se),k=t.mul(w,k),k=t.add(k,U),new l(x,_,k)}subtract(g){return this.add(g.negate())}is0(){return this.equals(l.ZERO)}wNAF(g){return m.wNAFCached(this,g,l.normalizeZ)}multiplyUnsafe(g){Te("scalar",g,bt,e.n);let b=l.ZERO;if(g===bt)return b;if(g===le)return this;let{endo:S}=e;if(!S)return m.unsafeLadder(this,g);let{k1neg:y,k1:I,k2neg:v,k2:B}=S.splitScalar(g),x=b,_=b,k=this;for(;I>bt||B>bt;)I&le&&(x=x.add(k)),B&le&&(_=_.add(k)),k=k.double(),I>>=le,B>>=le;return y&&(x=x.negate()),v&&(_=_.negate()),_=new l(t.mul(_.px,S.beta),_.py,_.pz),x.add(_)}multiply(g){let{endo:b,n:S}=e;Te("scalar",g,le,S);let y,I;if(b){let{k1neg:v,k1:B,k2neg:x,k2:_}=b.splitScalar(g),{p:k,f:z}=this.wNAF(B),{p:L,f:U}=this.wNAF(_);k=m.constTimeNegate(v,k),L=m.constTimeNegate(x,L),L=new l(t.mul(L.px,b.beta),L.py,L.pz),y=k.add(L),I=z.add(U)}else{let{p:v,f:B}=this.wNAF(g);y=v,I=B}return l.normalizeZ([y,I])[0]}multiplyAndAddUnsafe(g,b,S){let y=l.BASE,I=(B,x)=>x===bt||x===le||!B.equals(y)?B.multiplyUnsafe(x):B.multiply(x),v=I(this,b).add(I(g,S));return v.is0()?void 0:v}toAffine(g){return u(this,g)}isTorsionFree(){let{h:g,isTorsionFree:b}=e;if(g===le)return!0;if(b)return b(l,this);throw new Error("isTorsionFree() has not been declared for the elliptic curve")}clearCofactor(){let{h:g,clearCofactor:b}=e;return g===le?this:b?b(l,this):this.multiplyUnsafe(e.h)}toRawBytes(g=!0){return Ge("isCompressed",g),this.assertValidity(),n(l,this,g)}toHex(g=!0){return Ge("isCompressed",g),ot(this.toRawBytes(g))}}l.BASE=new l(e.Gx,e.Gy,t.ONE),l.ZERO=new l(t.ZERO,t.ONE,t.ZERO);let d=e.nBitLength,m=dr(l,e.endo?Math.ceil(d/2):d);return{CURVE:e,ProjectivePoint:l,normPrivateKeyToScalar:c,weierstrassEquation:o,isWithinCurveOrder:a}}function Pf(s){let e=Ls(s);return Ze(e,{hash:"hash",hmac:"function",randomBytes:"function"},{bits2int:"function",bits2int_modN:"function",lowS:"boolean"}),Object.freeze({lowS:!0,...e})}function Cc(s){let e=Pf(s),{Fp:t,n:r}=e,n=t.BYTES+1,i=2*t.BYTES+1;function o(T){return W(T,r)}function a(T){return fr(T,r)}let{ProjectivePoint:c,normPrivateKeyToScalar:f,weierstrassEquation:u,isWithinCurveOrder:h}=Mf({...e,toBytes(T,P,E){let w=P.toAffine(),A=t.toBytes(w.x),D=ct;return Ge("isCompressed",E),E?D(Uint8Array.from([P.hasEvenY()?2:3]),A):D(Uint8Array.from([4]),A,t.toBytes(w.y))},fromBytes(T){let P=T.length,E=T[0],w=T.subarray(1);if(P===n&&(E===2||E===3)){let A=at(w);if(!Ns(A,le,t.ORDER))throw new Error("Point is not on curve");let D=u(A),C;try{C=t.sqrt(D)}catch(O){let V=O instanceof Error?": "+O.message:"";throw new Error("Point is not on curve"+V)}let N=(C&le)===le;return(E&1)===1!==N&&(C=t.neg(C)),{x:A,y:C}}else if(P===i&&E===4){let A=t.fromBytes(w.subarray(0,t.BYTES)),D=t.fromBytes(w.subarray(t.BYTES,2*t.BYTES));return{x:A,y:D}}else throw new Error(`Point of length ${P} was invalid. Expected ${n} compressed bytes or ${i} uncompressed bytes`)}}),l=T=>ot(It(T,e.nByteLength));function d(T){let P=r>>le;return T>P}function m(T){return d(T)?o(-T):T}let p=(T,P,E)=>at(T.slice(P,E));class g{constructor(P,E,w){this.r=P,this.s=E,this.recovery=w,this.assertValidity()}static fromCompact(P){let E=e.nByteLength;return P=ee("compactSignature",P,E*2),new g(p(P,0,E),p(P,E,2*E))}static fromDER(P){let{r:E,s:w}=mt.toSig(ee("DER",P));return new g(E,w)}assertValidity(){Te("r",this.r,le,r),Te("s",this.s,le,r)}addRecoveryBit(P){return new g(this.r,this.s,P)}recoverPublicKey(P){let{r:E,s:w,recovery:A}=this,D=B(ee("msgHash",P));if(A==null||![0,1,2,3].includes(A))throw new Error("recovery id invalid");let C=A===2||A===3?E+e.n:E;if(C>=t.ORDER)throw new Error("recovery id 2 or 3 invalid");let N=A&1?"03":"02",F=c.fromHex(N+l(C)),O=a(C),V=o(-D*O),K=o(w*O),j=c.BASE.multiplyAndAddUnsafe(F,V,K);if(!j)throw new Error("point at infinify");return j.assertValidity(),j}hasHighS(){return d(this.s)}normalizeS(){return this.hasHighS()?new g(this.r,o(-this.s),this.recovery):this}toDERRawBytes(){return zt(this.toDERHex())}toDERHex(){return mt.hexFromSig({r:this.r,s:this.s})}toCompactRawBytes(){return zt(this.toCompactHex())}toCompactHex(){return l(this.r)+l(this.s)}}let b={isValidPrivateKey(T){try{return f(T),!0}catch{return!1}},normPrivateKeyToScalar:f,randomPrivateKey:()=>{let T=hi(e.n);return fa(e.randomBytes(T),e.n)},precompute(T=8,P=c.BASE){return P._setWindowSize(T),P.multiply(BigInt(3)),P}};function S(T,P=!0){return c.fromPrivateKey(T).toRawBytes(P)}function y(T){let P=St(T),E=typeof T=="string",w=(P||E)&&T.length;return P?w===n||w===i:E?w===2*n||w===2*i:T instanceof c}function I(T,P,E=!0){if(y(T))throw new Error("first arg must be private key");if(!y(P))throw new Error("second arg must be public key");return c.fromHex(P).multiply(f(T)).toRawBytes(E)}let v=e.bits2int||function(T){let P=at(T),E=T.length*8-e.nBitLength;return E>0?P>>BigInt(E):P},B=e.bits2int_modN||function(T){return o(v(T))},x=Rs(e.nBitLength);function _(T){return Te(`num < 2^${e.nBitLength}`,T,bt,x),It(T,e.nByteLength)}function k(T,P,E=z){if(["recovered","canonical"].some(ae=>ae in E))throw new Error("sign() legacy options not supported");let{hash:w,randomBytes:A}=e,{lowS:D,prehash:C,extraEntropy:N}=E;D==null&&(D=!0),T=ee("msgHash",T),Pc(E),C&&(T=ee("prehashed msgHash",w(T)));let F=B(T),O=f(P),V=[_(O),_(F)];if(N!=null&&N!==!1){let ae=N===!0?A(t.BYTES):N;V.push(ee("extraEntropy",ae))}let K=ct(...V),j=F;function oe(ae){let ue=v(ae);if(!h(ue))return;let we=a(ue),re=c.BASE.multiply(ue).toAffine(),Ae=o(re.x);if(Ae===bt)return;let st=o(we*o(j+Ae*O));if(st===bt)return;let ks=(re.x===Ae?0:2)|Number(re.y&le),Ts=st;return D&&d(st)&&(Ts=m(st),ks^=1),new g(Ae,Ts,ks)}return{seed:K,k2sig:oe}}let z={lowS:e.lowS,prehash:!1},L={lowS:e.lowS,prehash:!1};function U(T,P,E=z){let{seed:w,k2sig:A}=k(T,P,E),D=e;return ai(D.hash.outputLen,D.nByteLength,D.hmac)(w,A)}c.BASE._setWindowSize(8);function se(T,P,E,w=L){let A=T;if(P=ee("msgHash",P),E=ee("publicKey",E),"strict"in w)throw new Error("options.strict was renamed to lowS");Pc(w);let{lowS:D,prehash:C}=w,N,F;try{if(typeof A=="string"||St(A))try{N=g.fromDER(A)}catch(re){if(!(re instanceof mt.Err))throw re;N=g.fromCompact(A)}else if(typeof A=="object"&&typeof A.r=="bigint"&&typeof A.s=="bigint"){let{r:re,s:Ae}=A;N=new g(re,Ae)}else throw new Error("PARSE");F=c.fromHex(E)}catch(re){if(re.message==="PARSE")throw new Error("signature must be Signature instance, Uint8Array or hex string");return!1}if(D&&N.hasHighS())return!1;C&&(P=e.hash(P));let{r:O,s:V}=N,K=B(P),j=a(V),oe=o(K*j),ae=o(O*j),ue=c.BASE.multiplyAndAddUnsafe(F,oe,ae)?.toAffine();return ue?o(ue.x)===O:!1}return{CURVE:e,getPublicKey:S,getSharedSecret:I,sign:U,verify:se,ProjectivePoint:c,Signature:g,utils:b}}function Df(s){return{hash:s,hmac:(e,...t)=>ao(s,e,Qn(...t)),randomBytes:as}}function Nc(s,e){let t=r=>Cc({...s,...Df(r)});return Object.freeze({...t(e),create:t})}var Uc=BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),Rc=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),Cf=BigInt(1),co=BigInt(2),Lc=(s,e)=>(s+e/co)/e;function Nf(s){let e=Uc,t=BigInt(3),r=BigInt(6),n=BigInt(11),i=BigInt(22),o=BigInt(23),a=BigInt(44),c=BigInt(88),f=s*s*s%e,u=f*f*s%e,h=J(u,t,e)*u%e,l=J(h,t,e)*u%e,d=J(l,co,e)*f%e,m=J(d,n,e)*d%e,p=J(m,i,e)*m%e,g=J(p,a,e)*p%e,b=J(g,c,e)*g%e,S=J(b,a,e)*p%e,y=J(S,t,e)*u%e,I=J(y,o,e)*m%e,v=J(I,r,e)*f%e,B=J(v,co,e);if(!lo.eql(lo.sqr(B),s))throw new Error("Cannot find square root");return B}var lo=_t(Uc,void 0,void 0,{sqrt:Nf}),Zt=Nc({a:BigInt(0),b:BigInt(7),Fp:lo,n:Rc,Gx:BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"),Gy:BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"),h:BigInt(1),lowS:!0,endo:{beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),splitScalar:s=>{let e=Rc,t=BigInt("0x3086d221a7d46bcde86c90e49284eb15"),r=-Cf*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),n=BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),i=t,o=BigInt("0x100000000000000000000000000000000"),a=Lc(i*s,e),c=Lc(-r*s,e),f=W(s-a*t-c*n,e),u=W(-a*r-c*i,e),h=f>o,l=u>o;if(h&&(f=e-f),l&&(u=e-u),f>o||u>o)throw new Error("splitScalar: Endomorphism failed, k="+s);return{k1neg:h,k1:f,k2neg:l,k2:u}}}},fs),M0=BigInt(0);var P0=Zt.ProjectivePoint;function Rt(s,e){e==null&&(e=s.reduce((n,i)=>n+i.length,0));let t=de(e),r=0;for(let n of s)t.set(n,r),r+=n.length;return t}function Fc(s){return s==null?!1:typeof s.then=="function"&&typeof s.catch=="function"&&typeof s.finally=="function"}function Vc(s,e,t){let r=Tt.digest(t instanceof Uint8Array?t:t.subarray());if(Fc(r))return r.then(({digest:n})=>Zt.verify(e,n,s)).catch(n=>{throw new js(String(n))});try{return Zt.verify(e,r.digest,s)}catch(n){throw new js(String(n))}}var mn=class{type="secp256k1";raw;_key;constructor(e){this._key=Oc(e),this.raw=Hc(this._key)}toMultihash(){return nt.digest(At(this))}toCID(){return ke.createV1(114,this.toMultihash())}toString(){return te.encode(this.toMultihash().bytes).substring(1)}equals(e){return e==null||!(e.raw instanceof Uint8Array)?!1:Ue(this.raw,e.raw)}verify(e,t){return Vc(this._key,t,e)}};function uo(s){return new mn(s)}function Hc(s){return Zt.ProjectivePoint.fromHex(s).toRawBytes(!0)}function Oc(s){try{return Zt.ProjectivePoint.fromHex(s),s}catch(e){throw new Yt(String(e))}}function Xs(s){let{Type:e,Data:t}=Je.decode(s),r=t??new Uint8Array;switch(e){case ie.RSA:return oo(r);case ie.Ed25519:return mi(r);case ie.secp256k1:return uo(r);default:throw new Qt}}function zc(s){let{Type:e,Data:t}=Je.decode(s.digest),r=t??new Uint8Array;switch(e){case ie.Ed25519:return mi(r);case ie.secp256k1:return uo(r);default:throw new Qt}}function At(s){return Je.encode({Type:ie[s.type],Data:s.raw})}var Gc=Symbol.for("nodejs.util.inspect.custom"),Rf=114,Ys=class{type;multihash;publicKey;string;constructor(e){this.type=e.type,this.multihash=e.multihash,Object.defineProperty(this,"string",{enumerable:!1,writable:!0})}get[Symbol.toStringTag](){return`PeerId(${this.toString()})`}[Gn]=!0;toString(){return this.string==null&&(this.string=te.encode(this.multihash.bytes).slice(1)),this.string}toMultihash(){return this.multihash}toCID(){return ke.createV1(Rf,this.multihash)}toJSON(){return this.toString()}equals(e){if(e==null)return!1;if(e instanceof Uint8Array)return Ue(this.multihash.bytes,e);if(typeof e=="string")return this.toString()===e;if(e?.toMultihash()?.bytes!=null)return Ue(this.multihash.bytes,e.toMultihash().bytes);throw new Error("not valid Id")}[Gc](){return`PeerId(${this.toString()})`}},bn=class extends Ys{type="RSA";publicKey;constructor(e){super({...e,type:"RSA"}),this.publicKey=e.publicKey}},yn=class extends Ys{type="Ed25519";publicKey;constructor(e){super({...e,type:"Ed25519"}),this.publicKey=e.publicKey}},wn=class extends Ys{type="secp256k1";publicKey;constructor(e){super({...e,type:"secp256k1"}),this.publicKey=e.publicKey}},Lf=2336,vn=class{type="url";multihash;publicKey;url;constructor(e){this.url=e.toString(),this.multihash=nt.digest(X(this.url))}[Gc](){return`PeerId(${this.url})`}[Gn]=!0;toString(){return this.toCID().toString()}toMultihash(){return this.multihash}toCID(){return ke.createV1(Lf,this.toMultihash())}toJSON(){return this.toString()}equals(e){return e==null?!1:(e instanceof Uint8Array&&(e=$(e)),e.toString()===this.toString())}};function Lt(s,e){let t;if(s.charAt(0)==="1"||s.charAt(0)==="Q")t=Oe(te.decode(`z${s}`));else{if(e==null)throw new ce('Please pass a multibase decoder for strings that do not start with "1" or "Q"');t=Oe(e.decode(s))}return Qs(t)}function Qs(s){if(Ff(s))return new bn({multihash:s});if(Uf(s))try{let e=zc(s);if(e.type==="Ed25519")return new yn({multihash:s,publicKey:e});if(e.type==="secp256k1")return new wn({multihash:s,publicKey:e})}catch{let t=$(s.digest);return new vn(new URL(t))}throw new nr("Supplied PeerID Multihash is invalid")}function Uf(s){return s.code===nt.code}function Ff(s){return s.code===Tt.code}var Kc=Symbol.for("@achingbrain/uint8arraylist");function qc(s,e){if(e==null||e<0)throw new RangeError("index is out of bounds");let t=0;for(let r of s){let n=t+r.byteLength;if(e0&&this.appendAll(e)}*[Symbol.iterator](){yield*this.bufs}get byteLength(){return this.length}append(...e){this.appendAll(e)}appendAll(e){let t=0;for(let r of e)if(r instanceof Uint8Array)t+=r.byteLength,this.bufs.push(r);else if(xn(r))t+=r.byteLength,this.bufs.push(...r.bufs);else throw new Error("Could not append value, must be an Uint8Array or a Uint8ArrayList");this.length+=t}prepend(...e){this.prependAll(e)}prependAll(e){let t=0;for(let r of e.reverse())if(r instanceof Uint8Array)t+=r.byteLength,this.bufs.unshift(r);else if(xn(r))t+=r.byteLength,this.bufs.unshift(...r.bufs);else throw new Error("Could not prepend value, must be an Uint8Array or a Uint8ArrayList");this.length+=t}get(e){let t=qc(this.bufs,e);return t.buf[t.index]}set(e,t){let r=qc(this.bufs,e);r.buf[r.index]=t}write(e,t=0){if(e instanceof Uint8Array)for(let r=0;r0;)if(e>=this.bufs[0].byteLength)e-=this.bufs[0].byteLength,this.length-=this.bufs[0].byteLength,this.bufs.shift();else{this.bufs[0]=this.bufs[0].subarray(e),this.length-=e;break}}}slice(e,t){let{bufs:r,length:n}=this._subList(e,t);return Rt(r,n)}subarray(e,t){let{bufs:r,length:n}=this._subList(e,t);return r.length===1?r[0]:Rt(r,n)}sublist(e,t){let{bufs:r,length:n}=this._subList(e,t),i=new s;return i.length=n,i.bufs=[...r],i}_subList(e,t){if(e=e??0,t=t??this.length,e<0&&(e=this.length+e),t<0&&(t=this.length+t),e<0||t>this.length)throw new RangeError("index is out of bounds");if(e===t)return{bufs:[],length:0};if(e===0&&t===this.length)return{bufs:this.bufs,length:this.length};let r=[],n=0;for(let i=0;i=c)continue;let f=e>=a&&ea&&t<=c;if(f&&u){if(e===a&&t===c){r.push(o);break}let h=e-a;r.push(o.subarray(h,h+(t-e)));break}if(f){if(e===0){r.push(o);continue}r.push(o.subarray(e-a));continue}if(u){if(t===c){r.push(o);break}r.push(o.subarray(0,t-a));break}r.push(o)}return{bufs:r,length:t-e}}indexOf(e,t=0){if(!xn(e)&&!(e instanceof Uint8Array))throw new TypeError('The "value" argument must be a Uint8ArrayList or Uint8Array');let r=e instanceof Uint8Array?e:e.subarray();if(t=Number(t??0),isNaN(t)&&(t=0),t<0&&(t=this.length+t),t<0&&(t=0),e.length===0)return t>this.length?this.length:t;let n=r.byteLength;if(n===0)throw new TypeError("search must be at least 1 byte long");let i=256,o=new Int32Array(i);for(let h=0;h=0;l--){let d=this.get(h+l);if(r[l]!==d){u=Math.max(1,l-a[d]);break}}if(u===0)return h}return-1}getInt8(e){let t=this.subarray(e,e+1);return new DataView(t.buffer,t.byteOffset,t.byteLength).getInt8(0)}setInt8(e,t){let r=de(1);new DataView(r.buffer,r.byteOffset,r.byteLength).setInt8(0,t),this.write(r,e)}getInt16(e,t){let r=this.subarray(e,e+2);return new DataView(r.buffer,r.byteOffset,r.byteLength).getInt16(0,t)}setInt16(e,t,r){let n=lt(2);new DataView(n.buffer,n.byteOffset,n.byteLength).setInt16(0,t,r),this.write(n,e)}getInt32(e,t){let r=this.subarray(e,e+4);return new DataView(r.buffer,r.byteOffset,r.byteLength).getInt32(0,t)}setInt32(e,t,r){let n=lt(4);new DataView(n.buffer,n.byteOffset,n.byteLength).setInt32(0,t,r),this.write(n,e)}getBigInt64(e,t){let r=this.subarray(e,e+8);return new DataView(r.buffer,r.byteOffset,r.byteLength).getBigInt64(0,t)}setBigInt64(e,t,r){let n=lt(8);new DataView(n.buffer,n.byteOffset,n.byteLength).setBigInt64(0,t,r),this.write(n,e)}getUint8(e){let t=this.subarray(e,e+1);return new DataView(t.buffer,t.byteOffset,t.byteLength).getUint8(0)}setUint8(e,t){let r=de(1);new DataView(r.buffer,r.byteOffset,r.byteLength).setUint8(0,t),this.write(r,e)}getUint16(e,t){let r=this.subarray(e,e+2);return new DataView(r.buffer,r.byteOffset,r.byteLength).getUint16(0,t)}setUint16(e,t,r){let n=lt(2);new DataView(n.buffer,n.byteOffset,n.byteLength).setUint16(0,t,r),this.write(n,e)}getUint32(e,t){let r=this.subarray(e,e+4);return new DataView(r.buffer,r.byteOffset,r.byteLength).getUint32(0,t)}setUint32(e,t,r){let n=lt(4);new DataView(n.buffer,n.byteOffset,n.byteLength).setUint32(0,t,r),this.write(n,e)}getBigUint64(e,t){let r=this.subarray(e,e+8);return new DataView(r.buffer,r.byteOffset,r.byteLength).getBigUint64(0,t)}setBigUint64(e,t,r){let n=lt(8);new DataView(n.buffer,n.byteOffset,n.byteLength).setBigUint64(0,t,r),this.write(n,e)}getFloat32(e,t){let r=this.subarray(e,e+4);return new DataView(r.buffer,r.byteOffset,r.byteLength).getFloat32(0,t)}setFloat32(e,t,r){let n=lt(4);new DataView(n.buffer,n.byteOffset,n.byteLength).setFloat32(0,t,r),this.write(n,e)}getFloat64(e,t){let r=this.subarray(e,e+8);return new DataView(r.buffer,r.byteOffset,r.byteLength).getFloat64(0,t)}setFloat64(e,t,r){let n=lt(8);new DataView(n.buffer,n.byteOffset,n.byteLength).setFloat64(0,t,r),this.write(n,e)}equals(e){if(e==null||!(e instanceof s)||e.bufs.length!==this.bufs.length)return!1;for(let t=0;tn+i.byteLength,0)),r.length=t,r}};function En(s){return s[Symbol.asyncIterator]!=null}var Sn=s=>{let e=Ee(s),t=de(e);return Si(s,t),Sn.bytes=e,t};Sn.bytes=0;function vs(s,e){e=e??{};let t=e.lengthEncoder??Sn;function*r(n){let i=t(n.byteLength);i instanceof Uint8Array?yield i:yield*i,n instanceof Uint8Array?yield n:yield*n}return En(s)?async function*(){for await(let n of s)yield*r(n)}():function*(){for(let n of s)yield*r(n)}()}vs.single=(s,e)=>{e=e??{};let t=e.lengthEncoder??Sn;return new ws(t(s.byteLength),s)};var Bn=class extends Error{name="InvalidMessageLengthError";code="ERR_INVALID_MSG_LENGTH"},In=class extends Error{name="InvalidDataLengthError";code="ERR_MSG_DATA_TOO_LONG"},_n=class extends Error{name="InvalidDataLengthLengthError";code="ERR_MSG_LENGTH_TOO_LONG"},er=class extends Error{name="UnexpectedEOFError";code="ERR_UNEXPECTED_EOF"};var Vf=8,Hf=1024*1024*4,Jt;(function(s){s[s.LENGTH=0]="LENGTH",s[s.DATA=1]="DATA"})(Jt||(Jt={}));var ho=s=>{let e=us(s);return ho.bytes=Ee(e),e};ho.bytes=0;function tr(s,e){let t=new ws,r=Jt.LENGTH,n=-1,i=e?.lengthDecoder??ho,o=e?.maxLengthLength??Vf,a=e?.maxDataLength??Hf;function*c(){for(;t.byteLength>0;){if(r===Jt.LENGTH)try{if(n=i(t),n<0)throw new Bn("Invalid message length");if(n>a)throw new In("Message length too long");let f=i.bytes;t.consume(f),e?.onLength!=null&&e.onLength(n),r=Jt.DATA}catch(f){if(f instanceof RangeError){if(t.byteLength>o)throw new _n("Message length length too long");break}throw f}if(r===Jt.DATA){if(t.byteLength0)throw new er("Unexpected end of input")}():function*(){for(let f of s)t.append(f),yield*c();if(t.byteLength>0)throw new er("Unexpected end of input")}()}tr.fromReader=(s,e)=>{let t=1,r=async function*(){for(;;)try{let{done:i,value:o}=await s.next(t);if(i===!0)return;o!=null&&(yield o)}catch(i){if(i.code==="ERR_UNDER_READ")return{done:!0,value:null};throw i}finally{t=1}}();return tr(r,{...e??{},onLength:i=>{t=i}})};function An(){let s={};return s.promise=new Promise((e,t)=>{s.resolve=e,s.reject=t}),s}var kn=class{buffer;mask;top;btm;next;constructor(e){if(!(e>0)||e-1&e)throw new Error("Max size for a FixedFIFO should be a power of two");this.buffer=new Array(e),this.mask=e-1,this.top=0,this.btm=0,this.next=null}push(e){return this.buffer[this.top]!==void 0?!1:(this.buffer[this.top]=e,this.top=this.top+1&this.mask,!0)}shift(){let e=this.buffer[this.btm];if(e!==void 0)return this.buffer[this.btm]=void 0,this.btm=this.btm+1&this.mask,e}isEmpty(){return this.buffer[this.btm]===void 0}},xs=class{size;hwm;head;tail;constructor(e={}){this.hwm=e.splitLimit??16,this.head=new kn(this.hwm),this.tail=this.head,this.size=0}calculateSize(e){return e?.byteLength!=null?e.byteLength:1}push(e){if(e?.value!=null&&(this.size+=this.calculateSize(e.value)),!this.head.push(e)){let t=this.head;this.head=t.next=new kn(2*this.head.buffer.length),this.head.push(e)}}shift(){let e=this.tail.shift();if(e===void 0&&this.tail.next!=null){let t=this.tail.next;this.tail.next=null,this.tail=t,e=this.tail.shift()}return e?.value!=null&&(this.size-=this.calculateSize(e.value)),e}isEmpty(){return this.head.isEmpty()}};var fo=class extends Error{type;code;constructor(e,t){super(e??"The operation was aborted"),this.type="aborted",this.code=t??"ABORT_ERR"}};function yt(s={}){return Of(t=>{let r=t.shift();if(r==null)return{done:!0};if(r.error!=null)throw r.error;return{done:r.done===!0,value:r.value}},s)}function Of(s,e){e=e??{};let t=e.onEnd,r=new xs,n,i,o,a=An(),c=async()=>{try{return r.isEmpty()?o?{done:!0}:await new Promise((g,b)=>{i=S=>{i=null,r.push(S);try{g(s(r))}catch(y){b(y)}return n}}):s(r)}finally{r.isEmpty()&&queueMicrotask(()=>{a.resolve(),a=An()})}},f=g=>i!=null?i(g):(r.push(g),n),u=g=>(r=new xs,i!=null?i({error:g}):(r.push({error:g}),n)),h=g=>{if(o)return n;if(e?.objectMode!==!0&&g?.byteLength==null)throw new Error("objectMode was not true but tried to push non-Uint8Array value");return f({done:!1,value:g})},l=g=>o?n:(o=!0,g!=null?u(g):f({done:!0})),d=()=>(r=new xs,l(),{done:!0}),m=g=>(l(g),{done:!0});if(n={[Symbol.asyncIterator](){return this},next:c,return:d,throw:m,push:h,end:l,get readableLength(){return r.size},onEmpty:async g=>{let b=g?.signal;if(b?.throwIfAborted(),r.isEmpty())return;let S,y;b!=null&&(S=new Promise((I,v)=>{y=()=>{v(new fo)},b.addEventListener("abort",y)}));try{await Promise.race([a.promise,S])}finally{y!=null&&b!=null&&b?.removeEventListener("abort",y)}}},t==null)return n;let p=n;return n={[Symbol.asyncIterator](){return this},next(){return p.next()},throw(g){return p.throw(g),t!=null&&(t(g),t=void 0),{done:!0}},return(){return p.return(),t!=null&&(t(),t=void 0),{done:!0}},push:h,end(g){return p.end(g),t!=null&&(t(g),t=void 0),n},get readableLength(){return p.readableLength},onEmpty:g=>p.onEmpty(g)},n}function zf(s){return s[Symbol.asyncIterator]!=null}function Gf(...s){let e=[];for(let t of s)zf(t)||e.push(t);return e.length===s.length?function*(){for(let t of e)yield*t}():async function*(){let t=yt({objectMode:!0});Promise.resolve().then(async()=>{try{await Promise.all(s.map(async r=>{for await(let n of r)t.push(n)})),t.end()}catch(r){t.end(r)}}),yield*t}()}var Wc=Gf;function Es(s,...e){if(s==null)throw new Error("Empty pipeline");if(po(s)){let r=s;s=()=>r.source}else if(jc(s)||$c(s)){let r=s;s=()=>r}let t=[s,...e];if(t.length>1&&po(t[t.length-1])&&(t[t.length-1]=t[t.length-1].sink),t.length>2)for(let r=1;r{let e;for(;s.length>0;)e=s.shift()(e);return e},$c=s=>s?.[Symbol.asyncIterator]!=null,jc=s=>s?.[Symbol.iterator]!=null,po=s=>s==null?!1:s.sink!=null&&s.source!=null,Kf=s=>e=>{let t=s.sink(e);if(t?.then!=null){let r=yt({objectMode:!0});t.then(()=>{r.end()},o=>{r.end(o)});let n,i=s.source;if($c(i))n=async function*(){yield*i,r.end()};else if(jc(i))n=function*(){yield*i,r.end()};else throw new Error("Unknown duplex source type - must be Iterable or AsyncIterable");return Wc(r,n())}return s.source};var go="/floodsub/1.0.0",mo="/meshsub/1.0.0",Tn="/meshsub/1.1.0";var Zc="ERR_TOPIC_VALIDATOR_REJECT",Jc="ERR_TOPIC_VALIDATOR_IGNORE";var Xc={maxSubscriptions:1/0,maxMessages:1/0,maxIhaveMessageIDs:1/0,maxIwantMessageIDs:1/0,maxControlMessages:1/0,maxPeerInfos:1/0};var wt;(function(s){let e;(function(u){let h;u.codec=()=>(h==null&&(h=Ce((l,d,m={})=>{m.lengthDelimited!==!1&&d.fork(),l.subscribe!=null&&(d.uint32(8),d.bool(l.subscribe)),l.topic!=null&&(d.uint32(18),d.string(l.topic)),m.lengthDelimited!==!1&&d.ldelim()},(l,d,m={})=>{let p={},g=d==null?l.len:l.pos+d;for(;l.pos>>3){case 1:{p.subscribe=l.bool();break}case 2:{p.topic=l.string();break}default:{l.skipType(b&7);break}}}return p})),h),u.encode=l=>De(l,u.codec()),u.decode=(l,d)=>Pe(l,u.codec(),d)})(e=s.SubOpts||(s.SubOpts={}));let t;(function(u){let h;u.codec=()=>(h==null&&(h=Ce((l,d,m={})=>{m.lengthDelimited!==!1&&d.fork(),l.from!=null&&(d.uint32(10),d.bytes(l.from)),l.data!=null&&(d.uint32(18),d.bytes(l.data)),l.seqno!=null&&(d.uint32(26),d.bytes(l.seqno)),l.topic!=null&&l.topic!==""&&(d.uint32(34),d.string(l.topic)),l.signature!=null&&(d.uint32(42),d.bytes(l.signature)),l.key!=null&&(d.uint32(50),d.bytes(l.key)),m.lengthDelimited!==!1&&d.ldelim()},(l,d,m={})=>{let p={topic:""},g=d==null?l.len:l.pos+d;for(;l.pos>>3){case 1:{p.from=l.bytes();break}case 2:{p.data=l.bytes();break}case 3:{p.seqno=l.bytes();break}case 4:{p.topic=l.string();break}case 5:{p.signature=l.bytes();break}case 6:{p.key=l.bytes();break}default:{l.skipType(b&7);break}}}return p})),h),u.encode=l=>De(l,u.codec()),u.decode=(l,d)=>Pe(l,u.codec(),d)})(t=s.Message||(s.Message={}));let r;(function(u){let h;u.codec=()=>(h==null&&(h=Ce((l,d,m={})=>{if(m.lengthDelimited!==!1&&d.fork(),l.ihave!=null)for(let p of l.ihave)d.uint32(10),s.ControlIHave.codec().encode(p,d);if(l.iwant!=null)for(let p of l.iwant)d.uint32(18),s.ControlIWant.codec().encode(p,d);if(l.graft!=null)for(let p of l.graft)d.uint32(26),s.ControlGraft.codec().encode(p,d);if(l.prune!=null)for(let p of l.prune)d.uint32(34),s.ControlPrune.codec().encode(p,d);m.lengthDelimited!==!1&&d.ldelim()},(l,d,m={})=>{let p={ihave:[],iwant:[],graft:[],prune:[]},g=d==null?l.len:l.pos+d;for(;l.pos>>3){case 1:{if(m.limits?.ihave!=null&&p.ihave.length===m.limits.ihave)throw new Fe('Decode error - map field "ihave" had too many elements');p.ihave.push(s.ControlIHave.codec().decode(l,l.uint32(),{limits:m.limits?.ihave$}));break}case 2:{if(m.limits?.iwant!=null&&p.iwant.length===m.limits.iwant)throw new Fe('Decode error - map field "iwant" had too many elements');p.iwant.push(s.ControlIWant.codec().decode(l,l.uint32(),{limits:m.limits?.iwant$}));break}case 3:{if(m.limits?.graft!=null&&p.graft.length===m.limits.graft)throw new Fe('Decode error - map field "graft" had too many elements');p.graft.push(s.ControlGraft.codec().decode(l,l.uint32(),{limits:m.limits?.graft$}));break}case 4:{if(m.limits?.prune!=null&&p.prune.length===m.limits.prune)throw new Fe('Decode error - map field "prune" had too many elements');p.prune.push(s.ControlPrune.codec().decode(l,l.uint32(),{limits:m.limits?.prune$}));break}default:{l.skipType(b&7);break}}}return p})),h),u.encode=l=>De(l,u.codec()),u.decode=(l,d)=>Pe(l,u.codec(),d)})(r=s.ControlMessage||(s.ControlMessage={}));let n;(function(u){let h;u.codec=()=>(h==null&&(h=Ce((l,d,m={})=>{if(m.lengthDelimited!==!1&&d.fork(),l.topicID!=null&&(d.uint32(10),d.string(l.topicID)),l.messageIDs!=null)for(let p of l.messageIDs)d.uint32(18),d.bytes(p);m.lengthDelimited!==!1&&d.ldelim()},(l,d,m={})=>{let p={messageIDs:[]},g=d==null?l.len:l.pos+d;for(;l.pos>>3){case 1:{p.topicID=l.string();break}case 2:{if(m.limits?.messageIDs!=null&&p.messageIDs.length===m.limits.messageIDs)throw new Fe('Decode error - map field "messageIDs" had too many elements');p.messageIDs.push(l.bytes());break}default:{l.skipType(b&7);break}}}return p})),h),u.encode=l=>De(l,u.codec()),u.decode=(l,d)=>Pe(l,u.codec(),d)})(n=s.ControlIHave||(s.ControlIHave={}));let i;(function(u){let h;u.codec=()=>(h==null&&(h=Ce((l,d,m={})=>{if(m.lengthDelimited!==!1&&d.fork(),l.messageIDs!=null)for(let p of l.messageIDs)d.uint32(10),d.bytes(p);m.lengthDelimited!==!1&&d.ldelim()},(l,d,m={})=>{let p={messageIDs:[]},g=d==null?l.len:l.pos+d;for(;l.pos>>3){case 1:{if(m.limits?.messageIDs!=null&&p.messageIDs.length===m.limits.messageIDs)throw new Fe('Decode error - map field "messageIDs" had too many elements');p.messageIDs.push(l.bytes());break}default:{l.skipType(b&7);break}}}return p})),h),u.encode=l=>De(l,u.codec()),u.decode=(l,d)=>Pe(l,u.codec(),d)})(i=s.ControlIWant||(s.ControlIWant={}));let o;(function(u){let h;u.codec=()=>(h==null&&(h=Ce((l,d,m={})=>{m.lengthDelimited!==!1&&d.fork(),l.topicID!=null&&(d.uint32(10),d.string(l.topicID)),m.lengthDelimited!==!1&&d.ldelim()},(l,d,m={})=>{let p={},g=d==null?l.len:l.pos+d;for(;l.pos>>3){case 1:{p.topicID=l.string();break}default:{l.skipType(b&7);break}}}return p})),h),u.encode=l=>De(l,u.codec()),u.decode=(l,d)=>Pe(l,u.codec(),d)})(o=s.ControlGraft||(s.ControlGraft={}));let a;(function(u){let h;u.codec=()=>(h==null&&(h=Ce((l,d,m={})=>{if(m.lengthDelimited!==!1&&d.fork(),l.topicID!=null&&(d.uint32(10),d.string(l.topicID)),l.peers!=null)for(let p of l.peers)d.uint32(18),s.PeerInfo.codec().encode(p,d);l.backoff!=null&&(d.uint32(24),d.uint64Number(l.backoff)),m.lengthDelimited!==!1&&d.ldelim()},(l,d,m={})=>{let p={peers:[]},g=d==null?l.len:l.pos+d;for(;l.pos>>3){case 1:{p.topicID=l.string();break}case 2:{if(m.limits?.peers!=null&&p.peers.length===m.limits.peers)throw new Fe('Decode error - map field "peers" had too many elements');p.peers.push(s.PeerInfo.codec().decode(l,l.uint32(),{limits:m.limits?.peers$}));break}case 3:{p.backoff=l.uint64Number();break}default:{l.skipType(b&7);break}}}return p})),h),u.encode=l=>De(l,u.codec()),u.decode=(l,d)=>Pe(l,u.codec(),d)})(a=s.ControlPrune||(s.ControlPrune={}));let c;(function(u){let h;u.codec=()=>(h==null&&(h=Ce((l,d,m={})=>{m.lengthDelimited!==!1&&d.fork(),l.peerID!=null&&(d.uint32(10),d.bytes(l.peerID)),l.signedPeerRecord!=null&&(d.uint32(18),d.bytes(l.signedPeerRecord)),m.lengthDelimited!==!1&&d.ldelim()},(l,d,m={})=>{let p={},g=d==null?l.len:l.pos+d;for(;l.pos>>3){case 1:{p.peerID=l.bytes();break}case 2:{p.signedPeerRecord=l.bytes();break}default:{l.skipType(b&7);break}}}return p})),h),u.encode=l=>De(l,u.codec()),u.decode=(l,d)=>Pe(l,u.codec(),d)})(c=s.PeerInfo||(s.PeerInfo={}));let f;s.codec=()=>(f==null&&(f=Ce((u,h,l={})=>{if(l.lengthDelimited!==!1&&h.fork(),u.subscriptions!=null)for(let d of u.subscriptions)h.uint32(10),s.SubOpts.codec().encode(d,h);if(u.messages!=null)for(let d of u.messages)h.uint32(18),s.Message.codec().encode(d,h);u.control!=null&&(h.uint32(26),s.ControlMessage.codec().encode(u.control,h)),l.lengthDelimited!==!1&&h.ldelim()},(u,h,l={})=>{let d={subscriptions:[],messages:[]},m=h==null?u.len:u.pos+h;for(;u.pos>>3){case 1:{if(l.limits?.subscriptions!=null&&d.subscriptions.length===l.limits.subscriptions)throw new Fe('Decode error - map field "subscriptions" had too many elements');d.subscriptions.push(s.SubOpts.codec().decode(u,u.uint32(),{limits:l.limits?.subscriptions$}));break}case 2:{if(l.limits?.messages!=null&&d.messages.length===l.limits.messages)throw new Fe('Decode error - map field "messages" had too many elements');d.messages.push(s.Message.codec().decode(u,u.uint32(),{limits:l.limits?.messages$}));break}case 3:{d.control=s.ControlMessage.codec().decode(u,u.uint32(),{limits:l.limits?.control});break}default:{u.skipType(p&7);break}}}return d})),f),s.encode=u=>De(u,s.codec()),s.decode=(u,h)=>Pe(u,s.codec(),h)})(wt||(wt={}));var Mn=class{gossip;msgs=new Map;msgIdToStrFn;history=[];notValidatedCount=0;constructor(e,t,r){this.gossip=e,this.msgIdToStrFn=r;for(let n=0;n{if((this.msgs.get(n.msgIdStr)?.validated??!1)&&e.has(n.topic)){let o=t.get(n.topic);o==null&&(o=[],t.set(n.topic,o)),o.push(n.msgId)}});return t}validate(e){let t=this.msgs.get(e);if(t==null)return null;t.validated||this.notValidatedCount--;let{message:r,originatingPeers:n}=t;return t.validated=!0,t.originatingPeers=new Set,{message:r,originatingPeers:n}}shift(){this.history[this.history.length-1].forEach(t=>{let r=this.msgs.get(t.msgIdStr);r!=null&&(this.msgs.delete(t.msgIdStr),r.validated||this.notValidatedCount--)}),this.history.pop(),this.history.unshift([])}remove(e){let t=this.msgs.get(e);return t==null?null:(this.msgs.delete(e),t)}};var Yc;(function(s){s.StrictSign="StrictSign",s.StrictNoSign="StrictNoSign"})(Yc||(Yc={}));var Ut;(function(s){s[s.Signing=0]="Signing",s[s.Anonymous=1]="Anonymous"})(Ut||(Ut={}));var Be;(function(s){s.Error="error",s.Ignore="ignore",s.Reject="reject",s.Blacklisted="blacklisted"})(Be||(Be={}));var be;(function(s){s.InvalidSignature="invalid_signature",s.InvalidSeqno="invalid_seqno",s.InvalidPeerId="invalid_peerid",s.SignaturePresent="signature_present",s.SeqnoPresent="seqno_present",s.FromPresent="from_present",s.TransformFailed="transform_failed"})(be||(be={}));var ye;(function(s){s.duplicate="duplicate",s.invalid="invalid",s.valid="valid"})(ye||(ye={}));function bo(s){switch(s){case xe.Ignore:return Be.Ignore;case xe.Reject:return Be.Reject;default:throw new Error("Unreachable")}}var Qc;(function(s){s.forward="forward",s.publish="publish"})(Qc||(Qc={}));var Ie;(function(s){s.Fanout="fanout",s.Random="random",s.Subscribed="subscribed",s.Outbound="outbound",s.NotEnough="not_enough",s.Opportunistic="opportunistic"})(Ie||(Ie={}));var $e;(function(s){s.Dc="disconnected",s.BadScore="bad_score",s.Prune="prune",s.Excess="excess"})($e||($e={}));var Bs;(function(s){s.GraftBackoff="graft_backoff",s.BrokenPromise="broken_promise",s.MessageDeficit="message_deficit",s.IPColocation="IP_colocation"})(Bs||(Bs={}));var Is;(function(s){s.LowScore="low_score",s.MaxIhave="max_ihave",s.MaxIasked="max_iasked"})(Is||(Is={}));var Ss;(function(s){s.graylist="graylist",s.publish="publish",s.gossip="gossip",s.mesh="mesh"})(Ss||(Ss={}));function el(s,e,t){return{protocolsEnabled:s.gauge({name:"gossipsub_protocol",help:"Status of enabled protocols",labelNames:["protocol"]}),topicSubscriptionStatus:s.gauge({name:"gossipsub_topic_subscription_status",help:"Status of our subscription to this topic",labelNames:["topicStr"]}),topicPeersCount:s.gauge({name:"gossipsub_topic_peer_count",help:"Number of peers subscribed to each topic",labelNames:["topicStr"]}),meshPeerCounts:s.gauge({name:"gossipsub_mesh_peer_count",help:"Number of peers in our mesh",labelNames:["topicStr"]}),meshPeerInclusionEventsFanout:s.gauge({name:"gossipsub_mesh_peer_inclusion_events_fanout_total",help:"Number of times we include peers in a topic mesh for fanout reasons",labelNames:["topic"]}),meshPeerInclusionEventsRandom:s.gauge({name:"gossipsub_mesh_peer_inclusion_events_random_total",help:"Number of times we include peers in a topic mesh for random reasons",labelNames:["topic"]}),meshPeerInclusionEventsSubscribed:s.gauge({name:"gossipsub_mesh_peer_inclusion_events_subscribed_total",help:"Number of times we include peers in a topic mesh for subscribed reasons",labelNames:["topic"]}),meshPeerInclusionEventsOutbound:s.gauge({name:"gossipsub_mesh_peer_inclusion_events_outbound_total",help:"Number of times we include peers in a topic mesh for outbound reasons",labelNames:["topic"]}),meshPeerInclusionEventsNotEnough:s.gauge({name:"gossipsub_mesh_peer_inclusion_events_not_enough_total",help:"Number of times we include peers in a topic mesh for not_enough reasons",labelNames:["topic"]}),meshPeerInclusionEventsOpportunistic:s.gauge({name:"gossipsub_mesh_peer_inclusion_events_opportunistic_total",help:"Number of times we include peers in a topic mesh for opportunistic reasons",labelNames:["topic"]}),meshPeerInclusionEventsUnknown:s.gauge({name:"gossipsub_mesh_peer_inclusion_events_unknown_total",help:"Number of times we include peers in a topic mesh for unknown reasons",labelNames:["topic"]}),meshPeerChurnEventsDisconnected:s.gauge({name:"gossipsub_peer_churn_events_disconnected_total",help:"Number of times we remove peers in a topic mesh for disconnected reasons",labelNames:["topic"]}),meshPeerChurnEventsBadScore:s.gauge({name:"gossipsub_peer_churn_events_bad_score_total",help:"Number of times we remove peers in a topic mesh for bad_score reasons",labelNames:["topic"]}),meshPeerChurnEventsPrune:s.gauge({name:"gossipsub_peer_churn_events_prune_total",help:"Number of times we remove peers in a topic mesh for prune reasons",labelNames:["topic"]}),meshPeerChurnEventsExcess:s.gauge({name:"gossipsub_peer_churn_events_excess_total",help:"Number of times we remove peers in a topic mesh for excess reasons",labelNames:["topic"]}),meshPeerChurnEventsUnknown:s.gauge({name:"gossipsub_peer_churn_events_unknown_total",help:"Number of times we remove peers in a topic mesh for unknown reasons",labelNames:["topic"]}),peersPerProtocol:s.gauge({name:"gossipsub_peers_per_protocol_count",help:"Peers connected for each topic",labelNames:["protocol"]}),heartbeatDuration:s.histogram({name:"gossipsub_heartbeat_duration_seconds",help:"The time it takes to complete one iteration of the heartbeat",buckets:[.01,.1,1]}),heartbeatSkipped:s.gauge({name:"gossipsub_heartbeat_skipped",help:"Heartbeat run took longer than heartbeat interval so next is skipped"}),acceptedMessagesTotal:s.gauge({name:"gossipsub_accepted_messages_total",help:"Total accepted messages for each topic",labelNames:["topic"]}),ignoredMessagesTotal:s.gauge({name:"gossipsub_ignored_messages_total",help:"Total ignored messages for each topic",labelNames:["topic"]}),rejectedMessagesTotal:s.gauge({name:"gossipsub_rejected_messages_total",help:"Total rejected messages for each topic",labelNames:["topic"]}),unknownValidationResultsTotal:s.gauge({name:"gossipsub_unknown_validation_results_total",help:"Total unknown validation results for each topic",labelNames:["topic"]}),asyncValidationMcacheHit:s.gauge({name:"gossipsub_async_validation_mcache_hit_total",help:"Async validation result reported by the user layer",labelNames:["hit"]}),asyncValidationDelayFromFirstSeenSec:s.histogram({name:"gossipsub_async_validation_delay_from_first_seen",help:"Async validation report delay from first seen in second",buckets:[.01,.03,.1,.3,1,3,10]}),asyncValidationUnknownFirstSeen:s.gauge({name:"gossipsub_async_validation_unknown_first_seen_count_total",help:"Async validation report unknown first seen value for message"}),peerReadStreamError:s.gauge({name:"gossipsub_peer_read_stream_err_count_total",help:"Peer read stream error"}),rpcRecvBytes:s.gauge({name:"gossipsub_rpc_recv_bytes_total",help:"RPC recv"}),rpcRecvCount:s.gauge({name:"gossipsub_rpc_recv_count_total",help:"RPC recv"}),rpcRecvSubscription:s.gauge({name:"gossipsub_rpc_recv_subscription_total",help:"RPC recv"}),rpcRecvMessage:s.gauge({name:"gossipsub_rpc_recv_message_total",help:"RPC recv"}),rpcRecvControl:s.gauge({name:"gossipsub_rpc_recv_control_total",help:"RPC recv"}),rpcRecvIHave:s.gauge({name:"gossipsub_rpc_recv_ihave_total",help:"RPC recv"}),rpcRecvIWant:s.gauge({name:"gossipsub_rpc_recv_iwant_total",help:"RPC recv"}),rpcRecvGraft:s.gauge({name:"gossipsub_rpc_recv_graft_total",help:"RPC recv"}),rpcRecvPrune:s.gauge({name:"gossipsub_rpc_recv_prune_total",help:"RPC recv"}),rpcDataError:s.gauge({name:"gossipsub_rpc_data_err_count_total",help:"RPC data error"}),rpcRecvError:s.gauge({name:"gossipsub_rpc_recv_err_count_total",help:"RPC recv error"}),rpcRecvNotAccepted:s.gauge({name:"gossipsub_rpc_rcv_not_accepted_total",help:"Total count of RPC dropped because acceptFrom() == false"}),rpcSentBytes:s.gauge({name:"gossipsub_rpc_sent_bytes_total",help:"RPC sent"}),rpcSentCount:s.gauge({name:"gossipsub_rpc_sent_count_total",help:"RPC sent"}),rpcSentSubscription:s.gauge({name:"gossipsub_rpc_sent_subscription_total",help:"RPC sent"}),rpcSentMessage:s.gauge({name:"gossipsub_rpc_sent_message_total",help:"RPC sent"}),rpcSentControl:s.gauge({name:"gossipsub_rpc_sent_control_total",help:"RPC sent"}),rpcSentIHave:s.gauge({name:"gossipsub_rpc_sent_ihave_total",help:"RPC sent"}),rpcSentIWant:s.gauge({name:"gossipsub_rpc_sent_iwant_total",help:"RPC sent"}),rpcSentGraft:s.gauge({name:"gossipsub_rpc_sent_graft_total",help:"RPC sent"}),rpcSentPrune:s.gauge({name:"gossipsub_rpc_sent_prune_total",help:"RPC sent"}),msgPublishCount:s.gauge({name:"gossipsub_msg_publish_count_total",help:"Total count of msg published by topic",labelNames:["topic"]}),msgPublishPeersByTopic:s.gauge({name:"gossipsub_msg_publish_peers_total",help:"Total count of peers that we publish a msg to",labelNames:["topic"]}),directPeersPublishedTotal:s.gauge({name:"gossipsub_direct_peers_published_total",help:"Total direct peers that we publish a msg to",labelNames:["topic"]}),floodsubPeersPublishedTotal:s.gauge({name:"gossipsub_floodsub_peers_published_total",help:"Total floodsub peers that we publish a msg to",labelNames:["topic"]}),meshPeersPublishedTotal:s.gauge({name:"gossipsub_mesh_peers_published_total",help:"Total mesh peers that we publish a msg to",labelNames:["topic"]}),fanoutPeersPublishedTotal:s.gauge({name:"gossipsub_fanout_peers_published_total",help:"Total fanout peers that we publish a msg to",labelNames:["topic"]}),msgPublishBytes:s.gauge({name:"gossipsub_msg_publish_bytes_total",help:"Total count of msg publish data.length bytes",labelNames:["topic"]}),msgPublishTime:s.histogram({name:"gossipsub_msg_publish_seconds",help:"Total time in seconds to publish a message",buckets:[.001,.002,.005,.01,.1,.5,1],labelNames:["topic"]}),msgForwardCount:s.gauge({name:"gossipsub_msg_forward_count_total",help:"Total count of msg forwarded by topic",labelNames:["topic"]}),msgForwardPeers:s.gauge({name:"gossipsub_msg_forward_peers_total",help:"Total count of peers that we forward a msg to",labelNames:["topic"]}),msgReceivedPreValidation:s.gauge({name:"gossipsub_msg_received_prevalidation_total",help:"Total count of recv msgs before any validation",labelNames:["topic"]}),msgReceivedError:s.gauge({name:"gossipsub_msg_received_error_total",help:"Total count of recv msgs error",labelNames:["topic"]}),prevalidationInvalidTotal:s.gauge({name:"gossipsub_pre_validation_invalid_total",help:"Total count of invalid messages received",labelNames:["topic"]}),prevalidationValidTotal:s.gauge({name:"gossipsub_pre_validation_valid_total",help:"Total count of valid messages received",labelNames:["topic"]}),prevalidationDuplicateTotal:s.gauge({name:"gossipsub_pre_validation_duplicate_total",help:"Total count of duplicate messages received",labelNames:["topic"]}),prevalidationUnknownTotal:s.gauge({name:"gossipsub_pre_validation_unknown_status_total",help:"Total count of unknown_status messages received",labelNames:["topic"]}),msgReceivedInvalid:s.gauge({name:"gossipsub_msg_received_invalid_total",help:"Tracks specific reason of invalid",labelNames:["error"]}),msgReceivedInvalidByTopic:s.gauge({name:"gossipsub_msg_received_invalid_by_topic_total",help:"Tracks specific invalid message by topic",labelNames:["topic"]}),duplicateMsgDeliveryDelay:s.histogram({name:"gossisub_duplicate_msg_delivery_delay_seconds",help:"Time since the 1st duplicated message validated",labelNames:["topic"],buckets:[.25*t.maxMeshMessageDeliveriesWindowSec,.5*t.maxMeshMessageDeliveriesWindowSec,Number(t.maxMeshMessageDeliveriesWindowSec),2*t.maxMeshMessageDeliveriesWindowSec,4*t.maxMeshMessageDeliveriesWindowSec]}),duplicateMsgLateDelivery:s.gauge({name:"gossisub_duplicate_msg_late_delivery_total",help:"Total count of late duplicate message delivery by topic, which triggers P3 penalty",labelNames:["topic"]}),duplicateMsgIgnored:s.gauge({name:"gossisub_ignored_published_duplicate_msgs_total",help:"Total count of published duplicate message ignored by topic",labelNames:["topic"]}),scoreFnCalls:s.gauge({name:"gossipsub_score_fn_calls_total",help:"Total times score() is called"}),scoreFnRuns:s.gauge({name:"gossipsub_score_fn_runs_total",help:"Total times score() call actually computed computeScore(), no cache"}),scoreCachedDelta:s.histogram({name:"gossipsub_score_cache_delta",help:"Delta of score between cached values that expired",buckets:[10,100,1e3]}),peersByScoreThreshold:s.gauge({name:"gossipsub_peers_by_score_threshold_count",help:"Current count of peers by score threshold",labelNames:["threshold"]}),score:s.avgMinMax({name:"gossipsub_score",help:"Avg min max of gossip scores"}),scoreWeights:s.avgMinMax({name:"gossipsub_score_weights",help:"Separate score weights",labelNames:["topic","p"]}),scorePerMesh:s.avgMinMax({name:"gossipsub_score_per_mesh",help:"Histogram of the scores for each mesh topic",labelNames:["topic"]}),scoringPenalties:s.gauge({name:"gossipsub_scoring_penalties_total",help:"A counter of the kind of penalties being applied to peers",labelNames:["penalty"]}),behaviourPenalty:s.histogram({name:"gossipsub_peer_stat_behaviour_penalty",help:"Current peer stat behaviour_penalty at each scrape",buckets:[.25*t.behaviourPenaltyThreshold,.5*t.behaviourPenaltyThreshold,Number(t.behaviourPenaltyThreshold),2*t.behaviourPenaltyThreshold,4*t.behaviourPenaltyThreshold]}),ihaveRcvIgnored:s.gauge({name:"gossipsub_ihave_rcv_ignored_total",help:"Total received IHAVE messages that we ignore for some reason",labelNames:["reason"]}),ihaveRcvMsgids:s.gauge({name:"gossipsub_ihave_rcv_msgids_total",help:"Total received IHAVE messages by topic",labelNames:["topic"]}),ihaveRcvNotSeenMsgids:s.gauge({name:"gossipsub_ihave_rcv_not_seen_msgids_total",help:"Total messages per topic we do not have, not actual requests",labelNames:["topic"]}),iwantRcvMsgids:s.gauge({name:"gossipsub_iwant_rcv_msgids_total",help:"Total received IWANT messages by topic",labelNames:["topic"]}),iwantRcvDonthaveMsgids:s.gauge({name:"gossipsub_iwant_rcv_dont_have_msgids_total",help:"Total requested messageIDs that we do not have"}),iwantPromiseStarted:s.gauge({name:"gossipsub_iwant_promise_sent_total",help:"Total count of started IWANT promises"}),iwantPromiseResolved:s.gauge({name:"gossipsub_iwant_promise_resolved_total",help:"Total count of resolved IWANT promises"}),iwantPromiseResolvedFromDuplicate:s.gauge({name:"gossipsub_iwant_promise_resolved_from_duplicate_total",help:"Total count of resolved IWANT promises from duplicate messages"}),iwantPromiseResolvedPeers:s.gauge({name:"gossipsub_iwant_promise_resolved_peers",help:"Total count of peers we have asked IWANT promises that are resolved"}),iwantPromiseBroken:s.gauge({name:"gossipsub_iwant_promise_broken",help:"Total count of broken IWANT promises"}),iwantMessagePruned:s.gauge({name:"gossipsub_iwant_message_pruned",help:"Total count of pruned IWANT messages"}),iwantPromiseDeliveryTime:s.histogram({name:"gossipsub_iwant_promise_delivery_seconds",help:"Histogram of delivery time of resolved IWANT promises",buckets:[.5*t.gossipPromiseExpireSec,Number(t.gossipPromiseExpireSec),2*t.gossipPromiseExpireSec,4*t.gossipPromiseExpireSec]}),iwantPromiseUntracked:s.gauge({name:"gossip_iwant_promise_untracked",help:"Total count of untracked IWANT promise"}),connectedPeersBackoffSec:s.histogram({name:"gossipsub_connected_peers_backoff_seconds",help:"Backoff time in seconds",buckets:[1,2,4,10,20,60,120]}),cacheSize:s.gauge({name:"gossipsub_cache_size",help:"Unbounded cache sizes",labelNames:["cache"]}),mcacheSize:s.gauge({name:"gossipsub_mcache_size",help:"Current mcache msg count"}),mcacheNotValidatedCount:s.gauge({name:"gossipsub_mcache_not_validated_count",help:"Current mcache msg count not validated"}),fastMsgIdCacheCollision:s.gauge({name:"gossipsub_fastmsgid_cache_collision_total",help:"Total count of key collisions on fastmsgid cache put"}),newConnectionCount:s.gauge({name:"gossipsub_new_connection_total",help:"Total new connection by status",labelNames:["status"]}),topicStrToLabel:e,toTopic(r){return this.topicStrToLabel.get(r)??r},onJoin(r){this.topicSubscriptionStatus.set({topicStr:r},1),this.meshPeerCounts.set({topicStr:r},0)},onLeave(r){this.topicSubscriptionStatus.set({topicStr:r},0),this.meshPeerCounts.set({topicStr:r},0)},onAddToMesh(r,n,i){let o=this.toTopic(r);switch(n){case Ie.Fanout:this.meshPeerInclusionEventsFanout.inc({topic:o},i);break;case Ie.Random:this.meshPeerInclusionEventsRandom.inc({topic:o},i);break;case Ie.Subscribed:this.meshPeerInclusionEventsSubscribed.inc({topic:o},i);break;case Ie.Outbound:this.meshPeerInclusionEventsOutbound.inc({topic:o},i);break;case Ie.NotEnough:this.meshPeerInclusionEventsNotEnough.inc({topic:o},i);break;case Ie.Opportunistic:this.meshPeerInclusionEventsOpportunistic.inc({topic:o},i);break;default:this.meshPeerInclusionEventsUnknown.inc({topic:o},i);break}},onRemoveFromMesh(r,n,i){let o=this.toTopic(r);switch(n){case $e.Dc:this.meshPeerChurnEventsDisconnected.inc({topic:o},i);break;case $e.BadScore:this.meshPeerChurnEventsBadScore.inc({topic:o},i);break;case $e.Prune:this.meshPeerChurnEventsPrune.inc({topic:o},i);break;case $e.Excess:this.meshPeerChurnEventsExcess.inc({topic:o},i);break;default:this.meshPeerChurnEventsUnknown.inc({topic:o},i);break}},onReportValidation(r,n,i){if(this.asyncValidationMcacheHit.inc({hit:r!=null?"hit":"miss"}),r!=null){let o=this.toTopic(r.message.topic);switch(n){case xe.Accept:this.acceptedMessagesTotal.inc({topic:o});break;case xe.Ignore:this.ignoredMessagesTotal.inc({topic:o});break;case xe.Reject:this.rejectedMessagesTotal.inc({topic:o});break;default:this.unknownValidationResultsTotal.inc({topic:o});break}}i!=null?this.asyncValidationDelayFromFirstSeenSec.observe((Date.now()-i)/1e3):this.asyncValidationUnknownFirstSeen.inc()},onScorePenalty(r){this.scoringPenalties.inc({penalty:r},1)},onIhaveRcv(r,n,i){let o=this.toTopic(r);this.ihaveRcvMsgids.inc({topic:o},n),this.ihaveRcvNotSeenMsgids.inc({topic:o},i)},onIwantRcv(r,n){for(let[i,o]of r){let a=this.toTopic(i);this.iwantRcvMsgids.inc({topic:a},o)}this.iwantRcvDonthaveMsgids.inc(n)},onForwardMsg(r,n){let i=this.toTopic(r);this.msgForwardCount.inc({topic:i},1),this.msgForwardPeers.inc({topic:i},n)},onPublishMsg(r,n,i,o,a){let c=this.toTopic(r);this.msgPublishCount.inc({topic:c},1),this.msgPublishBytes.inc({topic:c},i*o),this.msgPublishPeersByTopic.inc({topic:c},i),this.directPeersPublishedTotal.inc({topic:c},n.direct),this.floodsubPeersPublishedTotal.inc({topic:c},n.floodsub),this.meshPeersPublishedTotal.inc({topic:c},n.mesh),this.fanoutPeersPublishedTotal.inc({topic:c},n.fanout),this.msgPublishTime.observe({topic:c},a/1e3)},onMsgRecvPreValidation(r){let n=this.toTopic(r);this.msgReceivedPreValidation.inc({topic:n},1)},onMsgRecvError(r){let n=this.toTopic(r);this.msgReceivedError.inc({topic:n},1)},onPrevalidationResult(r,n){let i=this.toTopic(r);switch(n){case ye.duplicate:this.prevalidationDuplicateTotal.inc({topic:i});break;case ye.invalid:this.prevalidationInvalidTotal.inc({topic:i});break;case ye.valid:this.prevalidationValidTotal.inc({topic:i});break;default:this.prevalidationUnknownTotal.inc({topic:i});break}},onMsgRecvInvalid(r,n){let i=this.toTopic(r),o=n.reason===Be.Error?n.error:n.reason;this.msgReceivedInvalid.inc({error:o},1),this.msgReceivedInvalidByTopic.inc({topic:i},1)},onDuplicateMsgDelivery(r,n,i){let o=this.toTopic(r);this.duplicateMsgDeliveryDelay.observe({topic:o},n/1e3),i&&this.duplicateMsgLateDelivery.inc({topic:o},1)},onPublishDuplicateMsg(r){let n=this.toTopic(r);this.duplicateMsgIgnored.inc({topic:n},1)},onPeerReadStreamError(){this.peerReadStreamError.inc(1)},onRpcRecvError(){this.rpcRecvError.inc(1)},onRpcDataError(){this.rpcDataError.inc(1)},onRpcRecv(r,n){this.rpcRecvBytes.inc(n),this.rpcRecvCount.inc(1),r.subscriptions!=null&&this.rpcRecvSubscription.inc(r.subscriptions.length),r.messages!=null&&this.rpcRecvMessage.inc(r.messages.length),r.control!=null&&(this.rpcRecvControl.inc(1),r.control.ihave!=null&&this.rpcRecvIHave.inc(r.control.ihave.length),r.control.iwant!=null&&this.rpcRecvIWant.inc(r.control.iwant.length),r.control.graft!=null&&this.rpcRecvGraft.inc(r.control.graft.length),r.control.prune!=null&&this.rpcRecvPrune.inc(r.control.prune.length))},onRpcSent(r,n){if(this.rpcSentBytes.inc(n),this.rpcSentCount.inc(1),r.subscriptions!=null&&this.rpcSentSubscription.inc(r.subscriptions.length),r.messages!=null&&this.rpcSentMessage.inc(r.messages.length),r.control!=null){let i=r.control.ihave?.length??0,o=r.control.iwant?.length??0,a=r.control.graft?.length??0,c=r.control.prune?.length??0;i>0&&this.rpcSentIHave.inc(i),o>0&&this.rpcSentIWant.inc(o),a>0&&this.rpcSentGraft.inc(a),c>0&&this.rpcSentPrune.inc(c),(i>0||o>0||a>0||c>0)&&this.rpcSentControl.inc(1)}},registerScores(r,n){let i=0,o=0,a=0,c=0;for(let f of r)f>=n.graylistThreshold&&i++,f>=n.publishThreshold&&o++,f>=n.gossipThreshold&&a++,f>=0&&c++;this.peersByScoreThreshold.set({threshold:Ss.graylist},i),this.peersByScoreThreshold.set({threshold:Ss.publish},o),this.peersByScoreThreshold.set({threshold:Ss.gossip},a),this.peersByScoreThreshold.set({threshold:Ss.mesh},c),this.score.set(r)},registerScoreWeights(r){for(let[n,i]of r.byTopic)this.scoreWeights.set({topic:n,p:"p1"},i.p1w),this.scoreWeights.set({topic:n,p:"p2"},i.p2w),this.scoreWeights.set({topic:n,p:"p3"},i.p3w),this.scoreWeights.set({topic:n,p:"p3b"},i.p3bw),this.scoreWeights.set({topic:n,p:"p4"},i.p4w);this.scoreWeights.set({p:"p5"},r.p5w),this.scoreWeights.set({p:"p6"},r.p6w),this.scoreWeights.set({p:"p7"},r.p7w)},registerScorePerMesh(r,n){let i=new Map;r.forEach((o,a)=>{let c=this.topicStrToLabel.get(a)??"unknown",f=i.get(c);f==null&&(f=new Set,i.set(c,f)),o.forEach(u=>f?.add(u))});for(let[o,a]of i){let c=[];a.forEach(f=>{c.push(n.get(f)??0)}),this.scorePerMesh.set({topic:o},c)}}}}var q=class extends Error{static name="InvalidPeerScoreParamsError";constructor(e="Invalid peer score params"){super(e),this.name="InvalidPeerScoreParamsError"}};var $f={topics:{},topicScoreCap:10,appSpecificScore:()=>0,appSpecificWeight:10,IPColocationFactorWeight:-5,IPColocationFactorThreshold:10,IPColocationFactorWhitelist:new Set,behaviourPenaltyWeight:-10,behaviourPenaltyThreshold:0,behaviourPenaltyDecay:.2,decayInterval:1e3,decayToZero:.1,retainScore:3600*1e3},jf={topicWeight:.5,timeInMeshWeight:1,timeInMeshQuantum:1,timeInMeshCap:3600,firstMessageDeliveriesWeight:1,firstMessageDeliveriesDecay:.5,firstMessageDeliveriesCap:2e3,meshMessageDeliveriesWeight:-1,meshMessageDeliveriesDecay:.5,meshMessageDeliveriesCap:100,meshMessageDeliveriesThreshold:20,meshMessageDeliveriesWindow:10,meshMessageDeliveriesActivation:5e3,meshFailurePenaltyWeight:-1,meshFailurePenaltyDecay:.5,invalidMessageDeliveriesWeight:-1,invalidMessageDeliveriesDecay:.3};function tl(s={}){return{...$f,...s,topics:s.topics!=null?Object.entries(s.topics).reduce((e,[t,r])=>(e[t]=Zf(r),e),{}):{}}}function Zf(s={}){return{...jf,...s}}function sl(s){for(let[e,t]of Object.entries(s.topics))try{Jf(t)}catch(r){throw new q(`invalid score parameters for topic ${e}: ${r.message}`)}if(s.topicScoreCap<0)throw new q("invalid topic score cap; must be positive (or 0 for no cap)");if(s.appSpecificScore===null||s.appSpecificScore===void 0)throw new q("missing application specific score function");if(s.IPColocationFactorWeight>0)throw new q("invalid IPColocationFactorWeight; must be negative (or 0 to disable)");if(s.IPColocationFactorWeight!==0&&s.IPColocationFactorThreshold<1)throw new q("invalid IPColocationFactorThreshold; must be at least 1");if(s.behaviourPenaltyWeight>0)throw new q("invalid BehaviourPenaltyWeight; must be negative (or 0 to disable)");if(s.behaviourPenaltyWeight!==0&&(s.behaviourPenaltyDecay<=0||s.behaviourPenaltyDecay>=1))throw new q("invalid BehaviourPenaltyDecay; must be between 0 and 1");if(s.decayInterval<1e3)throw new q("invalid DecayInterval; must be at least 1s");if(s.decayToZero<=0||s.decayToZero>=1)throw new q("invalid DecayToZero; must be between 0 and 1")}function Jf(s){if(s.topicWeight<0)throw new q("invalid topic weight; must be >= 0");if(s.timeInMeshQuantum===0)throw new q("invalid TimeInMeshQuantum; must be non zero");if(s.timeInMeshWeight<0)throw new q("invalid TimeInMeshWeight; must be positive (or 0 to disable)");if(s.timeInMeshWeight!==0&&s.timeInMeshQuantum<=0)throw new q("invalid TimeInMeshQuantum; must be positive");if(s.timeInMeshWeight!==0&&s.timeInMeshCap<=0)throw new q("invalid TimeInMeshCap; must be positive");if(s.firstMessageDeliveriesWeight<0)throw new q("invallid FirstMessageDeliveriesWeight; must be positive (or 0 to disable)");if(s.firstMessageDeliveriesWeight!==0&&(s.firstMessageDeliveriesDecay<=0||s.firstMessageDeliveriesDecay>=1))throw new q("invalid FirstMessageDeliveriesDecay; must be between 0 and 1");if(s.firstMessageDeliveriesWeight!==0&&s.firstMessageDeliveriesCap<=0)throw new q("invalid FirstMessageDeliveriesCap; must be positive");if(s.meshMessageDeliveriesWeight>0)throw new q("invalid MeshMessageDeliveriesWeight; must be negative (or 0 to disable)");if(s.meshMessageDeliveriesWeight!==0&&(s.meshMessageDeliveriesDecay<=0||s.meshMessageDeliveriesDecay>=1))throw new q("invalid MeshMessageDeliveriesDecay; must be between 0 and 1");if(s.meshMessageDeliveriesWeight!==0&&s.meshMessageDeliveriesCap<=0)throw new q("invalid MeshMessageDeliveriesCap; must be positive");if(s.meshMessageDeliveriesWeight!==0&&s.meshMessageDeliveriesThreshold<=0)throw new q("invalid MeshMessageDeliveriesThreshold; must be positive");if(s.meshMessageDeliveriesWindow<0)throw new q("invalid MeshMessageDeliveriesWindow; must be non-negative");if(s.meshMessageDeliveriesWeight!==0&&s.meshMessageDeliveriesActivation<1e3)throw new q("invalid MeshMessageDeliveriesActivation; must be at least 1s");if(s.meshFailurePenaltyWeight>0)throw new q("invalid MeshFailurePenaltyWeight; must be negative (or 0 to disable)");if(s.meshFailurePenaltyWeight!==0&&(s.meshFailurePenaltyDecay<=0||s.meshFailurePenaltyDecay>=1))throw new q("invalid MeshFailurePenaltyDecay; must be between 0 and 1");if(s.invalidMessageDeliveriesWeight>0)throw new q("invalid InvalidMessageDeliveriesWeight; must be negative (or 0 to disable)");if(s.invalidMessageDeliveriesDecay<=0||s.invalidMessageDeliveriesDecay>=1)throw new q("invalid InvalidMessageDeliveriesDecay; must be between 0 and 1")}var Xf={gossipThreshold:-10,publishThreshold:-50,graylistThreshold:-80,acceptPXThreshold:10,opportunisticGraftThreshold:20};function rl(s={}){return{...Xf,...s}}function Dn(s,e,t=()=>!0){let r=new Set;if(e<=0)return r;for(let n of s){if(r.size>=e)break;t(n)&&(r.add(n),s.delete(n))}return r}function nl(s,e){return Dn(s,e,()=>!0)}var Pn=class extends Map{getDefault;constructor(e){super(),this.getDefault=e}getOrDefault(e){let t=super.get(e);return t===void 0&&(t=this.getDefault(),this.set(e,t)),t}};function il(s,e,t,r){let n=0;Object.entries(e.topics).forEach(([o,a])=>{let c=t.topics[o];if(c===void 0)return;let f=0;if(a.inMesh){let d=a.meshTime/c.timeInMeshQuantum;d>c.timeInMeshCap&&(d=c.timeInMeshCap),f+=d*c.timeInMeshWeight}let u=a.firstMessageDeliveries;if(u>c.firstMessageDeliveriesCap&&(u=c.firstMessageDeliveriesCap),f+=u*c.firstMessageDeliveriesWeight,a.meshMessageDeliveriesActive&&a.meshMessageDeliveries0&&n>t.topicScoreCap&&(n=t.topicScoreCap);let i=t.appSpecificScore(s);if(n+=i*t.appSpecificWeight,e.knownIPs.forEach(o=>{if(t.IPColocationFactorWhitelist.has(o))return;let a=r.get(o),c=a!=null?a.size:0;if(c>t.IPColocationFactorThreshold){let f=c-t.IPColocationFactorThreshold,u=f*f;n+=u*t.IPColocationFactorWeight}}),e.behaviourPenalty>t.behaviourPenaltyThreshold){let o=e.behaviourPenalty-t.behaviourPenaltyThreshold,a=o*o;n+=a*t.behaviourPenaltyWeight}return n}var cl=Co(al(),1);var _e;(function(s){s[s.unknown=0]="unknown",s[s.valid=1]="valid",s[s.invalid=2]="invalid",s[s.ignored=3]="ignored"})(_e||(_e={}));var Cn=class{records;queue;constructor(){this.records=new Map,this.queue=new cl.default}getRecord(e){return this.records.get(e)}ensureRecord(e){let t=this.records.get(e);if(t!=null)return t;t={status:_e.unknown,firstSeenTsMs:Date.now(),validated:0,peers:new Set},this.records.set(e,t);let r={msgId:e,expire:Date.now()+12e4};return this.queue.push(r),t}gc(){let e=Date.now(),t=this.queue.peekFront();for(;t!=null&&t.expirenew Set);scoreCache=new Map;deliveryRecords=new Cn;_backgroundInterval;scoreCacheValidityMs;computeScore;log;constructor(e,t,r,n){this.params=e,this.metrics=t,sl(e),this.scoreCacheValidityMs=n.scoreCacheValidityMs,this.computeScore=n.computeScore??il,this.log=r.forComponent("libp2p:gossipsub:score")}get size(){return this.peerStats.size}start(){if(this._backgroundInterval!=null){this.log("Peer score already running");return}this._backgroundInterval=setInterval(()=>{this.background()},this.params.decayInterval),this.log("started")}stop(){if(this._backgroundInterval==null){this.log("Peer score already stopped");return}clearInterval(this._backgroundInterval),delete this._backgroundInterval,this.peerIPs.clear(),this.peerStats.clear(),this.deliveryRecords.clear(),this.log("stopped")}background(){this.refreshScores(),this.deliveryRecords.gc()}dumpPeerScoreStats(){return Object.fromEntries(Array.from(this.peerStats.entries()).map(([e,t])=>[e,t]))}messageFirstSeenTimestampMs(e){let t=this.deliveryRecords.getRecord(e);return t!=null?t.firstSeenTsMs:null}refreshScores(){let e=Date.now(),t=this.params.decayToZero;this.peerStats.forEach((r,n)=>{if(!r.connected){e>r.expire&&(this.removeIPsForPeer(n,r.knownIPs),this.peerStats.delete(n),this.scoreCache.delete(n));return}Object.entries(r.topics).forEach(([i,o])=>{let a=this.params.topics[i];a!==void 0&&(o.firstMessageDeliveries*=a.firstMessageDeliveriesDecay,o.firstMessageDeliveriesa.meshMessageDeliveriesActivation&&(o.meshMessageDeliveriesActive=!0)))}),r.behaviourPenalty*=this.params.behaviourPenaltyDecay,r.behaviourPenaltyr)return n.score;this.metrics?.scoreFnRuns.inc();let i=this.computeScore(e,t,this.params,this.peerIPs),o=r+this.scoreCacheValidityMs;return n!=null?(this.metrics?.scoreCachedDelta.observe(Math.abs(i-n.score)),n.score=i,n.cacheUntil=o):this.scoreCache.set(e,{score:i,cacheUntil:o}),i}addPenalty(e,t,r){let n=this.peerStats.get(e);n!=null&&(n.behaviourPenalty+=t,this.metrics?.onScorePenalty(r))}addPeer(e){let t={connected:!0,expire:0,topics:{},knownIPs:new Set,behaviourPenalty:0};this.peerStats.set(e,t)}addIP(e,t){let r=this.peerStats.get(e);r?.knownIPs.add(t),this.peerIPs.getOrDefault(t).add(e)}removeIP(e,t){let r=this.peerStats.get(e);r?.knownIPs.delete(t);let n=this.peerIPs.get(t);n!=null&&(n.delete(e),n.size===0&&this.peerIPs.delete(t))}removePeer(e){let t=this.peerStats.get(e);if(t!=null){if(this.score(e)>0){this.removeIPsForPeer(e,t.knownIPs),this.peerStats.delete(e);return}Object.entries(t.topics).forEach(([r,n])=>{n.firstMessageDeliveries=0;let i=this.params.topics[r].meshMessageDeliveriesThreshold;if(n.inMesh&&n.meshMessageDeliveriesActive&&n.meshMessageDeliveries{o!==e.toString()&&this.markDuplicateMessageDelivery(o,r)})}rejectInvalidMessage(e,t){this.markInvalidMessageDelivery(e,t)}rejectMessage(e,t,r,n){switch(n){case Be.Error:this.markInvalidMessageDelivery(e,r);return;case Be.Blacklisted:return}let i=this.deliveryRecords.ensureRecord(t);if(i.status!==_e.unknown){this.log("unexpected rejection: message from %s was first seen %s ago and has delivery status %d",e,Date.now()-i.firstSeenTsMs,_e[i.status]);return}if(n===Be.Ignore){i.status=_e.ignored,i.peers.clear();return}i.status=_e.invalid,this.markInvalidMessageDelivery(e,r),i.peers.forEach(o=>{this.markInvalidMessageDelivery(o,r)}),i.peers.clear()}duplicateMessage(e,t,r){let n=this.deliveryRecords.ensureRecord(t);if(!n.peers.has(e))switch(n.status){case _e.unknown:n.peers.add(e);break;case _e.valid:n.peers.add(e),this.markDuplicateMessageDelivery(e,r,n.validated);break;case _e.invalid:this.markInvalidMessageDelivery(e,r);break;case _e.ignored:break}}markInvalidMessageDelivery(e,t){let r=this.peerStats.get(e);if(r!=null){let n=this.getPtopicStats(r,t);n!=null&&(n.invalidMessageDeliveries+=1)}}markFirstMessageDelivery(e,t){let r=this.peerStats.get(e);if(r!=null){let n=this.getPtopicStats(r,t);if(n!=null){let i=this.params.topics[t].firstMessageDeliveriesCap;n.firstMessageDeliveries=Math.min(i,n.firstMessageDeliveries+1),n.inMesh&&(i=this.params.topics[t].meshMessageDeliveriesCap,n.meshMessageDeliveries=Math.min(i,n.meshMessageDeliveries+1))}}}markDuplicateMessageDelivery(e,t,r){let n=this.peerStats.get(e);if(n!=null){let i=r!==void 0?Date.now():0,o=this.getPtopicStats(n,t);if(o!=null&&o.inMesh){let a=this.params.topics[t];if(r!==void 0){let f=i-r,u=f>a.meshMessageDeliveriesWindow;if(this.metrics?.onDuplicateMsgDelivery(t,f,u),u)return}let c=a.meshMessageDeliveriesCap;o.meshMessageDeliveries=Math.min(c,o.meshMessageDeliveries+1)}}}removeIPsForPeer(e,t){for(let r of t){let n=this.peerIPs.get(r);n!=null&&(n.delete(e),n.size===0&&this.peerIPs.delete(r))}}getPtopicStats(e,t){let r=e.topics[t];return r!==void 0?r:this.params.topics[t]!==void 0?(r={inMesh:!1,graftTime:0,meshTime:0,firstMessageDeliveries:0,meshMessageDeliveries:0,meshMessageDeliveriesActive:!1,meshFailurePenalty:0,invalidMessageDeliveries:0},e.topics[t]=r,r):null}};function Yf(s,e,t,r,n){let i=0,o=new Map;if(Object.entries(e.topics).forEach(([l,d])=>{let m=n.get(l)??"unknown",p=t.topics[l];if(p===void 0)return;let g=o.get(m);g==null&&(g={p1w:0,p2w:0,p3w:0,p3bw:0,p4w:0},o.set(m,g));let b=0,S=0,y=0,I=0,v=0;if(d.inMesh){let k=Math.max(d.meshTime/p.timeInMeshQuantum,p.timeInMeshCap);b+=k*p.timeInMeshWeight}let B=d.firstMessageDeliveries;if(B>p.firstMessageDeliveriesCap&&(B=p.firstMessageDeliveriesCap),S+=B*p.firstMessageDeliveriesWeight,d.meshMessageDeliveriesActive&&d.meshMessageDeliveries0&&i>t.topicScoreCap){i=t.topicScoreCap;let l=t.topicScoreCap/i;for(let d of o.values())d.p1w*=l,d.p2w*=l,d.p3w*=l,d.p3bw*=l,d.p4w*=l}let a=0,c=0,f=0,u=t.appSpecificScore(s);a+=u*t.appSpecificWeight,e.knownIPs.forEach(l=>{if(t.IPColocationFactorWhitelist.has(l))return;let d=r.get(l),m=d!=null?d.size:0;if(m>t.IPColocationFactorThreshold){let p=m-t.IPColocationFactorThreshold,g=p*p;c+=g*t.IPColocationFactorWeight}});let h=e.behaviourPenalty*e.behaviourPenalty;return f+=h*t.behaviourPenaltyWeight,i+=a+c+f,{byTopic:o,p5w:a,p6w:c,p7w:f,score:i}}function ll(s,e,t,r,n){let i={byTopic:new Map,p5w:[],p6w:[],p7w:[],score:[]};for(let o of s){let a=e.get(o);if(a!=null){let c=Yf(o,a,t,r,n);for(let[f,u]of c.byTopic){let h=i.byTopic.get(f);h==null&&(h={p1w:[],p2w:[],p3w:[],p3bw:[],p4w:[]},i.byTopic.set(f,h)),h.p1w.push(u.p1w),h.p2w.push(u.p2w),h.p3w.push(u.p3w),h.p3bw.push(u.p3bw),h.p4w.push(u.p4w)}i.p5w.push(c.p5w),i.p6w.push(c.p6w),i.p7w.push(c.p7w),i.score.push(c.score)}else i.p5w.push(0),i.p6w.push(0),i.p7w.push(0),i.score.push(0)}return i}var Rn=class{rawStream;pushable;closeController;maxBufferSize;constructor(e,t,r){this.rawStream=e,this.pushable=yt(),this.closeController=new AbortController,this.maxBufferSize=r.maxBufferSize??1/0,this.closeController.signal.addEventListener("abort",()=>{e.close().catch(n=>{e.abort(n)})}),Es(this.pushable,this.rawStream).catch(t)}get protocol(){return this.rawStream.protocol}push(e){if(this.pushable.readableLength>this.maxBufferSize)throw Error(`OutboundStream buffer full, size > ${this.maxBufferSize}`);this.pushable.push(vs.single(e))}pushPrefixed(e){if(this.pushable.readableLength>this.maxBufferSize)throw Error(`OutboundStream buffer full, size > ${this.maxBufferSize}`);this.pushable.push(e)}async close(){this.closeController.abort(),await this.pushable.return()}},Ln=class{source;rawStream;closeController;constructor(e,t={}){this.rawStream=e,this.closeController=new AbortController,this.closeController.signal.addEventListener("abort",()=>{e.close().catch(r=>{e.abort(r)})}),this.source=Es(this.rawStream,r=>tr(r,t))}async close(){this.closeController.abort()}};var Un=class{gossipsubIWantFollowupMs;msgIdToStrFn;metrics;promises=new Map;requestMsByMsg=new Map;requestMsByMsgExpire;constructor(e,t,r){this.gossipsubIWantFollowupMs=e,this.msgIdToStrFn=t,this.metrics=r,this.requestMsByMsgExpire=10*e}get size(){return this.promises.size}get requestMsByMsgSize(){return this.requestMsByMsg.size}addPromise(e,t){let r=Math.floor(Math.random()*t.length),n=t[r],i=this.msgIdToStrFn(n),o=this.promises.get(i);o==null&&(o=new Map,this.promises.set(i,o));let a=Date.now();o.has(e)||(o.set(e,a+this.gossipsubIWantFollowupMs),this.metrics!=null&&(this.metrics.iwantPromiseStarted.inc(1),this.requestMsByMsg.has(i)||this.requestMsByMsg.set(i,a)))}getBrokenPromises(){let e=Date.now(),t=new Map,r=0;return this.promises.forEach((n,i)=>{n.forEach((o,a)=>{oMath.floor(Math.random()*Math.floor(s.length));for(let t=0;t{let t=X(e.toString(16).padStart(16,"0"),"base16"),r=At(s),n=new Uint8Array(r.byteLength+t.length);return n.set(r,0),n.set(t,r.byteLength),n};function ml(s){if(s.type!=="signed")throw new Error("expected signed message type");if(s.sequenceNumber==null)throw Error("missing seqno field");return gl(s.from.publicKey??s.key,s.sequenceNumber)}async function bl(s){return Tt.encode(s.data)}var Fn=class{index=0;input="";new(e){return this.index=0,this.input=e,this}readAtomically(e){let t=this.index,r=e();return r===void 0&&(this.index=t),r}parseWith(e){let t=e();if(this.index===this.input.length)return t}peekChar(){if(!(this.index>=this.input.length))return this.input[this.index]}readChar(){if(!(this.index>=this.input.length))return this.input[this.index++]}readGivenChar(e){return this.readAtomically(()=>{let t=this.readChar();if(t===e)return t})}readSeparator(e,t,r){return this.readAtomically(()=>{if(!(t>0&&this.readGivenChar(e)===void 0))return r()})}readNumber(e,t,r,n){return this.readAtomically(()=>{let i=0,o=0,a=this.peekChar();if(a===void 0)return;let c=a==="0",f=2**(8*n)-1;for(;;){let u=this.readAtomically(()=>{let h=this.readChar();if(h===void 0)return;let l=Number.parseInt(h,e);if(!Number.isNaN(l))return l});if(u===void 0)break;if(i*=e,i+=u,i>f||(o+=1,t!==void 0&&o>t))return}if(o!==0)return!r&&c&&o>1?void 0:i})}readIPv4Addr(){return this.readAtomically(()=>{let e=new Uint8Array(4);for(let t=0;tthis.readNumber(10,3,!1,1));if(r===void 0)return;e[t]=r}return e})}readIPv6Addr(){let e=t=>{for(let r=0;rthis.readIPv4Addr());if(o!==void 0)return t[n]=o[0],t[n+1]=o[1],t[n+2]=o[2],t[n+3]=o[3],[n+4,!0]}let i=this.readSeparator(":",r,()=>this.readNumber(16,4,!0,2));if(i===void 0)return[n,!1];t[n]=i>>8,t[n+1]=i&255}return[t.length,!1]};return this.readAtomically(()=>{let t=new Uint8Array(16),[r,n]=e(t);if(r===16)return t;if(n||this.readGivenChar(":")===void 0||this.readGivenChar(":")===void 0)return;let i=new Uint8Array(14),o=16-(r+2),[a]=e(i.subarray(0,o));return t.set(i.subarray(0,a),16-a),t})}readIPAddr(){return this.readIPv4Addr()??this.readIPv6Addr()}};var Qf=45;var yl=new Fn;function Vn(s){if(s.includes("%")&&(s=s.split("%")[0]),!(s.length>Qf))return yl.new(s).parseWith(()=>yl.readIPAddr())}var Iw=parseInt("0xFFFF",16),_w=new Uint8Array([0,0,0,0,0,0,0,0,0,0,255,255]);function wo(s){return!!Vn(s)}var xl=function(s,e=0,t){e=~~e,t=t??s.length-e;let r=new DataView(s.buffer);if(t===4){let n=[];for(let i=0;i{let e=cd(...s);xo[e.code]=e,vo[e.name]=e});function cd(s,e,t,r,n){return{code:s,size:e,name:t,resolvable:!!r,path:!!n}}function sr(s){if(typeof s=="number"){if(xo[s]!=null)return xo[s];throw new Error(`no protocol with code: ${s}`)}else if(typeof s=="string"){if(vo[s]!=null)return vo[s];throw new Error(`no protocol with name: ${s}`)}throw new Error(`invalid protocol id type: ${typeof s}`)}var fv=sr("ip4"),dv=sr("ip6"),pv=sr("ipcidr");function Sl(s,e){switch(sr(s).code){case 4:case 41:return ld(e);case 42:return So(e);case 6:case 273:case 33:case 132:return Bl(e).toString();case 53:case 54:case 55:case 56:case 400:case 449:case 777:return So(e);case 421:return hd(e);case 444:return El(e);case 445:return El(e);case 466:return ud(e);case 481:return globalThis.encodeURIComponent(So(e));default:return $(e,"base16")}}var Eo=Object.values(Us).map(s=>s.decoder),gv=function(){let s=Eo[0].or(Eo[1]);return Eo.slice(2).forEach(e=>s=s.or(e)),s}();function ld(s){let e=xl(s,0,s.length);if(e==null)throw new Error("ipBuff is required");if(!wo(e))throw new Error("invalid ip address");return e}function Bl(s){return new DataView(s.buffer).getUint16(s.byteOffset)}function So(s){let e=us(s);if(s=s.slice(Ee(e)),s.length!==e)throw new Error("inconsistent lengths");return $(s)}function ud(s){let e=us(s),t=s.slice(Ee(e));if(t.length!==e)throw new Error("inconsistent lengths");return"u"+$(t,"base64url")}function hd(s){let e=us(s),t=s.slice(Ee(e));if(t.length!==e)throw new Error("inconsistent lengths");return $(t,"base58btc")}function El(s){let e=s.slice(0,s.length-2),t=s.slice(s.length-2),r=$(e,"base32"),n=Bl(t);return`${r}:${n}`}var Hn;(function(s){s[s.ip4=4]="ip4",s[s.ip6=41]="ip6"})(Hn||(Hn={}));function Il(s){for(let e of s.tuples())switch(e[0]){case Hn.ip4:case Hn.ip6:return Sl(e[0],e[1]);default:break}return null}var _s=class{entries=new Map;validityMs;constructor(e){this.validityMs=e.validityMs}get size(){return this.entries.size}put(e,t){return this.entries.has(e)?!0:(this.entries.set(e,{value:t,validUntilMs:Date.now()+this.validityMs}),!1)}prune(){let e=Date.now();for(let[t,r]of this.entries.entries())if(r.validUntilMs=Date.now()?t.value:void 0}clear(){this.entries.clear()}};var Ud=Tn,Le;(function(s){s[s.started=0]="started",s[s.stopped=1]="stopped"})(Le||(Le={}));var On=class extends ir{globalSignaturePolicy;multicodecs=[Tn,mo];publishConfig;dataTransform;peers=new Set;streamsInbound=new Map;streamsOutbound=new Map;outboundInflightQueue=yt({objectMode:!0});direct=new Set;floodsubPeers=new Set;seenCache;acceptFromWhitelist=new Map;topics=new Map;subscriptions=new Set;mesh=new Map;fanout=new Map;fanoutLastpub=new Map;gossip=new Map;control=new Map;peerhave=new Map;iasked=new Map;backoff=new Map;outbound=new Map;msgIdFn;fastMsgIdFn;msgIdToStrFn;fastMsgIdCache;publishedMessageIds;mcache;score;topicValidators=new Map;log;heartbeatTicks=0;gossipTracer;components;directPeerInitial=null;static multicodec=Tn;opts;decodeRpcLimits;metrics;status={code:Le.stopped};maxInboundStreams;maxOutboundStreams;runOnLimitedConnection;allowedTopics;heartbeatTimer=null;constructor(e,t={}){super();let r={fallbackToFloodsub:!0,floodPublish:!0,batchPublish:!1,tagMeshPeers:!0,doPX:!1,directPeers:[],D:6,Dlo:4,Dhi:12,Dscore:4,Dout:2,Dlazy:6,heartbeatInterval:1e3,fanoutTTL:6e4,mcacheLength:5,mcacheGossip:3,seenTTL:12e4,gossipsubIWantFollowupMs:3e3,prunePeers:16,pruneBackoff:6e4,unsubcribeBackoff:1e4,graftFloodThreshold:1e4,opportunisticGraftPeers:2,opportunisticGraftTicks:60,directConnectTicks:300,gossipFactor:.25,...t,scoreParams:tl(t.scoreParams),scoreThresholds:rl(t.scoreThresholds)};if(this.components=e,this.decodeRpcLimits=r.decodeRpcLimits??Xc,this.globalSignaturePolicy=r.globalSignaturePolicy??Ft,r.fallbackToFloodsub&&this.multicodecs.push(go),this.log=e.logger.forComponent(r.debugName??"libp2p:gossipsub"),this.opts=r,this.direct=new Set(r.directPeers.map(n=>n.id.toString())),this.seenCache=new _s({validityMs:r.seenTTL}),this.publishedMessageIds=new _s({validityMs:r.seenTTL}),t.msgIdFn!=null)this.msgIdFn=t.msgIdFn;else switch(this.globalSignaturePolicy){case Ft:this.msgIdFn=ml;break;case Xt:this.msgIdFn=bl;break;default:throw new Error(`Invalid globalSignaturePolicy: ${this.globalSignaturePolicy}`)}if(t.fastMsgIdFn!=null&&(this.fastMsgIdFn=t.fastMsgIdFn,this.fastMsgIdCache=new _s({validityMs:r.seenTTL})),this.msgIdToStrFn=t.msgIdToStrFn??dl,this.mcache=t.messageCache??new Mn(r.mcacheGossip,r.mcacheLength,this.msgIdToStrFn),t.dataTransform!=null&&(this.dataTransform=t.dataTransform),t.metricsRegister!=null){if(t.metricsTopicStrToLabel==null)throw Error("Must set metricsTopicStrToLabel with metrics");let n=Math.max(...Object.values(r.scoreParams.topics).map(o=>o.meshMessageDeliveriesWindow),1e3),i=el(t.metricsRegister,t.metricsTopicStrToLabel,{gossipPromiseExpireSec:this.opts.gossipsubIWantFollowupMs/1e3,behaviourPenaltyThreshold:r.scoreParams.behaviourPenaltyThreshold,maxMeshMessageDeliveriesWindowSec:n/1e3});i.mcacheSize.addCollect(()=>{this.onScrapeMetrics(i)});for(let o of this.multicodecs)i.protocolsEnabled.set({protocol:o},1);this.metrics=i}else this.metrics=null;this.gossipTracer=new Un(this.opts.gossipsubIWantFollowupMs,this.msgIdToStrFn,this.metrics),this.score=new Nn(this.opts.scoreParams,this.metrics,this.components.logger,{scoreCacheValidityMs:r.heartbeatInterval}),this.maxInboundStreams=t.maxInboundStreams,this.maxOutboundStreams=t.maxOutboundStreams,this.runOnLimitedConnection=t.runOnLimitedConnection,this.allowedTopics=r.allowedTopics!=null?new Set(r.allowedTopics):null}[Symbol.toStringTag]="@chainsafe/libp2p-gossipsub";[Ro]=["@libp2p/pubsub"];[Lo]=["@libp2p/identify"];getPeers(){return[...this.peers.keys()].map(e=>Lt(e))}isStarted(){return this.status.code===Le.started}async start(){if(this.isStarted())return;this.log("starting"),this.publishConfig=pl(this.globalSignaturePolicy,this.components.peerId,this.components.privateKey),this.outboundInflightQueue=yt({objectMode:!0}),Es(this.outboundInflightQueue,async i=>{for await(let{peerId:o,connection:a}of i)await this.createOutboundStream(o,a)}).catch(i=>{this.log.error("outbound inflight queue error",i)}),await Promise.all(this.opts.directPeers.map(async i=>{await this.components.peerStore.merge(i.id,{multiaddrs:i.addrs})}));let e=this.components.registrar;await Promise.all(this.multicodecs.map(async i=>e.handle(i,this.onIncomingStream.bind(this),{maxInboundStreams:this.maxInboundStreams,maxOutboundStreams:this.maxOutboundStreams,runOnLimitedConnection:this.runOnLimitedConnection})));let t={onConnect:this.onPeerConnected.bind(this),onDisconnect:this.onPeerDisconnected.bind(this),notifyOnLimitedConnection:this.runOnLimitedConnection},r=await Promise.all(this.multicodecs.map(async i=>e.register(i,t))),n=setTimeout(this.runHeartbeat,100);this.status={code:Le.started,registrarTopologyIds:r,heartbeatTimeout:n,hearbeatStartMs:Date.now()+100},this.score.start(),this.directPeerInitial=setTimeout(()=>{Promise.resolve().then(async()=>{await Promise.all(Array.from(this.direct).map(async i=>this.connect(i)))}).catch(i=>{this.log(i)})},1e3),this.opts.tagMeshPeers&&(this.addEventListener("gossipsub:graft",this.tagMeshPeer),this.addEventListener("gossipsub:prune",this.untagMeshPeer)),this.log("started")}async stop(){if(this.log("stopping"),this.status.code!==Le.started)return;let{registrarTopologyIds:e}=this.status;this.status={code:Le.stopped},this.opts.tagMeshPeers&&(this.removeEventListener("gossipsub:graft",this.tagMeshPeer),this.removeEventListener("gossipsub:prune",this.untagMeshPeer));let t=this.components.registrar;await Promise.all(this.multicodecs.map(async n=>t.unhandle(n))),e.forEach(n=>{t.unregister(n)}),this.outboundInflightQueue.end();let r=[];for(let n of this.streamsOutbound.values())r.push(n.close());this.streamsOutbound.clear();for(let n of this.streamsInbound.values())r.push(n.close());this.streamsInbound.clear(),await Promise.all(r),this.peers.clear(),this.subscriptions.clear(),this.heartbeatTimer!=null&&(this.heartbeatTimer.cancel(),this.heartbeatTimer=null),this.score.stop(),this.mesh.clear(),this.fanout.clear(),this.fanoutLastpub.clear(),this.gossip.clear(),this.control.clear(),this.peerhave.clear(),this.iasked.clear(),this.backoff.clear(),this.outbound.clear(),this.gossipTracer.clear(),this.seenCache.clear(),this.fastMsgIdCache!=null&&this.fastMsgIdCache.clear(),this.directPeerInitial!=null&&clearTimeout(this.directPeerInitial),this.log("stopped")}dumpPeerScoreStats(){return this.score.dumpPeerScoreStats()}onIncomingStream({stream:e,connection:t}){if(!this.isStarted())return;let r=t.remotePeer;this.addPeer(r,t.direction,t.remoteAddr),this.createInboundStream(r,e),this.outboundInflightQueue.push({peerId:r,connection:t})}onPeerConnected(e,t){this.metrics?.newConnectionCount.inc({status:t.status}),!(!this.isStarted()||t.status!=="open")&&(this.addPeer(e,t.direction,t.remoteAddr),this.outboundInflightQueue.push({peerId:e,connection:t}))}onPeerDisconnected(e){this.log("connection ended %p",e),this.removePeer(e)}async createOutboundStream(e,t){if(!this.isStarted())return;let r=e.toString();if(this.peers.has(r)&&!this.streamsOutbound.has(r))try{let n=new Rn(await t.newStream(this.multicodecs,{runOnLimitedConnection:this.runOnLimitedConnection}),o=>{this.log.error("outbound pipe error",o)},{maxBufferSize:this.opts.maxOutboundBufferSize});this.log("create outbound stream %p",e),this.streamsOutbound.set(r,n);let i=n.protocol;i===go&&this.floodsubPeers.add(r),this.metrics?.peersPerProtocol.inc({protocol:i},1),this.subscriptions.size>0&&(this.log("send subscriptions to",r),this.sendSubscriptions(r,Array.from(this.subscriptions),!0))}catch(n){this.log.error("createOutboundStream error",n)}}createInboundStream(e,t){if(!this.isStarted())return;let r=e.toString();if(!this.peers.has(r))return;let n=this.streamsInbound.get(r);n!==void 0&&(this.log("replacing existing inbound steam %s",r),n.close().catch(o=>{this.log.error(o)})),this.log("create inbound stream %s",r);let i=new Ln(t,{maxDataLength:this.opts.maxInboundDataLength});this.streamsInbound.set(r,i),this.pipePeerReadStream(e,i.source).catch(o=>{this.log(o)})}addPeer(e,t,r){let n=e.toString();if(!this.peers.has(n)){this.log("new peer %p",e),this.peers.add(n),this.score.addPeer(n);let i=Il(r);i!==null?this.score.addIP(n,i):this.log("Added peer has no IP in current address %s %s",n,r.toString()),this.outbound.has(n)||this.outbound.set(n,t==="outbound")}}removePeer(e){let t=e.toString();if(!this.peers.has(t))return;this.log("delete peer %p",e),this.peers.delete(t);let r=this.streamsOutbound.get(t),n=this.streamsInbound.get(t);r!=null&&this.metrics?.peersPerProtocol.inc({protocol:r.protocol},-1),r?.close().catch(i=>{this.log.error(i)}),n?.close().catch(i=>{this.log.error(i)}),this.streamsOutbound.delete(t),this.streamsInbound.delete(t);for(let i of this.topics.values())i.delete(t);for(let[i,o]of this.mesh)o.delete(t)&&this.metrics?.onRemoveFromMesh(i,$e.Dc,1);for(let i of this.fanout.values())i.delete(t);this.floodsubPeers.delete(t),this.gossip.delete(t),this.control.delete(t),this.outbound.delete(t),this.score.removePeer(t),this.acceptFromWhitelist.delete(t)}get started(){return this.status.code===Le.started}getMeshPeers(e){let t=this.mesh.get(e);return t!=null?Array.from(t):[]}getSubscribers(e){let t=this.topics.get(e);return(t!=null?Array.from(t):[]).map(r=>Lt(r))}getTopics(){return Array.from(this.subscriptions)}async pipePeerReadStream(e,t){try{await Es(t,async r=>{for await(let n of r)try{let i=n.subarray(),o=wt.decode(i,{limits:{subscriptions:this.decodeRpcLimits.maxSubscriptions,messages:this.decodeRpcLimits.maxMessages,control$:{ihave:this.decodeRpcLimits.maxIhaveMessageIDs,iwant:this.decodeRpcLimits.maxIwantMessageIDs,graft:this.decodeRpcLimits.maxControlMessages,prune:this.decodeRpcLimits.maxControlMessages,prune$:{peers:this.decodeRpcLimits.maxPeerInfos}}}});if(this.metrics?.onRpcRecv(o,i.length),this.opts.awaitRpcHandler)try{await this.handleReceivedRpc(e,o)}catch(a){this.metrics?.onRpcRecvError(),this.log(a)}else this.handleReceivedRpc(e,o).catch(a=>{this.metrics?.onRpcRecvError(),this.log(a)})}catch(i){this.metrics?.onRpcDataError(),this.log(i)}})}catch(r){this.metrics?.onPeerReadStreamError(),this.handlePeerReadStreamError(r,e)}}handlePeerReadStreamError(e,t){this.log.error(e),this.onPeerDisconnected(t)}async handleReceivedRpc(e,t){if(!this.acceptFrom(e.toString())){this.log("received message from unacceptable peer %p",e),this.metrics?.rpcRecvNotAccepted.inc();return}let r=t.subscriptions!=null?t.subscriptions.length:0,n=t.messages!=null?t.messages.length:0,i=0,o=0,a=0,c=0;if(t.control!=null&&(t.control.ihave!=null&&(i=t.control.ihave.length),t.control.iwant!=null&&(o=t.control.iwant.length),t.control.graft!=null&&(a=t.control.graft.length),t.control.prune!=null&&(c=t.control.prune.length)),this.log(`rpc.from ${e.toString()} subscriptions ${r} messages ${n} ihave ${i} iwant ${o} graft ${a} prune ${c}`),t.subscriptions!=null&&t.subscriptions.length>0){let f=[];t.subscriptions.forEach(u=>{let h=u.topic,l=u.subscribe===!0;if(h!=null){if(this.allowedTopics!=null&&!this.allowedTopics.has(h))return;this.handleReceivedSubscription(e,h,l),f.push({topic:h,subscribe:l})}}),this.safeDispatchEvent("subscription-change",{detail:{peerId:e,subscriptions:f}})}for(let f of t.messages){if(this.allowedTopics!=null&&!this.allowedTopics.has(f.topic))continue;let u=this.handleReceivedMessage(e,f).catch(h=>{this.metrics?.onMsgRecvError(f.topic),this.log(h)});this.opts.awaitRpcMessageHandler&&await u}t.control!=null&&await this.handleControlMessage(e.toString(),t.control)}handleReceivedSubscription(e,t,r){this.log("subscription update from %p topic %s",e,t);let n=this.topics.get(t);n==null&&(n=new Set,this.topics.set(t,n)),r?n.add(e.toString()):n.delete(e.toString())}async handleReceivedMessage(e,t){this.metrics?.onMsgRecvPreValidation(t.topic);let r=await this.validateReceivedMessage(e,t);this.metrics?.onPrevalidationResult(t.topic,r.code);let n=r.code;switch(n){case ye.duplicate:this.score.duplicateMessage(e.toString(),r.msgIdStr,t.topic),this.gossipTracer.deliverMessage(r.msgIdStr,!0),this.mcache.observeDuplicate(r.msgIdStr,e.toString());return;case ye.invalid:if(r.msgIdStr!=null){let i=r.msgIdStr;this.score.rejectMessage(e.toString(),i,t.topic,r.reason),this.gossipTracer.rejectMessage(i,r.reason)}else this.score.rejectInvalidMessage(e.toString(),t.topic);this.metrics?.onMsgRecvInvalid(t.topic,r);return;case ye.valid:this.score.validateMessage(r.messageId.msgIdStr),this.gossipTracer.deliverMessage(r.messageId.msgIdStr),this.mcache.put(r.messageId,t,!this.opts.asyncValidation),this.subscriptions.has(t.topic)&&(!this.components.peerId.equals(e)||this.opts.emitSelf)&&(super.dispatchEvent(new CustomEvent("gossipsub:message",{detail:{propagationSource:e,msgId:r.messageId.msgIdStr,msg:r.msg}})),super.dispatchEvent(new CustomEvent("message",{detail:r.msg}))),this.opts.asyncValidation||this.forwardMessage(r.messageId.msgIdStr,t,e.toString());break;default:throw new Error(`Invalid validation result: ${n}`)}}async validateReceivedMessage(e,t){let r=this.fastMsgIdFn?.(t),n=r!==void 0?this.fastMsgIdCache?.get(r):void 0;if(n!=null)return{code:ye.duplicate,msgIdStr:n};let i=await fl(this.globalSignaturePolicy,t);if(!i.valid)return{code:ye.invalid,reason:Be.Error,error:i.error};let o=i.message;try{this.dataTransform!=null&&(o.data=this.dataTransform.inboundTransform(t.topic,o.data))}catch(h){return this.log("Invalid message, transform failed",h),{code:ye.invalid,reason:Be.Error,error:be.TransformFailed}}let a=await this.msgIdFn(o),c=this.msgIdToStrFn(a),f={msgId:a,msgIdStr:c};if(r!==void 0&&this.fastMsgIdCache!=null&&this.fastMsgIdCache.put(r,c)&&this.metrics?.fastMsgIdCacheCollision.inc(),this.seenCache.has(c))return{code:ye.duplicate,msgIdStr:c};this.seenCache.put(c);let u=this.topicValidators.get(t.topic);if(u!=null){let h;try{h=await u(e,o)}catch(l){let d=l.code;d===Jc&&(h=xe.Ignore),d===Zc?h=xe.Reject:h=xe.Ignore}if(h!==xe.Accept)return{code:ye.invalid,reason:bo(h),msgIdStr:c}}return{code:ye.valid,messageId:f,msg:o}}getScore(e){return this.score.score(e)}sendSubscriptions(e,t,r){this.sendRpc(e,{subscriptions:t.map(n=>({topic:n,subscribe:r})),messages:[]})}async handleControlMessage(e,t){if(t===void 0)return;let r=t.ihave!=null?this.handleIHave(e,t.ihave):[],n=t.iwant!=null?this.handleIWant(e,t.iwant):[],i=t.graft!=null?await this.handleGraft(e,t.graft):[];if(t.prune!=null&&await this.handlePrune(e,t.prune),r.length===0&&n.length===0&&i.length===0)return;let o=this.sendRpc(e,et(n,{iwant:r,prune:i})),a=r[0]?.messageIDs;a!=null&&(o?this.gossipTracer.addPromise(e,a):this.metrics?.iwantPromiseUntracked.inc(1))}acceptFrom(e){if(this.direct.has(e))return!0;let t=Date.now(),r=this.acceptFromWhitelist.get(e);if(r!=null&&r.messagesAccepted<128&&r.acceptUntil>=t)return r.messagesAccepted+=1,!0;let n=this.score.score(e);return n>=0?this.acceptFromWhitelist.set(e,{messagesAccepted:0,acceptUntil:t+1e3}):this.acceptFromWhitelist.delete(e),n>=this.opts.scoreThresholds.graylistThreshold}handleIHave(e,t){if(t.length===0)return[];let r=this.score.score(e);if(r10)return this.log("IHAVE: peer %s has advertised too many times (%d) within this heartbeat interval; ignoring",e,n),this.metrics?.ihaveRcvIgnored.inc({reason:Is.MaxIhave}),[];let i=this.iasked.get(e)??0;if(i>=5e3)return this.log("IHAVE: peer %s has already advertised too many messages (%d); ignoring",e,i),this.metrics?.ihaveRcvIgnored.inc({reason:Is.MaxIasked}),[];let o=new Map;if(t.forEach(({topicID:f,messageIDs:u})=>{if(f==null||u==null||!this.mesh.has(f))return;let h=0;u.forEach(l=>{let d=this.msgIdToStrFn(l);this.seenCache.has(d)||(o.set(d,l),h++)}),this.metrics?.onIhaveRcv(f,u.length,h)}),o.size===0)return[];let a=o.size;a+i>5e3&&(a=5e3-i),this.log("IHAVE: Asking for %d out of %d messages from %s",a,o.size,e);let c=Array.from(o.values());return tt(c),c=c.slice(0,a),this.iasked.set(e,i+a),[{messageIDs:c}]}handleIWant(e,t){if(t.length===0)return[];let r=this.score.score(e);if(r{a?.forEach(c=>{let f=this.msgIdToStrFn(c),u=this.mcache.getWithIWantCount(f,e);if(u==null){o++;return}if(i.set(u.msg.topic,1+(i.get(u.msg.topic)??0)),u.count>3){this.log("IWANT: Peer %s has asked for message %s too many times: ignoring request",e,c);return}n.set(f,u.msg)})}),this.metrics?.onIwantRcv(i,o),n.size===0?(this.log("IWANT: Could not provide any wanted messages to %s",e),[]):(this.log("IWANT: Sending %d messages to %s",n.size,e),Array.from(n.values()))}async handleGraft(e,t){let r=[],n=this.score.score(e),i=Date.now(),o=this.opts.doPX;if(t.forEach(({topicID:c})=>{if(c==null)return;let f=this.mesh.get(c);if(f==null){o=!1;return}if(f.has(e))return;let u=this.backoff.get(c)?.get(e);if(this.direct.has(e))this.log("GRAFT: ignoring request from direct peer %s",e),r.push(c),o=!1;else if(typeof u=="number"&&i=this.opts.Dhi&&!(this.outbound.get(e)??!1)?(r.push(c),this.addBackoff(e,c)):(this.log("GRAFT: Add mesh link from %s in %s",e,c),this.score.graft(e,c),f.add(e),this.metrics?.onAddToMesh(c,Ie.Subscribed,1));this.safeDispatchEvent("gossipsub:graft",{detail:{peerId:e,topic:c,direction:"inbound"}})}),r.length===0)return[];let a=!1;return Promise.all(r.map(async c=>this.makePrune(e,c,o,a)))}async handlePrune(e,t){let r=this.score.score(e);for(let{topicID:n,backoff:i,peers:o}of t){if(n==null)continue;let a=this.mesh.get(n);if(a==null)return;this.log("PRUNE: Remove mesh link to %s in %s",e,n),this.score.prune(e,n),a.has(e)&&(a.delete(e),this.metrics?.onRemoveFromMesh(n,$e.Prune,1)),typeof i=="number"&&i>0?this.doAddBackoff(e,n,i*1e3):this.addBackoff(e,n),o!=null&&o.length>0&&(r{this.log("peer %s didn't follow up in %d IWANT requests; adding penalty",t,e),this.score.addPenalty(t,e,Bs.BrokenPromise)})}clearBackoff(){if(this.heartbeatTicks%15!==0)return;let e=Date.now();this.backoff.forEach((t,r)=>{t.forEach((n,i)=>{n+1*this.opts.heartbeatInterval{this.streamsOutbound.has(t)||e.push(t)}),await Promise.all(e.map(async t=>this.connect(t)))}async pxConnect(e){e.length>this.opts.prunePeers&&(tt(e),e=e.slice(0,this.opts.prunePeers));let t=[];await Promise.all(e.map(async r=>{if(r.peerID==null)return;let n=Qs(Oe(r.peerID)),i=n.toString();if(!this.peers.has(i)){if(r.signedPeerRecord==null){t.push(i);return}try{if(!await this.components.peerStore.consumePeerRecord(r.signedPeerRecord,n)){this.log("bogus peer record obtained through px: could not add peer record to address book");return}t.push(i)}catch{this.log("bogus peer record obtained through px: invalid signature or not a peer record")}}})),t.length!==0&&await Promise.all(t.map(async r=>this.connect(r)))}async connect(e){this.log("Initiating connection with %s",e);let t=Lt(e),r=await this.components.connectionManager.openConnection(t);for(let n of this.multicodecs)for(let i of this.components.registrar.getTopologies(n))i.onConnect?.(t,r)}subscribe(e){if(this.status.code!==Le.started)throw new Error("Pubsub has not started");if(!this.subscriptions.has(e)){this.subscriptions.add(e);for(let t of this.peers.keys())this.sendSubscriptions(t,[e],!0)}this.join(e)}unsubscribe(e){if(this.status.code!==Le.started)throw new Error("Pubsub is not started");let t=this.subscriptions.delete(e);if(this.log("unsubscribe from %s - am subscribed %s",e,t),t)for(let r of this.peers.keys())this.sendSubscriptions(r,[e],!1);this.leave(e)}join(e){if(this.status.code!==Le.started)throw new Error("Gossipsub has not started");if(this.mesh.has(e))return;this.log("JOIN %s",e),this.metrics?.onJoin(e);let t=new Set,r=this.backoff.get(e),n=this.fanout.get(e);if(n!=null&&(this.fanout.delete(e),this.fanoutLastpub.delete(e),n.forEach(i=>{!this.direct.has(i)&&this.score.score(i)>=0&&(r==null||!r.has(i))&&t.add(i)}),this.metrics?.onAddToMesh(e,Ie.Fanout,t.size)),t.size!t.has(a)&&!this.direct.has(a)&&this.score.score(a)>=0&&(r==null||!r.has(a))).forEach(a=>{t.add(a)}),this.metrics?.onAddToMesh(e,Ie.Random,t.size-i)}this.mesh.set(e,t),t.forEach(i=>{this.log("JOIN: Add mesh link to %s in %s",i,e),this.sendGraft(i,e)})}leave(e){if(this.status.code!==Le.started)throw new Error("Gossipsub has not started");this.log("LEAVE %s",e),this.metrics?.onLeave(e);let t=this.mesh.get(e);t!=null&&(Promise.all(Array.from(t).map(async r=>{this.log("LEAVE: Remove mesh link to %s in %s",r,e),await this.sendPrune(r,e)})).catch(r=>{this.log("Error sending prunes to mesh peers",r)}),this.mesh.delete(e))}selectPeersToForward(e,t,r){let n=new Set,i=this.topics.get(e);i!=null&&(this.direct.forEach(a=>{i.has(a)&&t!==a&&!(r?.has(a)??!1)&&n.add(a)}),this.floodsubPeers.forEach(a=>{i.has(a)&&t!==a&&!(r?.has(a)??!1)&&this.score.score(a)>=this.opts.scoreThresholds.publishThreshold&&n.add(a)}));let o=this.mesh.get(e);return o!=null&&o.size>0&&o.forEach(a=>{t!==a&&!(r?.has(a)??!1)&&n.add(a)}),n}selectPeersToPublish(e){let t=new Set,r={direct:0,floodsub:0,mesh:0,fanout:0},n=this.topics.get(e);if(n!=null)if(this.opts.floodPublish)n.forEach(i=>{this.direct.has(i)?(t.add(i),r.direct++):this.score.score(i)>=this.opts.scoreThresholds.publishThreshold&&(t.add(i),r.floodsub++)});else{this.direct.forEach(o=>{n.has(o)&&(t.add(o),r.direct++)}),this.floodsubPeers.forEach(o=>{n.has(o)&&this.score.score(o)>=this.opts.scoreThresholds.publishThreshold&&(t.add(o),r.floodsub++)});let i=this.mesh.get(e);if(i!=null&&i.size>0)i.forEach(o=>{t.add(o),r.mesh++}),i.size!i.has(a)&&!this.direct.has(a)&&!this.floodsubPeers.has(a)&&this.score.score(a)>=this.opts.scoreThresholds.publishThreshold).forEach(a=>{t.add(a),r.mesh++});else{let o=this.fanout.get(e);if(o!=null&&o.size>0)o.forEach(a=>{t.add(a),r.fanout++});else{let a=this.getRandomGossipPeers(e,this.opts.D,c=>this.score.score(c)>=this.opts.scoreThresholds.publishThreshold);a.size>0&&(this.fanout.set(e,a),a.forEach(c=>{t.add(c),r.fanout++}))}this.fanoutLastpub.set(e,Date.now())}}return{tosend:t,tosendCount:r}}forwardMessage(e,t,r,n){r!=null&&this.score.deliverMessage(r,e,t.topic);let i=this.selectPeersToForward(t.topic,r,n);i.forEach(o=>{this.sendRpc(o,et([t]))}),this.metrics?.onForwardMsg(t.topic,i.size)}async publish(e,t,r){let n=Date.now(),i=this.dataTransform!=null?this.dataTransform.outboundTransform(e,t):t;if(this.publishConfig==null)throw Error("PublishError.Uninitialized");let{raw:o,msg:a}=await hl(this.publishConfig,e,t,i),c=await this.msgIdFn(a),f=this.msgIdToStrFn(c),u=r?.ignoreDuplicatePublishError??this.opts.ignoreDuplicatePublishError;if(this.seenCache.has(f)){if(u)return this.metrics?.onPublishDuplicateMsg(e),{recipients:[]};throw Error("PublishError.Duplicate")}let{tosend:h,tosendCount:l}=this.selectPeersToPublish(e),d=this.opts.emitSelf&&this.subscriptions.has(e),m=r?.allowPublishToZeroTopicPeers??this.opts.allowPublishToZeroTopicPeers;if(h.size===0&&!m&&!d)throw Error("PublishError.NoPeersSubscribedToTopic");this.seenCache.put(f),this.mcache.put({msgId:c,msgIdStr:f},o,!0),this.publishedMessageIds.put(f);let p=r?.batchPublish??this.opts.batchPublish,g=et([o]);if(p)this.sendRpcInBatch(h,g);else for(let S of h)this.sendRpc(S,g)||h.delete(S);let b=Date.now()-n;return this.metrics?.onPublishMsg(e,l,h.size,o.data!=null?o.data.length:0,b),d&&(h.add(this.components.peerId.toString()),super.dispatchEvent(new CustomEvent("gossipsub:message",{detail:{propagationSource:this.components.peerId,msgId:f,msg:a}})),super.dispatchEvent(new CustomEvent("message",{detail:a}))),{recipients:Array.from(h.values()).map(S=>Lt(S))}}sendRpcInBatch(e,t){let r=wt.encode(t),n=vs.single(r);for(let i of e){let o=this.streamsOutbound.get(i);if(o==null){this.log(`Cannot send RPC to ${i} as there is no open stream to it available`),e.delete(i);continue}try{o.pushPrefixed(n)}catch(a){e.delete(i),this.log.error(`Cannot send rpc to ${i}`,a)}this.metrics?.onRpcSent(t,r.length)}}reportMessageValidationResult(e,t,r){let n;if(r===xe.Accept){if(n=this.mcache.validate(e),n!=null){let{message:o,originatingPeers:a}=n;this.score.deliverMessage(t,e,o.topic),this.forwardMessage(e,n.message,t,a)}}else if(n=this.mcache.remove(e),n!=null){let o=bo(r),{message:a,originatingPeers:c}=n;this.score.rejectMessage(t,e,a.topic,o);for(let f of c)this.score.rejectMessage(f,e,a.topic,o)}let i=this.score.messageFirstSeenTimestampMs(e);this.metrics?.onReportValidation(n,r,i)}sendGraft(e,t){let n=et([],{graft:[{topicID:t}]});this.sendRpc(e,n)}async sendPrune(e,t){let n=[await this.makePrune(e,t,this.opts.doPX,!0)],i=et([],{prune:n});this.sendRpc(e,i)}sendRpc(e,t){let r=this.streamsOutbound.get(e);if(r==null)return this.log(`Cannot send RPC to ${e} as there is no open stream to it available`),!1;let n=this.control.get(e);n!=null&&(this.piggybackControl(e,t,n),this.control.delete(e));let i=this.gossip.get(e);i!=null&&(this.piggybackGossip(e,t,i),this.gossip.delete(e));let o=wt.encode(t);try{r.push(o)}catch(a){return this.log.error(`Cannot send rpc to ${e}`,a),n!=null&&this.control.set(e,n),i!=null&&this.gossip.set(e,i),!1}if(this.metrics?.onRpcSent(t,o.length),t.control?.graft!=null)for(let a of t.control?.graft)a.topicID!=null&&this.safeDispatchEvent("gossipsub:graft",{detail:{peerId:e,topic:a.topicID,direction:"outbound"}});if(t.control?.prune!=null)for(let a of t.control?.prune)a.topicID!=null&&this.safeDispatchEvent("gossipsub:prune",{detail:{peerId:e,topic:a.topicID,direction:"outbound"}});return!0}piggybackControl(e,t,r){let n=yo(t);for(let i of r.graft)i.topicID!=null&&(this.mesh.get(i.topicID)?.has(e)??!1)&&n.control.graft.push(i);for(let i of r.prune)i.topicID!=null&&!(this.mesh.get(i.topicID)?.has(e)??!1)&&n.control.prune.push(i)}piggybackGossip(e,t,r){let n=yo(t);n.control.ihave=r}async sendGraftPrune(e,t,r){let n=this.opts.doPX,i=!1;for(let[o,a]of e){let c=a.map(h=>({topicID:h})),f=[],u=t.get(o);u!=null&&(f=await Promise.all(u.map(async h=>this.makePrune(o,h,n&&!(r.get(o)??!1),i))),t.delete(o)),this.sendRpc(o,et([],{graft:c,prune:f}))}for(let[o,a]of t){let c=await Promise.all(a.map(async f=>this.makePrune(o,f,n&&!(r.get(o)??!1),i)));this.sendRpc(o,et([],{prune:c}))}}emitGossip(e){let t=this.mcache.getGossipIDs(new Set(e.keys()));for(let[r,n]of e)this.doEmitGossip(r,n,t.get(r)??[])}doEmitGossip(e,t,r){if(r.length===0||(tt(r),r.length>5e3&&this.log("too many messages for gossip; will truncate IHAVE list (%d messages)",r.length),t.size===0))return;let n=this.opts.Dlazy,o=this.opts.gossipFactor*t.size,a=t;o>n&&(n=o),n>a.size?n=a.size:a=tt(Array.from(a)).slice(0,n),a.forEach(c=>{let f=r;r.length>5e3&&(f=tt(f.slice()).slice(0,5e3)),this.pushGossip(c,{topicID:e,messageIDs:f})})}flush(){for(let[e,t]of this.gossip.entries())this.gossip.delete(e),this.sendRpc(e,et([],{ihave:t}));for(let[e,t]of this.control.entries()){this.control.delete(e);let r=et([],{graft:t.graft,prune:t.prune});this.sendRpc(e,r)}}pushGossip(e,t){this.log("Add gossip to %s",e);let r=this.gossip.get(e)??[];this.gossip.set(e,r.concat(t))}async makePrune(e,t,r,n){if(this.score.prune(e,t),this.streamsOutbound.get(e)?.protocol===mo)return{topicID:t,peers:[]};let i=n?this.opts.unsubcribeBackoff:this.opts.pruneBackoff,o=i/1e3;if(this.doAddBackoff(e,t,i),!r)return{topicID:t,peers:[],backoff:o};let a=this.getRandomGossipPeers(t,this.opts.prunePeers,f=>f!==e&&this.score.score(f)>=0),c=await Promise.all(Array.from(a).map(async f=>{let u=Lt(f),h;try{h=await this.components.peerStore.get(u)}catch(l){if(l.name!=="NotFoundError")throw l}return{peerID:u.toMultihash().bytes,signedPeerRecord:h?.peerRecordEnvelope}}));return{topicID:t,peers:c,backoff:o}}runHeartbeat=()=>{let e=this.metrics?.heartbeatDuration.startTimer();this.heartbeat().catch(t=>{this.log("Error running heartbeat",t)}).finally(()=>{if(e?.(),this.status.code===Le.started){clearTimeout(this.status.heartbeatTimeout);let t=this.opts.heartbeatInterval-(Date.now()-this.status.hearbeatStartMs)%this.opts.heartbeatInterval;t{let p=a.get(m);return p===void 0&&(p=this.score.score(m),a.set(m,p)),p},f=new Map,u=new Map,h=new Map;this.clearBackoff(),this.peerhave.clear(),this.metrics?.cacheSize.set({cache:"iasked"},this.iasked.size),this.iasked.clear(),this.applyIwantPenalties(),this.heartbeatTicks%this.opts.directConnectTicks===0&&await this.directConnect(),this.fastMsgIdCache?.prune(),this.seenCache.prune(),this.gossipTracer.prune(),this.publishedMessageIds.prune();let l=new Map;this.mesh.forEach((m,p)=>{let g=this.topics.get(p),b=new Set,S=new Set;if(l.set(p,S),g!=null){let v=tt(Array.from(g)),B=this.backoff.get(p);for(let x of v){let _=this.streamsOutbound.get(x);if(_!=null&&this.multicodecs.includes(_.protocol)&&!m.has(x)&&!this.direct.has(x)){let k=c(x);(B==null||!B.has(x))&&k>=0&&b.add(x),k>=this.opts.scoreThresholds.gossipThreshold&&S.add(x)}}}let y=(v,B)=>{this.log("HEARTBEAT: Remove mesh link to %s in %s",v,p),this.addBackoff(v,p),m.delete(v),c(v)>=this.opts.scoreThresholds.gossipThreshold&&S.add(v),this.metrics?.onRemoveFromMesh(p,B,1);let x=u.get(v);x==null?u.set(v,[p]):x.push(p)},I=(v,B)=>{this.log("HEARTBEAT: Add mesh link to %s in %s",v,p),this.score.graft(v,p),m.add(v),S.delete(v),this.metrics?.onAddToMesh(p,B,1);let x=f.get(v);x==null?f.set(v,[p]):x.push(p)};if(m.forEach(v=>{let B=c(v);B<0&&(this.log("HEARTBEAT: Prune peer %s with negative score: score=%d, topic=%s",v,B,p),y(v,$e.BadScore),h.set(v,!0))}),m.size{I(x,Ie.NotEnough)})}if(m.size>r){let v=Array.from(m);v.sort((x,_)=>c(_)-c(x)),v=v.slice(0,n).concat(tt(v.slice(n)));let B=0;if(v.slice(0,e).forEach(x=>{(this.outbound.get(x)??!1)&&B++}),B{let z=v[k];for(let L=k;L>0;L--)v[L]=v[L-1];v[0]=z};if(B>0){let k=B;for(let z=1;z0;z++)(this.outbound.get(v[z])??!1)&&(x(z),k--)}let _=e-B;for(let k=e;k0;k++)(this.outbound.get(v[k])??!1)&&(x(k),_--)}v.slice(e).forEach(x=>{y(x,$e.Excess)})}if(m.size>=t){let v=0;if(m.forEach(B=>{(this.outbound.get(B)??!1)&&v++}),vthis.outbound.get(_)===!0).forEach(_=>{I(_,Ie.Outbound)})}}if(this.heartbeatTicks%this.opts.opportunisticGraftTicks===0&&m.size>1){let v=Array.from(m).sort((_,k)=>c(_)-c(k)),B=Math.floor(m.size/2),x=c(v[B]);if(xc(z)>x);for(let z of k)this.log("HEARTBEAT: Opportunistically graft peer %s on topic %s",z,p),I(z,Ie.Opportunistic)}}});let d=Date.now();this.fanoutLastpub.forEach((m,p)=>{m+o{let g=this.topics.get(p);m.forEach(I=>{(!(g?.has(I)??!1)||c(I)=this.opts.scoreThresholds.publishThreshold&&S.push(v),x>=this.opts.scoreThresholds.gossipThreshold&&y.add(v)}}}if(m.size{m.add(v),y?.delete(v)})}}),this.emitGossip(l),await this.sendGraftPrune(f,u,h),this.flush(),this.mcache.shift(),this.dispatchEvent(new CustomEvent("gossipsub:heartbeat"))}getRandomGossipPeers(e,t,r=()=>!0){let n=this.topics.get(e);if(n==null)return new Set;let i=[];return n.forEach(o=>{let a=this.streamsOutbound.get(o);a!=null&&this.multicodecs.includes(a.protocol)&&r(o)&&i.push(o)}),i=tt(i),t>0&&i.length>t&&(i=i.slice(0,t)),new Set(i)}onScrapeMetrics(e){e.mcacheSize.set(this.mcache.size),e.mcacheNotValidatedCount.set(this.mcache.notValidatedCount),e.cacheSize.set({cache:"direct"},this.direct.size),e.cacheSize.set({cache:"seenCache"},this.seenCache.size),e.cacheSize.set({cache:"fastMsgIdCache"},this.fastMsgIdCache?.size??0),e.cacheSize.set({cache:"publishedMessageIds"},this.publishedMessageIds.size),e.cacheSize.set({cache:"mcache"},this.mcache.size),e.cacheSize.set({cache:"score"},this.score.size),e.cacheSize.set({cache:"gossipTracer.promises"},this.gossipTracer.size),e.cacheSize.set({cache:"gossipTracer.requests"},this.gossipTracer.requestMsByMsgSize),e.cacheSize.set({cache:"topics"},this.topics.size),e.cacheSize.set({cache:"subscriptions"},this.subscriptions.size),e.cacheSize.set({cache:"mesh"},this.mesh.size),e.cacheSize.set({cache:"fanout"},this.fanout.size),e.cacheSize.set({cache:"peers"},this.peers.size),e.cacheSize.set({cache:"streamsOutbound"},this.streamsOutbound.size),e.cacheSize.set({cache:"streamsInbound"},this.streamsInbound.size),e.cacheSize.set({cache:"acceptFromWhitelist"},this.acceptFromWhitelist.size),e.cacheSize.set({cache:"gossip"},this.gossip.size),e.cacheSize.set({cache:"control"},this.control.size),e.cacheSize.set({cache:"peerhave"},this.peerhave.size),e.cacheSize.set({cache:"outbound"},this.outbound.size);let t=0,r=Date.now();e.connectedPeersBackoffSec.reset();for(let a of this.backoff.values()){t+=a.size;for(let[c,f]of a.entries())this.peers.has(c)&&e.connectedPeersBackoffSec.observe(Math.max(0,f-r)/1e3)}e.cacheSize.set({cache:"backoff"},t);for(let[a,c]of this.topics)e.topicPeersCount.set({topicStr:a},c.size);for(let[a,c]of this.mesh)e.meshPeerCounts.set({topicStr:a},c.size);let n=[],i=new Map;e.behaviourPenalty.reset();for(let a of this.peers.keys()){let c=this.score.score(a);n.push(c),i.set(a,c),e.behaviourPenalty.observe(this.score.peerStats.get(a)?.behaviourPenalty??0)}e.registerScores(n,this.opts.scoreThresholds),e.registerScorePerMesh(this.mesh,i);let o=ll(this.peers.keys(),this.score.peerStats,this.score.params,this.score.peerIPs,e.topicStrToLabel);e.registerScoreWeights(o)}tagMeshPeer=e=>{let{peerId:t,topic:r}=e.detail;this.components.peerStore.merge(Lt(t),{tags:{[r]:{value:100}}}).catch(n=>{this.log.error("Error tagging peer %s with topic %s",t,r,n)})};untagMeshPeer=e=>{let{peerId:t,topic:r}=e.detail;this.components.peerStore.merge(Lt(t),{tags:{[r]:void 0}}).catch(n=>{this.log.error("Error untagging peer %s with topic %s",t,r,n)})}};function Fd(s={}){return e=>new On(e,s)}return Hl(Vd);})(); + /*! Bundled license information: + + pvtsutils/build/index.js: +diff --git a/node_modules/@chainsafe/libp2p-gossipsub/dist/src/errors.d.ts b/node_modules/@chainsafe/libp2p-gossipsub/dist/src/errors.d.ts +new file mode 100644 +index 0000000..5aef11a +--- /dev/null ++++ b/node_modules/@chainsafe/libp2p-gossipsub/dist/src/errors.d.ts +@@ -0,0 +1,9 @@ ++export declare class InvalidPeerScoreParamsError extends Error { ++ static name: string; ++ constructor(message?: string); ++} ++export declare class InvalidPeerScoreThresholdsError extends Error { ++ static name: string; ++ constructor(message?: string); ++} ++//# sourceMappingURL=errors.d.ts.map +\ No newline at end of file +diff --git a/node_modules/@chainsafe/libp2p-gossipsub/dist/src/errors.d.ts.map b/node_modules/@chainsafe/libp2p-gossipsub/dist/src/errors.d.ts.map +new file mode 100644 +index 0000000..4af32c8 +--- /dev/null ++++ b/node_modules/@chainsafe/libp2p-gossipsub/dist/src/errors.d.ts.map +@@ -0,0 +1 @@ ++{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../src/errors.ts"],"names":[],"mappings":"AAAA,qBAAa,2BAA4B,SAAQ,KAAK;IACpD,MAAM,CAAC,IAAI,SAAgC;gBAE9B,OAAO,SAA8B;CAInD;AAED,qBAAa,+BAAgC,SAAQ,KAAK;IACxD,MAAM,CAAC,IAAI,SAAoC;gBAElC,OAAO,SAAkC;CAIvD"} +\ No newline at end of file +diff --git a/node_modules/@chainsafe/libp2p-gossipsub/dist/src/errors.js b/node_modules/@chainsafe/libp2p-gossipsub/dist/src/errors.js +new file mode 100644 +index 0000000..7e5472d +--- /dev/null ++++ b/node_modules/@chainsafe/libp2p-gossipsub/dist/src/errors.js +@@ -0,0 +1,15 @@ ++export class InvalidPeerScoreParamsError extends Error { ++ static name = 'InvalidPeerScoreParamsError'; ++ constructor(message = 'Invalid peer score params') { ++ super(message); ++ this.name = 'InvalidPeerScoreParamsError'; ++ } ++} ++export class InvalidPeerScoreThresholdsError extends Error { ++ static name = 'InvalidPeerScoreThresholdsError'; ++ constructor(message = 'Invalid peer score thresholds') { ++ super(message); ++ this.name = 'InvalidPeerScoreThresholdsError'; ++ } ++} ++//# sourceMappingURL=errors.js.map +\ No newline at end of file +diff --git a/node_modules/@chainsafe/libp2p-gossipsub/dist/src/errors.js.map b/node_modules/@chainsafe/libp2p-gossipsub/dist/src/errors.js.map +new file mode 100644 +index 0000000..83abbce +--- /dev/null ++++ b/node_modules/@chainsafe/libp2p-gossipsub/dist/src/errors.js.map +@@ -0,0 +1 @@ ++{"version":3,"file":"errors.js","sourceRoot":"","sources":["../../src/errors.ts"],"names":[],"mappings":"AAAA,MAAM,OAAO,2BAA4B,SAAQ,KAAK;IACpD,MAAM,CAAC,IAAI,GAAG,6BAA6B,CAAA;IAE3C,YAAa,OAAO,GAAG,2BAA2B;QAChD,KAAK,CAAC,OAAO,CAAC,CAAA;QACd,IAAI,CAAC,IAAI,GAAG,6BAA6B,CAAA;IAC3C,CAAC;;AAGH,MAAM,OAAO,+BAAgC,SAAQ,KAAK;IACxD,MAAM,CAAC,IAAI,GAAG,iCAAiC,CAAA;IAE/C,YAAa,OAAO,GAAG,+BAA+B;QACpD,KAAK,CAAC,OAAO,CAAC,CAAA;QACd,IAAI,CAAC,IAAI,GAAG,iCAAiC,CAAA;IAC/C,CAAC"} +\ No newline at end of file +diff --git a/node_modules/@chainsafe/libp2p-gossipsub/dist/src/index.d.ts b/node_modules/@chainsafe/libp2p-gossipsub/dist/src/index.d.ts +index 9f8230c..9601863 100644 +--- a/node_modules/@chainsafe/libp2p-gossipsub/dist/src/index.d.ts ++++ b/node_modules/@chainsafe/libp2p-gossipsub/dist/src/index.d.ts +@@ -8,7 +8,7 @@ import { InboundStream, OutboundStream } from './stream.js'; + import { IWantTracer } from './tracer.js'; + import { type MsgIdFn, type TopicStr, type MsgIdStr, type PeerIdStr, type FastMsgIdFn, type AddrInfo, type DataTransform, type MsgIdToStrFn, type PublishOpts } from './types.js'; + import type { GossipsubOptsSpec } from './config.js'; +-import type { Direction, PeerId, PeerStore, Message, PublishResult, PubSub, PubSubEvents, PubSubInit, TopicValidatorFn, Logger, ComponentLogger } from '@libp2p/interface'; ++import type { Direction, PeerId, PeerStore, Message, PublishResult, PubSub, PubSubEvents, PubSubInit, TopicValidatorFn, Logger, ComponentLogger, PrivateKey } from '@libp2p/interface'; + import type { ConnectionManager, Registrar } from '@libp2p/interface-internal'; + export declare const multicodec: string; + export interface GossipsubOpts extends GossipsubOptsSpec, PubSubInit { +@@ -81,13 +81,13 @@ export interface GossipsubOpts extends GossipsubOptsSpec, PubSubInit { + */ + maxOutboundStreams?: number; + /** +- * Pass true to run on transient connections - data or time-limited ++ * Pass true to run on limited connections - data or time-limited + * connections that may be closed at any time such as circuit relay + * connections. + * + * @default false + */ +- runOnTransientConnection?: boolean; ++ runOnLimitedConnection?: boolean; + /** + * Specify max buffer size in bytes for OutboundStream. + * If full it will throw and reject sending any more data. +@@ -140,6 +140,7 @@ interface GossipOptions extends GossipsubOpts { + scoreThresholds: PeerScoreThresholds; + } + export interface GossipSubComponents { ++ privateKey: PrivateKey; + peerId: PeerId; + peerStore: PeerStore; + registrar: Registrar; +@@ -263,7 +264,7 @@ export declare class GossipSub extends TypedEventEmitter implem + private status; + private readonly maxInboundStreams?; + private readonly maxOutboundStreams?; +- private readonly runOnTransientConnection?; ++ private readonly runOnLimitedConnection?; + private readonly allowedTopics; + private heartbeatTimer; + constructor(components: GossipSubComponents, options?: Partial); +diff --git a/node_modules/@chainsafe/libp2p-gossipsub/dist/src/index.d.ts.map b/node_modules/@chainsafe/libp2p-gossipsub/dist/src/index.d.ts.map +index a280ef0..f32bc4a 100644 +--- a/node_modules/@chainsafe/libp2p-gossipsub/dist/src/index.d.ts.map ++++ b/node_modules/@chainsafe/libp2p-gossipsub/dist/src/index.d.ts.map +@@ -1 +1 @@ +-{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,UAAU,EAAE,YAAY,EAAE,oBAAoB,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAA;AAY/I,OAAO,EAAE,KAAK,eAAe,EAA0B,MAAM,wBAAwB,CAAA;AACrF,OAAO,EAAE,GAAG,EAAE,MAAM,kBAAkB,CAAA;AACtC,OAAO,EAAE,YAAY,EAA2B,MAAM,oBAAoB,CAAA;AAC1E,OAAO,EAML,KAAK,eAAe,EAEpB,KAAK,eAAe,EAErB,MAAM,cAAc,CAAA;AACrB,OAAO,EACL,SAAS,EACT,KAAK,eAAe,EACpB,KAAK,mBAAmB,EAGxB,KAAK,kBAAkB,EACxB,MAAM,kBAAkB,CAAA;AAEzB,OAAO,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,aAAa,CAAA;AAC3D,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAA;AACzC,OAAO,EACL,KAAK,OAAO,EAEZ,KAAK,QAAQ,EACb,KAAK,QAAQ,EAEb,KAAK,SAAS,EAId,KAAK,WAAW,EAChB,KAAK,QAAQ,EACb,KAAK,aAAa,EAElB,KAAK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AAS;IAQvB;;OAEG;IACH,OAAO,CAAC,OAAO;IA0Df,+DAA+D;IACxD,gBAAgB,CAAE,EAAE,EAAE,SAAS,EAAE,MAAM,EAAE,GAAG,EAAE,IAAI,EAAE,GAAG,CAAC,cAAc,GAAG,IAAI;IAepF,qDAAqD;IACrD,OAAO,CAAC,eAAe;IAKvB;;;;;OAKG;YACW,cAAc;IAiC5B;;OAEG;IACH,OAAO,CAAC,UAAU;IAOlB;;;;;;;;OAQG;IACH,OAAO,CAAC,YAAY;IA6CpB;;OAEG;IACH,OAAO,CAAC,KAAK;IAcb;;OAEG;IACH,OAAO,CAAC,UAAU;IAMlB;;OAEG;YACW,SAAS;IA+DvB,OAAO,CAAC,QAAQ,CAAC,YAAY,CA+B5B;IAED;;OAEG;IACU,SAAS,IAAK,OAAO,CAAC,IAAI,CAAC;IA+TxC;;;;;;;OAOG;IACH,OAAO,CAAC,oBAAoB;IAiC5B,OAAO,CAAC,eAAe;IAoFvB,OAAO,CAAC,QAAQ,CAAC,WAAW,CAS3B;IAED,OAAO,CAAC,QAAQ,CAAC,aAAa,CAO7B;CACF;AAED,wBAAgB,SAAS,CACvB,IAAI,GAAE,OAAO,CAAC,aAAa,CAAM,GAChC,CAAC,UAAU,EAAE,mBAAmB,KAAK,MAAM,CAAC,eAAe,CAAC,CAE9D"} +\ No newline at end of file +diff --git a/node_modules/@chainsafe/libp2p-gossipsub/dist/src/index.js b/node_modules/@chainsafe/libp2p-gossipsub/dist/src/index.js +index 31aeddd..ad2479e 100644 +--- a/node_modules/@chainsafe/libp2p-gossipsub/dist/src/index.js ++++ b/node_modules/@chainsafe/libp2p-gossipsub/dist/src/index.js +@@ -1,8 +1,9 @@ + import { TypedEventEmitter, StrictSign, StrictNoSign, TopicValidatorResult, serviceCapabilities, serviceDependencies } from '@libp2p/interface'; +-import { peerIdFromBytes, peerIdFromString } from '@libp2p/peer-id'; ++import { peerIdFromMultihash, peerIdFromString } from '@libp2p/peer-id'; + import { encode } from 'it-length-prefixed'; + import { pipe } from 'it-pipe'; + import { pushable } from 'it-pushable'; ++import * as Digest from 'multiformats/hashes/digest'; + import * as constants from './constants.js'; + import { ACCEPT_FROM_WHITELIST_DURATION_MS, ACCEPT_FROM_WHITELIST_MAX_MESSAGES, ACCEPT_FROM_WHITELIST_THRESHOLD_SCORE, BACKOFF_SLACK } from './constants.js'; + import { defaultDecodeRpcLimits } from './message/decodeRpc.js'; +@@ -147,7 +148,7 @@ export class GossipSub extends TypedEventEmitter { + status = { code: GossipStatusCode.stopped }; + maxInboundStreams; + maxOutboundStreams; +- runOnTransientConnection; ++ runOnLimitedConnection; + allowedTopics; + heartbeatTimer = null; + constructor(components, options = {}) { +@@ -254,7 +255,7 @@ export class GossipSub extends TypedEventEmitter { + }); + this.maxInboundStreams = options.maxInboundStreams; + this.maxOutboundStreams = options.maxOutboundStreams; +- this.runOnTransientConnection = options.runOnTransientConnection; ++ this.runOnLimitedConnection = options.runOnLimitedConnection; + this.allowedTopics = (opts.allowedTopics != null) ? new Set(opts.allowedTopics) : null; + } + [Symbol.toStringTag] = '@chainsafe/libp2p-gossipsub'; +@@ -281,7 +282,7 @@ export class GossipSub extends TypedEventEmitter { + return; + } + this.log('starting'); +- this.publishConfig = await getPublishConfigFromPeerId(this.globalSignaturePolicy, this.components.peerId); ++ this.publishConfig = getPublishConfigFromPeerId(this.globalSignaturePolicy, this.components.peerId, this.components.privateKey); + // Create the outbound inflight queue + // This ensures that outbound stream creation happens sequentially + this.outboundInflightQueue = pushable({ objectMode: true }); +@@ -302,7 +303,7 @@ export class GossipSub extends TypedEventEmitter { + await Promise.all(this.multicodecs.map(async (multicodec) => registrar.handle(multicodec, this.onIncomingStream.bind(this), { + maxInboundStreams: this.maxInboundStreams, + maxOutboundStreams: this.maxOutboundStreams, +- runOnTransientConnection: this.runOnTransientConnection ++ runOnLimitedConnection: this.runOnLimitedConnection + }))); + // # How does Gossipsub interact with libp2p? Rough guide from Mar 2022 + // +@@ -325,7 +326,7 @@ export class GossipSub extends TypedEventEmitter { + const topology = { + onConnect: this.onPeerConnected.bind(this), + onDisconnect: this.onPeerDisconnected.bind(this), +- notifyOnTransient: this.runOnTransientConnection ++ notifyOnLimitedConnection: this.runOnLimitedConnection + }; + const registrarTopologyIds = await Promise.all(this.multicodecs.map(async (multicodec) => registrar.register(multicodec, topology))); + // Schedule to start heartbeat after `GossipsubHeartbeatInitialDelay` +@@ -464,7 +465,7 @@ export class GossipSub extends TypedEventEmitter { + } + try { + const stream = new OutboundStream(await connection.newStream(this.multicodecs, { +- runOnTransientConnection: this.runOnTransientConnection ++ runOnLimitedConnection: this.runOnLimitedConnection + }), (e) => { this.log.error('outbound pipe error', e); }, { maxBufferSize: this.opts.maxOutboundBufferSize }); + this.log('create outbound stream %p', peerId); + this.streamsOutbound.set(id, stream); +@@ -1280,7 +1281,7 @@ export class GossipSub extends TypedEventEmitter { + if (pi.peerID == null) { + return; + } +- const peer = peerIdFromBytes(pi.peerID); ++ const peer = peerIdFromMultihash(Digest.decode(pi.peerID)); + const p = peer.toString(); + if (this.peers.has(p)) { + return; +@@ -1969,12 +1970,12 @@ export class GossipSub extends TypedEventEmitter { + peerInfo = await this.components.peerStore.get(id); + } + catch (err) { +- if (err.code !== 'ERR_NOT_FOUND') { ++ if (err.name !== 'NotFoundError') { + throw err; + } + } + return { +- peerID: id.toBytes(), ++ peerID: id.toMultihash().bytes, + signedPeerRecord: peerInfo?.peerRecordEnvelope + }; + })); +diff --git a/node_modules/@chainsafe/libp2p-gossipsub/dist/src/index.js.map b/node_modules/@chainsafe/libp2p-gossipsub/dist/src/index.js.map +index 9aa9e8a..89e3c7e 100644 +--- a/node_modules/@chainsafe/libp2p-gossipsub/dist/src/index.js.map ++++ b/node_modules/@chainsafe/libp2p-gossipsub/dist/src/index.js.map +@@ -1 +1 @@ +-{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,UAAU,EAAE,YAAY,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E;IAEjC,OAAO,CAAC,UAA+B,EAAE,EAAE,CAAC,IAAI,SAAS,CAAC,UAAU,EAAE,IAAI,CAAC,CAAA;AAC7E,CAAC"} +\ No newline at end of file +diff --git a/node_modules/@chainsafe/libp2p-gossipsub/dist/src/message/rpc.d.ts.map b/node_modules/@chainsafe/libp2p-gossipsub/dist/src/message/rpc.d.ts.map +index 9a8634d..7b08f29 100644 +--- a/node_modules/@chainsafe/libp2p-gossipsub/dist/src/message/rpc.d.ts.map ++++ b/node_modules/@chainsafe/libp2p-gossipsub/dist/src/message/rpc.d.ts.map +@@ -1 +1 @@ +-{"version":3,"file":"rpc.d.ts","sourceRoot":"","sources":["../../../src/message/rpc.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,KAAK,KAAK,EAA4B,KAAK,aAAa,EAA0B,MAAM,iBAAiB,CAAA;AAClH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAA;AAEpD,MAAM,WAAW,GAAG;IAClB,aAAa,EAAE,GAAG,CAAC,OAAO,EAAE,CAAA;IAC5B,QAAQ,EAAE,GAAG,CAAC,OAAO,EAAE,CAAA;IACvB,OAAO,CAAC,EAAE,GAAG,CAAC,cAAc,CAAA;CAC7B;AAED,yBAAiB,GAAG,CAAC;IACnB,UAAiB,OAAO;QACtB,SAAS,CAAC,EAAE,OAAO,CAAA;QACnB,KAAK,CAAC,EAAE,MAAM,CAAA;KACf;IAED,UAAiB,OAAO,CAAC;QAGhB,MAAM,KAAK,QAAO,MAAM,OAAO,CAiDrC,CAAA;QAEM,MAAM,MAAM,QAAS,QAAQ,OAAO,CAAC,KAAG,UAE9C,CAAA;QAEM,MAAM,MAAM,QAAS,UAAU,GAAG,cAAc,SAAS,cAAc,OAAO,CAAC,KAAG,OAExF,CAAA;KACF;IAED,UAAiB,OAAO;QACtB,IAAI,CAAC,EAAE,UAAU,CAAA;QACjB,IAAI,CAAC,EAAE,UAAU,CAAA;QACjB,KAAK,CAAC,EAAE,UAAU,CA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2p-gossipsub/dist/src/message/rpc.js +index ea32a68..889aae0 100644 +--- a/node_modules/@chainsafe/libp2p-gossipsub/dist/src/message/rpc.js ++++ b/node_modules/@chainsafe/libp2p-gossipsub/dist/src/message/rpc.js +@@ -3,7 +3,7 @@ + /* eslint-disable @typescript-eslint/no-namespace */ + /* eslint-disable @typescript-eslint/no-unnecessary-boolean-literal-compare */ + /* eslint-disable @typescript-eslint/no-empty-interface */ +-import { CodeError, decodeMessage, encodeMessage, message } from 'protons-runtime'; ++import { decodeMessage, encodeMessage, MaxLengthError, message } from 'protons-runtime'; + export var RPC; + (function (RPC) { + let SubOpts; +@@ -193,30 +193,38 @@ export var RPC; + switch (tag >>> 3) { + case 1: { + if (opts.limits?.ihave != null && obj.ihave.length === opts.limits.ihave) { +- throw new CodeError('decode error - map field "ihave" had too many elements', 'ERR_MAX_LENGTH'); ++ throw new MaxLengthError('Decode error - map field "ihave" had too many elements'); + } +- obj.ihave.push(RPC.ControlIHave.codec().decode(reader, reader.uint32())); ++ obj.ihave.push(RPC.ControlIHave.codec().decode(reader, reader.uint32(), { ++ limits: opts.limits?.ihave$ ++ })); + break; + } + case 2: { + if (opts.limits?.iwant != null && obj.iwant.length === opts.limits.iwant) { +- throw new CodeError('decode error - map field "iwant" had too many elements', 'ERR_MAX_LENGTH'); ++ throw new MaxLengthError('Decode error - map field "iwant" had too many elements'); + } +- obj.iwant.push(RPC.ControlIWant.codec().decode(reader, reader.uint32())); ++ obj.iwant.push(RPC.ControlIWant.codec().decode(reader, reader.uint32(), { ++ limits: opts.limits?.iwant$ ++ })); + break; + } + case 3: { + if (opts.limits?.graft != null && obj.graft.length === opts.limits.graft) { +- throw new CodeError('decode error - map field "graft" had too many elements', 'ERR_MAX_LENGTH'); ++ throw new MaxLengthError('Decode error - map field "graft" had too many elements'); + } +- obj.graft.push(RPC.ControlGraft.codec().decode(reader, reader.uint32())); ++ obj.graft.push(RPC.ControlGraft.codec().decode(reader, reader.uint32(), { ++ limits: opts.limits?.graft$ ++ })); + break; + } + case 4: { + if (opts.limits?.prune != null && obj.prune.length === opts.limits.prune) { +- throw new CodeError('decode error - map field "prune" had too many elements', 'ERR_MAX_LENGTH'); ++ throw new MaxLengthError('Decode error - map field "prune" had too many elements'); + } +- obj.prune.push(RPC.ControlPrune.codec().decode(reader, reader.uint32())); ++ obj.prune.push(RPC.ControlPrune.codec().decode(reader, reader.uint32(), { ++ limits: opts.limits?.prune$ ++ })); + break; + } + default: { +@@ -273,7 +281,7 @@ export var RPC; + } + case 2: { + if (opts.limits?.messageIDs != null && obj.messageIDs.length === opts.limits.messageIDs) { +- throw new CodeError('decode error - map field "messageIDs" had too many elements', 'ERR_MAX_LENGTH'); ++ throw new MaxLengthError('Decode error - map field "messageIDs" had too many elements'); + } + obj.messageIDs.push(reader.bytes()); + break; +@@ -324,7 +332,7 @@ export var RPC; + switch (tag >>> 3) { + case 1: { + if (opts.limits?.messageIDs != null && obj.messageIDs.length === opts.limits.messageIDs) { +- throw new CodeError('decode error - map field "messageIDs" had too many elements', 'ERR_MAX_LENGTH'); ++ throw new MaxLengthError('Decode error - map field "messageIDs" had too many elements'); + } + obj.messageIDs.push(reader.bytes()); + break; +@@ -431,9 +439,11 @@ export var RPC; + } + case 2: { + if (opts.limits?.peers != null && obj.peers.length === opts.limits.peers) { +- throw new CodeError('decode error - map field "peers" had too many elements', 'ERR_MAX_LENGTH'); ++ throw new MaxLengthError('Decode error - map field "peers" had too many elements'); + } +- obj.peers.push(RPC.PeerInfo.codec().decode(reader, reader.uint32())); ++ obj.peers.push(RPC.PeerInfo.codec().decode(reader, reader.uint32(), { ++ limits: opts.limits?.peers$ ++ })); + break; + } + case 3: { +@@ -547,20 +557,26 @@ export var RPC; + switch (tag >>> 3) { + case 1: { + if (opts.limits?.subscriptions != null && obj.subscriptions.length === opts.limits.subscriptions) { +- throw new CodeError('decode error - map field "subscriptions" had too many elements', 'ERR_MAX_LENGTH'); ++ throw new MaxLengthError('Decode error - map field "subscriptions" had too many elements'); + } +- obj.subscriptions.push(RPC.SubOpts.codec().decode(reader, reader.uint32())); ++ obj.subscriptions.push(RPC.SubOpts.codec().decode(reader, reader.uint32(), { ++ limits: opts.limits?.subscriptions$ ++ })); + break; + } + case 2: { + if (opts.limits?.messages != null && obj.messages.length === opts.limits.messages) { +- throw new CodeError('decode error - map field "messages" had too many elements', 'ERR_MAX_LENGTH'); ++ throw new MaxLengthError('Decode error - map field "messages" had too many elements'); + } +- obj.messages.push(RPC.Message.codec().decode(reader, reader.uint32())); ++ obj.messages.push(RPC.Message.codec().decode(reader, reader.uint32(), { ++ limits: opts.limits?.messages$ ++ })); + break; + } + case 3: { +- obj.control = RPC.ControlMessage.codec().decode(reader, reader.uint32()); ++ obj.control = RPC.ControlMessage.codec().decode(reader, reader.uint32(), { ++ limits: opts.limits?.control ++ }); + break; + } + default: { +diff --git a/node_modules/@chainsafe/libp2p-gossipsub/dist/src/message/rpc.js.map b/node_modules/@chainsafe/libp2p-gossipsub/dist/src/message/rpc.js.map +index a7d65f5..7a72e5f 100644 +--- a/node_modules/@chainsafe/libp2p-gossipsub/dist/src/message/rpc.js.map ++++ b/node_modules/@chainsafe/libp2p-gossipsub/dist/src/message/rpc.js.map +@@ -1 +1 @@ +-{"version":3,"file":"rpc.js","sourceRoot":"","sources":["../../../src/message/rpc.ts"],"names":[],"mappings":"AAAA,kCAAkC;AAClC,+BAA+B;AAC/B,oDAAoD;AACpD,8EAA8E;AAC9E,0DAA0D;AAE1D,OAAO,EAAc,SAAS,EAAE,aAAa,EAAsB,aAAa,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAA;AASlH,MAAM,KAAW,GAAG,CA8tBnB;AA9tBD,WAAiB,GAAG;IAMlB,IAAiB,OAAO,CA6DvB;IA7DD,WAAiB,OAAO;QACtB,IAAI,MAAsB,CAAA;QAEb,aAAK,GAAG,GAAmB,EAAE;YACxC,IAAI,MAAM,IAAI,IAAI,EAAE,CAAC;gBACnB,MAAM,GAAG,OAAO,CAAU,CA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AC;4BACP,GAAG,CAAC,OAAO,GAAG,GAAG,CAAC,cAAc,CAAC,KAAK,EAAE,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,EAAE;gCACvE,MAAM,EAAE,IAAI,CAAC,MAAM,EAAE,OAAO;6BAC7B,CAAC,CAAA;4BACF,MAAK;wBACP,CAAC;wBACD,OAAO,CAAC,CAAC,CAAC;4BACR,MAAM,CAAC,QAAQ,CAAC,GAAG,GAAG,CAAC,CAAC,CAAA;4BACxB,MAAK;wBACP,CAAC;oBACH,CAAC;gBACH,CAAC;gBAED,OAAO,GAAG,CAAA;YACZ,CAAC,CAAC,CAAA;QACJ,CAAC;QAED,OAAO,MAAM,CAAA;IACf,CAAC,CAAA;IAEY,UAAM,GAAG,CAAC,GAAiB,EAAc,EAAE;QACtD,OAAO,aAAa,CAAC,GAAG,EAAE,GAAG,CAAC,KAAK,EAAE,CAAC,CAAA;IACxC,CAAC,CAAA;IAEY,UAAM,GAAG,CAAC,GAAgC,EAAE,IAAyB,EAAO,EAAE;QACzF,OAAO,aAAa,CAAC,GAAG,EAAE,GAAG,CAAC,KAAK,EAAE,EAAE,IAAI,CAAC,CAAA;IAC9C,CAAC,CAAA;AACH,CAAC,EA9uBgB,GAAG,KAAH,GAAG,QA8uBnB"} +\ No newline at end of file +diff --git a/node_modules/@chainsafe/libp2p-gossipsub/dist/src/score/constants.d.ts b/node_modules/@chainsafe/libp2p-gossipsub/dist/src/score/constants.d.ts +deleted file mode 100644 +index 76c80cf..0000000 +--- a/node_modules/@chainsafe/libp2p-gossipsub/dist/src/score/constants.d.ts ++++ /dev/null +@@ -1,3 +0,0 @@ +-export declare const ERR_INVALID_PEER_SCORE_PARAMS = "ERR_INVALID_PEER_SCORE_PARAMS"; +-export declare const ERR_INVALID_PEER_SCORE_THRESHOLDS = "ERR_INVALID_PEER_SCORE_THRESHOLDS"; +-//# sourceMappingURL=constants.d.ts.map +\ No newline at end of file +diff --git a/node_modules/@chainsafe/libp2p-gossipsub/dist/src/score/constants.d.ts.map b/node_modules/@chainsafe/libp2p-gossipsub/dist/src/score/constants.d.ts.map +deleted file mode 100644 +index 275a4c1..0000000 +--- a/node_modules/@chainsafe/libp2p-gossipsub/dist/src/score/constants.d.ts.map ++++ /dev/null +@@ -1 +0,0 @@ +-{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../src/score/constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,6BAA6B,kCAAkC,CAAA;AAC5E,eAAO,MAAM,iCAAiC,sCAAsC,CAAA"} +\ No newline at end of file +diff --git a/node_modules/@chainsafe/libp2p-gossipsub/dist/src/score/constants.js b/node_modules/@chainsafe/libp2p-gossipsub/dist/src/score/constants.js +deleted file mode 100644 +index 71cf943..0000000 +--- a/node_modules/@chainsafe/libp2p-gossipsub/dist/src/score/constants.js ++++ /dev/null +@@ -1,3 +0,0 @@ +-export const ERR_INVALID_PEER_SCORE_PARAMS = 'ERR_INVALID_PEER_SCORE_PARAMS'; +-export const ERR_INVALID_PEER_SCORE_THRESHOLDS = 'ERR_INVALID_PEER_SCORE_THRESHOLDS'; +-//# sourceMappingURL=constants.js.map +\ No newline at end of file +diff --git a/node_modules/@chainsafe/libp2p-gossipsub/dist/src/score/constants.js.map b/node_modules/@chainsafe/libp2p-gossipsub/dist/src/score/constants.js.map +deleted file mode 100644 +index 941de96..0000000 +--- a/node_modules/@chainsafe/libp2p-gossipsub/dist/src/score/constants.js.map ++++ /dev/null +@@ -1 +0,0 @@ +-{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../src/score/constants.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,6BAA6B,GAAG,+BAA+B,CAAA;AAC5E,MAAM,CAAC,MAAM,iCAAiC,GAAG,mCAAmC,CAAA"} +\ No newline at end of file +diff --git a/node_modules/@chainsafe/libp2p-gossipsub/dist/src/score/peer-score-params.d.ts.map b/node_modules/@chainsafe/libp2p-gossipsub/dist/src/score/peer-score-params.d.ts.map +index 50dd811..61ec260 100644 +--- a/node_modules/@chainsafe/libp2p-gossipsub/dist/src/score/peer-score-params.d.ts.map ++++ b/node_modules/@chainsafe/libp2p-gossipsub/dist/src/score/peer-score-params.d.ts.map +@@ -1 +1 @@ +-{"version":3,"file":"peer-score-params.d.ts","sourceRoot":"","sources":["../../../src/score/peer-score-params.ts"],"names":[],"mappings":"AAOA,MAAM,WAAW,eAAe;IAC9B;;OAEG;IACH,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,gBAAgB,CAAC,CAAA;IAExC;;;OAGG;IACH,aAAa,EAAE,MAAM,CAAA;IAErB;;OAEG;IACH,gBAAgB,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,CAAA;IACnC,iBAAiB,EAAE,MAAM,CAAA;IAEzB;;;;;;;;;OASG;IACH,wBAAwB,EAAE,MAAM,CAAA;IAChC,2BAA2B,EAAE,MAAM,CAAA;IACnC,2BAA2B,EAAE,GAAG,CAAC,MAAM,CAAC,CAAA;IAExC;;;;;;;;;OASG;IACH,sBAAsB,EAAE,MAAM,CAAA;IAC9B,yBAAyB,EAAE,MAAM,CAAA;IACjC,qBAAqB,EAAE,MAAM,CAAA;IAE7B;;OAEG;IACH,aAAa,EAAE,MAAM,CAAA;IAErB;;OAEG;IACH,WAAW,EAAE,MAAM,CAAA;IAEnB;;OAEG;IACH,WAAW,EAAE,MAAM,CAAA;CACpB;AAED,MAAM,WAAW,gBAAgB;IAC/B;;OAEG;IACH,WAAW,EAAE,MAAM,CAAA;IAEnB;;;;;OAKG;IACH,gBAAgB,EAAE,MAAM,CAAA;IACxB,iBAAiB,EAAE,MAAM,CAAA;IACzB,aAAa,EAAE,MAAM,CAAA;IAErB;;;;;;OAMG;IACH,4BAA4B,EAAE,MAAM,CAAA;IACpC,2BAA2B,EAAE,MAAM,CAAA;IACnC,yBAAyB,EAAE,MAAM,CAAA;IAEjC;;;;;;;;;;;;;;;OAeG;IACH,2BAA2B,EAAE,MAAM,CAAA;IACnC,0BAA0B,EAAE,MAAM,CAAA;IAClC,wBAAwB,EAAE,MAAM,CAAA;IAChC,8BAA8B,EAAE,MAAM,CAAA;IACtC,2BAA2B,EAAE,MAAM,CAAA;IACnC,+BAA+B,EAAE,MAAM,CAAA;IAEvC;;;;;OAKG;IACH,wBAAwB,EAAE,MAAM,CAAA;IAChC,uBAAuB,EAAE,MAAM,CAAA;IAE/B;;;;;;OAMG;IACH,8BAA8B,EAAE,MAAM,CAAA;IACtC,6BAA6B,EAAE,MAAM,CAAA;CACtC;AAED,eAAO,MAAM,sBAAsB,EAAE,eAcpC,CAAA;AAED,eAAO,MAAM,uBAAuB,EAAE,gBAsBrC,CAAA;AAED,wBAAgB,qBAAqB,CAAE,CAAC,GAAE,OAAO,CAAC,eAAe,CAAM,GAAG,eAAe,CAWxF;AAED,wBAAgB,sBAAsB,CAAE,CAAC,GAAE,OAAO,CAAC,gBAAgB,CAAM,GAAG,gBAAgB,CAK3F;AAGD,wBAAgB,uBAAuB,CAAE,CAAC,EAAE,eAAe,GAAG,IAAI,CAqDjE;AAGD,wBAAgB,wBAAwB,CAAE,CAAC,EAAE,gBAAgB,GAAG,IAAI,CAiFnE"} +\ No newline at end of file ++{"version":3,"file":"peer-score-params.d.ts","sourceRoot":"","sources":["../../../src/score/peer-score-params.ts"],"names":[],"mappings":"AAMA,MAAM,WAAW,eAAe;IAC9B;;OAEG;IACH,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,gBAAgB,CAAC,CAAA;IAExC;;;OAGG;IACH,aAAa,EAAE,MAAM,CAAA;IAErB;;OAEG;IACH,gBAAgB,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,CAAA;IACnC,iBAAiB,EAAE,MAAM,CAAA;IAEzB;;;;;;;;;OASG;IACH,wBAAwB,EAAE,MAAM,CAAA;IAChC,2BAA2B,EAAE,MAAM,CAAA;IACnC,2BAA2B,EAAE,GAAG,CAAC,MAAM,CAAC,CAAA;IAExC;;;;;;;;;OASG;IACH,sBAAsB,E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CjE;AAGD,wBAAgB,wBAAwB,CAAE,CAAC,EAAE,gBAAgB,GAAG,IAAI,CAqEnE"} +\ No newline at end of file +diff --git a/node_modules/@chainsafe/libp2p-gossipsub/dist/src/score/peer-score-params.js b/node_modules/@chainsafe/libp2p-gossipsub/dist/src/score/peer-score-params.js +index 51e4b57..cdf392a 100644 +--- a/node_modules/@chainsafe/libp2p-gossipsub/dist/src/score/peer-score-params.js ++++ b/node_modules/@chainsafe/libp2p-gossipsub/dist/src/score/peer-score-params.js +@@ -1,5 +1,4 @@ +-import { CodeError } from '@libp2p/interface'; +-import { ERR_INVALID_PEER_SCORE_PARAMS } from './constants.js'; ++import { InvalidPeerScoreParamsError } from '../errors.js'; + export const defaultPeerScoreParams = { + topics: {}, + topicScoreCap: 10.0, +@@ -59,37 +58,37 @@ export function validatePeerScoreParams(p) { + validateTopicScoreParams(params); + } + catch (e) { +- throw new CodeError(`invalid score parameters for topic ${topic}: ${e.message}`, ERR_INVALID_PEER_SCORE_PARAMS); ++ throw new InvalidPeerScoreParamsError(`invalid score parameters for topic ${topic}: ${e.message}`); + } + } + // check that the topic score is 0 or something positive + if (p.topicScoreCap < 0) { +- throw new CodeError('invalid topic score cap; must be positive (or 0 for no cap)', ERR_INVALID_PEER_SCORE_PARAMS); ++ throw new InvalidPeerScoreParamsError('invalid topic score cap; must be positive (or 0 for no cap)'); + } + // check that we have an app specific score; the weight can be anything (but expected positive) + if (p.appSpecificScore === null || p.appSpecificScore === undefined) { +- throw new CodeError('missing application specific score function', ERR_INVALID_PEER_SCORE_PARAMS); ++ throw new InvalidPeerScoreParamsError('missing application specific score function'); + } + // check the IP colocation factor + if (p.IPColocationFactorWeight > 0) { +- throw new CodeError('invalid IPColocationFactorWeight; must be negative (or 0 to disable)', ERR_INVALID_PEER_SCORE_PARAMS); ++ throw new InvalidPeerScoreParamsError('invalid IPColocationFactorWeight; must be negative (or 0 to disable)'); + } + if (p.IPColocationFactorWeight !== 0 && p.IPColocationFactorThreshold < 1) { +- throw new CodeError('invalid IPColocationFactorThreshold; must be at least 1', ERR_INVALID_PEER_SCORE_PARAMS); ++ throw new InvalidPeerScoreParamsError('invalid IPColocationFactorThreshold; must be at least 1'); + } + // check the behaviour penalty + if (p.behaviourPenaltyWeight > 0) { +- throw new CodeError('invalid BehaviourPenaltyWeight; must be negative (or 0 to disable)', ERR_INVALID_PEER_SCORE_PARAMS); ++ throw new InvalidPeerScoreParamsError('invalid BehaviourPenaltyWeight; must be negative (or 0 to disable)'); + } + if (p.behaviourPenaltyWeight !== 0 && (p.behaviourPenaltyDecay <= 0 || p.behaviourPenaltyDecay >= 1)) { +- throw new CodeError('invalid BehaviourPenaltyDecay; must be between 0 and 1', ERR_INVALID_PEER_SCORE_PARAMS); ++ throw new InvalidPeerScoreParamsError('invalid BehaviourPenaltyDecay; must be between 0 and 1'); + } + // check the decay parameters + if (p.decayInterval < 1000) { +- throw new CodeError('invalid DecayInterval; must be at least 1s', ERR_INVALID_PEER_SCORE_PARAMS); ++ throw new InvalidPeerScoreParamsError('invalid DecayInterval; must be at least 1s'); + } + if (p.decayToZero <= 0 || p.decayToZero >= 1) { +- throw new CodeError('invalid DecayToZero; must be between 0 and 1', ERR_INVALID_PEER_SCORE_PARAMS); ++ throw new InvalidPeerScoreParamsError('invalid DecayToZero; must be between 0 and 1'); + } + // no need to check the score retention; a value of 0 means that we don't retain scores + } +@@ -97,64 +96,64 @@ export function validatePeerScoreParams(p) { + export function validateTopicScoreParams(p) { + // make sure we have a sane topic weight + if (p.topicWeight < 0) { +- throw new CodeError('invalid topic weight; must be >= 0', ERR_INVALID_PEER_SCORE_PARAMS); ++ throw new InvalidPeerScoreParamsError('invalid topic weight; must be >= 0'); + } + // check P1 + if (p.timeInMeshQuantum === 0) { +- throw new CodeError('invalid TimeInMeshQuantum; must be non zero', ERR_INVALID_PEER_SCORE_PARAMS); ++ throw new InvalidPeerScoreParamsError('invalid TimeInMeshQuantum; must be non zero'); + } + if (p.timeInMeshWeight < 0) { +- throw new CodeError('invalid TimeInMeshWeight; must be positive (or 0 to disable)', ERR_INVALID_PEER_SCORE_PARAMS); ++ throw new InvalidPeerScoreParamsError('invalid TimeInMeshWeight; must be positive (or 0 to disable)'); + } + if (p.timeInMeshWeight !== 0 && p.timeInMeshQuantum <= 0) { +- throw new CodeError('invalid TimeInMeshQuantum; must be positive', ERR_INVALID_PEER_SCORE_PARAMS); ++ throw new InvalidPeerScoreParamsError('invalid TimeInMeshQuantum; must be positive'); + } + if (p.timeInMeshWeight !== 0 && p.timeInMeshCap <= 0) { +- throw new CodeError('invalid TimeInMeshCap; must be positive', ERR_INVALID_PEER_SCORE_PARAMS); ++ throw new InvalidPeerScoreParamsError('invalid TimeInMeshCap; must be positive'); + } + // check P2 + if (p.firstMessageDeliveriesWeight < 0) { +- throw new CodeError('invallid FirstMessageDeliveriesWeight; must be positive (or 0 to disable)', ERR_INVALID_PEER_SCORE_PARAMS); ++ throw new InvalidPeerScoreParamsError('invallid FirstMessageDeliveriesWeight; must be positive (or 0 to disable)'); + } + if (p.firstMessageDeliveriesWeight !== 0 && + (p.firstMessageDeliveriesDecay <= 0 || p.firstMessageDeliveriesDecay >= 1)) { +- throw new CodeError('invalid FirstMessageDeliveriesDecay; must be between 0 and 1', ERR_INVALID_PEER_SCORE_PARAMS); ++ throw new InvalidPeerScoreParamsError('invalid FirstMessageDeliveriesDecay; must be between 0 and 1'); + } + if (p.firstMessageDeliveriesWeight !== 0 && p.firstMessageDeliveriesCap <= 0) { +- throw new CodeError('invalid FirstMessageDeliveriesCap; must be positive', ERR_INVALID_PEER_SCORE_PARAMS); ++ throw new InvalidPeerScoreParamsError('invalid FirstMessageDeliveriesCap; must be positive'); + } + // check P3 + if (p.meshMessageDeliveriesWeight > 0) { +- throw new CodeError('invalid MeshMessageDeliveriesWeight; must be negative (or 0 to disable)', ERR_INVALID_PEER_SCORE_PARAMS); ++ throw new InvalidPeerScoreParamsError('invalid MeshMessageDeliveriesWeight; must be negative (or 0 to disable)'); + } + if (p.meshMessageDeliveriesWeight !== 0 && (p.meshMessageDeliveriesDecay <= 0 || p.meshMessageDeliveriesDecay >= 1)) { +- throw new CodeError('invalid MeshMessageDeliveriesDecay; must be between 0 and 1', ERR_INVALID_PEER_SCORE_PARAMS); ++ throw new InvalidPeerScoreParamsError('invalid MeshMessageDeliveriesDecay; must be between 0 and 1'); + } + if (p.meshMessageDeliveriesWeight !== 0 && p.meshMessageDeliveriesCap <= 0) { +- throw new CodeError('invalid MeshMessageDeliveriesCap; must be positive', ERR_INVALID_PEER_SCORE_PARAMS); ++ throw new InvalidPeerScoreParamsError('invalid MeshMessageDeliveriesCap; must be positive'); + } + if (p.meshMessageDeliveriesWeight !== 0 && p.meshMessageDeliveriesThreshold <= 0) { +- throw new CodeError('invalid MeshMessageDeliveriesThreshold; must be positive', ERR_INVALID_PEER_SCORE_PARAMS); ++ throw new InvalidPeerScoreParamsError('invalid MeshMessageDeliveriesThreshold; must be positive'); + } + if (p.meshMessageDeliveriesWindow < 0) { +- throw new CodeError('invalid MeshMessageDeliveriesWindow; must be non-negative', ERR_INVALID_PEER_SCORE_PARAMS); ++ throw new InvalidPeerScoreParamsError('invalid MeshMessageDeliveriesWindow; must be non-negative'); + } + if (p.meshMessageDeliveriesWeight !== 0 && p.meshMessageDeliveriesActivation < 1000) { +- throw new CodeError('invalid MeshMessageDeliveriesActivation; must be at least 1s', ERR_INVALID_PEER_SCORE_PARAMS); ++ throw new InvalidPeerScoreParamsError('invalid MeshMessageDeliveriesActivation; must be at least 1s'); + } + // check P3b + if (p.meshFailurePenaltyWeight > 0) { +- throw new CodeError('invalid MeshFailurePenaltyWeight; must be negative (or 0 to disable)', ERR_INVALID_PEER_SCORE_PARAMS); ++ throw new InvalidPeerScoreParamsError('invalid MeshFailurePenaltyWeight; must be negative (or 0 to disable)'); + } + if (p.meshFailurePenaltyWeight !== 0 && (p.meshFailurePenaltyDecay <= 0 || p.meshFailurePenaltyDecay >= 1)) { +- throw new CodeError('invalid MeshFailurePenaltyDecay; must be between 0 and 1', ERR_INVALID_PEER_SCORE_PARAMS); ++ throw new InvalidPeerScoreParamsError('invalid MeshFailurePenaltyDecay; must be between 0 and 1'); + } + // check P4 + if (p.invalidMessageDeliveriesWeight > 0) { +- throw new CodeError('invalid InvalidMessageDeliveriesWeight; must be negative (or 0 to disable)', ERR_INVALID_PEER_SCORE_PARAMS); ++ throw new InvalidPeerScoreParamsError('invalid InvalidMessageDeliveriesWeight; must be negative (or 0 to disable)'); + } + if (p.invalidMessageDeliveriesDecay <= 0 || p.invalidMessageDeliveriesDecay >= 1) { +- throw new CodeError('invalid InvalidMessageDeliveriesDecay; must be between 0 and 1', ERR_INVALID_PEER_SCORE_PARAMS); ++ throw new InvalidPeerScoreParamsError('invalid InvalidMessageDeliveriesDecay; must be between 0 and 1'); + } + } + //# sourceMappingURL=peer-score-params.js.map +\ No newline at end of file +diff --git a/node_modules/@chainsafe/libp2p-gossipsub/dist/src/score/peer-score-params.js.map b/node_modules/@chainsafe/libp2p-gossipsub/dist/src/score/peer-score-params.js.map +index 4c77cc9..05a44c8 100644 +--- a/node_modules/@chainsafe/libp2p-gossipsub/dist/src/score/peer-score-params.js.map ++++ b/node_modules/@chainsafe/libp2p-gossipsub/dist/src/score/peer-score-params.js.map +@@ -1 +1 @@ +-{"version":3,"file":"peer-score-params.js","sourceRoot":"","sources":["../../../src/score/peer-score-params.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAA;AAC7C,OAAO,EAAE,6BAA6B,EAAE,MAAM,gBAAgB,CAAA;AA0I9D,MAAM,CAAC,MAAM,sBAAsB,GAAoB;IACrD,MAAM,EAAE,EAAE;IACV,aAAa,EAAE,IAAI;IACnB,gBAAgB,EAAE,GAAG,EAAE,CAAC,GAAG;IAC3B,iBAAiB,EAAE,IAAI;IACvB,wBAAwB,EAAE,CAAC,GAAG;IAC9B,2BAA2B,EAAE,IAAI;IACjC,2BAA2B,EAAE,IAAI,GAAG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/node_modules/@chainsafe/libp2p-gossipsub/dist/src/score/peer-score-thresholds.d.ts.map b/node_modules/@chainsafe/libp2p-gossipsub/dist/src/score/peer-score-thresholds.d.ts.map +index 8608948..5c5b1a8 100644 +--- a/node_modules/@chainsafe/libp2p-gossipsub/dist/src/score/peer-score-thresholds.d.ts.map ++++ b/node_modules/@chainsafe/libp2p-gossipsub/dist/src/score/peer-score-thresholds.d.ts.map +@@ -1 +1 @@ +-{"version":3,"file":"peer-score-thresholds.d.ts","sourceRoot":"","sources":["../../../src/score/peer-score-thresholds.ts"],"names":[],"mappings":"AAOA,MAAM,WAAW,mBAAmB;IAClC;;;OAGG;IACH,eAAe,EAAE,MAAM,CAAA;IAEvB;;;OAGG;IACH,gBAAgB,EAAE,MAAM,CAAA;IAExB;;;OAGG;IACH,iBAAiB,EAAE,MAAM,CAAA;IAEzB;;;OAGG;IACH,iBAAiB,EAAE,MAAM,CAAA;IAEzB;;;OAGG;IACH,2BAA2B,EAAE,MAAM,CAAA;CACpC;AAED,eAAO,MAAM,0BAA0B,EAAE,mBAMxC,CAAA;AAED,wBAAgB,yBAAyB,CAAE,CAAC,GAAE,OAAO,CAAC,mBAAmB,CAAM,GAAG,mBAAmB,CAKpG;AAED,wBAAgB,2BAA2B,CAAE,CAAC,EAAE,mBAAmB,GAAG,IAAI,CAsBzE"} +\ No newline at end of file ++{"version":3,"file":"peer-score-thresholds.d.ts","sourceRoot":"","sources":["../../../src/score/peer-score-thresholds.ts"],"names":[],"mappings":"AAMA,MAAM,WAAW,mBAAmB;IAClC;;;OAGG;IACH,eAAe,EAAE,MAAM,CAAA;IAEvB;;;OAGG;IACH,gBAAgB,EAAE,MAAM,CAAA;IAExB;;;OAGG;IACH,iBAAiB,EAAE,MAAM,CAAA;IAEzB;;;OAGG;IACH,iBAAiB,EAAE,MAAM,CAAA;IAEzB;;;OAGG;IACH,2BAA2B,EAAE,MAAM,CAAA;CACpC;AAED,eAAO,MAAM,0BAA0B,EAAE,mBAMxC,CAAA;AAED,wBAAgB,yBAAyB,CAAE,CAAC,GAAE,OAAO,CAAC,mBAAmB,CAAM,GAAG,mBAAmB,CAKpG;AAED,wBAAgB,2BAA2B,CAAE,CAAC,EAAE,mBAAmB,GAAG,IAAI,CAgBzE"} +\ No newline at end of file +diff --git a/node_modules/@chainsafe/libp2p-gossipsub/dist/src/score/peer-score-thresholds.js b/node_modules/@chainsafe/libp2p-gossipsub/dist/src/score/peer-score-thresholds.js +index 08d0d9b..9ce752e 100644 +--- a/node_modules/@chainsafe/libp2p-gossipsub/dist/src/score/peer-score-thresholds.js ++++ b/node_modules/@chainsafe/libp2p-gossipsub/dist/src/score/peer-score-thresholds.js +@@ -1,5 +1,4 @@ +-import { CodeError } from '@libp2p/interface'; +-import { ERR_INVALID_PEER_SCORE_THRESHOLDS } from './constants.js'; ++import { InvalidPeerScoreThresholdsError } from '../errors.js'; + export const defaultPeerScoreThresholds = { + gossipThreshold: -10, + publishThreshold: -50, +@@ -15,19 +14,19 @@ export function createPeerScoreThresholds(p = {}) { + } + export function validatePeerScoreThresholds(p) { + if (p.gossipThreshold > 0) { +- throw new CodeError('invalid gossip threshold; it must be <= 0', ERR_INVALID_PEER_SCORE_THRESHOLDS); ++ throw new InvalidPeerScoreThresholdsError('invalid gossip threshold; it must be <= 0'); + } + if (p.publishThreshold > 0 || p.publishThreshold > p.gossipThreshold) { +- throw new CodeError('invalid publish threshold; it must be <= 0 and <= gossip threshold', ERR_INVALID_PEER_SCORE_THRESHOLDS); ++ throw new InvalidPeerScoreThresholdsError('invalid publish threshold; it must be <= 0 and <= gossip threshold'); + } + if (p.graylistThreshold > 0 || p.graylistThreshold > p.publishThreshold) { +- throw new CodeError('invalid graylist threshold; it must be <= 0 and <= publish threshold', ERR_INVALID_PEER_SCORE_THRESHOLDS); ++ throw new InvalidPeerScoreThresholdsError('invalid graylist threshold; it must be <= 0 and <= publish threshold'); + } + if (p.acceptPXThreshold < 0) { +- throw new CodeError('invalid accept PX threshold; it must be >= 0', ERR_INVALID_PEER_SCORE_THRESHOLDS); ++ throw new InvalidPeerScoreThresholdsError('invalid accept PX threshold; it must be >= 0'); + } + if (p.opportunisticGraftThreshold < 0) { +- throw new CodeError('invalid opportunistic grafting threshold; it must be >= 0', ERR_INVALID_PEER_SCORE_THRESHOLDS); ++ throw new InvalidPeerScoreThresholdsError('invalid opportunistic grafting threshold; it must be >= 0'); + } + } + //# sourceMappingURL=peer-score-thresholds.js.map +\ No newline at end of file +diff --git a/node_modules/@chainsafe/libp2p-gossipsub/dist/src/score/peer-score-thresholds.js.map b/node_modules/@chainsafe/libp2p-gossipsub/dist/src/score/peer-score-thresholds.js.map +index 9b30020..ac578e5 100644 +--- a/node_modules/@chainsafe/libp2p-gossipsub/dist/src/score/peer-score-thresholds.js.map ++++ b/node_modules/@chainsafe/libp2p-gossipsub/dist/src/score/peer-score-thresholds.js.map +@@ -1 +1 @@ +-{"version":3,"file":"peer-score-thresholds.js","sourceRoot":"","sources":["../../../src/score/peer-score-thresholds.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAA;AAC7C,OAAO,EAAE,iCAAiC,EAAE,MAAM,gBAAgB,CAAA;AAsClE,MAAM,CAAC,MAAM,0BAA0B,GAAwB;IAC7D,eAAe,EAAE,CAAC,EAAE;IACpB,gBAAgB,EAAE,CAAC,EAAE;IACrB,iBAAiB,EAAE,CAAC,EAAE;IACtB,iBAAiB,EAAE,EAAE;IACrB,2BAA2B,EAAE,EAAE;CAChC,CAAA;AAED,MAAM,UAAU,yBAAyB,CAAE,IAAkC,EAAE;IAC7E,OAAO;QACL,GAAG,0BAA0B;QAC7B,GAAG,CAAC;KACL,CAAA;AACH,CAAC;AAED,MAAM,UAAU,2BAA2B,CAAE,CAAsB;IACjE,IAAI,CAAC,CAAC,eAAe,GAAG,CAAC,EAAE,CAAC;QAC1B,MAAM,IAAI,SAAS,CAAC,2CAA2C,EAAE,iCAAiC,CAAC,CAAA;IACrG,CAAC;IACD,IAAI,CAAC,CAAC,gBAAgB,GAAG,CAAC,IAAI,CAAC,CAAC,gBAAgB,GAAG,CAAC,CAAC,eAAe,EAAE,CAAC;QACrE,MAAM,IAAI,SAAS,CACjB,oEAAoE,EACpE,iCAAiC,CAClC,CAAA;IACH,CAAC;IACD,IAAI,CAAC,CAAC,iBAAiB,GAAG,CAAC,IAAI,CAAC,CAAC,iBAAiB,GAAG,CAAC,CAAC,gBAAgB,EAAE,CAAC;QACxE,MAAM,IAAI,SAAS,CACjB,sEAAsE,EACtE,iCAAiC,CAClC,CAAA;IACH,CAAC;IACD,IAAI,CAAC,CAAC,iBAAiB,GAAG,CAAC,EAAE,CAAC;QAC5B,MAAM,IAAI,SAAS,CAAC,8CAA8C,EAAE,iCAAiC,CAAC,CAAA;IACxG,CAAC;IACD,IAAI,CAAC,CAAC,2BAA2B,GAAG,CAAC,EAAE,CAAC;QACtC,MAAM,IAAI,SAAS,CAAC,2DAA2D,EAAE,iCAAiC,CAAC,CAAA;IACrH,CAAC;AACH,CAAC"} +\ No newline at end of file ++{"version":3,"file":"peer-score-thresholds.js","sourceRoot":"","sources":["../../../src/score/peer-score-thresholds.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,+BAA+B,EAAE,MAAM,cAAc,CAAA;AAsC9D,MAAM,CAAC,MAAM,0BAA0B,GAAwB;IAC7D,eAAe,EAAE,CAAC,EAAE;IACpB,gBAAgB,EAAE,CAAC,EAAE;IACrB,iBAAiB,EAAE,CAAC,EAAE;IACtB,iBAAiB,EAAE,EAAE;IACrB,2BAA2B,EAAE,EAAE;CAChC,CAAA;AAED,MAAM,UAAU,yBAAyB,CAAE,IAAkC,EAAE;IAC7E,OAAO;QACL,GAAG,0BAA0B;QAC7B,GAAG,CAAC;KACL,CAAA;AACH,CAAC;AAED,MAAM,UAAU,2BAA2B,CAAE,CAAsB;IACjE,IAAI,CAAC,CAAC,eAAe,GAAG,CAAC,EAAE,CAAC;QAC1B,MAAM,IAAI,+BAA+B,CAAC,2CAA2C,CAAC,CAAA;IACxF,CAAC;IACD,IAAI,CAAC,CAAC,gBAAgB,GAAG,CAAC,IAAI,CAAC,CAAC,gBAAgB,GAAG,CAAC,CAAC,eAAe,EAAE,CAAC;QACrE,MAAM,IAAI,+BAA+B,CAAC,oEAAoE,CAAC,CAAA;IACjH,CAAC;IACD,IAAI,CAAC,CAAC,iBAAiB,GAAG,CAAC,IAAI,CAAC,CAAC,iBAAiB,GAAG,CAAC,CAAC,gBAAgB,EAAE,CAAC;QACxE,MAAM,IAAI,+BAA+B,CAAC,sEAAsE,CAAC,CAAA;IACnH,CAAC;IACD,IAAI,CAAC,CAAC,iBAAiB,GAAG,CAAC,EAAE,CAAC;QAC5B,MAAM,IAAI,+BAA+B,CAAC,8CAA8C,CAAC,CAAA;IAC3F,CAAC;IACD,IAAI,CAAC,CAAC,2BAA2B,GAAG,CAAC,EAAE,CAAC;QACtC,MAAM,IAAI,+BAA+B,CAAC,2DAA2D,CAAC,CAAA;IACxG,CAAC;AACH,CAAC"} +\ No newline at end of file +diff --git a/node_modules/@chainsafe/libp2p-gossipsub/dist/src/utils/buildRawMessage.js b/node_modules/@chainsafe/libp2p-gossipsub/dist/src/utils/buildRawMessage.js +index 75b1723..602896c 100644 +--- a/node_modules/@chainsafe/libp2p-gossipsub/dist/src/utils/buildRawMessage.js ++++ b/node_modules/@chainsafe/libp2p-gossipsub/dist/src/utils/buildRawMessage.js +@@ -1,9 +1,9 @@ + import { randomBytes } from '@libp2p/crypto'; +-import { marshalPublicKey, unmarshalPublicKey } from '@libp2p/crypto/keys'; ++import { publicKeyFromProtobuf } from '@libp2p/crypto/keys'; + import { StrictSign, StrictNoSign } from '@libp2p/interface'; +-import { peerIdFromBytes } from '@libp2p/peer-id'; ++import { peerIdFromMultihash } from '@libp2p/peer-id'; ++import * as Digest from 'multiformats/hashes/digest'; + import { concat as uint8ArrayConcat } from 'uint8arrays/concat'; +-import { equals as uint8ArrayEquals } from 'uint8arrays/equals'; + import { fromString as uint8ArrayFromString } from 'uint8arrays/from-string'; + import { toString as uint8ArrayToString } from 'uint8arrays/to-string'; + import { RPC } from '../message/rpc.js'; +@@ -13,7 +13,7 @@ export async function buildRawMessage(publishConfig, topic, originalData, transf + switch (publishConfig.type) { + case PublishConfigType.Signing: { + const rpcMsg = { +- from: publishConfig.author.toBytes(), ++ from: publishConfig.author.toMultihash().bytes, + data: transformedData, + seqno: randomBytes(8), + topic, +@@ -32,7 +32,7 @@ export async function buildRawMessage(publishConfig, topic, originalData, transf + sequenceNumber: BigInt(`0x${uint8ArrayToString(rpcMsg.seqno, 'base16')}`), + topic, + signature: rpcMsg.signature, +- key: rpcMsg.key ++ key: publicKeyFromProtobuf(rpcMsg.key) + }; + return { + raw: rpcMsg, +@@ -86,7 +86,7 @@ export async function validateToRawMessage(signaturePolicy, msg) { + let fromPeerId; + try { + // TODO: Fix PeerId types +- fromPeerId = peerIdFromBytes(msg.from); ++ fromPeerId = peerIdFromMultihash(Digest.decode(msg.from)); + } + catch (e) { + return { valid: false, error: ValidateError.InvalidPeerId }; +@@ -99,9 +99,9 @@ export async function validateToRawMessage(signaturePolicy, msg) { + // - verify sig + let publicKey; + if (msg.key != null) { +- publicKey = unmarshalPublicKey(msg.key); ++ publicKey = publicKeyFromProtobuf(msg.key); + // TODO: Should `fromPeerId.pubKey` be optional? +- if (fromPeerId.publicKey !== undefined && !uint8ArrayEquals(publicKey.bytes, fromPeerId.publicKey)) { ++ if (fromPeerId.publicKey !== undefined && !publicKey.equals(fromPeerId.publicKey)) { + return { valid: false, error: ValidateError.InvalidPeerId }; + } + } +@@ -109,7 +109,7 @@ export async function validateToRawMessage(signaturePolicy, msg) { + if (fromPeerId.publicKey == null) { + return { valid: false, error: ValidateError.InvalidPeerId }; + } +- publicKey = unmarshalPublicKey(fromPeerId.publicKey); ++ publicKey = fromPeerId.publicKey; + } + const rpcMsgPreSign = { + from: msg.from, +@@ -134,7 +134,7 @@ export async function validateToRawMessage(signaturePolicy, msg) { + sequenceNumber: BigInt(`0x${uint8ArrayToString(msg.seqno, 'base16')}`), + topic: msg.topic, + signature: msg.signature, +- key: msg.key ?? marshalPublicKey(publicKey) ++ key: msg.key != null ? publicKeyFromProtobuf(msg.key) : publicKey + } + }; + } +diff --git a/node_modules/@chainsafe/libp2p-gossipsub/dist/src/utils/buildRawMessage.js.map b/node_modules/@chainsafe/libp2p-gossipsub/dist/src/utils/buildRawMessage.js.map +index d596983..df441d9 100644 +--- a/node_modules/@chainsafe/libp2p-gossipsub/dist/src/utils/buildRawMessage.js.map ++++ b/node_modules/@chainsafe/libp2p-gossipsub/dist/src/utils/buildRawMessage.js.map +@@ -1 +1 @@ +-{"version":3,"file":"buildRawMessage.js","sourceRoot":"","sources":["../../../src/utils/buildRawMessage.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAA;AAC5C,OAAO,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAA;AAC1E,OAAO,EAAE,UAAU,EAAE,YAAY,EAA6C,MAAM,mBAAmB,CAAA;AACvG,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAA;AACjD,OAAO,EAAE,MAAM,IAAI,gBAAgB,EAAE,MAAM,oBAAoB,CAAA;AAC/D,OAAO,EAAE,MAAM,IAAI,gBAAgB,EAAE,MAAM,oBAAoB,CAAA;AAC/D,OAAO,EAAE,UAAU,IAAI,oBAAoB,EAAE,MAAM,yBAAyB,CAAA;AAC5E,OAAO,EAAE,QAAQ,IAAI,kBAAkB,EAAE,MAAM,uBAAuB,CAAA;AACtE,OAAO,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAA;AACvC,OAAO,EAAsB,iBAAiB,EAAiB,aAAa,EAAE,MAAM,aAAa,CAAA;AAEjG,MAAM,CAAC,MAAM,UAAU,GAAG,oBAAoB,CAAC,gBAAgB,CAAC,CAAA;AAOhE,MAAM,CAAC,KAAK,UAAU,eAAe,CACnC,aAA4B,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C/D,qEAAqE;YACrE,MAAM,KAAK,GAAG,gBAAgB,CAAC,CAAC,UAAU,EAAE,GAAG,CAAC,OAAO,CAAC,MAAM,CAAC,aAAa,CAAC,CAAC,CAAC,CAAA;YAE/E,IAAI,CAAC,CAAC,MAAM,SAAS,CAAC,MAAM,CAAC,KAAK,EAAE,GAAG,CAAC,SAAS,CAAC,CAAC,EAAE,CAAC;gBACpD,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,aAAa,CAAC,gBAAgB,EAAE,CAAA;YAChE,CAAC;YAED,OAAO;gBACL,KAAK,EAAE,IAAI;gBACX,OAAO,EAAE;oBACP,IAAI,EAAE,QAAQ;oBACd,IAAI,EAAE,UAAU;oBAChB,IAAI,EAAE,GAAG,CAAC,IAAI,IAAI,IAAI,UAAU,CAAC,CAAC,CAAC;oBACnC,cAAc,EAAE,MAAM,CAAC,KAAK,kBAAkB,CAAC,GAAG,CAAC,KAAK,EAAE,QAAQ,CAAC,EAAE,CAAC;oBACtE,KAAK,EAAE,GAAG,CAAC,KAAK;oBAChB,SAAS,EAAE,GAAG,CAAC,SAAS;oBACxB,GAAG,EAAE,GAAG,CAAC,GAAG,IAAI,IAAI,CAAC,CAAC,CAAC,qBAAqB,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,SAAS;iBAClE;aACF,CAAA;QACH,CAAC;QAED;YACE,MAAM,IAAI,KAAK,CAAC,aAAa,CAAC,CAAA;IAClC,CAAC;AACH,CAAC"} +\ No newline at end of file +diff --git a/node_modules/@chainsafe/libp2p-gossipsub/dist/src/utils/msgIdFn.js b/node_modules/@chainsafe/libp2p-gossipsub/dist/src/utils/msgIdFn.js +index b95a717..488cb10 100644 +--- a/node_modules/@chainsafe/libp2p-gossipsub/dist/src/utils/msgIdFn.js ++++ b/node_modules/@chainsafe/libp2p-gossipsub/dist/src/utils/msgIdFn.js +@@ -11,7 +11,7 @@ export function msgIdFnStrictSign(msg) { + if (msg.sequenceNumber == null) + throw Error('missing seqno field'); + // TODO: Should use .from here or key? +- return msgId(msg.from.toBytes(), msg.sequenceNumber); ++ return msgId(msg.from.publicKey ?? msg.key, msg.sequenceNumber); + } + /** + * Generate a message id, based on message `data` +diff --git a/node_modules/@chainsafe/libp2p-gossipsub/dist/src/utils/msgIdFn.js.map b/node_modules/@chainsafe/libp2p-gossipsub/dist/src/utils/msgIdFn.js.map +index a6bd556..0538bf5 100644 +--- a/node_modules/@chainsafe/libp2p-gossipsub/dist/src/utils/msgIdFn.js.map ++++ b/node_modules/@chainsafe/libp2p-gossipsub/dist/src/utils/msgIdFn.js.map +@@ -1 +1 @@ +-{"version":3,"file":"msgIdFn.js","sourceRoot":"","sources":["../../../src/utils/msgIdFn.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAA;AAC5C,OAAO,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAA;AAGjD;;GAEG;AACH,MAAM,UAAU,iBAAiB,CAAE,GAAY;IAC7C,IAAI,GAAG,CAAC,IAAI,KAAK,QAAQ,EAAE,CAAC;QAC1B,MAAM,IAAI,KAAK,CAAC,8BAA8B,CAAC,CAAA;IACjD,CAAC;IACD,sBAAsB;IACtB,IAAI,GAAG,CAAC,cAAc,IAAI,IAAI;QAAE,MAAM,KAAK,CAAC,qBAAqB,CAAC,CAAA;IAElE,sCAAsC;IACtC,OAAO,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,OAAO,EAAE,EAAE,GAAG,CAAC,cAAc,CAAC,CAAA;AACtD,CAAC;AAED;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,mBAAmB,CAAE,GAAY;IACrD,OAAO,MAAM,CAAC,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,CAAA;AAChC,CAAC"} +\ No newline at end of file ++{"version":3,"file":"msgIdFn.js","sourceRoot":"","sources":["../../../src/utils/msgIdFn.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAA;AAC5C,OAAO,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAA;AAGjD;;GAEG;AACH,MAAM,UAAU,iBAAiB,CAAE,GAAY;IAC7C,IAAI,GAAG,CAAC,IAAI,KAAK,QAAQ,EAAE,CAAC;QAC1B,MAAM,IAAI,KAAK,CAAC,8BAA8B,CAAC,CAAA;IACjD,CAAC;IACD,sBAAsB;IACtB,IAAI,GAAG,CAAC,cAAc,IAAI,IAAI;QAAE,MAAM,KAAK,CAAC,qBAAqB,CAAC,CAAA;IAElE,sCAAsC;IACtC,OAAO,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,SAAS,IAAI,GAAG,CAAC,GAAG,EAAE,GAAG,CAAC,cAAc,CAAC,CAAA;AACjE,CAAC;AAED;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,mBAAmB,CAAE,GAAY;IACrD,OAAO,MAAM,CAAC,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,CAAA;AAChC,CAAC"} +\ No newline at end of file +diff --git a/node_modules/@chainsafe/libp2p-gossipsub/dist/src/utils/publishConfig.d.ts b/node_modules/@chainsafe/libp2p-gossipsub/dist/src/utils/publishConfig.d.ts +index e2eac64..cfba540 100644 +--- a/node_modules/@chainsafe/libp2p-gossipsub/dist/src/utils/publishConfig.d.ts ++++ b/node_modules/@chainsafe/libp2p-gossipsub/dist/src/utils/publishConfig.d.ts +@@ -1,8 +1,8 @@ + import { StrictSign, StrictNoSign } from '@libp2p/interface'; + import { type PublishConfig } from '../types.js'; +-import type { PeerId } from '@libp2p/interface'; ++import type { PeerId, PrivateKey } from '@libp2p/interface'; + /** + * Prepare a PublishConfig object from a PeerId. + */ +-export declare function getPublishConfigFromPeerId(signaturePolicy: typeof StrictSign | typeof StrictNoSign, peerId?: PeerId): Promise; ++export declare function getPublishConfigFromPeerId(signaturePolicy: typeof StrictSign | typeof StrictNoSign, peerId: PeerId, privateKey: PrivateKey): PublishConfig; + //# sourceMappingURL=publishConfig.d.ts.map +\ No newline at end of file +diff --git a/node_modules/@chainsafe/libp2p-gossipsub/dist/src/utils/publishConfig.d.ts.map b/node_modules/@chainsafe/libp2p-gossipsub/dist/src/utils/publishConfig.d.ts.map +index e8c10a6..e291d9b 100644 +--- a/node_modules/@chainsafe/libp2p-gossipsub/dist/src/utils/publishConfig.d.ts.map ++++ b/node_modules/@chainsafe/libp2p-gossipsub/dist/src/utils/publishConfig.d.ts.map +@@ -1 +1 @@ +-{"version":3,"file":"publishConfig.d.ts","sourceRoot":"","sources":["../../../src/utils/publishConfig.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAA;AAC5D,OAAO,EAAE,KAAK,aAAa,EAAqB,MAAM,aAAa,CAAA;AACnE,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAA;AAE/C;;GAEG;AACH,wBAAsB,0BAA0B,CAC9C,eAAe,EAAE,OAAO,UAAU,GAAG,OAAO,YAAY,EACxD,MAAM,CAAC,EAAE,MAAM,GACd,OAAO,CAAC,aAAa,CAAC,CAkCxB"} +\ No newline at end of file ++{"version":3,"file":"publishConfig.d.ts","sourceRoot":"","sources":["../../../src/utils/publishConfig.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAA;AAC5D,OAAO,EAAE,KAAK,aAAa,EAAqB,MAAM,aAAa,CAAA;AACnE,OAAO,KAAK,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAA;AAE3D;;GAEG;AACH,wBAAgB,0BAA0B,CACxC,eAAe,EAAE,OAAO,UAAU,GAAG,OAAO,YAAY,EACxD,MAAM,EAAE,MAAM,EACd,UAAU,EAAE,UAAU,GACrB,aAAa,CAmBf"} +\ No newline at end of file +diff --git a/node_modules/@chainsafe/libp2p-gossipsub/dist/src/utils/publishConfig.js b/node_modules/@chainsafe/libp2p-gossipsub/dist/src/utils/publishConfig.js +index 21075bf..89ebede 100644 +--- a/node_modules/@chainsafe/libp2p-gossipsub/dist/src/utils/publishConfig.js ++++ b/node_modules/@chainsafe/libp2p-gossipsub/dist/src/utils/publishConfig.js +@@ -1,27 +1,16 @@ +-import { unmarshalPrivateKey } from '@libp2p/crypto/keys'; ++import { publicKeyToProtobuf } from '@libp2p/crypto/keys'; + import { StrictSign, StrictNoSign } from '@libp2p/interface'; + import { PublishConfigType } from '../types.js'; + /** + * Prepare a PublishConfig object from a PeerId. + */ +-export async function getPublishConfigFromPeerId(signaturePolicy, peerId) { ++export function getPublishConfigFromPeerId(signaturePolicy, peerId, privateKey) { + switch (signaturePolicy) { + case StrictSign: { +- if (peerId == null) { +- throw Error('Must provide PeerId'); +- } +- if (peerId.privateKey == null) { +- throw Error('Cannot sign message, no private key present'); +- } +- if (peerId.publicKey == null) { +- throw Error('Cannot sign message, no public key present'); +- } +- // Transform privateKey once at initialization time instead of once per message +- const privateKey = await unmarshalPrivateKey(peerId.privateKey); + return { + type: PublishConfigType.Signing, + author: peerId, +- key: peerId.publicKey, ++ key: publicKeyToProtobuf(privateKey.publicKey), + privateKey + }; + } +diff --git a/node_modules/@chainsafe/libp2p-gossipsub/dist/src/utils/publishConfig.js.map b/node_modules/@chainsafe/libp2p-gossipsub/dist/src/utils/publishConfig.js.map +index 6b28cb1..9949dfc 100644 +--- a/node_modules/@chainsafe/libp2p-gossipsub/dist/src/utils/publishConfig.js.map ++++ b/node_modules/@chainsafe/libp2p-gossipsub/dist/src/utils/publishConfig.js.map +@@ -1 +1 @@ +-{"version":3,"file":"publishConfig.js","sourceRoot":"","sources":["../../../src/utils/publishConfig.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAA;AACzD,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAA;AAC5D,OAAO,EAAsB,iBAAiB,EAAE,MAAM,aAAa,CAAA;AAGnE;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,0BAA0B,CAC9C,eAAwD,EACxD,MAAe;IAEf,QAAQ,eAAe,EAAE,CAAC;QACxB,KAAK,UAAU,CAAC,CAAC,CAAC;YAChB,IAAI,MAAM,IAAI,IAAI,EAAE,CAAC;gBACnB,MAAM,KAAK,CAAC,qBAAqB,CAAC,CAAA;YACpC,CAAC;YAED,IAAI,MAAM,CAAC,UAAU,IAAI,IAAI,EAAE,CAAC;gBAC9B,MAAM,KAAK,CAAC,6CAA6C,CAAC,CAAA;YAC5D,CAAC;YAED,IAAI,MAAM,CAAC,SAAS,IAAI,IAAI,EAAE,CAAC;gBAC7B,MAAM,KAAK,CAAC,4CAA4C,CAAC,CAAA;YAC3D,CAAC;YAED,+EAA+E;YAC/E,MAAM,UAAU,GAAG,MAAM,mBAAmB,CAAC,MAAM,CAAC,UAAU,CAAC,CAAA;YAE/D,OAAO;gBACL,IAAI,EAAE,iBAAiB,CAAC,OAAO;gBAC/B,MAAM,EAAE,MAAM;gBACd,GAAG,EAAE,MAAM,CAAC,SAAS;gBACrB,UAAU;aACX,CAAA;QACH,CAAC;QAED,KAAK,YAAY;YACf,OAAO;gBACL,IAAI,EAAE,iBAAiB,CAAC,SAAS;aAClC,CAAA;QAEH;YACE,MAAM,IAAI,KAAK,CAAC,6BAA6B,eAAe,GAAG,CAAC,CAAA;IACpE,CAAC;AACH,CAAC"} +\ No newline at end of file ++{"version":3,"file":"publishConfig.js","sourceRoot":"","sources":["../../../src/utils/publishConfig.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAA;AACzD,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAA;AAC5D,OAAO,EAAsB,iBAAiB,EAAE,MAAM,aAAa,CAAA;AAGnE;;GAEG;AACH,MAAM,UAAU,0BAA0B,CACxC,eAAwD,EACxD,MAAc,EACd,UAAsB;IAEtB,QAAQ,eAAe,EAAE,CAAC;QACxB,KAAK,UAAU,CAAC,CAAC,CAAC;YAChB,OAAO;gBACL,IAAI,EAAE,iBAAiB,CAAC,OAAO;gBAC/B,MAAM,EAAE,MAAM;gBACd,GAAG,EAAE,mBAAmB,CAAC,UAAU,CAAC,SAAS,CAAC;gBAC9C,UAAU;aACX,CAAA;QACH,CAAC;QAED,KAAK,YAAY;YACf,OAAO;gBACL,IAAI,EAAE,iBAAiB,CAAC,SAAS;aAClC,CAAA;QAEH;YACE,MAAM,IAAI,KAAK,CAAC,6BAA6B,eAAe,GAAG,CAAC,CAAA;IACpE,CAAC;AACH,CAAC"} +\ No newline at end of file +diff --git a/node_modules/@chainsafe/libp2p-gossipsub/dist/test/2-nodes.spec.d.ts b/node_modules/@chainsafe/libp2p-gossipsub/dist/test/2-nodes.spec.d.ts +new file mode 100644 +index 0000000..ea6a513 +--- /dev/null ++++ b/node_modules/@chainsafe/libp2p-gossipsub/dist/test/2-nodes.spec.d.ts +@@ -0,0 +1,2 @@ ++export {}; ++//# sourceMappingURL=2-nodes.spec.d.ts.map +\ No newline at end of file +diff --git a/node_modules/@chainsafe/libp2p-gossipsub/dist/test/2-nodes.spec.d.ts.map b/node_modules/@chainsafe/libp2p-gossipsub/dist/test/2-nodes.spec.d.ts.map +new file mode 100644 +index 0000000..baff019 +--- /dev/null ++++ b/node_modules/@chainsafe/libp2p-gossipsub/dist/test/2-nodes.spec.d.ts.map +@@ -0,0 +1 @@ ++{"version":3,"file":"2-nodes.spec.d.ts","sourceRoot":"","sources":["../../test/2-nodes.spec.ts"],"names":[],"mappings":""} +\ No newline at end of file +diff --git a/node_modules/@chainsafe/libp2p-gossipsub/dist/test/2-nodes.spec.js b/node_modules/@chainsafe/libp2p-gossipsub/dist/test/2-nodes.spec.js +new file mode 100644 +index 0000000..139d5e4 +--- /dev/null ++++ b/node_modules/@chainsafe/libp2p-gossipsub/dist/test/2-nodes.spec.js +@@ -0,0 +1,293 @@ ++import { stop } from '@libp2p/interface'; ++import { mockNetwork } from '@libp2p/interface-compliance-tests/mocks'; ++import { expect } from 'aegir/chai'; ++import defer from 'p-defer'; ++import { pEvent } from 'p-event'; ++import pWaitFor from 'p-wait-for'; ++import { fromString as uint8ArrayFromString } from 'uint8arrays/from-string'; ++import { toString as uint8ArrayToString } from 'uint8arrays/to-string'; ++import { connectAllPubSubNodes, connectPubsubNodes, createComponentsArray } from './utils/create-pubsub.js'; ++const shouldNotHappen = () => expect.fail(); ++async function nodesArePubSubPeers(node0, node1, timeout = 60000) { ++ await pWaitFor(() => { ++ const node0SeesNode1 = node0.pubsub ++ .getPeers() ++ .map((p) => p.toString()) ++ .includes(node1.components.peerId.toString()); ++ const node1SeesNode0 = node1.pubsub ++ .getPeers() ++ .map((p) => p.toString()) ++ .includes(node0.components.peerId.toString()); ++ return node0SeesNode1 && node1SeesNode0; ++ }, { ++ timeout ++ }); ++} ++describe('2 nodes', () => { ++ describe('Pubsub dial', () => { ++ let nodes; ++ // Create pubsub nodes ++ beforeEach(async () => { ++ mockNetwork.reset(); ++ nodes = await createComponentsArray({ number: 2 }); ++ }); ++ afterEach(async () => { ++ await stop(...nodes.reduce((acc, curr) => acc.concat(curr.pubsub, ...Object.entries(curr.components)), [])); ++ mockNetwork.reset(); ++ }); ++ it('Dial from nodeA to nodeB happened with FloodsubID', async () => { ++ await connectPubsubNodes(nodes[0], nodes[1]); ++ await nodesArePubSubPeers(nodes[0], nodes[1]); ++ }); ++ }); ++ describe('basics', () => { ++ let nodes; ++ // Create pubsub nodes ++ beforeEach(async () => { ++ mockNetwork.reset(); ++ nodes = await createComponentsArray({ number: 2 }); ++ }); ++ afterEach(async () => { ++ await stop(...nodes.reduce((acc, curr) => acc.concat(curr.pubsub, ...Object.entries(curr.components)), [])); ++ mockNetwork.reset(); ++ }); ++ it('Dial from nodeA to nodeB happened with GossipsubIDv11', async () => { ++ await connectPubsubNodes(nodes[0], nodes[1]); ++ await nodesArePubSubPeers(nodes[0], nodes[1]); ++ }); ++ }); ++ describe('subscription functionality', () => { ++ let nodes; ++ // Create pubsub nodes ++ beforeEach(async () => { ++ mockNetwork.reset(); ++ nodes = await createComponentsArray({ ++ number: 2, ++ connected: true ++ }); ++ await nodesArePubSubPeers(nodes[0], nodes[1]); ++ }); ++ afterEach(async () => { ++ await stop(...nodes.reduce((acc, curr) => acc.concat(curr.pubsub, ...Object.entries(curr.components)), [])); ++ mockNetwork.reset(); ++ }); ++ it('Subscribe to a topic', async () => { ++ const topic = 'test_topic'; ++ nodes[0].pubsub.subscribe(topic); ++ nodes[1].pubsub.subscribe(topic); ++ // await subscription change ++ const [evt0] = await Promise.all([ ++ pEvent(nodes[0].pubsub, 'subscription-change'), ++ pEvent(nodes[1].pubsub, 'subscription-change') ++ ]); ++ const { peerId: changedPeerId, subscriptions: changedSubs } = evt0.detail; ++ expect(nodes[0].pubsub.getTopics()).to.include(topic); ++ expect(nodes[1].pubsub.getTopics()).to.include(topic); ++ expect(nodes[0].pubsub.getSubscribers(topic).map((p) => p.toString())).to.include(nodes[1].components.peerId.toString()); ++ expect(nodes[1].pubsub.getSubscribers(topic).map((p) => p.toString())).to.include(nodes[0].components.peerId.toString()); ++ expect(changedPeerId.toString()).to.equal(nodes[1].components.peerId.toString()); ++ expect(changedSubs).to.have.lengthOf(1); ++ expect(changedSubs[0].topic).to.equal(topic); ++ expect(changedSubs[0].subscribe).to.equal(true); ++ // await heartbeats ++ await Promise.all([ ++ pEvent(nodes[0].pubsub, 'gossipsub:heartbeat'), ++ pEvent(nodes[1].pubsub, 'gossipsub:heartbeat') ++ ]); ++ expect((nodes[0].pubsub).mesh.get(topic)?.has(nodes[1].components.peerId.toString())).to.be.true(); ++ expect((nodes[1].pubsub).mesh.get(topic)?.has(nodes[0].components.peerId.toString())).to.be.true(); ++ }); ++ }); ++ describe('publish functionality', () => { ++ const topic = 'Z'; ++ let nodes; ++ // Create pubsub nodes ++ beforeEach(async () => { ++ mockNetwork.reset(); ++ nodes = await createComponentsArray({ ++ number: 2, ++ connected: true ++ }); ++ // Create subscriptions ++ nodes[0].pubsub.subscribe(topic); ++ nodes[1].pubsub.subscribe(topic); ++ // await subscription change and heartbeat ++ await Promise.all([ ++ pEvent(nodes[0].pubsub, 'subscription-change'), ++ pEvent(nodes[1].pubsub, 'subscription-change'), ++ pEvent(nodes[0].pubsub, 'gossipsub:heartbeat'), ++ pEvent(nodes[1].pubsub, 'gossipsub:heartbeat') ++ ]); ++ }); ++ afterEach(async () => { ++ await stop(...nodes.reduce((acc, curr) => acc.concat(curr.pubsub, ...Object.entries(curr.components)), [])); ++ mockNetwork.reset(); ++ }); ++ it('Publish to a topic - nodeA', async () => { ++ const promise = pEvent(nodes[1].pubsub, 'message'); ++ nodes[0].pubsub.addEventListener('message', shouldNotHappen); ++ const data = uint8ArrayFromString('hey'); ++ await nodes[0].pubsub.publish(topic, data); ++ const evt = await promise; ++ if (evt.detail.type !== 'signed') { ++ throw new Error('unexpected msg type'); ++ } ++ expect(evt.detail.data).to.equalBytes(data); ++ expect(evt.detail.from.toString()).to.equal(nodes[0].components.peerId.toString()); ++ nodes[0].pubsub.removeEventListener('message', shouldNotHappen); ++ }); ++ it('Publish to a topic - nodeB', async () => { ++ const promise = pEvent(nodes[0].pubsub, 'message'); ++ nodes[1].pubsub.addEventListener('message', shouldNotHappen); ++ const data = uint8ArrayFromString('banana'); ++ await nodes[1].pubsub.publish(topic, data); ++ const evt = await promise; ++ if (evt.detail.type !== 'signed') { ++ throw new Error('unexpected msg type'); ++ } ++ expect(evt.detail.data).to.equalBytes(data); ++ expect(evt.detail.from.toString()).to.equal(nodes[1].components.peerId.toString()); ++ nodes[1].pubsub.removeEventListener('message', shouldNotHappen); ++ }); ++ it('Publish 10 msg to a topic', async () => { ++ let counter = 0; ++ nodes[1].pubsub.addEventListener('message', shouldNotHappen); ++ nodes[0].pubsub.addEventListener('message', receivedMsg); ++ const done = defer(); ++ function receivedMsg(evt) { ++ const msg = evt.detail; ++ expect(uint8ArrayToString(msg.data)).to.startWith('banana'); ++ if (msg.type !== 'signed') { ++ throw new Error('unexpected msg type'); ++ } ++ expect(msg.from.toString()).to.equal(nodes[1].components.peerId.toString()); ++ expect(msg.sequenceNumber).to.be.a('BigInt'); ++ expect(msg.topic).to.equal(topic); ++ if (++counter === 10) { ++ nodes[0].pubsub.removeEventListener('message', receivedMsg); ++ nodes[1].pubsub.removeEventListener('message', shouldNotHappen); ++ done.resolve(); ++ } ++ } ++ await Promise.all(Array.from({ length: 10 }).map(async (_, i) => { ++ await nodes[1].pubsub.publish(topic, uint8ArrayFromString(`banana${i}`)); ++ })); ++ await done.promise; ++ }); ++ }); ++ describe('publish after unsubscribe', () => { ++ const topic = 'Z'; ++ let nodes; ++ // Create pubsub nodes ++ beforeEach(async () => { ++ mockNetwork.reset(); ++ nodes = await createComponentsArray({ number: 2, init: { allowPublishToZeroTopicPeers: true } }); ++ await connectAllPubSubNodes(nodes); ++ // Create subscriptions ++ nodes[0].pubsub.subscribe(topic); ++ nodes[1].pubsub.subscribe(topic); ++ // await subscription change and heartbeat ++ await Promise.all([ ++ pEvent(nodes[0].pubsub, 'subscription-change'), ++ pEvent(nodes[1].pubsub, 'subscription-change') ++ ]); ++ await Promise.all([ ++ pEvent(nodes[0].pubsub, 'gossipsub:heartbeat'), ++ pEvent(nodes[1].pubsub, 'gossipsub:heartbeat') ++ ]); ++ }); ++ afterEach(async () => { ++ await stop(...nodes.reduce((acc, curr) => acc.concat(curr.pubsub, ...Object.entries(curr.components)), [])); ++ mockNetwork.reset(); ++ }); ++ it('Unsubscribe from a topic', async () => { ++ nodes[0].pubsub.unsubscribe(topic); ++ expect(nodes[0].pubsub.getTopics()).to.be.empty(); ++ const evt = await pEvent(nodes[1].pubsub, 'subscription-change'); ++ const { peerId: changedPeerId, subscriptions: changedSubs } = evt.detail; ++ await pEvent(nodes[1].pubsub, 'gossipsub:heartbeat'); ++ expect(nodes[1].pubsub.getPeers()).to.have.lengthOf(1); ++ expect(nodes[1].pubsub.getSubscribers(topic)).to.be.empty(); ++ expect(changedPeerId.toString()).to.equal(nodes[0].components.peerId.toString()); ++ expect(changedSubs).to.have.lengthOf(1); ++ expect(changedSubs[0].topic).to.equal(topic); ++ expect(changedSubs[0].subscribe).to.equal(false); ++ }); ++ it('Publish to a topic after unsubscribe', async () => { ++ const promises = [pEvent(nodes[1].pubsub, 'subscription-change'), pEvent(nodes[1].pubsub, 'gossipsub:heartbeat')]; ++ nodes[0].pubsub.unsubscribe(topic); ++ await Promise.all(promises); ++ const promise = new Promise((resolve, reject) => { ++ nodes[0].pubsub.addEventListener('message', reject); ++ setTimeout(() => { ++ nodes[0].pubsub.removeEventListener('message', reject); ++ resolve(); ++ }, 100); ++ }); ++ await nodes[1].pubsub.publish('Z', uint8ArrayFromString('banana')); ++ await nodes[0].pubsub.publish('Z', uint8ArrayFromString('banana')); ++ try { ++ await promise; ++ } ++ catch (e) { ++ expect.fail('message should not be received'); ++ } ++ }); ++ }); ++ describe('nodes send state on connection', () => { ++ let nodes; ++ // Create pubsub nodes ++ beforeEach(async () => { ++ mockNetwork.reset(); ++ nodes = await createComponentsArray({ ++ number: 2 ++ }); ++ // Make subscriptions prior to new nodes ++ nodes[0].pubsub.subscribe('Za'); ++ nodes[1].pubsub.subscribe('Zb'); ++ expect(nodes[0].pubsub.getPeers()).to.be.empty(); ++ expect(nodes[0].pubsub.getTopics()).to.include('Za'); ++ expect(nodes[1].pubsub.getPeers()).to.be.empty(); ++ expect(nodes[1].pubsub.getTopics()).to.include('Zb'); ++ }); ++ afterEach(async () => { ++ await stop(...nodes.reduce((acc, curr) => acc.concat(curr.pubsub, ...Object.entries(curr.components)), [])); ++ mockNetwork.reset(); ++ }); ++ it('existing subscriptions are sent upon peer connection', async function () { ++ this.timeout(5000); ++ await Promise.all([ ++ connectPubsubNodes(nodes[0], nodes[1]), ++ pEvent(nodes[0].pubsub, 'subscription-change'), ++ pEvent(nodes[1].pubsub, 'subscription-change') ++ ]); ++ expect(nodes[0].pubsub.getTopics()).to.include('Za'); ++ expect(nodes[1].pubsub.getPeers()).to.have.lengthOf(1); ++ expect(nodes[1].pubsub.getSubscribers('Za').map((p) => p.toString())).to.include(nodes[0].components.peerId.toString()); ++ expect(nodes[1].pubsub.getTopics()).to.include('Zb'); ++ expect(nodes[0].pubsub.getPeers()).to.have.lengthOf(1); ++ expect(nodes[0].pubsub.getSubscribers('Zb').map((p) => p.toString())).to.include(nodes[1].components.peerId.toString()); ++ }); ++ }); ++ describe('nodes handle stopping', () => { ++ let nodes; ++ // Create pubsub nodes ++ beforeEach(async () => { ++ mockNetwork.reset(); ++ nodes = await createComponentsArray({ ++ number: 2, ++ connected: true ++ }); ++ }); ++ afterEach(async () => { ++ await stop(...nodes.reduce((acc, curr) => acc.concat(curr.pubsub, ...Object.entries(curr.components)), [])); ++ mockNetwork.reset(); ++ }); ++ it("nodes don't have peers after stopped", async () => { ++ await stop(...nodes.reduce((acc, curr) => acc.concat(curr.pubsub, ...Object.entries(curr.components)), [])); ++ expect(nodes[0].pubsub.getPeers()).to.be.empty(); ++ expect(nodes[1].pubsub.getPeers()).to.be.empty(); ++ }); ++ }); ++}); ++//# sourceMappingURL=2-nodes.spec.js.map +\ No newline at end of file +diff --git a/node_modules/@chainsafe/libp2p-gossipsub/dist/test/2-nodes.spec.js.map b/node_modules/@chainsafe/libp2p-gossipsub/dist/test/2-nodes.spec.js.map +new file mode 100644 +index 0000000..2ae1bb6 +--- /dev/null ++++ b/node_modules/@chainsafe/libp2p-gossipsub/dist/test/2-nodes.spec.js.map +@@ -0,0 +1 @@ ++{"version":3,"file":"2-nodes.spec.js","sourceRoot":"","sources":["../../test/2-nodes.spec.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAA;AACxC,OAAO,EAAE,WAAW,EAAE,MAAM,0CAA0C,CAAA;AACtE,OAAO,EAAE,MAAM,EAAE,MAAM,YAAY,CAAA;AACnC,OAAO,KAAK,MAAM,SAAS,CAAA;AAC3B,OAAO,EAAE,MAAM,EAAE,MAAM,SA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OAAO,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAA;YAClH,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,QAAQ,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,KAAK,EAAE,CAAA;YAChD,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,QAAQ,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,KAAK,EAAE,CAAA;QAClD,CAAC,CAAC,CAAA;IACJ,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"} +\ No newline at end of file +diff --git a/node_modules/@chainsafe/libp2p-gossipsub/dist/test/accept-from.spec.d.ts b/node_modules/@chainsafe/libp2p-gossipsub/dist/test/accept-from.spec.d.ts +new file mode 100644 +index 0000000..fc7a6c0 +--- /dev/null ++++ b/node_modules/@chainsafe/libp2p-gossipsub/dist/test/accept-from.spec.d.ts +@@ -0,0 +1,2 @@ ++export {}; ++//# sourceMappingURL=accept-from.spec.d.ts.map +\ No newline at end of file +diff --git a/node_modules/@chainsafe/libp2p-gossipsub/dist/test/accept-from.spec.d.ts.map b/node_modules/@chainsafe/libp2p-gossipsub/dist/test/accept-from.spec.d.ts.map +new file mode 100644 +index 0000000..0e3c1a5 +--- /dev/null ++++ b/node_modules/@chainsafe/libp2p-gossipsub/dist/test/accept-from.spec.d.ts.map +@@ -0,0 +1 @@ ++{"version":3,"file":"accept-from.spec.d.ts","sourceRoot":"","sources":["../../test/accept-from.spec.ts"],"names":[],"mappings":""} +\ No newline at end of file +diff --git a/node_modules/@chainsafe/libp2p-gossipsub/dist/test/accept-from.spec.js b/node_modules/@chainsafe/libp2p-gossipsub/dist/test/accept-from.spec.js +new file mode 100644 +index 0000000..3d86544 +--- /dev/null ++++ b/node_modules/@chainsafe/libp2p-gossipsub/dist/test/accept-from.spec.js +@@ -0,0 +1,92 @@ ++import { generateKeyPair } from '@libp2p/crypto/keys'; ++import {} from '@libp2p/interface'; ++import { defaultLogger } from '@libp2p/logger'; ++import { peerIdFromPrivateKey } from '@libp2p/peer-id'; ++import { expect } from 'aegir/chai'; ++import sinon from 'sinon'; ++import { stubInterface } from 'ts-sinon'; ++import { GossipSub } from '../src/index.js'; ++import { fastMsgIdFn } from './utils/msgId.js'; ++const peerA = '16Uiu2HAmMkH6ZLen2tbhiuNCTZLLvrZaDgufNdT5MPjtC9Hr9YNA'; ++describe('Gossipsub acceptFrom', () => { ++ let gossipsub; ++ let sandbox; ++ let scoreSpy; ++ beforeEach(async () => { ++ sandbox = sinon.createSandbox(); ++ // not able to use fake timers or tests in browser are suspended ++ // sandbox.useFakeTimers(Date.now()) ++ const privateKey = await generateKeyPair('Ed25519'); ++ const peerId = peerIdFromPrivateKey(privateKey); ++ gossipsub = new GossipSub({ ++ privateKey, ++ peerId, ++ registrar: stubInterface(), ++ peerStore: stubInterface(), ++ connectionManager: stubInterface(), ++ logger: defaultLogger() ++ }, { emitSelf: false, fastMsgIdFn }); ++ // stubbing PeerScore causes some pending issue in firefox browser environment ++ // we can only spy it ++ // using scoreSpy.withArgs("peerA").calledOnce causes the pending issue in firefox ++ // while spy.getCall() is fine ++ scoreSpy = sandbox.spy(gossipsub.score, 'score'); ++ }); ++ afterEach(() => { ++ sandbox.restore(); ++ }); ++ it('should only white list peer with positive score', () => { ++ // by default the score is 0 ++ gossipsub.acceptFrom(peerA); ++ // 1st time, we have to compute score ++ expect(scoreSpy.getCall(0).args[0]).to.be.equal(peerA); ++ expect(scoreSpy.getCall(0).returnValue).to.be.equal(0); ++ expect(scoreSpy.getCall(1)).to.not.be.ok(); ++ // 2nd time, use a cached score since it's white listed ++ gossipsub.acceptFrom(peerA); ++ expect(scoreSpy.getCall(1)).to.not.be.ok(); ++ }); ++ it('should recompute score after 1s', async () => { ++ // by default the score is 0 ++ gossipsub.acceptFrom(peerA); ++ // 1st time, we have to compute score ++ expect(scoreSpy.getCall(0).args[0]).to.be.equal(peerA); ++ expect(scoreSpy.getCall(1)).to.not.be.ok(); ++ gossipsub.acceptFrom(peerA); ++ // score is cached ++ expect(scoreSpy.getCall(1)).to.not.be.ok(); ++ // after 1s ++ await new Promise((resolve) => setTimeout(resolve, 1001)); ++ gossipsub.acceptFrom(peerA); ++ expect(scoreSpy.getCall(1).args[0]).to.be.equal(peerA); ++ expect(scoreSpy.getCall(2)).to.not.be.ok(); ++ }); ++ it('should recompute score after max messages accepted', () => { ++ // by default the score is 0 ++ gossipsub.acceptFrom(peerA); ++ // 1st time, we have to compute score ++ expect(scoreSpy.getCall(0).args[0]).to.be.equal(peerA); ++ expect(scoreSpy.getCall(1)).to.not.be.ok(); ++ for (let i = 0; i < 128; i++) { ++ gossipsub.acceptFrom(peerA); ++ } ++ expect(scoreSpy.getCall(1)).to.not.be.ok(); ++ // max messages reached ++ gossipsub.acceptFrom(peerA); ++ expect(scoreSpy.getCall(1).args[0]).to.be.equal(peerA); ++ expect(scoreSpy.getCall(2)).to.not.be.ok(); ++ }); ++ // TODO: run this in a unit test setup ++ // this causes the test to not finish in firefox environment ++ // it.skip('should NOT white list peer with negative score', () => { ++ // // peerB is not white listed since score is negative ++ // scoreStub.score.withArgs('peerB').returns(-1) ++ // gossipsub["acceptFrom"]('peerB') ++ // // 1st time, we have to compute score ++ // expect(scoreStub.score.withArgs('peerB').calledOnce).to.be.true() ++ // // 2nd time, still have to compute score since it's NOT white listed ++ // gossipsub["acceptFrom"]('peerB') ++ // expect(scoreStub.score.withArgs('peerB').calledTwice).to.be.true() ++ // }) ++}); ++//# sourceMappingURL=accept-from.spec.js.map +\ No newline at end of file +diff --git a/node_modules/@chainsafe/libp2p-gossipsub/dist/test/accept-from.spec.js.map b/node_modules/@chainsafe/libp2p-gossipsub/dist/test/accept-from.spec.js.map +new file mode 100644 +index 0000000..1302849 +--- /dev/null ++++ b/node_modules/@chainsafe/libp2p-gossipsub/dist/test/accept-from.spec.js.map +@@ -0,0 +1 @@ ++{"version":3,"file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,CAAC,UAAU,CAAC,KAAK,CAAC,CAAA;QAC7B,CAAC;QACD,MAAM,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAA;QAE1C,uBAAuB;QACvB,SAAS,CAAC,UAAU,CAAC,KAAK,CAAC,CAAA;QAC3B,MAAM,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,CAAA;QACtD,MAAM,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAA;IAC5C,CAAC,CAAC,CAAA;IAEF,sCAAsC;IACtC,4DAA4D;IAC5D,oEAAoE;IACpE,yDAAyD;IACzD,kDAAkD;IAClD,qCAAqC;IACrC,0CAA0C;IAC1C,sEAAsE;IACtE,yEAAyE;IACzE,qCAAqC;IACrC,uEAAuE;IACvE,KAAK;AACP,CAAC,CAAC,CAAA"} +\ No newline at end of file +diff --git a/node_modules/@chainsafe/libp2p-gossipsub/dist/test/allowedTopics.spec.d.ts b/node_modules/@chainsafe/libp2p-gossipsub/dist/test/allowedTopics.spec.d.ts +new file mode 100644 +index 0000000..8ba8e83 +--- /dev/null ++++ b/node_modules/@chainsafe/libp2p-gossipsub/dist/test/allowedTopics.spec.d.ts +@@ -0,0 +1,2 @@ ++export {}; ++//# sourceMappingURL=allowedTopics.spec.d.ts.map +\ No newline at end of file +diff --git a/node_modules/@chainsafe/libp2p-gossipsub/dist/test/allowedTopics.spec.d.ts.map b/node_modules/@chainsafe/libp2p-gossipsub/dist/test/allowedTopics.spec.d.ts.map +new file mode 100644 +index 0000000..efec67b +--- /dev/null ++++ b/node_modules/@chainsafe/libp2p-gossipsub/dist/test/allowedTopics.spec.d.ts.map +@@ -0,0 +1 @@ ++{"version":3,"file":"allowedTopics.spec.d.ts","sourceRoot":"","sources":["../../test/allowedTopics.spec.ts"],"names":[],"mappings":""} +\ No newline at end of file +diff --git a/node_modules/@chainsafe/libp2p-gossipsub/dist/test/allowedTopics.spec.js b/node_modules/@chainsafe/libp2p-gossipsub/dist/test/allowedTopics.spec.js +new file mode 100644 +index 0000000..6ed6d08 +--- /dev/null ++++ b/node_modules/@chainsafe/libp2p-gossipsub/dist/test/allowedTopics.spec.js +@@ -0,0 +1,49 @@ ++import { stop } from '@libp2p/interface'; ++import { mockNetwork } from '@libp2p/interface-compliance-tests/mocks'; ++import { expect } from 'aegir/chai'; ++import { pEvent } from 'p-event'; ++import { connectAllPubSubNodes, createComponentsArray } from './utils/create-pubsub.js'; ++/* eslint-disable dot-notation */ ++describe('gossip / allowedTopics', () => { ++ let nodes; ++ const allowedTopic = 'topic_allowed'; ++ const notAllowedTopic = 'topic_not_allowed'; ++ const allowedTopics = [allowedTopic]; ++ const allTopics = [allowedTopic, notAllowedTopic]; ++ // Create pubsub nodes ++ beforeEach(async () => { ++ mockNetwork.reset(); ++ nodes = await createComponentsArray({ ++ number: 2, ++ connected: false, ++ init: { ++ allowedTopics ++ } ++ }); ++ }); ++ afterEach(async () => { ++ await stop(...nodes.reduce((acc, curr) => acc.concat(curr.pubsub, ...Object.entries(curr.components)), [])); ++ mockNetwork.reset(); ++ }); ++ it('should send gossip to non-mesh peers in topic', async function () { ++ this.timeout(10 * 1000); ++ const [nodeA, nodeB] = nodes; ++ // add subscriptions to each node ++ for (const topic of allTopics) { ++ nodeA.pubsub.subscribe(topic); ++ } ++ // every node connected to every other ++ await Promise.all([ ++ connectAllPubSubNodes(nodes), ++ // nodeA should send nodeB all its subscriptions on connection ++ pEvent(nodeB.pubsub, 'subscription-change') ++ ]); ++ // eslint-disable-next-line @typescript-eslint/dot-notation ++ const nodeASubscriptions = Array.from((nodeA.pubsub)['subscriptions'].keys()); ++ expect(nodeASubscriptions).deep.equals(allTopics, 'nodeA.subscriptions should be subcribed to all'); ++ // eslint-disable-next-line @typescript-eslint/dot-notation ++ const nodeBTopics = Array.from((nodeB.pubsub)['topics'].keys()); ++ expect(nodeBTopics).deep.equals(allowedTopics, 'nodeB.topics should only contain allowedTopics'); ++ }); ++}); ++//# sourceMappingURL=allowedTopics.spec.js.map +\ No newline at end of file +diff --git a/node_modules/@chainsafe/libp2p-gossipsub/dist/test/allowedTopics.spec.js.map b/node_modules/@chainsafe/libp2p-gossipsub/dist/test/allowedTopics.spec.js.map +new file mode 100644 +index 0000000..1da0eb7 +--- /dev/null ++++ b/node_modules/@chainsafe/libp2p-gossipsub/dist/test/allowedTopics.spec.js.map +@@ -0,0 +1 @@ ++{"version":3,"file":"allowedTopics.spec.js","sourceRoot":"","sources":["../../test/allowedTopics.spec.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAA;AACxC,OAAO,EAAE,WAAW,EAAE,MAAM,0CAA0C,CAAA;AACtE,OAAO,EAAE,MAAM,EAAE,MAAM,YAAY,CAAA;AACnC,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAA;AAChC,OAAO,EAAE,qBAAqB,EAAE,qBAAqB,EAA+B,MAAM,0BAA0B,CAAA;AAEpH,iCAAiC;AACjC,QAAQ,CAAC,wBAAwB,EAAE,GAAG,EAAE;IACtC,IAAI,KAA+B,CAAA;IAEnC,MAAM,YAAY,GAAG,eAAe,CAAA;IACpC,MAAM,eAAe,GAAG,mBAAmB,CAAA;IAC3C,MAAM,aAAa,GAAG,CAAC,YAAY,CAAC,CAAA;IACpC,MAAM,SAAS,GAAG,CAAC,YAAY,EAAE,eAAe,CAAC,CAAA;IAEjD,sBAAsB;IACtB,UAAU,CAAC,KAAK,IAAI,EAAE;QACpB,WAAW,CAAC,KAAK,EAAE,CAAA;QACnB,KAAK,GAAG,MAAM,qBAAqB,CAAC;YAClC,MAAM,EAAE,CAAC;YACT,SAAS,E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,QAAQ,CAAC,CAAC,IAAI,EAAE,CAAC,CAAA;QAC/D,MAAM,CAAC,WAAW,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,aAAa,EAAE,gDAAgD,CAAC,CAAA;IAClG,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"} +\ No newline at end of file +diff --git a/node_modules/@chainsafe/libp2p-gossipsub/dist/test/benchmark/asyncIterable.test.d.ts b/node_modules/@chainsafe/libp2p-gossipsub/dist/test/benchmark/asyncIterable.test.d.ts +new file mode 100644 +index 0000000..20d9496 +--- /dev/null ++++ b/node_modules/@chainsafe/libp2p-gossipsub/dist/test/benchmark/asyncIterable.test.d.ts +@@ -0,0 +1,2 @@ ++export {}; ++//# sourceMappingURL=asyncIterable.test.d.ts.map +\ No newline at end of file +diff --git a/node_modules/@chainsafe/libp2p-gossipsub/dist/test/benchmark/asyncIterable.test.d.ts.map b/node_modules/@chainsafe/libp2p-gossipsub/dist/test/benchmark/asyncIterable.test.d.ts.map +new file mode 100644 +index 0000000..e99e026 +--- /dev/null ++++ b/node_modules/@chainsafe/libp2p-gossipsub/dist/test/benchmark/asyncIterable.test.d.ts.map +@@ -0,0 +1 @@ ++{"version":3,"file":"asyncIterable.test.d.ts","sourceRoot":"","sources":["../../../test/benchmark/asyncIterable.test.ts"],"names":[],"mappings":""} +\ No newline at end of file +diff --git a/node_modules/@chainsafe/libp2p-gossipsub/dist/test/benchmark/asyncIterable.test.js b/node_modules/@chainsafe/libp2p-gossipsub/dist/test/benchmark/asyncIterable.test.js +new file mode 100644 +index 0000000..c8e5ce2 +--- /dev/null ++++ b/node_modules/@chainsafe/libp2p-gossipsub/dist/test/benchmark/asyncIterable.test.js +@@ -0,0 +1,79 @@ ++import { itBench } from '@dapplion/benchmark'; ++import { abortableSource } from 'abortable-iterator'; ++import all from 'it-all'; ++import { pipe } from 'it-pipe'; ++/* eslint-disable generator-star-spacing */ ++describe('abortableSource cost', function () { ++ const n = 10000; ++ const bytes = new Uint8Array(200); ++ const controller = new AbortController(); ++ async function* bytesSource() { ++ let i = 0; ++ while (i++ < n) { ++ yield bytes; ++ } ++ } ++ for (let k = 0; k < 5; k++) { ++ itBench({ ++ id: `async iterate abortable x${k} bytesSource ${n}`, ++ beforeEach: () => { ++ let source = bytesSource(); ++ for (let i = 0; i < k; i++) { ++ source = abortableSource(source, controller.signal); ++ } ++ return source; ++ }, ++ fn: async (source) => { ++ for await (const chunk of source) { ++ // eslint-disable-next-line @typescript-eslint/no-unused-expressions ++ chunk; ++ } ++ } ++ }); ++ } ++}); ++describe('pipe extra iterables cost', function () { ++ const n = 10000; ++ async function* numberSource() { ++ let i = 0; ++ while (i < n) { ++ yield i++; ++ } ++ } ++ async function* numberTransform(source) { ++ for await (const num of source) { ++ yield num + 1; ++ } ++ } ++ itBench({ ++ id: `async iterate pipe x0 transforms ${n}`, ++ fn: async () => { ++ await pipe(numberSource, all); ++ } ++ }); ++ itBench({ ++ id: `async iterate pipe x1 transforms ${n}`, ++ fn: async () => { ++ await pipe(numberSource, numberTransform, all); ++ } ++ }); ++ itBench({ ++ id: `async iterate pipe x2 transforms ${n}`, ++ fn: async () => { ++ await pipe(numberSource, numberTransform, numberTransform, all); ++ } ++ }); ++ itBench({ ++ id: `async iterate pipe x4 transforms ${n}`, ++ fn: async () => { ++ await pipe(numberSource, numberTransform, numberTransform, numberTransform, numberTransform, all); ++ } ++ }); ++ itBench({ ++ id: `async iterate pipe x8 transforms ${n}`, ++ fn: async () => { ++ await pipe(numberSource, numberTransform, numberTransform, numberTransform, numberTransform, numberTransform, numberTransform, numberTransform, numberTransform, all); ++ } ++ }); ++}); ++//# sourceMappingURL=asyncIterable.test.js.map +\ No newline at end of file +diff --git a/node_modules/@chainsafe/libp2p-gossipsub/dist/test/benchmark/asyncIterable.test.js.map b/node_modules/@chainsafe/libp2p-gossipsub/dist/test/benchmark/asyncIterable.test.js.map +new file mode 100644 +index 0000000..efdb4ba +--- /dev/null ++++ b/node_modules/@chainsafe/libp2p-gossipsub/dist/test/benchmark/asyncIterable.test.js.map +@@ -0,0 +1 @@ ++{"version":3,"file":"asyncIterable.test.js","sourceRoot":"","sources":["../../../test/benchmark/asyncIterable.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAA;AAC7C,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAA;AACpD,OAAO,GAAG,MAAM,QAAQ,CAAA;AACxB,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAA;AAE9B,2CAA2C;AAE3C,QAAQ,CAAC,sBAAsB,EAAE;IAC/B,MAAM,CAAC,GAAG,KAAK,CAAA;IACf,MAAM,KAAK,GAAG,IAAI,UAAU,CAAC,GAAG,CAAC,CAAA;IACjC,MAAM,UAAU,GAAG,IAAI,eAAe,EAAE,CAAA;IAExC,KAAK,SAAS,CAAC,CAAC,WAAW;QACzB,IAAI,CAAC,GAAG,CAAC,CAAA;QACT,OAAO,CAAC,EAAE,GAAG,CAAC,EAAE,CAAC;YACf,MAAM,KAAK,CAAA;QACb,CAAC;IACH,CAAC;IAED,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;QAC3B,OAAO,CAAC;YACN,EAAE,EAAE,4BAA4B,CAAC,gBAAgB,CAAC,EAAE;YACpD,UAAU,EAAE,GAAG,EAAE;gBACf,IAAI,MAAM,GAAG,WAAW,EAAE,CAAA;gBAC1B,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;oBAC3B,MAAM,GAAG,eAAe,CAAC,MAAM,EAAE,UAAU,CAAC,MAAM,CAAC,CAAA;gBACrD,CAAC;gBACD,OAAO,MAAM,CAAA;YACf,CAAC;YACD,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,EAAE;gBACnB,IAAI,KAAK,EAAE,MAAM,KAAK,IAAI,MAAM,EAAE,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eAAe,EACf,GAAG,CACJ,CAAA;QACH,CAAC;KACF,CAAC,CAAA;IAEF,OAAO,CAAC;QACN,EAAE,EAAE,oCAAoC,CAAC,EAAE;QAC3C,EAAE,EAAE,KAAK,IAAI,EAAE;YACb,MAAM,IAAI,CACR,YAAY,EACZ,eAAe,EACf,eAAe,EACf,eAAe,EACf,eAAe,EACf,eAAe,EACf,eAAe,EACf,eAAe,EACf,eAAe,EACf,GAAG,CACJ,CAAA;QACH,CAAC;KACF,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"} +\ No newline at end of file +diff --git a/node_modules/@chainsafe/libp2p-gossipsub/dist/test/benchmark/index.test.d.ts b/node_modules/@chainsafe/libp2p-gossipsub/dist/test/benchmark/index.test.d.ts +new file mode 100644 +index 0000000..121d59b +--- /dev/null ++++ b/node_modules/@chainsafe/libp2p-gossipsub/dist/test/benchmark/index.test.d.ts +@@ -0,0 +1,2 @@ ++export {}; ++//# sourceMappingURL=index.test.d.ts.map +\ No newline at end of file +diff --git a/node_modules/@chainsafe/libp2p-gossipsub/dist/test/benchmark/index.test.d.ts.map b/node_modules/@chainsafe/libp2p-gossipsub/dist/test/benchmark/index.test.d.ts.map +new file mode 100644 +index 0000000..dbcc819 +--- /dev/null ++++ b/node_modules/@chainsafe/libp2p-gossipsub/dist/test/benchmark/index.test.d.ts.map +@@ -0,0 +1 @@ ++{"version":3,"file":"index.test.d.ts","sourceRoot":"","sources":["../../../test/benchmark/index.test.ts"],"names":[],"mappings":""} +\ No newline at end of file +diff --git a/node_modules/@chainsafe/libp2p-gossipsub/dist/test/benchmark/index.test.js b/node_modules/@chainsafe/libp2p-gossipsub/dist/test/benchmark/index.test.js +new file mode 100644 +index 0000000..e4e2454 +--- /dev/null ++++ b/node_modules/@chainsafe/libp2p-gossipsub/dist/test/benchmark/index.test.js +@@ -0,0 +1,110 @@ ++import { itBench } from '@dapplion/benchmark'; ++import { expect } from 'aegir/chai'; ++import { fromString as uint8ArrayFromString } from 'uint8arrays/from-string'; ++import { connectPubsubNodes, createComponentsArray, denseConnect } from '../utils/create-pubsub.js'; ++import { awaitEvents, checkReceivedSubscriptions, checkReceivedSubscription } from '../utils/events.js'; ++describe('heartbeat', function () { ++ const topic = 'foobar'; ++ const numTopic = 70; ++ const numPeers = 50; ++ const numPeersPerTopic = 30; ++ let numLoop = 0; ++ const getTopic = (i) => { ++ return topic + String(i); ++ }; ++ const getTopicPeerIndices = (topic) => { ++ // peer 0 join all topics ++ const peers = [0]; ++ // topic 0 starts from index 1 ++ // topic 1 starts from index 2... ++ for (let i = 0; i < numPeersPerTopic - 1; i++) { ++ const peerIndex = (i + topic + 1) % numPeers; ++ if (peerIndex !== 0) ++ peers.push(peerIndex); ++ } ++ return peers; ++ }; ++ /** ++ * Star topology ++ * * peer 1 ++ * * / ++ * peer 0 - peer 2 ++ * * \ ++ * * peer 3 ++ * ++ * A topic contains peer 0 and some other peers, with numPeersPerTopic = 4 ++ * ++ * |Topic| Peers | ++ * |-----|-----------| ++ * | 0 | 0, 1, 2, 3| ++ * | 1 | 0, 2, 3, 4| ++ */ ++ itBench({ ++ id: 'heartbeat', ++ before: async () => { ++ const psubs = await createComponentsArray({ ++ number: numPeers, ++ init: { ++ scoreParams: { ++ IPColocationFactorWeight: 0 ++ }, ++ floodPublish: true, ++ // TODO: why we need to configure this low score ++ // probably we should tweak topic score params ++ // is that why we don't have mesh peers? ++ scoreThresholds: { ++ gossipThreshold: -10, ++ publishThreshold: -100, ++ graylistThreshold: -1000 ++ } ++ } ++ }); ++ // build the star ++ await Promise.all(psubs.slice(1).map(async (ps) => connectPubsubNodes(psubs[0], ps))); ++ await Promise.all(psubs.map(async (ps) => awaitEvents(ps.pubsub, 'gossipsub:heartbeat', 2))); ++ await denseConnect(psubs); ++ // make sure psub 0 has `numPeers - 1` peers ++ expect(psubs[0].pubsub.getPeers().length).to.be.gte(numPeers - 1, `peer 0 should have at least ${numPeers - 1} peers`); ++ const peerIds = psubs.map((psub) => psub.components.peerId.toString()); ++ for (let topicIndex = 0; topicIndex < numTopic; topicIndex++) { ++ const topic = getTopic(topicIndex); ++ psubs.forEach((ps) => { ps.pubsub.subscribe(topic); }); ++ const peerIndices = getTopicPeerIndices(topicIndex); ++ const peerIdsOnTopic = peerIndices.map((peerIndex) => peerIds[peerIndex]); ++ // peer 0 see all subscriptions from other ++ const subscription = checkReceivedSubscriptions(psubs[0], peerIdsOnTopic, topic); ++ // other peers should see the subsription from peer 0 to prevent PublishError.InsufficientPeers error ++ const otherSubscriptions = peerIndices ++ .slice(1) ++ .map((peerIndex) => psubs[peerIndex]) ++ .map(async (psub) => checkReceivedSubscription(psub, peerIds[0], topic, 0)); ++ peerIndices.forEach((peerIndex) => { psubs[peerIndex].pubsub.subscribe(topic); }); ++ await Promise.all([subscription, ...otherSubscriptions]); ++ } ++ // wait for heartbeats to build mesh ++ await Promise.all(psubs.map(async (ps) => awaitEvents(ps.pubsub, 'gossipsub:heartbeat', 3))); ++ // make sure psubs 0 have at least 10 topic peers and 4 mesh peers for each topic ++ for (let i = 0; i < numTopic; i++) { ++ expect((psubs[0].pubsub).getSubscribers(getTopic(i)).length).to.be.gte(10, `psub 0: topic ${i} does not have enough topic peers`); ++ expect((psubs[0].pubsub).getMeshPeers(getTopic(i)).length).to.be.gte(4, `psub 0: topic ${i} does not have enough mesh peers`); ++ } ++ return psubs; ++ }, ++ beforeEach: async (psubs) => { ++ numLoop++; ++ const msg = `its not a flooooood ${numLoop}`; ++ const promises = []; ++ for (let topicIndex = 0; topicIndex < numTopic; topicIndex++) { ++ for (const peerIndex of getTopicPeerIndices(topicIndex)) { ++ promises.push(psubs[peerIndex].pubsub.publish(getTopic(topicIndex), uint8ArrayFromString(psubs[peerIndex].components.peerId.toString() + msg))); ++ } ++ } ++ await Promise.all(promises); ++ return psubs[0]; ++ }, ++ fn: async (firstPsub) => { ++ return (firstPsub.pubsub).heartbeat(); ++ } ++ }); ++}); ++//# sourceMappingURL=index.test.js.map +\ No newline at end of file +diff --git a/node_modules/@chainsafe/libp2p-gossipsub/dist/test/benchmark/index.test.js.map b/node_modules/@chainsafe/libp2p-gossipsub/dist/test/benchmark/index.test.js.map +new file mode 100644 +index 0000000..1cd94a0 +--- /dev/null ++++ b/node_modules/@chainsafe/libp2p-gossipsub/dist/test/benchmark/index.test.js.map +@@ -0,0 +1 @@ ++{"version":3,"file":"index.test.js","sourceRoot":"","sources":["../../../test/benchmark/index.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAA;AAC7C,OAAO,EAAE,MAAM,EAAE,MAAM,YAAY,CAAA;AACnC,OAAO,EAAE,UAAU,IAAI,oBAAoB,EAAE,MAAM,yBAAyB,CAAA;AAC5E,OAAO,EACL,kBAAkB,EAClB,qBAAqB,EACrB,YAAY,EAEb,MAAM,2BAA2B,CAAA;AAClC,OAAO,EAAE,WAAW,EAAE,0BAA0B,EAAE,yBAAyB,EAAE,MAAM,oBAAoB,CAAA;AAEvG,QAAQ,CAAC,WAAW,EAAE;IACpB,MAAM,KAAK,GAAG,QAAQ,CAAA;IACtB,MAAM,QAAQ,GAAG,EAAE,CAAA;IACnB,MAAM,QAAQ,GAAG,EAAE,CAAA;IACnB,MAAM,gBAAgB,GAAG,EAAE,CAAA;IAC3B,IAAI,OAAO,GAAG,CAAC,CAAA;IAEf,MAAM,QAAQ,GAAG,CAAC,CAAS,EAAU,EAAE;QACrC,OAAO,KAAK,GAAG,MAAM,CAAC,CAAC,CAAC,CAAA;IAC1B,CAAC,CAAA;IAED,MAAM,mBAAmB,GAAG,CAAC,KAAa,EAAY,EAAE;QACtD,yBAAyB;QACzB,MAAM,KAAK,GAAG,CAAC,CAAC,CAAC,CAAA;QACjB,8BAA8B;QAC9B,iCAAiC;QACjC,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,gBAAgB,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;YAC9C,MAAM,SAAS,GAAG,CAAC,CAAC,GAAG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xD,QAAQ,CAAC,IAAI,CACX,KAAK,CAAC,SAAS,CAAC,CAAC,MAAM,CAAC,OAAO,CAC7B,QAAQ,CAAC,UAAU,CAAC,EACpB,oBAAoB,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC,UAAU,CAAC,MAAM,CAAC,QAAQ,EAAE,GAAG,GAAG,CAAC,CAC1E,CACF,CAAA;gBACH,CAAC;YACH,CAAC;YACD,MAAM,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAA;YAE3B,OAAO,KAAK,CAAC,CAAC,CAAC,CAAA;QACjB,CAAC;QACD,EAAE,EAAE,KAAK,EAAE,SAAiC,EAAE,EAAE;YAC9C,OAAO,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,SAAS,EAAE,CAAA;QACvC,CAAC;KACF,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"} +\ No newline at end of file +diff --git a/node_modules/@chainsafe/libp2p-gossipsub/dist/test/benchmark/protobuf.test.d.ts b/node_modules/@chainsafe/libp2p-gossipsub/dist/test/benchmark/protobuf.test.d.ts +new file mode 100644 +index 0000000..05311f5 +--- /dev/null ++++ b/node_modules/@chainsafe/libp2p-gossipsub/dist/test/benchmark/protobuf.test.d.ts +@@ -0,0 +1,2 @@ ++export {}; ++//# sourceMappingURL=protobuf.test.d.ts.map +\ No newline at end of file +diff --git a/node_modules/@chainsafe/libp2p-gossipsub/dist/test/benchmark/protobuf.test.d.ts.map b/node_modules/@chainsafe/libp2p-gossipsub/dist/test/benchmark/protobuf.test.d.ts.map +new file mode 100644 +index 0000000..a7e2596 +--- /dev/null ++++ b/node_modules/@chainsafe/libp2p-gossipsub/dist/test/benchmark/protobuf.test.d.ts.map +@@ -0,0 +1 @@ ++{"version":3,"file":"protobuf.test.d.ts","sourceRoot":"","sources":["../../../test/benchmark/protobuf.test.ts"],"names":[],"mappings":""} +\ No newline at end of file +diff --git a/node_modules/@chainsafe/libp2p-gossipsub/dist/test/benchmark/protobuf.test.js b/node_modules/@chainsafe/libp2p-gossipsub/dist/test/benchmark/protobuf.test.js +new file mode 100644 +index 0000000..9e50b47 +--- /dev/null ++++ b/node_modules/@chainsafe/libp2p-gossipsub/dist/test/benchmark/protobuf.test.js +@@ -0,0 +1,48 @@ ++import crypto from 'node:crypto'; ++import { itBench } from '@dapplion/benchmark'; ++import { RPC } from '../../src/message/rpc.js'; ++describe('protobuf', function () { ++ const testCases = [ ++ // As of Oct 2023, Attestation length = 281 ++ { name: 'Attestation', length: 300 }, ++ // A SignedBeaconBlock could be from 70_000 to 300_000 ++ { name: 'SignedBeaconBlock', length: 70_000 }, ++ { name: 'SignedBeaconBlock', length: 140_000 }, ++ { name: 'SignedBeaconBlock', length: 210_000 }, ++ { name: 'SignedBeaconBlock', length: 280_000 } ++ ]; ++ for (const { name, length } of testCases) { ++ const rpc = { ++ subscriptions: [], ++ messages: [ ++ { ++ topic: 'topic1', ++ data: crypto.randomBytes(length), ++ signature: Uint8Array.from(Array.from({ length: 96 }, () => 100)) ++ } ++ ], ++ control: undefined ++ }; ++ const bytes = RPC.encode(rpc); ++ const runsFactor = 1000; ++ itBench({ ++ id: `decode ${name} message ${length} bytes`, ++ fn: () => { ++ for (let i = 0; i < runsFactor; i++) { ++ RPC.decode(bytes); ++ } ++ }, ++ runsFactor ++ }); ++ itBench({ ++ id: `encode ${name} message ${length} bytes`, ++ fn: () => { ++ for (let i = 0; i < runsFactor; i++) { ++ RPC.encode(rpc); ++ } ++ }, ++ runsFactor ++ }); ++ } ++}); ++//# sourceMappingURL=protobuf.test.js.map +\ No newline at end of file +diff --git a/node_modules/@chainsafe/libp2p-gossipsub/dist/test/benchmark/protobuf.test.js.map b/node_modules/@chainsafe/libp2p-gossipsub/dist/test/benchmark/protobuf.test.js.map +new file mode 100644 +index 0000000..0741329 +--- /dev/null ++++ b/node_modules/@chainsafe/libp2p-gossipsub/dist/test/benchmark/protobuf.test.js.map +@@ -0,0 +1 @@ ++{"version":3,"file":"protobuf.test.js","sourceRoot":"","sources":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G,CAAC,EAAE,CAAC,GAAG,UAAU,EAAE,CAAC,EAAE,EAAE,CAAC;oBACpC,GAAG,CAAC,MAAM,CAAC,KAAK,CAAC,CAAA;gBACnB,CAAC;YACH,CAAC;YACD,UAAU;SACX,CAAC,CAAA;QAEF,OAAO,CAAC;YACN,EAAE,EAAE,UAAU,IAAI,YAAY,MAAM,QAAQ;YAC5C,EAAE,EAAE,GAAG,EAAE;gBACP,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,UAAU,EAAE,CAAC,EAAE,EAAE,CAAC;oBACpC,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAA;gBACjB,CAAC;YACH,CAAC;YACD,UAAU;SACX,CAAC,CAAA;IACJ,CAAC;AACH,CAAC,CAAC,CAAA"} +\ No newline at end of file +diff --git a/node_modules/@chainsafe/libp2p-gossipsub/dist/test/benchmark/time-cache.test.d.ts b/node_modules/@chainsafe/libp2p-gossipsub/dist/test/benchmark/time-cache.test.d.ts +new file mode 100644 +index 0000000..8b84d29 +--- /dev/null ++++ b/node_modules/@chainsafe/libp2p-gossipsub/dist/test/benchmark/time-cache.test.d.ts +@@ -0,0 +1,2 @@ ++export {}; ++//# sourceMappingURL=time-cache.test.d.ts.map +\ No newline at end of file +diff --git a/node_modules/@chainsafe/libp2p-gossipsub/dist/test/benchmark/time-cache.test.d.ts.map b/node_modules/@chainsafe/libp2p-gossipsub/dist/test/benchmark/time-cache.test.d.ts.map +new file mode 100644 +index 0000000..fae2ec2 +--- /dev/null ++++ b/node_modules/@chainsafe/libp2p-gossipsub/dist/test/benchmark/time-cache.test.d.ts.map +@@ -0,0 +1 @@ ++{"version":3,"file":"time-cache.test.d.ts","sourceRoot":"","sources":["../../../test/benchmark/time-cache.test.ts"],"names":[],"mappings":""} +\ No newline at end of file +diff --git a/node_modules/@chainsafe/libp2p-gossipsub/dist/test/benchmark/time-cache.test.js b/node_modules/@chainsafe/libp2p-gossipsub/dist/test/benchmark/time-cache.test.js +new file mode 100644 +index 0000000..1d2dec6 +--- /dev/null ++++ b/node_modules/@chainsafe/libp2p-gossipsub/dist/test/benchmark/time-cache.test.js +@@ -0,0 +1,22 @@ ++import { itBench } from '@dapplion/benchmark'; ++// eslint-disable-next-line @typescript-eslint/ban-ts-comment ++// @ts-expect-error no types ++import TimeCache from 'time-cache'; ++import { SimpleTimeCache } from '../../src/utils/time-cache.js'; ++// TODO: errors with "Error: root suite not found" ++describe('npm TimeCache vs SimpleTimeCache', () => { ++ const iterations = [1_000_000, 4_000_000, 8_000_000, 16_000_000]; ++ const timeCache = new TimeCache({ validity: 1 }); ++ const simpleTimeCache = new SimpleTimeCache({ validityMs: 1000 }); ++ for (const iteration of iterations) { ++ itBench(`npm TimeCache.put x${iteration}`, () => { ++ for (let j = 0; j < iteration; j++) ++ timeCache.put(String(j)); ++ }); ++ itBench(`SimpleTimeCache.put x${iteration}`, () => { ++ for (let j = 0; j < iteration; j++) ++ simpleTimeCache.put(String(j), true); ++ }); ++ } ++}); ++//# sourceMappingURL=time-cache.test.js.map +\ No newline at end of file +diff --git a/node_modules/@chainsafe/libp2p-gossipsub/dist/test/benchmark/time-cache.test.js.map b/node_modules/@chainsafe/libp2p-gossipsub/dist/test/benchmark/time-cache.test.js.map +new file mode 100644 +index 0000000..0f77d79 +--- /dev/null ++++ b/node_modules/@chainsafe/libp2p-gossipsub/dist/test/benchmark/time-cache.test.js.map +@@ -0,0 +1 @@ ++{"version":3,"file":"time-cache.test.js","sourceRoot":"","sources":["../../../test/benchmark/time-cache.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAA;AAC7C,6DAA6D;AAC7D,4BAA4B;AAC5B,OAAO,SAAS,MAAM,YAAY,CAAA;AAClC,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAA;AAE/D,kDAAkD;AAClD,QAAQ,CAAC,kCAAkC,EAAE,GAAG,EAAE;IAChD,MAAM,UAAU,GAAG,CAAC,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,UAAU,CAAC,CAAA;IAChE,MAAM,SAAS,GAAG,IAAI,SAAS,CAAC,EAAE,QAAQ,EAAE,CAAC,EAAE,CAAC,CAAA;IAChD,MAAM,eAAe,GAAG,IAAI,eAAe,CAAC,EAAE,UAAU,EAAE,IAAI,EAAE,CAAC,CAAA;IAEjE,KAAK,MAAM,SAAS,IAAI,UAAU,EAAE,CAAC;QACnC,OAAO,CAAC,sBAAsB,SAAS,EAAE,EAAE,GAAG,EAAE;YAC9C,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,SAAS,EAAE,CAAC,EAAE;gBAAE,SAAS,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAA;QAC9D,CAAC,CAAC,CAAA;QAEF,OAAO,CAAC,wBAAwB,SAAS,EAAE,EAAE,GAAG,EAAE;YAChD,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,SAAS,EAAE,CAAC,EAAE;gBAAE,eAAe,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,IAAI,CAAC,CAAA;QAC1E,CAAC,CAAC,CAAA;IACJ,CAAC;AACH,CAAC,CAAC,CAAA"} +\ No newline at end of file +diff --git a/node_modules/@chainsafe/libp2p-gossipsub/dist/test/compliance.spec.d.ts b/node_modules/@chainsafe/libp2p-gossipsub/dist/test/compliance.spec.d.ts +new file mode 100644 +index 0000000..dac08d9 +--- /dev/null ++++ b/node_modules/@chainsafe/libp2p-gossipsub/dist/test/compliance.spec.d.ts +@@ -0,0 +1,2 @@ ++export {}; ++//# sourceMappingURL=compliance.spec.d.ts.map +\ No newline at end of file +diff --git a/node_modules/@chainsafe/libp2p-gossipsub/dist/test/compliance.spec.d.ts.map b/node_modules/@chainsafe/libp2p-gossipsub/dist/test/compliance.spec.d.ts.map +new file mode 100644 +index 0000000..dc9e719 +--- /dev/null ++++ b/node_modules/@chainsafe/libp2p-gossipsub/dist/test/compliance.spec.d.ts.map +@@ -0,0 +1 @@ ++{"version":3,"file":"compliance.spec.d.ts","sourceRoot":"","sources":["../../test/compliance.spec.ts"],"names":[],"mappings":""} +\ No newline at end of file +diff --git a/node_modules/@chainsafe/libp2p-gossipsub/dist/test/compliance.spec.js b/node_modules/@chainsafe/libp2p-gossipsub/dist/test/compliance.spec.js +new file mode 100644 +index 0000000..71c5311 +--- /dev/null ++++ b/node_modules/@chainsafe/libp2p-gossipsub/dist/test/compliance.spec.js +@@ -0,0 +1,35 @@ ++import { TypedEventEmitter } from '@libp2p/interface'; ++import tests from '@libp2p/interface-compliance-tests/pubsub'; ++import { defaultLogger } from '@libp2p/logger'; ++import { PersistentPeerStore } from '@libp2p/peer-store'; ++import { MemoryDatastore } from 'datastore-core'; ++import { GossipSub } from '../src/index.js'; ++describe.skip('interface compliance', function () { ++ this.timeout(3000); ++ tests({ ++ async setup(args) { ++ if (args == null) { ++ throw new Error('PubSubOptions is required'); ++ } ++ const pubsub = new GossipSub({ ++ ...args.components, ++ peerStore: new PersistentPeerStore({ ++ peerId: args.components.peerId, ++ datastore: new MemoryDatastore(), ++ events: new TypedEventEmitter(), ++ logger: defaultLogger() ++ }) ++ }, { ++ ...args.init, ++ // libp2p-interfaces-compliance-tests in test 'can subscribe and unsubscribe correctly' publishes to no peers ++ // Disable check to allow passing tests ++ allowPublishToZeroTopicPeers: true ++ }); ++ return pubsub; ++ }, ++ async teardown() { ++ // ++ } ++ }); ++}); ++//# sourceMappingURL=compliance.spec.js.map +\ No newline at end of file +diff --git a/node_modules/@chainsafe/libp2p-gossipsub/dist/test/compliance.spec.js.map b/node_modules/@chainsafe/libp2p-gossipsub/dist/test/compliance.spec.js.map +new file mode 100644 +index 0000000..d05a95d +--- /dev/null ++++ b/node_modules/@chainsafe/libp2p-gossipsub/dist/test/compliance.spec.js.map +@@ -0,0 +1 @@ ++{"version":3,"file":"compliance.spec.js","sourceRoot":"","sources":["../../test/compliance.spec.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAA;AACrD,OAAO,KAAK,MAAM,2CAA2C,CAAA;AAC7D,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAA;AAC9C,OAAO,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAA;AACxD,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAA;AAChD,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAA;AAG3C,QAAQ,CAAC,IAAI,CAAC,sBAAsB,EAAE;IACpC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,CAAA;IAElB,KAAK,CAAC;QACJ,KAAK,CAAC,KAAK,CAAE,IAAI;YACf,IAAI,IAAI,IAAI,IAAI,EAAE,CAAC;gBACjB,MAAM,IAAI,KAAK,CAAC,2BAA2B,CAAC,CAAA;YAC9C,CAAC;YAED,MAAM,MAAM,GAAG,IAAI,SAAS,CAC1B;gBACE,GAAG,IAAI,CAAC,UAAU;gBAClB,SAAS,EAAE,IAAI,mBAAmB,CAAC;oBACjC,MAAM,EAAE,IAAI,CAAC,UAAU,CAAC,MAAM;oBAC9B,SAAS,EAAE,IAAI,eAAe,EAAE;oBAChC,MAAM,EAAE,IAAI,iBAAiB,EAAgB;oBAC7C,MAAM,EAAE,aAAa,EAAE;iBACxB,CAAC;aACH,EACD;gBACE,GAAG,IAAI,CAAC,IAAI;gBACZ,6GAA6G;gBAC7G,uCAAuC;gBACvC,4BAA4B,EAAE,IAAI;aACnC,CACF,CAAA;YAED,OAAO,MAAM,CAAA;QACf,CAAC;QAED,KAAK,CAAC,QAAQ;YACZ,EAAE;QACJ,CAAC;KACF,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"} +\ No newline at end of file +diff --git a/node_modules/@chainsafe/libp2p-gossipsub/dist/test/e2e/go-gossipsub.spec.d.ts b/node_modules/@chainsafe/libp2p-gossipsub/dist/test/e2e/go-gossipsub.spec.d.ts +new file mode 100644 +index 0000000..86c3450 +--- /dev/null ++++ b/node_modules/@chainsafe/libp2p-gossipsub/dist/test/e2e/go-gossipsub.spec.d.ts +@@ -0,0 +1,2 @@ ++export {}; ++//# sourceMappingURL=go-gossipsub.spec.d.ts.map +\ No newline at end of file +diff --git a/node_modules/@chainsafe/libp2p-gossipsub/dist/test/e2e/go-gossipsub.spec.d.ts.map b/node_modules/@chainsafe/libp2p-gossipsub/dist/test/e2e/go-gossipsub.spec.d.ts.map +new file mode 100644 +index 0000000..35560e4 +--- /dev/null ++++ b/node_modules/@chainsafe/libp2p-gossipsub/dist/test/e2e/go-gossipsub.spec.d.ts.map +@@ -0,0 +1 @@ ++{"version":3,"file":"go-gossipsub.spec.d.ts","sourceRoot":"","sources":["../../../test/e2e/go-gossipsub.spec.ts"],"names":[],"mappings":""} +\ No newline at end of file +diff --git a/node_modules/@chainsafe/libp2p-gossipsub/dist/test/e2e/go-gossipsub.spec.js b/node_modules/@chainsafe/libp2p-gossipsub/dist/test/e2e/go-gossipsub.spec.js +new file mode 100644 +index 0000000..fc27489 +--- /dev/null ++++ b/node_modules/@chainsafe/libp2p-gossipsub/dist/test/e2e/go-gossipsub.spec.js +@@ -0,0 +1,1113 @@ ++import { FloodSub } from '@libp2p/floodsub'; ++import { TopicValidatorResult } from '@libp2p/interface'; ++import { stop } from '@libp2p/interface'; ++import { mockNetwork } from '@libp2p/interface-compliance-tests/mocks'; ++import { expect } from 'aegir/chai'; ++import delay from 'delay'; ++import pRetry from 'p-retry'; ++import pWaitFor from 'p-wait-for'; ++import { equals as uint8ArrayEquals } from 'uint8arrays/equals'; ++import { fromString as uint8ArrayFromString } from 'uint8arrays/from-string'; ++import { GossipsubD } from '../../src/constants.js'; ++import { sparseConnect, denseConnect, connectSome, createComponentsArray, createComponents, connectPubsubNodes } from '../utils/create-pubsub.js'; ++import { awaitEvents, checkReceivedSubscription, checkReceivedSubscriptions } from '../utils/events.js'; ++import { fastMsgIdFn } from '../utils/index.js'; ++/** ++ * These tests were translated from: ++ * https://github.com/libp2p/go-libp2p-pubsub/blob/master/gossipsub_test.go ++ */ ++/** ++ * Given a topic and data (and debug metadata -- sender index and msg index) ++ * Return a function (takes a gossipsub (and receiver index)) ++ * that returns a Promise that awaits the message being received ++ * and checks that the received message equals the given message ++ */ ++const checkReceivedMessage = (topic, data, senderIx, msgIx) => async (node, receiverIx) => new Promise((resolve, reject) => { ++ const t = setTimeout(() => { ++ node.pubsub.removeEventListener('message', cb); ++ reject(new Error(`Message never received, sender ${senderIx}, receiver ${receiverIx}, index ${msgIx}`)); ++ }, 60000); ++ const cb = (evt) => { ++ const msg = evt.detail; ++ if (msg.topic !== topic) { ++ return; ++ } ++ if (uint8ArrayEquals(data, msg.data)) { ++ clearTimeout(t); ++ node.pubsub.removeEventListener('message', cb); ++ resolve(); ++ } ++ }; ++ node.pubsub.addEventListener('message', cb); ++}); ++describe('go-libp2p-pubsub gossipsub tests', function () { ++ // In Github runners it takes ~10sec the longest test ++ this.timeout(120 * 1000); ++ this.retries(3); ++ let psubs; ++ beforeEach(() => { ++ mockNetwork.reset(); ++ }); ++ afterEach(async () => { ++ await stop(...psubs.reduce((acc, curr) => acc.concat(curr.pubsub, ...Object.entries(curr.components)), [])); ++ mockNetwork.reset(); ++ }); ++ it('test sparse gossipsub', async function () { ++ // Create 20 gossipsub nodes ++ // Subscribe to the topic, all nodes ++ // Sparsely connect the nodes ++ // Publish 100 messages, each from a random node ++ // Assert that subscribed nodes receive the message ++ psubs = await createComponentsArray({ ++ number: 20, ++ init: { ++ floodPublish: false, ++ batchPublish: true, ++ scoreParams: { ++ IPColocationFactorThreshold: 20, ++ behaviourPenaltyWeight: 0 ++ } ++ } ++ }); ++ const topic = 'foobar'; ++ psubs.forEach((ps) => { ps.pubsub.subscribe(topic); }); ++ await sparseConnect(psubs); ++ // wait for heartbeats to build mesh ++ await Promise.all(psubs.map(async (ps) => awaitEvents(ps.pubsub, 'gossipsub:heartbeat', 2))); ++ const sendRecv = []; ++ for (let i = 0; i < 100; i++) { ++ const msg = uint8ArrayFromString(`${i} its not a flooooood ${i}`); ++ const owner = Math.floor(Math.random() * psubs.length); ++ const results = Promise.all(psubs.filter((psub, j) => j !== owner).map(checkReceivedMessage(topic, msg, owner, i))); ++ sendRecv.push(psubs[owner].pubsub.publish(topic, msg)); ++ sendRecv.push(results); ++ } ++ await Promise.all(sendRecv); ++ }); ++ const batchOpts = [true, false]; ++ for (const batchPublish of batchOpts) { ++ // eslint-disable-next-line no-loop-func ++ it(`test dense gossipsub batchPublish=${batchPublish}`, async function () { ++ // Create 20 gossipsub nodes ++ // Subscribe to the topic, all nodes ++ // Densely connect the nodes ++ // Publish 100 messages, each from a random node ++ // Assert that subscribed nodes receive the message ++ psubs = await createComponentsArray({ ++ number: 20, ++ init: { ++ floodPublish: false, ++ batchPublish, ++ scoreParams: { ++ IPColocationFactorThreshold: 20, ++ behaviourPenaltyWeight: 0 ++ } ++ } ++ }); ++ const topic = 'foobar'; ++ psubs.forEach((ps) => { ps.pubsub.subscribe(topic); }); ++ await denseConnect(psubs); ++ // wait for heartbeats to build mesh ++ await Promise.all(psubs.map(async (ps) => awaitEvents(ps.pubsub, 'gossipsub:heartbeat', 2))); ++ const sendRecv = []; ++ for (let i = 0; i < 100; i++) { ++ const msg = uint8ArrayFromString(`${i} its not a flooooood ${i}`); ++ const owner = Math.floor(Math.random() * psubs.length); ++ const results = Promise.all(psubs.filter((psub, j) => j !== owner).map(checkReceivedMessage(topic, msg, owner, i))); ++ sendRecv.push(psubs[owner].pubsub.publish(topic, msg)); ++ sendRecv.push(results); ++ } ++ await Promise.all(sendRecv); ++ }); ++ } ++ it('test gossipsub fanout', async function () { ++ // Create 20 gossipsub nodes ++ // Subscribe to the topic, all nodes except the first ++ // Densely connect the nodes ++ // Publish 100 messages, each from the first node ++ // Assert that subscribed nodes receive the message ++ // Subscribe to the topic, first node ++ // Publish 100 messages, each from the first node ++ // Assert that subscribed nodes receive the message ++ psubs = await createComponentsArray({ ++ number: 20, ++ init: { ++ floodPublish: false, ++ scoreParams: { ++ IPColocationFactorThreshold: 20, ++ behaviourPenaltyWeight: 0 ++ } ++ } ++ }); ++ const topic = 'foobar'; ++ const promises = psubs.map(async (ps) => awaitEvents(ps.pubsub, 'gossipsub:heartbeat', 2)); ++ psubs.slice(1).forEach((ps) => { ps.pubsub.subscribe(topic); }); ++ await denseConnect(psubs); ++ // wait for heartbeats to build mesh ++ await Promise.all(promises); ++ let sendRecv = []; ++ for (let i = 0; i < 100; i++) { ++ const msg = uint8ArrayFromString(`${i} its not a flooooood ${i}`); ++ const owner = 0; ++ const results = Promise.all(psubs.slice(1).map(checkReceivedMessage(topic, msg, owner, i))); ++ await psubs[owner].pubsub.publish(topic, msg); ++ await results; ++ } ++ // await Promise.all(sendRecv) ++ psubs[0].pubsub.subscribe(topic); ++ // wait for a heartbeat ++ await Promise.all(psubs.map(async (ps) => awaitEvents(ps.pubsub, 'gossipsub:heartbeat', 1))); ++ sendRecv = []; ++ for (let i = 0; i < 100; i++) { ++ const msg = uint8ArrayFromString(`2nd - ${i} its not a flooooood ${i}`); ++ const owner = 0; ++ const results = Promise.all(psubs ++ .slice(1) ++ .filter((psub, j) => j !== owner) ++ .map(checkReceivedMessage(topic, msg, owner, i))); ++ sendRecv.push(psubs[owner].pubsub.publish(topic, msg)); ++ sendRecv.push(results); ++ } ++ await Promise.all(sendRecv); ++ }); ++ it('test gossipsub fanout maintenance', async function () { ++ // Create 20 gossipsub nodes ++ // Subscribe to the topic, all nodes except the first ++ // Densely connect the nodes ++ // Publish 100 messages, each from the first node ++ // Assert that subscribed nodes receive the message ++ // Unsubscribe to the topic, all nodes except the first ++ // Resubscribe to the topic, all nodes except the first ++ // Publish 100 messages, each from the first node ++ // Assert that the subscribed nodes receive the message ++ psubs = await createComponentsArray({ ++ number: 20, ++ init: { ++ floodPublish: false, ++ scoreParams: { ++ IPColocationFactorThreshold: 20, ++ behaviourPenaltyWeight: 0 ++ } ++ } ++ }); ++ const promises = psubs.map(async (ps) => awaitEvents(ps.pubsub, 'gossipsub:heartbeat', 2)); ++ const topic = 'foobar'; ++ psubs.slice(1).forEach((ps) => { ps.pubsub.subscribe(topic); }); ++ await denseConnect(psubs); ++ // wait for heartbeats to build mesh ++ await Promise.all(promises); ++ let sendRecv = []; ++ const sendMessages = async (time) => { ++ for (let i = 0; i < 100; i++) { ++ const msg = uint8ArrayFromString(`${time} ${i} its not a flooooood ${i}`); ++ const owner = 0; ++ const results = Promise.all(psubs ++ .slice(1) ++ .filter((psub, j) => j !== owner) ++ .map(checkReceivedMessage(topic, msg, owner, i))); ++ await psubs[owner].pubsub.publish(topic, msg); ++ sendRecv.push(results); ++ } ++ }; ++ await sendMessages(1); ++ await Promise.all(sendRecv); ++ psubs.slice(1).forEach((ps) => { ps.pubsub.unsubscribe(topic); }); ++ // wait for heartbeats ++ await Promise.all(psubs.map(async (ps) => awaitEvents(ps.pubsub, 'gossipsub:heartbeat', 2))); ++ psubs.slice(1).forEach((ps) => { ps.pubsub.subscribe(topic); }); ++ // wait for heartbeats ++ await Promise.all(psubs.map(async (ps) => awaitEvents(ps.pubsub, 'gossipsub:heartbeat', 2))); ++ sendRecv = []; ++ await sendMessages(2); ++ await Promise.all(sendRecv); ++ }); ++ it('test gossipsub fanout expiry', async function () { ++ // Create 10 gossipsub nodes ++ // Subscribe to the topic, all nodes except the first ++ // Densely connect the nodes ++ // Publish 5 messages, each from the first node ++ // Assert that the subscribed nodes receive every message ++ // Assert that the first node has fanout peers ++ // Wait until fanout expiry ++ // Assert that the first node has no fanout ++ psubs = await createComponentsArray({ ++ number: 10, ++ init: { ++ scoreParams: { ++ IPColocationFactorThreshold: 20, ++ behaviourPenaltyWeight: 0 ++ }, ++ floodPublish: false, ++ fanoutTTL: 1000 ++ } ++ }); ++ const promises = psubs.map(async (ps) => awaitEvents(ps.pubsub, 'gossipsub:heartbeat', 2)); ++ const topic = 'foobar'; ++ psubs.slice(1).forEach((ps) => { ps.pubsub.subscribe(topic); }); ++ await denseConnect(psubs); ++ // wait for heartbeats to build mesh ++ await Promise.all(promises); ++ const sendRecv = []; ++ for (let i = 0; i < 5; i++) { ++ const msg = uint8ArrayFromString(`${i} its not a flooooood ${i}`); ++ const owner = 0; ++ const results = Promise.all(psubs.filter((psub, j) => j !== owner).map(checkReceivedMessage(topic, msg, owner, i))); ++ await psubs[owner].pubsub.publish(topic, msg); ++ sendRecv.push(results); ++ } ++ await Promise.all(sendRecv); ++ expect((psubs[0].pubsub).fanout).to.not.be.empty(); ++ await pWaitFor(async () => { ++ return (psubs[0].pubsub).fanout.size === 0; ++ }); ++ }); ++ it('test gossipsub gossip', async function () { ++ // Create 20 gossipsub nodes ++ // Subscribe to the topic, all nodes ++ // Densely connect the nodes ++ // Publish 100 messages, each from a random node ++ // Assert that the subscribed nodes receive the message ++ // Wait a bit between each message so gossip can be interleaved ++ psubs = await createComponentsArray({ ++ number: 20, ++ init: { ++ scoreParams: { ++ IPColocationFactorThreshold: 20, ++ behaviourPenaltyWeight: 0 ++ } ++ } ++ }); ++ const promises = psubs.map(async (ps) => awaitEvents(ps.pubsub, 'gossipsub:heartbeat', 2)); ++ const topic = 'foobar'; ++ psubs.forEach((ps) => { ps.pubsub.subscribe(topic); }); ++ await denseConnect(psubs); ++ // wait for heartbeats to build mesh ++ await Promise.all(promises); ++ for (let i = 0; i < 100; i++) { ++ const msg = uint8ArrayFromString(`${i} its not a flooooood ${i}`); ++ const owner = Math.floor(Math.random() * psubs.length); ++ const results = Promise.all(psubs.filter((psub, j) => j !== owner).map(checkReceivedMessage(topic, msg, owner, i))); ++ await psubs[owner].pubsub.publish(topic, msg); ++ await results; ++ // wait a bit to have some gossip interleaved ++ await delay(100); ++ } ++ // and wait for some gossip flushing ++ await Promise.all(psubs.map(async (ps) => awaitEvents(ps.pubsub, 'gossipsub:heartbeat', 2))); ++ }); ++ it('test gossipsub gossip propagation', async function () { ++ // Create 20 gossipsub nodes ++ // Split into two groups, just a single node shared between ++ // Densely connect each group to itself ++ // Subscribe to the topic, first group minus the shared node ++ // Publish 10 messages, each from the shared node ++ // Assert that the first group receives the messages ++ // Subscribe to the topic, second group minus the shared node ++ // Assert that the second group receives the messages (via gossip) ++ psubs = await createComponentsArray({ ++ number: 20, ++ init: { ++ floodPublish: false, ++ scoreParams: { ++ IPColocationFactorThreshold: 20, ++ behaviourPenaltyWeight: 0 ++ } ++ } ++ }); ++ const topic = 'foobar'; ++ const group1 = psubs.slice(0, GossipsubD + 1); ++ const group2 = psubs.slice(GossipsubD + 1); ++ group2.unshift(psubs[0]); ++ await denseConnect(group1); ++ await denseConnect(group2); ++ group1.slice(1).forEach((ps) => { ps.pubsub.subscribe(topic); }); ++ // wait for heartbeats to build mesh ++ await Promise.all(psubs.map(async (ps) => awaitEvents(ps.pubsub, 'gossipsub:heartbeat', 3))); ++ const sendRecv = []; ++ for (let i = 0; i < 10; i++) { ++ const msg = uint8ArrayFromString(`${i} its not a flooooood ${i}`); ++ const owner = 0; ++ const results = Promise.all(group1.slice(1).map(checkReceivedMessage(topic, msg, owner, i))); ++ sendRecv.push(psubs[owner].pubsub.publish(topic, msg)); ++ sendRecv.push(results); ++ } ++ await Promise.all(sendRecv); ++ await delay(100); ++ psubs.slice(GossipsubD + 1).forEach((ps) => { ps.pubsub.subscribe(topic); }); ++ const received = Array.from({ length: psubs.length - (GossipsubD + 1) }, () => []); ++ const results = Promise.all(group2.slice(1).map(async (ps, ix) => new Promise((resolve, reject) => { ++ const t = setTimeout(() => { reject(new Error('Timed out')); }, 10000); ++ ps.pubsub.addEventListener('message', (e) => { ++ if (e.detail.topic !== topic) { ++ return; ++ } ++ received[ix].push(e.detail); ++ if (received[ix].length >= 10) { ++ clearTimeout(t); ++ resolve(); ++ } ++ }); ++ }))); ++ await results; ++ }); ++ it('test gossipsub prune', async function () { ++ // Create 20 gossipsub nodes ++ // Subscribe to the topic, all nodes ++ // Densely connect nodes ++ // Unsubscribe to the topic, first 5 nodes ++ // Publish 100 messages, each from a random node ++ // Assert that the subscribed nodes receive every message ++ psubs = await createComponentsArray({ ++ number: 20, ++ init: { ++ scoreParams: { ++ IPColocationFactorThreshold: 20 ++ } ++ } ++ }); ++ const topic = 'foobar'; ++ psubs.forEach((ps) => { ps.pubsub.subscribe(topic); }); ++ await denseConnect(psubs); ++ // wait for heartbeats to build mesh ++ await Promise.all(psubs.map(async (ps) => awaitEvents(ps.pubsub, 'gossipsub:heartbeat', 2))); ++ // disconnect some peers from the mesh to get some PRUNEs ++ psubs.slice(0, 5).forEach((ps) => { ps.pubsub.unsubscribe(topic); }); ++ // wait a bit to take effect ++ await Promise.all(psubs.map(async (ps) => awaitEvents(ps.pubsub, 'gossipsub:heartbeat', 2))); ++ const sendRecv = []; ++ for (let i = 0; i < 100; i++) { ++ const msg = uint8ArrayFromString(`${i} its not a flooooood ${i}`); ++ const owner = Math.floor(Math.random() * psubs.length); ++ const results = Promise.all(psubs ++ .slice(5) ++ .filter((psub, j) => j + 5 !== owner) ++ .map(checkReceivedMessage(topic, msg, owner, i))); ++ sendRecv.push(psubs[owner].pubsub.publish(topic, msg)); ++ sendRecv.push(results); ++ } ++ await Promise.all(sendRecv); ++ }); ++ it('test gossipsub graft', async function () { ++ // Create 20 gossipsub nodes ++ // Sparsely connect nodes ++ // Subscribe to the topic, all nodes, waiting for each subscription to propagate first ++ // Publish 100 messages, each from a random node ++ // Assert that the subscribed nodes receive every message ++ psubs = await createComponentsArray({ ++ number: 20, ++ init: { ++ scoreParams: { ++ IPColocationFactorThreshold: 20, ++ behaviourPenaltyWeight: 0 ++ } ++ } ++ }); ++ const topic = 'foobar'; ++ await sparseConnect(psubs); ++ for (const ps of psubs) { ++ ps.pubsub.subscribe(topic); ++ // wait for announce to propagate ++ await delay(100); ++ } ++ await Promise.all(psubs.map(async (ps) => awaitEvents(ps.pubsub, 'gossipsub:heartbeat', 2))); ++ const sendRecv = []; ++ for (let i = 0; i < 100; i++) { ++ const msg = uint8ArrayFromString(`${i} its not a flooooood ${i}`); ++ const owner = Math.floor(Math.random() * psubs.length); ++ const results = Promise.all(psubs.filter((psub, j) => j !== owner).map(checkReceivedMessage(topic, msg, owner, i))); ++ sendRecv.push(psubs[owner].pubsub.publish(topic, msg)); ++ sendRecv.push(results); ++ } ++ await Promise.all(sendRecv); ++ }); ++ it('test gossipsub remove peer', async function () { ++ // Create 20 gossipsub nodes ++ // Subscribe to the topic, all nodes ++ // Densely connect nodes ++ // Stop 5 nodes ++ // Publish 100 messages, each from a random still-started node ++ // Assert that the subscribed nodes receive every message ++ psubs = await createComponentsArray({ ++ number: 20, ++ init: { ++ scoreParams: { ++ IPColocationFactorThreshold: 20 ++ } ++ } ++ }); ++ const topic = 'foobar'; ++ await denseConnect(psubs); ++ psubs.forEach((ps) => { ps.pubsub.subscribe(topic); }); ++ // wait for heartbeats to build mesh ++ await Promise.all(psubs.map(async (ps) => awaitEvents(ps.pubsub, 'gossipsub:heartbeat', 2))); ++ // disconnect some peers to exercise _removePeer paths ++ afterEach(async () => { ++ await stop(...psubs ++ .slice(0, 5) ++ .reduce((acc, curr) => acc.concat(curr.pubsub, ...Object.entries(curr.components)), [])); ++ }); ++ const sendRecv = []; ++ for (let i = 0; i < 100; i++) { ++ const msg = uint8ArrayFromString(`${i} its not a flooooood ${i}`); ++ const owner = Math.floor(Math.random() * (psubs.length - 5)); ++ const results = Promise.all(psubs ++ .slice(5) ++ .filter((psub, j) => j !== owner) ++ .map(checkReceivedMessage(topic, msg, owner, i))); ++ sendRecv.push(psubs.slice(5)[owner].pubsub.publish(topic, msg)); ++ sendRecv.push(results); ++ } ++ await Promise.all(sendRecv); ++ }); ++ it('test gossipsub graft prune retry', async function () { ++ // Create 10 gossipsub nodes ++ // Densely connect nodes ++ // Subscribe to 35 topics, all nodes ++ // Publish a message from each topic, each from a random node ++ // Assert that the subscribed nodes receive every message ++ psubs = await createComponentsArray({ ++ number: 10, ++ init: { ++ scoreParams: { ++ IPColocationFactorThreshold: 20 ++ } ++ } ++ }); ++ const topic = 'foobar'; ++ await denseConnect(psubs); ++ for (let i = 0; i < 35; i++) { ++ psubs.forEach((ps) => { ps.pubsub.subscribe(`${topic}${i}`); }); ++ } ++ // wait for heartbeats to build mesh ++ await Promise.all(psubs.map(async (ps) => awaitEvents(ps.pubsub, 'gossipsub:heartbeat', 9))); ++ for (let i = 0; i < 35; i++) { ++ const msg = uint8ArrayFromString(`${i} its not a flooooood ${i}`); ++ const owner = Math.floor(Math.random() * psubs.length); ++ const results = Promise.all(psubs.filter((psub, j) => j !== owner).map(checkReceivedMessage(`${topic}${i}`, msg, owner, i))); ++ await psubs[owner].pubsub.publish(`${topic}${i}`, msg); ++ await delay(20); ++ await results; ++ } ++ }); ++ it.skip('test gossipsub control piggyback', async function () { ++ // Create 10 gossipsub nodes ++ // Densely connect nodes ++ // Subscribe to a 'flood' topic, all nodes ++ // Publish 10k messages on the flood topic, each from a random node, in the background ++ // Subscribe to 5 topics, all nodes ++ // Wait for the flood to stop ++ // Publish a message to each topic, each from a random node ++ // Assert that subscribed nodes receive each message ++ // Publish a message from each topic, each from a random node ++ // Assert that the subscribed nodes receive every message ++ psubs = await createComponentsArray({ ++ number: 10, ++ init: { ++ scoreParams: { ++ IPColocationFactorThreshold: 20, ++ behaviourPenaltyWeight: 0 ++ } ++ } ++ }); ++ const topic = 'foobar'; ++ await denseConnect(psubs); ++ const floodTopic = 'flood'; ++ psubs.forEach((ps) => { ps.pubsub.subscribe(floodTopic); }); ++ await Promise.all(psubs.map(async (ps) => awaitEvents(ps.pubsub, 'gossipsub:heartbeat', 1))); ++ // create a background flood of messages that overloads the queues ++ const floodOwner = Math.floor(Math.random() * psubs.length); ++ const floodMsg = uint8ArrayFromString('background flooooood'); ++ const backgroundFlood = Promise.resolve().then(async () => { ++ for (let i = 0; i < 10000; i++) { ++ await psubs[floodOwner].pubsub.publish(floodTopic, floodMsg); ++ } ++ }); ++ await delay(20); ++ // and subscribe to a bunch of topics in the meantime -- this should ++ // result in some dropped control messages, with subsequent piggybacking ++ // in the background flood ++ for (let i = 0; i < 5; i++) { ++ psubs.forEach((ps) => { ps.pubsub.subscribe(`${topic}${i}`); }); ++ } ++ // wait for the flood to stop ++ await backgroundFlood; ++ // and test that we have functional overlays ++ const sendRecv = []; ++ for (let i = 0; i < 5; i++) { ++ const msg = uint8ArrayFromString(`${i} its not a flooooood ${i}`); ++ const owner = Math.floor(Math.random() * psubs.length); ++ const results = Promise.all(psubs.filter((psub, j) => j !== owner).map(checkReceivedMessage(`${topic}${i}`, msg, owner, i))); ++ await psubs[owner].pubsub.publish(`${topic}${i}`, msg); ++ sendRecv.push(results); ++ } ++ await Promise.all(sendRecv); ++ }); ++ it('test mixed gossipsub', async function () { ++ // Create 20 gossipsub nodes ++ // Create 10 floodsub nodes ++ // Subscribe to the topic, all nodes ++ // Sparsely connect nodes ++ // Publish 100 messages, each from a random node ++ // Assert that the subscribed nodes receive every message ++ const gsubs = await createComponentsArray({ ++ number: 20, ++ init: { ++ scoreParams: { ++ IPColocationFactorThreshold: 20, ++ behaviourPenaltyWeight: 0 ++ }, ++ fastMsgIdFn ++ } ++ }); ++ const fsubs = await createComponentsArray({ ++ number: 10, ++ pubsub: FloodSub ++ }); ++ psubs = gsubs.concat(fsubs); ++ const topic = 'foobar'; ++ psubs.forEach((ps) => { ps.pubsub.subscribe(topic); }); ++ await sparseConnect(psubs); ++ // wait for heartbeats to build mesh ++ await Promise.all(gsubs.map(async (ps) => awaitEvents(ps.pubsub, 'gossipsub:heartbeat', 2))); ++ const sendRecv = []; ++ for (let i = 0; i < 100; i++) { ++ const msg = uint8ArrayFromString(`${i} its not a flooooood ${i}`); ++ const owner = Math.floor(Math.random() * psubs.length); ++ const results = Promise.all(psubs.filter((psub, j) => j !== owner).map(checkReceivedMessage(topic, msg, owner, i))); ++ sendRecv.push(psubs[owner].pubsub.publish(topic, msg)); ++ sendRecv.push(results); ++ } ++ await Promise.all(sendRecv); ++ }); ++ it('test gossipsub multihops', async function () { ++ // Create 6 gossipsub nodes ++ // Connect nodes in a line (eg: 0 -> 1 -> 2 -> 3 ...) ++ // Subscribe to the topic, all nodes ++ // Publish a message from node 0 ++ // Assert that the last node receives the message ++ const numPeers = 6; ++ psubs = await createComponentsArray({ ++ number: numPeers, ++ init: { ++ scoreParams: { ++ IPColocationFactorThreshold: 20, ++ behaviourPenaltyWeight: 0 ++ } ++ } ++ }); ++ const topic = 'foobar'; ++ for (let i = 0; i < numPeers - 1; i++) { ++ await connectPubsubNodes(psubs[i], psubs[i + 1]); ++ } ++ const peerIdStrsByIdx = []; ++ for (let i = 0; i < numPeers; i++) { ++ if (i === 0) { ++ // first ++ peerIdStrsByIdx[i] = [psubs[i + 1].components.peerId.toString()]; ++ } ++ else if (i > 0 && i < numPeers - 1) { ++ // middle ++ peerIdStrsByIdx[i] = [psubs[i + 1].components.peerId.toString(), psubs[i - 1].components.peerId.toString()]; ++ } ++ else if (i === numPeers - 1) { ++ // last ++ peerIdStrsByIdx[i] = [psubs[i - 1].components.peerId.toString()]; ++ } ++ } ++ const subscriptionPromises = psubs.map(async (psub, i) => checkReceivedSubscriptions(psub, peerIdStrsByIdx[i], topic)); ++ psubs.forEach((ps) => { ps.pubsub.subscribe(topic); }); ++ // wait for heartbeats to build mesh ++ await Promise.all(psubs.map(async (ps) => awaitEvents(ps.pubsub, 'gossipsub:heartbeat', 2))); ++ await Promise.all(subscriptionPromises); ++ const msg = uint8ArrayFromString(`${0} its not a flooooood ${0}`); ++ const owner = 0; ++ const results = checkReceivedMessage(topic, msg, owner, 0)(psubs[5], 5); ++ await psubs[owner].pubsub.publish(topic, msg); ++ await results; ++ }); ++ it('test gossipsub tree topology', async function () { ++ // Create 10 gossipsub nodes ++ // Connect nodes in a tree, diagram below ++ // Subscribe to the topic, all nodes ++ // Assert that the nodes are peered appropriately ++ // Publish two messages, one from either end of the tree ++ // Assert that the subscribed nodes receive every message ++ psubs = await createComponentsArray({ ++ number: 10, ++ init: { ++ scoreParams: { ++ IPColocationFactorThreshold: 20 ++ } ++ } ++ }); ++ const topic = 'foobar'; ++ /* ++ [0] -> [1] -> [2] -> [3] ++ | L->[4] ++ v ++ [5] -> [6] -> [7] ++ | ++ v ++ [8] -> [9] ++ */ ++ const treeTopology = [ ++ [1, 5], // 0 ++ [2, 4], // 1 ++ [3], // 2 ++ [], // 3 leaf ++ [], // 4 leaf ++ [6, 8], // 5 ++ [7], // 6 ++ [], // 7 leaf ++ [9], // 8 ++ [] // 9 leaf ++ ]; ++ for (let from = 0; from < treeTopology.length; from++) { ++ for (const to of treeTopology[from]) { ++ await connectPubsubNodes(psubs[from], psubs[to]); ++ } ++ } ++ const getPeerIdStrs = (idx) => { ++ const outbounds = treeTopology[idx]; ++ const inbounds = []; ++ for (let i = 0; i < treeTopology.length; i++) { ++ if (treeTopology[i].includes(idx)) ++ inbounds.push(i); ++ } ++ return Array.from(new Set([...inbounds, ...outbounds])).map((i) => psubs[i].components.peerId.toString()); ++ }; ++ const subscriptionPromises = psubs.map(async (psub, i) => checkReceivedSubscriptions(psub, getPeerIdStrs(i), topic)); ++ psubs.forEach((ps) => { ps.pubsub.subscribe(topic); }); ++ // wait for heartbeats to build mesh ++ await Promise.all(psubs.map(async (ps) => awaitEvents(ps.pubsub, 'gossipsub:heartbeat', 2))); ++ await Promise.all(subscriptionPromises); ++ expect(psubs[0].pubsub.getPeers().map((s) => s.toString())).to.have.members([ ++ psubs[1].components.peerId.toString(), ++ psubs[5].components.peerId.toString() ++ ]); ++ expect(psubs[1].pubsub.getPeers().map((s) => s.toString())).to.have.members([ ++ psubs[0].components.peerId.toString(), ++ psubs[2].components.peerId.toString(), ++ psubs[4].components.peerId.toString() ++ ]); ++ expect(psubs[2].pubsub.getPeers().map((s) => s.toString())).to.have.members([ ++ psubs[1].components.peerId.toString(), ++ psubs[3].components.peerId.toString() ++ ]); ++ const sendRecv = []; ++ for (const owner of [9, 3]) { ++ const msg = uint8ArrayFromString(`${owner} its not a flooooood ${owner}`); ++ const results = Promise.all(psubs.filter((psub, j) => j !== owner).map(checkReceivedMessage(topic, msg, owner, owner))); ++ sendRecv.push(psubs[owner].pubsub.publish(topic, msg)); ++ sendRecv.push(results); ++ } ++ await Promise.all(sendRecv); ++ }); ++ it('test gossipsub star topology with signed peer records', async function () { ++ // Create 20 gossipsub nodes with lower degrees ++ // Connect nodes to a center node, with the center having very low degree ++ // Subscribe to the topic, all nodes ++ // Assert that all nodes have > 1 connection ++ // Publish one message per node ++ // Assert that the subscribed nodes receive every message ++ psubs = await createComponentsArray({ ++ number: 20, ++ init: { ++ scoreThresholds: { ++ acceptPXThreshold: 0 ++ }, ++ scoreParams: { ++ IPColocationFactorThreshold: 20 ++ }, ++ doPX: true, ++ D: 4, ++ Dhi: 5, ++ Dlo: 3, ++ Dscore: 3, ++ prunePeers: 5 ++ } ++ }); ++ (psubs[0].pubsub).opts.D = 0; ++ (psubs[0].pubsub).opts.Dhi = 0; ++ (psubs[0].pubsub).opts.Dlo = 0; ++ (psubs[0].pubsub).opts.Dscore = 0; ++ // build the star ++ await Promise.all(psubs.slice(1).map(async (ps) => connectPubsubNodes(psubs[0], ps))); ++ await Promise.all(psubs.map(async (ps) => awaitEvents(ps.pubsub, 'gossipsub:heartbeat', 2))); ++ // build the mesh ++ const topic = 'foobar'; ++ const peerIdStrs = psubs.map((psub) => psub.components.peerId.toString()); ++ const subscriptionPromise = checkReceivedSubscriptions(psubs[0], peerIdStrs, topic); ++ psubs.forEach((ps) => { ps.pubsub.subscribe(topic); }); ++ // wait a bit for the mesh to build ++ await Promise.all(psubs.map(async (ps) => awaitEvents(ps.pubsub, 'gossipsub:heartbeat', 15, 25000))); ++ await subscriptionPromise; ++ // check that all peers have > 1 connection ++ psubs.forEach((ps) => { ++ expect(ps.components.connectionManager.getConnections().length).to.be.gt(1); ++ }); ++ // send a message from each peer and assert it was propagated ++ const sendRecv = []; ++ for (let i = 0; i < psubs.length; i++) { ++ const msg = uint8ArrayFromString(`${i} its not a flooooood ${i}`); ++ const owner = i; ++ const results = Promise.all(psubs.filter((psub, j) => j !== owner).map(checkReceivedMessage(topic, msg, owner, i))); ++ sendRecv.push(psubs[owner].pubsub.publish(topic, msg)); ++ sendRecv.push(results); ++ } ++ await Promise.all(sendRecv); ++ }); ++ it('test gossipsub direct peers', async function () { ++ // Create 3 gossipsub nodes ++ // 2 and 3 with direct peer connections with each other ++ // Connect nodes: 2 <- 1 -> 3 ++ // Assert that the nodes are connected ++ // Subscribe to the topic, all nodes ++ // Publish a message from each node ++ // Assert that all nodes receive the messages ++ // Disconnect peers ++ // Assert peers reconnect ++ // Publish a message from each node ++ // Assert that all nodes receive the messages ++ psubs = await Promise.all([ ++ createComponents({ ++ init: { ++ scoreParams: { ++ IPColocationFactorThreshold: 20 ++ }, ++ fastMsgIdFn, ++ directConnectTicks: 2 ++ } ++ }), ++ createComponents({ ++ init: { ++ scoreParams: { ++ IPColocationFactorThreshold: 20 ++ }, ++ fastMsgIdFn, ++ directConnectTicks: 2 ++ } ++ }), ++ createComponents({ ++ init: { ++ scoreParams: { ++ IPColocationFactorThreshold: 20 ++ }, ++ fastMsgIdFn ++ } ++ }) ++ ]); ++ (psubs[1].pubsub).direct.add(psubs[2].components.peerId.toString()); ++ await connectPubsubNodes(psubs[1], psubs[2]); ++ (psubs[2].pubsub).direct.add(psubs[1].components.peerId.toString()); ++ await connectPubsubNodes(psubs[2], psubs[1]); ++ // each peer connects to 2 other peers ++ await connectPubsubNodes(psubs[0], psubs[1]); ++ await connectPubsubNodes(psubs[0], psubs[2]); ++ const topic = 'foobar'; ++ const peerIdStrs = psubs.map((libp2p) => libp2p.components.peerId.toString()); ++ let subscriptionPromises = psubs.map(async (libp2ps) => checkReceivedSubscriptions(libp2ps, peerIdStrs, topic)); ++ psubs.forEach((ps) => { ps.pubsub.subscribe(topic); }); ++ await Promise.all(psubs.map(async (ps) => awaitEvents(ps.pubsub, 'gossipsub:heartbeat', 1))); ++ await Promise.all(subscriptionPromises); ++ let sendRecv = []; ++ for (let i = 0; i < 3; i++) { ++ const msg = uint8ArrayFromString(`${i} its not a flooooood ${i}`); ++ const owner = i; ++ const results = Promise.all(psubs.filter((_, j) => j !== owner).map(checkReceivedMessage(topic, msg, owner, i))); ++ sendRecv.push(psubs[owner].pubsub.publish(topic, msg)); ++ sendRecv.push(results); ++ } ++ await Promise.all(sendRecv); ++ const connectPromises = [1, 2].map(async (i) => awaitEvents(psubs[i].components.events, 'peer:connect', 1)); ++ // disconnect the direct peers to test reconnection ++ // need more time to disconnect/connect/send subscriptions again ++ subscriptionPromises = [ ++ checkReceivedSubscription(psubs[1], peerIdStrs[2], topic, 2, 10000), ++ checkReceivedSubscription(psubs[2], peerIdStrs[1], topic, 1, 10000) ++ ]; ++ await psubs[1].components.connectionManager.closeConnections(psubs[2].components.peerId); ++ // TODO remove when https://github.com/libp2p/js-libp2p-interfaces/pull/268 is merged ++ await psubs[2].components.connectionManager.closeConnections(psubs[1].components.peerId); ++ await Promise.all(psubs.map(async (ps) => awaitEvents(ps.pubsub, 'gossipsub:heartbeat', 5))); ++ await Promise.all(connectPromises); ++ await Promise.all(subscriptionPromises); ++ expect(psubs[1].components.connectionManager.getConnections(psubs[2].components.peerId)).to.not.be.empty(); ++ sendRecv = []; ++ for (let i = 0; i < 3; i++) { ++ const msg = uint8ArrayFromString(`2nd - ${i} its not a flooooood ${i}`); ++ const owner = i; ++ const results = Promise.all(psubs.filter((psub, j) => j !== owner).map(checkReceivedMessage(topic, msg, owner, i))); ++ sendRecv.push(psubs[owner].pubsub.publish(topic, msg)); ++ sendRecv.push(results); ++ } ++ await Promise.all(sendRecv); ++ }); ++ it('test gossipsub flood publish', async function () { ++ // Create 30 gossipsub nodes ++ // Connect in star topology ++ // Subscribe to the topic, all nodes ++ // Publish 20 messages, each from the center node ++ // Assert that the other nodes receive the message ++ const numPeers = 30; ++ psubs = await createComponentsArray({ ++ number: numPeers, ++ init: { ++ scoreParams: { ++ IPColocationFactorThreshold: 30 ++ } ++ } ++ }); ++ await Promise.all(psubs.slice(1).map(async (ps) => { ++ await connectPubsubNodes(psubs[0], ps); ++ })); ++ const owner = 0; ++ const psub0 = psubs[owner]; ++ const peerIdStrs = psubs.filter((_, j) => j !== owner).map((psub) => psub.components.peerId.toString()); ++ // build the (partial, unstable) mesh ++ const topic = 'foobar'; ++ const subscriptionPromise = checkReceivedSubscriptions(psub0, peerIdStrs, topic); ++ psubs.forEach((ps) => { ps.pubsub.subscribe(topic); }); ++ await Promise.all(psubs.map(async (ps) => awaitEvents(ps.pubsub, 'gossipsub:heartbeat', 1))); ++ await subscriptionPromise; ++ // send messages from the star and assert they were received ++ const sendRecv = []; ++ for (let i = 0; i < 20; i++) { ++ const msg = uint8ArrayFromString(`${i} its not a flooooood ${i}`); ++ const results = Promise.all(psubs.filter((psub, j) => j !== owner).map(checkReceivedMessage(topic, msg, owner, i))); ++ sendRecv.push(psubs[owner].pubsub.publish(topic, msg)); ++ sendRecv.push(results); ++ } ++ await Promise.all(sendRecv); ++ }); ++ it('test gossipsub negative score', async function () { ++ // Create 20 gossipsub nodes, with scoring params to quickly lower node 0's score ++ // Connect densely ++ // Subscribe to the topic, all nodes ++ // Publish 20 messages, each from a different node, collecting all received messages ++ // Assert that nodes other than 0 should not receive any messages from node 0 ++ psubs = await createComponentsArray({ ++ number: 20, ++ init: { ++ scoreParams: { ++ IPColocationFactorThreshold: 30, ++ appSpecificScore: (p) => (p === psubs[0].components.peerId.toString() ? -1000 : 0), ++ decayInterval: 1000, ++ decayToZero: 0.01 ++ }, ++ scoreThresholds: { ++ gossipThreshold: -10, ++ publishThreshold: -100, ++ graylistThreshold: -1000 ++ }, ++ fastMsgIdFn ++ } ++ }); ++ await denseConnect(psubs); ++ const topic = 'foobar'; ++ psubs.forEach((ps) => { ps.pubsub.subscribe(topic); }); ++ await Promise.all(psubs.map(async (ps) => awaitEvents(ps.pubsub, 'gossipsub:heartbeat', 3))); ++ psubs.slice(1).forEach((ps) => { ++ ps.pubsub.addEventListener('message', (evt) => { ++ if (evt.detail.type !== 'signed') { ++ throw new Error('unexpected message type'); ++ } ++ expect(evt.detail.from.equals(psubs[0].components.peerId)).to.be.false(); ++ }); ++ }); ++ const sendRecv = []; ++ for (let i = 0; i < 20; i++) { ++ const msg = uint8ArrayFromString(`${i} its not a flooooood ${i}`); ++ const owner = i; ++ sendRecv.push(psubs[owner].pubsub.publish(topic, msg)); ++ } ++ await Promise.all(sendRecv); ++ await Promise.all(psubs.map(async (ps) => awaitEvents(ps.pubsub, 'gossipsub:heartbeat', 2))); ++ }); ++ it('test gossipsub score validator ex', async function () { ++ // Create 3 gossipsub nodes ++ // Connect fully ++ // Register a topic validator on node 0: ignore 1, reject 2 ++ // Subscribe to the topic, node 0 ++ // Publish 2 messages, from 1 and 2 ++ // Assert that 0 received neither message ++ // Assert that 1's score is 0, 2's score is negative ++ const topic = 'foobar'; ++ psubs = await createComponentsArray({ ++ number: 3, ++ init: { ++ scoreParams: { ++ topics: { ++ [topic]: { ++ topicWeight: 1, ++ timeInMeshQuantum: 1000, ++ invalidMessageDeliveriesWeight: -1, ++ invalidMessageDeliveriesDecay: 0.9999, ++ timeInMeshWeight: 0, ++ timeInMeshCap: 0, ++ firstMessageDeliveriesWeight: 0, ++ firstMessageDeliveriesDecay: 0, ++ firstMessageDeliveriesCap: 0, ++ meshMessageDeliveriesWeight: 0, ++ meshMessageDeliveriesDecay: 0, ++ meshMessageDeliveriesCap: 0, ++ meshMessageDeliveriesThreshold: 0, ++ meshMessageDeliveriesWindow: 0, ++ meshMessageDeliveriesActivation: 0, ++ meshFailurePenaltyWeight: 0, ++ meshFailurePenaltyDecay: 0 ++ } ++ } ++ } ++ } ++ }); ++ await connectPubsubNodes(psubs[0], psubs[1]); ++ await connectPubsubNodes(psubs[1], psubs[2]); ++ await connectPubsubNodes(psubs[0], psubs[2]); ++ (psubs[0].pubsub).topicValidators.set(topic, async (propagationSource, m) => { ++ if (propagationSource.equals(psubs[1].components.peerId)) ++ return TopicValidatorResult.Ignore; ++ if (propagationSource.equals(psubs[2].components.peerId)) ++ return TopicValidatorResult.Reject; ++ throw Error('Unknown PeerId'); ++ }); ++ psubs[0].pubsub.subscribe(topic); ++ await delay(200); ++ psubs[0].pubsub.addEventListener('message', () => expect.fail('node 0 should not receive any messages')); ++ const msg = uint8ArrayFromString('its not a flooooood'); ++ await psubs[1].pubsub.publish(topic, msg); ++ const msg2 = uint8ArrayFromString('2nd - its not a flooooood'); ++ await psubs[2].pubsub.publish(topic, msg2); ++ await Promise.all(psubs.map(async (ps) => awaitEvents(ps.pubsub, 'gossipsub:heartbeat', 2))); ++ expect((psubs[0].pubsub).score.score(psubs[1].components.peerId.toString())).to.be.eql(0); ++ expect((psubs[0].pubsub).score.score(psubs[2].components.peerId.toString())).to.be.lt(0); ++ }); ++ it('test gossipsub piggyback control', async function () { ++ psubs = await createComponentsArray({ number: 2 }); ++ const otherId = psubs[1].components.peerId.toString(); ++ const psub = psubs[0].pubsub; ++ const topic1 = 'topic_1'; ++ const topic2 = 'topic_2'; ++ const topic3 = 'topic_3'; ++ psub.mesh.set(topic1, new Set([otherId])); ++ psub.mesh.set(topic2, new Set()); ++ const rpc = { ++ subscriptions: [], ++ messages: [] ++ }; ++ const toGraft = (topicID) => ({ topicID }); ++ const toPrune = (topicID) => ({ topicID, peers: [] }); ++ psub.piggybackControl(otherId, rpc, { ++ graft: [toGraft(topic1), toGraft(topic2), toGraft(topic3)], ++ prune: [toPrune(topic1), toPrune(topic2), toPrune(topic3)], ++ ihave: [], ++ iwant: [] ++ }); ++ const expectedRpc = { ++ subscriptions: [], ++ messages: [], ++ control: { ++ graft: [toGraft(topic1)], ++ prune: [toPrune(topic2), toPrune(topic3)], ++ ihave: [], ++ iwant: [] ++ } ++ }; ++ expect(rpc).deep.equals(expectedRpc); ++ await psub.stop(); ++ }); ++ it('test gossipsub opportunistic grafting', async function () { ++ // Create 20 nodes ++ // 6 real gossip nodes, 14 'sybil' nodes, unresponsive nodes ++ // Connect some of the real nodes ++ // Connect every sybil to every real node ++ // Subscribe to the topic, all real nodes ++ // Publish 300 messages from the real nodes ++ // Wait for opgraft ++ // Assert the real peer meshes have at least 2 honest peers ++ const topic = 'test'; ++ psubs = await createComponentsArray({ ++ number: 20, ++ init: { ++ scoreParams: { ++ IPColocationFactorThreshold: 50, ++ decayToZero: 0.01, ++ topics: { ++ // eslint-disable-next-line @typescript-eslint/consistent-type-assertions ++ [topic]: { ++ topicWeight: 1, ++ timeInMeshWeight: 0.00002777, ++ timeInMeshQuantum: 1000, ++ timeInMeshCap: 3600, ++ firstMessageDeliveriesWeight: 100, ++ firstMessageDeliveriesDecay: 0.99997, ++ firstMessageDeliveriesCap: 1000, ++ meshMessageDeliveriesWeight: 0, ++ invalidMessageDeliveriesDecay: 0.99997 ++ } ++ } ++ }, ++ scoreThresholds: { ++ gossipThreshold: -10, ++ publishThreshold: -100, ++ graylistThreshold: -10000, ++ opportunisticGraftThreshold: 1 ++ } ++ } ++ }); ++ const promises = psubs.map(async (ps) => awaitEvents(ps.pubsub, 'gossipsub:heartbeat', 1)); ++ const real = psubs.slice(0, 6); ++ const sybils = psubs.slice(6); ++ const connectPromises = real.map(async (psub) => awaitEvents(psub.components.events, 'peer:connect', 3)); ++ await connectSome(real, 5); ++ await Promise.all(connectPromises); ++ sybils.forEach((s) => { ++ (s.pubsub).handleReceivedRpc = async function () { ++ // ++ }; ++ }); ++ for (let i = 0; i < sybils.length; i++) { ++ for (let j = 0; j < real.length; j++) { ++ await connectPubsubNodes(sybils[i], real[j]); ++ } ++ } ++ await Promise.all(promises); ++ const realPeerIdStrs = real.map((psub) => psub.components.peerId.toString()); ++ const subscriptionPromises = real.map(async (psub) => { ++ const waitingPeerIdStrs = Array.from(psub.pubsub.getPeers().values()) ++ .map((p) => p.toString()) ++ .filter((peerId) => realPeerIdStrs.includes(peerId.toString())); ++ return checkReceivedSubscriptions(psub, waitingPeerIdStrs, topic); ++ }); ++ psubs.forEach((ps) => { ps.pubsub.subscribe(topic); }); ++ await Promise.all(subscriptionPromises); ++ for (let i = 0; i < 300; i++) { ++ const msg = uint8ArrayFromString(`${i} its not a flooooood ${i}`); ++ const owner = i % real.length; ++ await psubs[owner].pubsub.publish(topic, msg); ++ } ++ // now wait for opgraft cycles ++ await Promise.all(psubs.map(async (ps) => awaitEvents(ps.pubsub, 'gossipsub:heartbeat', 7))); ++ // check the honest node meshes, they should have at least 3 honest peers each ++ const realPeerIds = real.map((r) => r.components.peerId.toString()); ++ await pRetry(async () => { ++ for (const r of real) { ++ const meshPeers = (r.pubsub).mesh.get(topic); ++ if (meshPeers == null) { ++ throw new Error('meshPeers was null'); ++ } ++ let count = 0; ++ realPeerIds.forEach((p) => { ++ if (meshPeers.has(p)) { ++ count++; ++ } ++ }); ++ if (count < 2) { ++ await delay(100); ++ throw new Error('Count was less than 3'); ++ } ++ } ++ }, { retries: 10 }); ++ }); ++}); ++//# sourceMappingURL=go-gossipsub.spec.js.map +\ No newline at end of file +diff --git a/node_modules/@chainsafe/libp2p-gossipsub/dist/test/e2e/go-gossipsub.spec.js.map b/node_modules/@chainsafe/libp2p-gossipsub/dist/test/e2e/go-gossipsub.spec.js.map +new file mode 100644 +index 0000000..1cba745 +--- /dev/null ++++ b/node_modules/@chainsafe/libp2p-gossipsub/dist/test/e2e/go-gossipsub.spec.js.map +@@ -0,0 +1 @@ ++{"version":3,"file":"go-gossipsub.spec.js","sourceRoot":"","sources":["../../../test/e2e/go-gossipsub.spec.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAA;AAC3C,OAAO,EAAgB,oBAAoB,EAAqB,MAAM,mBAAmB,CAAA;AACzF,OAAO,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAA;AACxC,OAAO,EAAE,WAAW,EAAE,MAAM,0CAA0C,CAAA;AACtE,OAAO,EAAE,MAAM,EAAE,MAAM,YAAY,CAAA;AACnC,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,MAAM,MAAM,SAAS,CAAA;AAC5B,OAAO,QAAQ,MAAM,YAAY,CAAA;AACjC,OAAO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EF,IAAI,KAAK,GAAG,CAAC,EAAE,CAAC;oBACd,MAAM,KAAK,CAAC,GAAG,CAAC,CAAA;oBAChB,MAAM,IAAI,KAAK,CAAC,uBAAuB,CAAC,CAAA;gBAC1C,CAAC;YACH,CAAC;QACH,CAAC,EACD,EAAE,OAAO,EAAE,EAAE,EAAE,CAChB,CAAA;IACH,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"} +\ No newline at end of file +diff --git a/node_modules/@chainsafe/libp2p-gossipsub/dist/test/floodsub.spec.d.ts b/node_modules/@chainsafe/libp2p-gossipsub/dist/test/floodsub.spec.d.ts +new file mode 100644 +index 0000000..f880385 +--- /dev/null ++++ b/node_modules/@chainsafe/libp2p-gossipsub/dist/test/floodsub.spec.d.ts +@@ -0,0 +1,2 @@ ++export {}; ++//# sourceMappingURL=floodsub.spec.d.ts.map +\ No newline at end of file +diff --git a/node_modules/@chainsafe/libp2p-gossipsub/dist/test/floodsub.spec.d.ts.map b/node_modules/@chainsafe/libp2p-gossipsub/dist/test/floodsub.spec.d.ts.map +new file mode 100644 +index 0000000..7060884 +--- /dev/null ++++ b/node_modules/@chainsafe/libp2p-gossipsub/dist/test/floodsub.spec.d.ts.map +@@ -0,0 +1 @@ ++{"version":3,"file":"floodsub.spec.d.ts","sourceRoot":"","sources":["../../test/floodsub.spec.ts"],"names":[],"mappings":""} +\ No newline at end of file +diff --git a/node_modules/@chainsafe/libp2p-gossipsub/dist/test/floodsub.spec.js b/node_modules/@chainsafe/libp2p-gossipsub/dist/test/floodsub.spec.js +new file mode 100644 +index 0000000..8bf55e2 +--- /dev/null ++++ b/node_modules/@chainsafe/libp2p-gossipsub/dist/test/floodsub.spec.js +@@ -0,0 +1,226 @@ ++import { FloodSub } from '@libp2p/floodsub'; ++import { stop } from '@libp2p/interface'; ++import { mockNetwork } from '@libp2p/interface-compliance-tests/mocks'; ++import { expect } from 'aegir/chai'; ++import delay from 'delay'; ++import { pEvent } from 'p-event'; ++import pRetry from 'p-retry'; ++import { fromString as uint8ArrayFromString } from 'uint8arrays/from-string'; ++import { connectPubsubNodes, createComponents } from './utils/create-pubsub.js'; ++describe('gossipsub fallbacks to floodsub', () => { ++ describe('basics', () => { ++ let nodeGs; ++ let nodeFs; ++ beforeEach(async () => { ++ mockNetwork.reset(); ++ nodeGs = await createComponents({ ++ init: { ++ fallbackToFloodsub: true ++ } ++ }); ++ nodeFs = await createComponents({ ++ pubsub: FloodSub ++ }); ++ }); ++ afterEach(async () => { ++ await stop(...[nodeGs, nodeFs].reduce((acc, curr) => acc.concat(curr.pubsub, ...Object.entries(curr.components)), [])); ++ mockNetwork.reset(); ++ }); ++ it('Dial event happened from nodeGs to nodeFs', async () => { ++ await connectPubsubNodes(nodeGs, nodeFs); ++ await pRetry(() => { ++ // eslint-disable-next-line max-nested-callbacks ++ expect(nodeGs.pubsub.getPeers().map((s) => s.toString())).to.include(nodeFs.components.peerId.toString()); ++ // eslint-disable-next-line max-nested-callbacks ++ expect(nodeFs.pubsub.getPeers().map((s) => s.toString())).to.include(nodeGs.components.peerId.toString()); ++ }); ++ }); ++ }); ++ describe.skip('should not be added if fallback disabled', () => { ++ let nodeGs; ++ let nodeFs; ++ beforeEach(async () => { ++ mockNetwork.reset(); ++ nodeGs = await createComponents({ ++ init: { ++ fallbackToFloodsub: false ++ } ++ }); ++ nodeFs = await createComponents({ ++ pubsub: FloodSub ++ }); ++ }); ++ afterEach(async () => { ++ await stop(...[nodeGs, nodeFs].reduce((acc, curr) => acc.concat(curr.pubsub, ...Object.entries(curr.components)), [])); ++ mockNetwork.reset(); ++ }); ++ it('Dial event happened from nodeGs to nodeFs, but nodeGs does not support floodsub', async () => { ++ try { ++ await connectPubsubNodes(nodeGs, nodeFs); ++ expect.fail('Dial should not have succeed'); ++ } ++ catch (err) { ++ expect(err).to.have.property('name', 'UnsupportedProtocolError'); ++ } ++ }); ++ }); ++ describe('subscription functionality', () => { ++ let nodeGs; ++ let nodeFs; ++ before(async () => { ++ mockNetwork.reset(); ++ nodeGs = await createComponents({ ++ init: { ++ fallbackToFloodsub: true ++ } ++ }); ++ nodeFs = await createComponents({ ++ pubsub: FloodSub ++ }); ++ await connectPubsubNodes(nodeGs, nodeFs); ++ }); ++ afterEach(async () => { ++ await stop(...[nodeGs, nodeFs].reduce((acc, curr) => { ++ acc.push(curr.pubsub, ...Object.entries(curr.components)); ++ return acc; ++ }, [])); ++ mockNetwork.reset(); ++ }); ++ it('Subscribe to a topic', async function () { ++ this.timeout(10000); ++ const topic = 'Z'; ++ nodeGs.pubsub.subscribe(topic); ++ nodeFs.pubsub.subscribe(topic); ++ // await subscription change ++ const [evt] = await Promise.all([ ++ pEvent(nodeGs.pubsub, 'subscription-change'), ++ pEvent(nodeFs.pubsub, 'subscription-change') ++ ]); ++ const { peerId: changedPeerId, subscriptions: changedSubs } = evt.detail; ++ expect(nodeGs.pubsub.getTopics()).to.include(topic); ++ expect(nodeFs.pubsub.getTopics()).to.include(topic); ++ expect(nodeGs.pubsub.getPeers()).to.have.lengthOf(1); ++ expect(nodeFs.pubsub.getPeers()).to.have.lengthOf(1); ++ expect(nodeGs.pubsub.getSubscribers(topic).map((p) => p.toString())).to.include(nodeFs.components.peerId.toString()); ++ expect(nodeFs.pubsub.getSubscribers(topic).map((p) => p.toString())).to.include(nodeGs.components.peerId.toString()); ++ expect(nodeGs.pubsub.getPeers().map((p) => p.toString())).to.include(changedPeerId.toString()); ++ expect(changedSubs).to.have.lengthOf(1); ++ expect(changedSubs[0].topic).to.equal(topic); ++ expect(changedSubs[0].subscribe).to.equal(true); ++ }); ++ }); ++ describe('publish functionality', () => { ++ let nodeGs; ++ let nodeFs; ++ const topic = 'Z'; ++ beforeEach(async () => { ++ mockNetwork.reset(); ++ nodeGs = await createComponents({ ++ init: { ++ fallbackToFloodsub: true ++ } ++ }); ++ nodeFs = await createComponents({ ++ pubsub: FloodSub ++ }); ++ await connectPubsubNodes(nodeGs, nodeFs); ++ nodeGs.pubsub.subscribe(topic); ++ nodeFs.pubsub.subscribe(topic); ++ // await subscription change ++ await Promise.all([pEvent(nodeGs.pubsub, 'subscription-change'), pEvent(nodeFs.pubsub, 'subscription-change')]); ++ }); ++ afterEach(async () => { ++ await stop(...[nodeGs, nodeFs].reduce((acc, curr) => acc.concat(curr.pubsub, ...Object.entries(curr.components)), [])); ++ mockNetwork.reset(); ++ }); ++ const batchPublishOpts = [true, false]; ++ for (const batchPublish of batchPublishOpts) { ++ // eslint-disable-next-line no-loop-func ++ it(`Publish to a topic - nodeGs - batchPublish: ${batchPublish}`, async () => { ++ const promise = pEvent(nodeFs.pubsub, 'message'); ++ const data = uint8ArrayFromString('hey'); ++ await nodeGs.pubsub.publish(topic, data, { batchPublish }); ++ const evt = await promise; ++ if (evt.detail.type !== 'signed') { ++ throw new Error('unexpected message type'); ++ } ++ expect(evt.detail.data).to.equalBytes(data); ++ expect(evt.detail.from.toString()).to.be.eql(nodeGs.components.peerId.toString()); ++ }); ++ // eslint-disable-next-line no-loop-func ++ it(`Publish to a topic - nodeFs - batchPublish: ${batchPublish}`, async () => { ++ const promise = pEvent(nodeGs.pubsub, 'message'); ++ const data = uint8ArrayFromString('banana'); ++ await nodeFs.pubsub.publish(topic, data, { batchPublish }); ++ const evt = await promise; ++ if (evt.detail.type !== 'signed') { ++ throw new Error('unexpected message type'); ++ } ++ expect(evt.detail.data).to.equalBytes(data); ++ expect(evt.detail.from.toString()).to.be.eql(nodeFs.components.peerId.toString()); ++ }); ++ } ++ }); ++ describe('publish after unsubscribe', () => { ++ let nodeGs; ++ let nodeFs; ++ const topic = 'Z'; ++ beforeEach(async () => { ++ mockNetwork.reset(); ++ nodeGs = await createComponents({ ++ init: { ++ fallbackToFloodsub: true ++ } ++ }); ++ nodeFs = await createComponents({ ++ pubsub: FloodSub ++ }); ++ await connectPubsubNodes(nodeGs, nodeFs); ++ nodeGs.pubsub.subscribe(topic); ++ nodeFs.pubsub.subscribe(topic); ++ // await subscription change ++ await Promise.all([pEvent(nodeGs.pubsub, 'subscription-change'), pEvent(nodeFs.pubsub, 'subscription-change')]); ++ // allow subscriptions to propagate to the other peer ++ await delay(10); ++ }); ++ afterEach(async () => { ++ await stop(...[nodeGs, nodeFs].reduce((acc, curr) => acc.concat(curr.pubsub, ...Object.entries(curr.components)), [])); ++ mockNetwork.reset(); ++ }); ++ it('Unsubscribe from a topic', async () => { ++ const promise = pEvent(nodeFs.pubsub, 'subscription-change'); ++ nodeGs.pubsub.unsubscribe(topic); ++ expect(nodeGs.pubsub.getTopics()).to.be.empty(); ++ const evt = await promise; ++ const { peerId: changedPeerId, subscriptions: changedSubs } = evt.detail; ++ expect(nodeFs.pubsub.getPeers()).to.have.lengthOf(1); ++ expect(nodeFs.pubsub.getSubscribers(topic)).to.be.empty(); ++ expect(nodeFs.pubsub.getPeers().map((p) => p.toString())).to.include(changedPeerId.toString()); ++ expect(changedSubs).to.have.lengthOf(1); ++ expect(changedSubs[0].topic).to.equal(topic); ++ expect(changedSubs[0].subscribe).to.equal(false); ++ }); ++ it('Publish to a topic after unsubscribe', async () => { ++ nodeGs.pubsub.unsubscribe(topic); ++ await pEvent(nodeFs.pubsub, 'subscription-change'); ++ const promise = new Promise((resolve, reject) => { ++ nodeGs.pubsub.addEventListener('message', reject, { ++ once: true ++ }); ++ setTimeout(() => { ++ nodeGs.pubsub.removeEventListener('message', reject); ++ resolve(); ++ }, 100); ++ }); ++ await nodeFs.pubsub.publish(topic, uint8ArrayFromString('banana')); ++ await nodeGs.pubsub.publish(topic, uint8ArrayFromString('banana')); ++ try { ++ await promise; ++ } ++ catch (e) { ++ expect.fail('message should not be received'); ++ } ++ }); ++ }); ++}); ++//# sourceMappingURL=floodsub.spec.js.map +\ No newline at end of file +diff --git a/node_modules/@chainsafe/libp2p-gossipsub/dist/test/floodsub.spec.js.map b/node_modules/@chainsafe/libp2p-gossipsub/dist/test/floodsub.spec.js.map +new file mode 100644 +index 0000000..ba3c78f +--- /dev/null ++++ b/node_modules/@chainsafe/libp2p-gossipsub/dist/test/floods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,CAAA;YAC/C,CAAC;QACH,CAAC,CAAC,CAAA;IACJ,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"} +\ No newline at end of file +diff --git a/node_modules/@chainsafe/libp2p-gossipsub/dist/test/gossip.spec.d.ts b/node_modules/@chainsafe/libp2p-gossipsub/dist/test/gossip.spec.d.ts +new file mode 100644 +index 0000000..e16b30d +--- /dev/null ++++ b/node_modules/@chainsafe/libp2p-gossipsub/dist/test/gossip.spec.d.ts +@@ -0,0 +1,2 @@ ++export {}; ++//# sourceMappingURL=gossip.spec.d.ts.map +\ No newline at end of file +diff --git a/node_modules/@chainsafe/libp2p-gossipsub/dist/test/gossip.spec.d.ts.map b/node_modules/@chainsafe/libp2p-gossipsub/dist/test/gossip.spec.d.ts.map +new file mode 100644 +index 0000000..bd3eae1 +--- /dev/null ++++ b/node_modules/@chainsafe/libp2p-gossipsub/dist/test/gossip.spec.d.ts.map +@@ -0,0 +1 @@ ++{"version":3,"file":"gossip.spec.d.ts","sourceRoot":"","sources":["../../test/gossip.spec.ts"],"names":[],"mappings":""} +\ No newline at end of file +diff --git a/node_modules/@chainsafe/libp2p-gossipsub/dist/test/gossip.spec.js b/node_modules/@chainsafe/libp2p-gossipsub/dist/test/gossip.spec.js +new file mode 100644 +index 0000000..ba911ff +--- /dev/null ++++ b/node_modules/@chainsafe/libp2p-gossipsub/dist/test/gossip.spec.js +@@ -0,0 +1,223 @@ ++import { generateKeyPair } from '@libp2p/crypto/keys'; ++import { stop } from '@libp2p/interface'; ++import { mockNetwork } from '@libp2p/interface-compliance-tests/mocks'; ++import { defaultLogger } from '@libp2p/logger'; ++import { peerIdFromPrivateKey } from '@libp2p/peer-id'; ++import { expect } from 'aegir/chai'; ++import { pEvent } from 'p-event'; ++import sinon, {} from 'sinon'; ++import { stubInterface } from 'ts-sinon'; ++import { fromString as uint8ArrayFromString } from 'uint8arrays/from-string'; ++import { GossipsubDhi } from '../src/constants.js'; ++import { GossipSub } from '../src/index.js'; ++import { connectAllPubSubNodes, createComponentsArray } from './utils/create-pubsub.js'; ++describe('gossip', () => { ++ let nodes; ++ // Create pubsub nodes ++ beforeEach(async () => { ++ mockNetwork.reset(); ++ nodes = await createComponentsArray({ ++ number: GossipsubDhi + 2, ++ connected: false, ++ init: { ++ scoreParams: { ++ IPColocationFactorThreshold: GossipsubDhi + 3 ++ }, ++ maxInboundDataLength: 4000000, ++ allowPublishToZeroTopicPeers: false ++ } ++ }); ++ }); ++ afterEach(async () => { ++ await stop(...nodes.reduce((acc, curr) => acc.concat(curr.pubsub, ...Object.entries(curr.components)), [])); ++ mockNetwork.reset(); ++ }); ++ it('should send gossip to non-mesh peers in topic', async function () { ++ this.timeout(10e4); ++ const nodeA = nodes[0]; ++ const topic = 'Z'; ++ const subscriptionPromises = nodes.map(async (n) => pEvent(n.pubsub, 'subscription-change')); ++ // add subscriptions to each node ++ nodes.forEach((n) => { n.pubsub.subscribe(topic); }); ++ // every node connected to every other ++ await connectAllPubSubNodes(nodes); ++ // wait for subscriptions to be transmitted ++ await Promise.all(subscriptionPromises); ++ // await mesh rebalancing ++ await Promise.all(nodes.map(async (n) => pEvent(n.pubsub, 'gossipsub:heartbeat'))); ++ // set spy. NOTE: Forcing private property to be public ++ const nodeASpy = nodeA.pubsub; ++ sinon.spy(nodeASpy, 'pushGossip'); ++ await nodeA.pubsub.publish(topic, uint8ArrayFromString('hey')); ++ // gossip happens during the heartbeat ++ await pEvent(nodeA.pubsub, 'gossipsub:heartbeat'); ++ const mesh = (nodeA.pubsub).mesh.get(topic); ++ if (mesh == null) { ++ throw new Error('No mesh for topic'); ++ } ++ nodeASpy.pushGossip ++ .getCalls() ++ .map((call) => call.args[0]) ++ .forEach((peerId) => { ++ expect(mesh).to.not.include(peerId); ++ }); ++ // unset spy ++ nodeASpy.pushGossip.restore(); ++ }); ++ it('Should allow publishing to zero peers if flag is passed', async function () { ++ this.timeout(10e4); ++ const nodeA = nodes[0]; ++ const topic = 'Z'; ++ const publishResult = await nodeA.pubsub.publish(topic, uint8ArrayFromString('hey'), { ++ allowPublishToZeroTopicPeers: true ++ }); ++ // gossip happens during the heartbeat ++ await pEvent(nodeA.pubsub, 'gossipsub:heartbeat'); ++ // should have sent message to peerB ++ expect(publishResult.recipients).to.deep.equal([]); ++ }); ++ it('should tag peers', async function () { ++ this.timeout(10e4); ++ const nodeA = nodes[0]; ++ const nodeB = nodes[1]; ++ const topic = 'Z'; ++ const twoNodes = [nodeA, nodeB]; ++ const graftPromises = twoNodes.map(async (n) => pEvent(n.pubsub, 'gossipsub:graft')); ++ // add subscriptions to each node ++ twoNodes.forEach((n) => { n.pubsub.subscribe(topic); }); ++ // every node connected to every other ++ await connectAllPubSubNodes(twoNodes); ++ // await grafts ++ await Promise.all(graftPromises); ++ // await mesh rebalancing ++ await Promise.all(twoNodes.map(async (n) => pEvent(n.pubsub, 'gossipsub:heartbeat'))); ++ const peerInfoA = await nodeA.components.peerStore.get(nodeB.components.peerId).catch((e) => undefined); ++ const peerInfoB = await nodeB.components.peerStore.get(nodeA.components.peerId).catch((e) => undefined); ++ expect(peerInfoA?.tags.get(topic)?.value).to.equal(100); ++ expect(peerInfoB?.tags.get(topic)?.value).to.equal(100); ++ }); ++ it('should remove the tags upon pruning', async function () { ++ this.timeout(10e4); ++ const nodeA = nodes[0]; ++ const nodeB = nodes[1]; ++ const topic = 'Z'; ++ const twoNodes = [nodeA, nodeB]; ++ const subscriptionPromises = nodes.map(async (n) => pEvent(n.pubsub, 'subscription-change')); ++ // add subscriptions to each node ++ twoNodes.forEach((n) => { n.pubsub.subscribe(topic); }); ++ // every node connected to every other ++ await connectAllPubSubNodes(nodes); ++ // await for subscriptions to be transmitted ++ await Promise.all(subscriptionPromises); ++ // await mesh rebalancing ++ await Promise.all(twoNodes.map(async (n) => pEvent(n.pubsub, 'gossipsub:heartbeat'))); ++ twoNodes.forEach((n) => { n.pubsub.unsubscribe(topic); }); ++ // await for unsubscriptions to be transmitted ++ // await mesh rebalancing ++ await Promise.all(twoNodes.map(async (n) => pEvent(n.pubsub, 'gossipsub:heartbeat'))); ++ const peerInfoA = await nodeA.components.peerStore.get(nodeB.components.peerId).catch((e) => undefined); ++ const peerInfoB = await nodeB.components.peerStore.get(nodeA.components.peerId).catch((e) => undefined); ++ expect(peerInfoA?.tags.get(topic)).to.be.undefined(); ++ expect(peerInfoB?.tags.get(topic)).to.be.undefined(); ++ }); ++ it('should reject incoming messages bigger than maxInboundDataLength limit', async function () { ++ this.timeout(10e4); ++ const nodeA = nodes[0]; ++ const nodeB = nodes[1]; ++ const twoNodes = [nodeA, nodeB]; ++ const topic = 'Z'; ++ const subscriptionPromises = twoNodes.map(async (n) => pEvent(n.pubsub, 'subscription-change')); ++ // add subscriptions to each node ++ twoNodes.forEach((n) => { n.pubsub.subscribe(topic); }); ++ // every node connected to every other ++ await connectAllPubSubNodes(twoNodes); ++ // wait for subscriptions to be transmitted ++ await Promise.all(subscriptionPromises); ++ // await mesh rebalancing ++ await Promise.all(twoNodes.map(async (n) => pEvent(n.pubsub, 'gossipsub:heartbeat'))); ++ // set spy. NOTE: Forcing private property to be public ++ const nodeBSpy = nodeB.pubsub; ++ sinon.spy(nodeBSpy, 'handlePeerReadStreamError'); ++ // This should lead to handlePeerReadStreamError at nodeB ++ await nodeA.pubsub.publish(topic, new Uint8Array(5000000)); ++ await pEvent(nodeA.pubsub, 'gossipsub:heartbeat'); ++ const expectedError = nodeBSpy.handlePeerReadStreamError.getCalls()[0]?.args[0]; ++ expect(expectedError).to.have.property('name', 'InvalidDataLengthError'); ++ // unset spy ++ nodeBSpy.handlePeerReadStreamError.restore(); ++ }); ++ it('should send piggyback control into other sent messages', async function () { ++ this.timeout(10e4); ++ const nodeA = nodes[0]; ++ const topic = 'Z'; ++ const promises = nodes.map(async (n) => pEvent(n.pubsub, 'subscription-change')); ++ // add subscriptions to each node ++ nodes.forEach((n) => { n.pubsub.subscribe(topic); }); ++ // every node connected to every other ++ await connectAllPubSubNodes(nodes); ++ // wait for subscriptions to be transmitted ++ await Promise.all(promises); ++ // await nodeA mesh rebalancing ++ await pEvent(nodeA.pubsub, 'gossipsub:heartbeat'); ++ const mesh = (nodeA.pubsub).mesh.get(topic); ++ if (mesh == null) { ++ throw new Error('No mesh for topic'); ++ } ++ if (mesh.size === 0) { ++ throw new Error('Topic mesh was empty'); ++ } ++ const peerB = Array.from(mesh)[0]; ++ if (peerB == null) { ++ throw new Error('Could not get peer from mesh'); ++ } ++ // should have peerB as a subscriber to the topic ++ expect(nodeA.pubsub.getSubscribers(topic).map((p) => p.toString())).to.include(peerB, "did not know about peerB's subscription to topic"); ++ // should be able to send them messages ++ expect((nodeA.pubsub).streamsOutbound.has(peerB)).to.be.true('nodeA did not have connection open to peerB'); ++ // set spy. NOTE: Forcing private property to be public ++ const nodeASpy = sinon.spy(nodeA.pubsub, 'piggybackControl'); ++ // manually add control message to be sent to peerB ++ const graft = { ihave: [], iwant: [], graft: [{ topicID: topic }], prune: [] }; ++ (nodeA.pubsub).control.set(peerB, graft); ++ (nodeA.pubsub).gossip.set(peerB, []); ++ const publishResult = await nodeA.pubsub.publish(topic, uint8ArrayFromString('hey')); ++ // should have sent message to peerB ++ expect(publishResult.recipients.map((p) => p.toString())).to.include(peerB, 'did not send pubsub message to peerB'); ++ // wait until spy is called ++ const startTime = Date.now(); ++ while (Date.now() - startTime < 5000) { ++ if (nodeASpy.callCount > 0) ++ break; ++ } ++ expect(nodeASpy.callCount).to.be.equal(1); ++ // expect control message to be sent alongside published message ++ const call = nodeASpy.getCalls()[0]; ++ expect(call).to.have.deep.nested.property('args[1].control.graft', graft.graft); ++ // unset spy ++ nodeASpy.restore(); ++ }); ++ it('should allow configuring stream limits', async () => { ++ const maxInboundStreams = 7; ++ const maxOutboundStreams = 5; ++ const registrar = stubInterface(); ++ const privateKey = await generateKeyPair('Ed25519'); ++ const peerId = peerIdFromPrivateKey(privateKey); ++ const pubsub = new GossipSub({ ++ privateKey, ++ peerId, ++ registrar, ++ peerStore: stubInterface(), ++ connectionManager: stubInterface(), ++ logger: defaultLogger() ++ }, { ++ maxInboundStreams, ++ maxOutboundStreams ++ }); ++ await pubsub.start(); ++ expect(registrar.register.called).to.be.true(); ++ expect(registrar.handle.getCall(0)).to.have.nested.property('args[2].maxInboundStreams', maxInboundStreams); ++ expect(registrar.handle.getCall(0)).to.have.nested.property('args[2].maxOutboundStreams', maxOutboundStreams); ++ await pubsub.stop(); ++ }); ++}); ++//# sourceMappingURL=gossip.spec.js.map +\ No newline at end of file +diff --git a/node_modules/@chainsafe/libp2p-gossipsub/dist/test/gossip.spec.js.map b/node_modules/@chainsafe/libp2p-gossipsub/dist/test/gossip.spec.js.map +new file mode 100644 +index 0000000..f95cd15 +--- /dev/null ++++ b/node_modules/@chainsafe/libp2p-gossipsub/dist/test/gossip.spec.js.map +@@ -0,0 +1 @@ ++{"version":3,"file":"gossip.spec.js","sourceRoot":"","sources":["../../test/gossip.spec.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAA;AACrD,OAAO,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAA;AACxC,OAAO,EAAE,WAAW,EAAE,MAAM,0CAA0C,CAAA;AACtE,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAA;AAC9C,OAAO,EAAE,oBAAoB,EAAE,MAAM,iBAAiB,CAAA;AACtD,OAAO,EAAE,MAAM,EAAE,MAAM,YAAY,CAAA;AACnC,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAA;AAChC,OAAO,KAAK,EAAE,EAA6B,MAAM,OAAO,CAAA;AACxD,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAA;AACxC,OAAO,EAAE,UAAU,IAAI,oBAAoB,EAAE,MAAM,yBAAyB,CAAA;AAC5E,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAA;AAClD,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAA;AAC3C,OAAO,EAAE,qBAAqB,EAAE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,wCAAwC,EAAE,KAAK,IAAI,EAAE;QACtD,MAAM,iBAAiB,GAAG,CAAC,CAAA;QAC3B,MAAM,kBAAkB,GAAG,CAAC,CAAA;QAE5B,MAAM,SAAS,GAAG,aAAa,EAAa,CAAA;QAC5C,MAAM,UAAU,GAAG,MAAM,eAAe,CAAC,SAAS,CAAC,CAAA;QACnD,MAAM,MAAM,GAAG,oBAAoB,CAAC,UAAU,CAAC,CAAA;QAC/C,MAAM,MAAM,GAAG,IAAI,SAAS,CAC1B;YACE,UAAU;YACV,MAAM;YACN,SAAS;YACT,SAAS,EAAE,aAAa,EAAa;YACrC,iBAAiB,EAAE,aAAa,EAAqB;YACrD,MAAM,EAAE,aAAa,EAAE;SACxB,EACD;YACE,iBAAiB;YACjB,kBAAkB;SACnB,CACF,CAAA;QAED,MAAM,MAAM,CAAC,KAAK,EAAE,CAAA;QAEpB,MAAM,CAAC,SAAS,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,IAAI,EAAE,CAAA;QAC9C,MAAM,CAAC,SAAS,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,2BAA2B,EAAE,iBAAiB,CAAC,CAAA;QAC3G,MAAM,CAAC,SAAS,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,4BAA4B,EAAE,kBAAkB,CAAC,CAAA;QAE7G,MAAM,MAAM,CAAC,IAAI,EAAE,CAAA;IACrB,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"} +\ No newline at end of file +diff --git a/node_modules/@chainsafe/libp2p-gossipsub/dist/test/heartbeat.spec.d.ts b/node_modules/@chainsafe/libp2p-gossipsub/dist/test/heartbeat.spec.d.ts +new file mode 100644 +index 0000000..023ae00 +--- /dev/null ++++ b/node_modules/@chainsafe/libp2p-gossipsub/dist/test/heartbeat.spec.d.ts +@@ -0,0 +1,2 @@ ++export {}; ++//# sourceMappingURL=heartbeat.spec.d.ts.map +\ No newline at end of file +diff --git a/node_modules/@chainsafe/libp2p-gossipsub/dist/test/heartbeat.spec.d.ts.map b/node_modules/@chainsafe/libp2p-gossipsub/dist/test/heartbeat.spec.d.ts.map +new file mode 100644 +index 0000000..c13564c +--- /dev/null ++++ b/node_modules/@chainsafe/libp2p-gossipsub/dist/test/heartbeat.spec.d.ts.map +@@ -0,0 +1 @@ ++{"version":3,"file":"heartbeat.spec.d.ts","sourceRoot":"","sources":["../../test/heartbeat.spec.ts"],"names":[],"mappings":""} +\ No newline at end of file +diff --git a/node_modules/@chainsafe/libp2p-gossipsub/dist/test/heartbeat.spec.js b/node_modules/@chainsafe/libp2p-gossipsub/dist/test/heartbeat.spec.js +new file mode 100644 +index 0000000..bcbeada +--- /dev/null ++++ b/node_modules/@chainsafe/libp2p-gossipsub/dist/test/heartbeat.spec.js +@@ -0,0 +1,31 @@ ++import { stop } from '@libp2p/interface'; ++import { mockNetwork } from '@libp2p/interface-compliance-tests/mocks'; ++import { expect } from 'aegir/chai'; ++import { pEvent } from 'p-event'; ++import { GossipsubHeartbeatInterval } from '../src/constants.js'; ++import { createComponents } from './utils/create-pubsub.js'; ++describe('heartbeat', () => { ++ let node; ++ before(async () => { ++ mockNetwork.reset(); ++ node = await createComponents({ ++ init: { ++ emitSelf: true ++ } ++ }); ++ }); ++ after(async () => { ++ await stop(node.pubsub, ...Object.entries(node.components)); ++ mockNetwork.reset(); ++ }); ++ it('should occur with regularity defined by a constant', async function () { ++ this.timeout(GossipsubHeartbeatInterval * 5); ++ await pEvent(node.pubsub, 'gossipsub:heartbeat'); ++ const t1 = Date.now(); ++ await pEvent(node.pubsub, 'gossipsub:heartbeat'); ++ const t2 = Date.now(); ++ const safeFactor = 1.5; ++ expect(t2 - t1).to.be.lt(GossipsubHeartbeatInterval * safeFactor); ++ }); ++}); ++//# sourceMappingURL=heartbeat.spec.js.map +\ No newline at end of file +diff --git a/node_modules/@chainsafe/libp2p-gossipsub/dist/test/heartbeat.spec.js.map b/node_modules/@chainsafe/libp2p-gossipsub/dist/test/heartbeat.spec.js.map +new file mode 100644 +index 0000000..ed99f50 +--- /dev/null ++++ b/node_modules/@chainsafe/libp2p-gossipsub/dist/test/heartbeat.spec.js.map +@@ -0,0 +1 @@ ++{"version":3,"file":"heartbeat.spec.js","sourceRoot":"","sources":["../../test/heartbeat.spec.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAA;AACxC,OAAO,EAAE,WAAW,EAAE,MAAM,0CAA0C,CAAA;AACtE,OAAO,EAAE,MAAM,EAAE,MAAM,YAAY,CAAA;AACnC,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAA;AAChC,OAAO,EAAE,0BAA0B,EAAE,MAAM,qBAAqB,CAAA;AAChE,OAAO,EAAE,gBAAgB,EAA+B,MAAM,0BAA0B,CAAA;AAExF,QAAQ,CAAC,WAAW,EAAE,GAAG,EAAE;IACzB,IAAI,IAA4B,CAAA;IAEhC,MAAM,CAAC,KAAK,IAAI,EAAE;QAChB,WAAW,CAAC,KAAK,EAAE,CAAA;QACnB,IAAI,GAAG,MAAM,gBAAgB,CAAC;YAC5B,IAAI,EAAE;gBACJ,QAAQ,EAAE,IAAI;aACf;SACF,CAAC,CAAA;IACJ,CAAC,CAAC,CAAA;IAEF,KAAK,CAAC,KAAK,IAAI,EAAE;QACf,MAAM,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,CAAA;QAC3D,WAAW,CAAC,KAAK,EAAE,CAAA;IACrB,CAAC,CAAC,CAAA;IAEF,EAAE,CAAC,oDAAoD,EAAE,KAAK;QAC5D,IAAI,CAAC,OAAO,CAAC,0BAA0B,GAAG,CAAC,CAAC,CAAA;QAE5C,MAAM,MAAM,CAAC,IAAI,CAAC,MAAM,EAAE,qBAAqB,CAAC,CAAA;QAChD,MAAM,EAAE,GAAG,IAAI,CAAC,GAAG,EAAE,CAAA;QAErB,MAAM,MAAM,CAAC,IAAI,CAAC,MAAM,EAAE,qBAAqB,CAAC,CAAA;QAChD,MAAM,EAAE,GAAG,IAAI,CAAC,GAAG,EAAE,CAAA;QAErB,MAAM,UAAU,GAAG,GAAG,CAAA;QACtB,MAAM,CAAC,EAAE,GAAG,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,0BAA0B,GAAG,UAAU,CAAC,CAAA;IACnE,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"} +\ No newline at end of file +diff --git a/node_modules/@chainsafe/libp2p-gossipsub/dist/test/mesh.spec.d.ts b/node_modules/@chainsafe/libp2p-gossipsub/dist/test/mesh.spec.d.ts +new file mode 100644 +index 0000000..739752a +--- /dev/null ++++ b/node_modules/@chainsafe/libp2p-gossipsub/dist/test/mesh.spec.d.ts +@@ -0,0 +1,2 @@ ++export {}; ++//# sourceMappingURL=mesh.spec.d.ts.map +\ No newline at end of file +diff --git a/node_modules/@chainsafe/libp2p-gossipsub/dist/test/mesh.spec.d.ts.map b/node_modules/@chainsafe/libp2p-gossipsub/dist/test/mesh.spec.d.ts.map +new file mode 100644 +index 0000000..0ca3f98 +--- /dev/null ++++ b/node_modules/@chainsafe/libp2p-gossipsub/dist/test/mesh.spec.d.ts.map +@@ -0,0 +1 @@ ++{"version":3,"file":"mesh.spec.d.ts","sourceRoot":"","sources":["../../test/mesh.spec.ts"],"names":[],"mappings":""} +\ No newline at end of file +diff --git a/node_modules/@chainsafe/libp2p-gossipsub/dist/test/mesh.spec.js b/node_modules/@chainsafe/libp2p-gossipsub/dist/test/mesh.spec.js +new file mode 100644 +index 0000000..924b948 +--- /dev/null ++++ b/node_modules/@chainsafe/libp2p-gossipsub/dist/test/mesh.spec.js +@@ -0,0 +1,61 @@ ++import { stop } from '@libp2p/interface'; ++import { mockNetwork } from '@libp2p/interface-compliance-tests/mocks'; ++import { expect } from 'aegir/chai'; ++import delay from 'delay'; ++import { pEvent } from 'p-event'; ++import { GossipsubDhi } from '../src/constants.js'; ++import { connectAllPubSubNodes, createComponentsArray } from './utils/create-pubsub.js'; ++describe('mesh overlay', () => { ++ let nodes; ++ // Create pubsub nodes ++ beforeEach(async () => { ++ mockNetwork.reset(); ++ nodes = await createComponentsArray({ ++ number: GossipsubDhi + 2, ++ connected: false, ++ init: { ++ scoreParams: { ++ IPColocationFactorThreshold: GossipsubDhi + 3 ++ } ++ } ++ }); ++ }); ++ afterEach(async () => { ++ await stop(...nodes.reduce((acc, curr) => acc.concat(curr.pubsub, ...Object.entries(curr.components)), [])); ++ mockNetwork.reset(); ++ }); ++ it('should add mesh peers below threshold', async function () { ++ this.timeout(10e3); ++ // test against node0 ++ const node0 = nodes[0]; ++ const topic = 'Z'; ++ // add subscriptions to each node ++ nodes.forEach((node) => { node.pubsub.subscribe(topic); }); ++ // connect N (< GossipsubD) nodes to node0 ++ const N = 4; ++ await connectAllPubSubNodes(nodes.slice(0, N + 1)); ++ await delay(50); ++ // await mesh rebalancing ++ await new Promise((resolve) => { ++ (node0.pubsub).addEventListener('gossipsub:heartbeat', resolve, { ++ once: true ++ }); ++ }); ++ const mesh = (node0.pubsub).mesh.get(topic); ++ expect(mesh).to.have.property('size', N); ++ }); ++ it('should remove mesh peers once above threshold', async function () { ++ this.timeout(10e4); ++ // test against node0 ++ const node0 = nodes[0]; ++ const topic = 'Z'; ++ // add subscriptions to each node ++ nodes.forEach((node) => { node.pubsub.subscribe(topic); }); ++ await connectAllPubSubNodes(nodes); ++ // await mesh rebalancing ++ await pEvent(node0.pubsub, 'gossipsub:heartbeat'); ++ const mesh = (node0.pubsub).mesh.get(topic); ++ expect(mesh).to.have.property('size').that.is.lte(GossipsubDhi); ++ }); ++}); ++//# sourceMappingURL=mesh.spec.js.map +\ No newline at end of file +diff --git a/node_modules/@chainsafe/libp2p-gossipsub/dist/test/mesh.spec.js.map b/node_modules/@chainsafe/libp2p-gossipsub/dist/test/mesh.spec.js.map +new file mode 100644 +index 0000000..90ba2a0 +--- /dev/null ++++ b/node_modules/@chainsafe/libp2p-gossipsub/dist/test/mesh.spec.js.map +@@ -0,0 +1 @@ ++{"version":3,"file":"mesh.spec.js","sourceRoot":"","sources":["../../test/mesh.spec.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAA;AACxC,OAAO,EAAE,WAAW,EAAE,MAAM,0CAA0C,CAAA;AACtE,OAAO,EAAE,MAAM,EAAE,MAAM,YAAY,CAAA;AACnC,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAA;AAChC,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAA;AAClD,OAAO,EAAE,qBAAqB,EAAE,qBAAqB,EAA+B,MAAM,0BAA0B,CAAA;AAEpH,QAAQ,CAAC,cAAc,EAAE,GAAG,EAAE;IAC5B,IAAI,KAA+B,CAAA;IAEnC,sBAAsB;IACtB,UAAU,CAAC,KAAK,IAAI,EAAE;QACpB,WAAW,CAAC,KAAK,EAAE,CAAA;QACnB,KAAK,GAAG,MAAM,qBAAqB,CAAC;YAClC,MAAM,EAAE,YAAY,GAAG,CAAC;YACxB,SAAS,EAAE,KAAK;YAChB,IAAI,EAAE;gBACJ,WAAW,EAAE;oBACX,2BAA2B,EAAE,YAAY,GAAG,CAAC;iBAC9C;aACF;SACF,CAAC,CAAA;IACJ,CAAC,CAAC,CAAA;IAEF,SAAS,CAAC,KAAK,IAAI,EAAE;QACnB,MAAM,IAAI,CAAC,GAAG,KAAK,CAAC,MAAM,CAAQ,CAAC,GAAG,EAAE,IAAI,EAAE,EAAE,CAAC,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,MAAM,CAAC,OAAO,CAAC,IAAI,C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CAAC,CAAC,CAAC,CAAA;QACtB,MAAM,KAAK,GAAG,GAAG,CAAA;QAEjB,iCAAiC;QACjC,KAAK,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,EAAE,GAAG,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,KAAK,CAAC,CAAA,CAAC,CAAC,CAAC,CAAA;QAEzD,MAAM,qBAAqB,CAAC,KAAK,CAAC,CAAA;QAElC,yBAAyB;QACzB,MAAM,MAAM,CAAC,KAAK,CAAC,MAAM,EAAE,qBAAqB,CAAC,CAAA;QAEjD,MAAM,IAAI,GAAG,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,CAAA;QAC3C,MAAM,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,GAAG,CAAC,YAAY,CAAC,CAAA;IACjE,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"} +\ No newline at end of file +diff --git a/node_modules/@chainsafe/libp2p-gossipsub/dist/test/message-cache.spec.d.ts b/node_modules/@chainsafe/libp2p-gossipsub/dist/test/message-cache.spec.d.ts +new file mode 100644 +index 0000000..291d274 +--- /dev/null ++++ b/node_modules/@chainsafe/libp2p-gossipsub/dist/test/message-cache.spec.d.ts +@@ -0,0 +1,2 @@ ++export {}; ++//# sourceMappingURL=message-cache.spec.d.ts.map +\ No newline at end of file +diff --git a/node_modules/@chainsafe/libp2p-gossipsub/dist/test/message-cache.spec.d.ts.map b/node_modules/@chainsafe/libp2p-gossipsub/dist/test/message-cache.spec.d.ts.map +new file mode 100644 +index 0000000..af9ebd3 +--- /dev/null ++++ b/node_modules/@chainsafe/libp2p-gossipsub/dist/test/message-cache.spec.d.ts.map +@@ -0,0 +1 @@ ++{"version":3,"file":"message-cache.spec.d.ts","sourceRoot":"","sources":["../../test/message-cache.spec.ts"],"names":[],"mappings":""} +\ No newline at end of file +diff --git a/node_modules/@chainsafe/libp2p-gossipsub/dist/test/message-cache.spec.js b/node_modules/@chainsafe/libp2p-gossipsub/dist/test/message-cache.spec.js +new file mode 100644 +index 0000000..02969ca +--- /dev/null ++++ b/node_modules/@chainsafe/libp2p-gossipsub/dist/test/message-cache.spec.js +@@ -0,0 +1,134 @@ ++import * as utils from '@libp2p/pubsub/utils'; ++import { expect } from 'aegir/chai'; ++import { fromString as uint8ArrayFromString } from 'uint8arrays/from-string'; ++import { MessageCache } from '../src/message-cache.js'; ++import { messageIdToString } from '../src/utils/messageIdToString.js'; ++import { getMsgId } from './utils/index.js'; ++const toMessageId = (msgId) => { ++ return { ++ msgId, ++ msgIdStr: messageIdToString(msgId) ++ }; ++}; ++describe('Testing Message Cache Operations', () => { ++ const messageCache = new MessageCache(3, 5, messageIdToString); ++ const testMessages = []; ++ const topic = 'test'; ++ const getGossipIDs = (mcache, topic) => { ++ const gossipIDsByTopic = mcache.getGossipIDs(new Set([topic])); ++ return gossipIDsByTopic.get(topic) ?? []; ++ }; ++ before(async () => { ++ const makeTestMessage = (n) => { ++ return { ++ from: new Uint8Array(0), ++ data: uint8ArrayFromString(n.toString()), ++ seqno: uint8ArrayFromString(utils.randomSeqno().toString(16).padStart(16, '0'), 'base16'), ++ topic ++ }; ++ }; ++ for (let i = 0; i < 60; i++) { ++ testMessages.push(makeTestMessage(i)); ++ } ++ for (let i = 0; i < 10; i++) { ++ messageCache.put(toMessageId(getMsgId(testMessages[i])), testMessages[i], true); ++ } ++ }); ++ it('Should retrieve correct messages for each test message', () => { ++ for (let i = 0; i < 10; i++) { ++ const messageId = getMsgId(testMessages[i]); ++ const message = messageCache.get(messageId); ++ expect(message).to.equal(testMessages[i]); ++ } ++ }); ++ it('Get GossipIDs', () => { ++ const gossipIDs = getGossipIDs(messageCache, topic); ++ expect(gossipIDs.length).to.equal(10); ++ for (let i = 0; i < 10; i++) { ++ const messageID = getMsgId(testMessages[i]); ++ expect(messageID).to.deep.equal(gossipIDs[i]); ++ } ++ }); ++ it('Shift message cache', async () => { ++ messageCache.shift(); ++ for (let i = 10; i < 20; i++) { ++ messageCache.put(toMessageId(getMsgId(testMessages[i])), testMessages[i], true); ++ } ++ for (let i = 0; i < 20; i++) { ++ const messageID = getMsgId(testMessages[i]); ++ const message = messageCache.get(messageID); ++ expect(message).to.equal(testMessages[i]); ++ } ++ let gossipIDs = getGossipIDs(messageCache, topic); ++ expect(gossipIDs.length).to.equal(20); ++ for (let i = 0; i < 10; i++) { ++ const messageID = getMsgId(testMessages[i]); ++ expect(messageID).to.deep.equal(gossipIDs[10 + i]); ++ } ++ for (let i = 10; i < 20; i++) { ++ const messageID = getMsgId(testMessages[i]); ++ expect(messageID).to.deep.equal(gossipIDs[i - 10]); ++ } ++ messageCache.shift(); ++ for (let i = 20; i < 30; i++) { ++ messageCache.put(toMessageId(getMsgId(testMessages[i])), testMessages[i], true); ++ } ++ messageCache.shift(); ++ for (let i = 30; i < 40; i++) { ++ messageCache.put(toMessageId(getMsgId(testMessages[i])), testMessages[i], true); ++ } ++ messageCache.shift(); ++ for (let i = 40; i < 50; i++) { ++ messageCache.put(toMessageId(getMsgId(testMessages[i])), testMessages[i], true); ++ } ++ messageCache.shift(); ++ for (let i = 50; i < 60; i++) { ++ messageCache.put(toMessageId(getMsgId(testMessages[i])), testMessages[i], true); ++ } ++ expect(messageCache.msgs.size).to.equal(50); ++ for (let i = 0; i < 10; i++) { ++ const messageID = getMsgId(testMessages[i]); ++ const message = messageCache.get(messageID); ++ expect(message).to.be.an('undefined'); ++ } ++ for (let i = 10; i < 60; i++) { ++ const messageID = getMsgId(testMessages[i]); ++ const message = messageCache.get(messageID); ++ expect(message).to.equal(testMessages[i]); ++ } ++ gossipIDs = getGossipIDs(messageCache, topic); ++ expect(gossipIDs.length).to.equal(30); ++ for (let i = 0; i < 10; i++) { ++ const messageID = getMsgId(testMessages[50 + i]); ++ expect(messageID).to.deep.equal(gossipIDs[i]); ++ } ++ for (let i = 10; i < 20; i++) { ++ const messageID = getMsgId(testMessages[30 + i]); ++ expect(messageID).to.deep.equal(gossipIDs[i]); ++ } ++ for (let i = 20; i < 30; i++) { ++ const messageID = getMsgId(testMessages[10 + i]); ++ expect(messageID).to.deep.equal(gossipIDs[i]); ++ } ++ }); ++ it('should not gossip not-validated message ids', () => { ++ let gossipIDs = getGossipIDs(messageCache, topic); ++ while (gossipIDs.length > 0) { ++ messageCache.shift(); ++ gossipIDs = getGossipIDs(messageCache, topic); ++ } ++ expect(gossipIDs.length).to.be.equal(0); ++ for (let i = 10; i < 20; i++) { ++ // 5 last messages are not validated ++ const validated = i < 15; ++ messageCache.put(toMessageId(getMsgId(testMessages[i])), testMessages[i], validated); ++ } ++ gossipIDs = getGossipIDs(messageCache, topic); ++ expect(gossipIDs.length).to.be.equal(5); ++ // only validate the new gossip ids ++ for (let i = 0; i < 5; i++) { ++ expect(gossipIDs[i]).to.deep.equal(getMsgId(testMessages[i + 10]), 'incorrect gossip message id ' + String(i)); ++ } ++ }); ++}); ++//# sourceMappingURL=message-cache.spec.js.map +\ No newline at end of file +diff --git a/node_modules/@chainsafe/libp2p-gossipsub/dist/test/message-cache.spec.js.map b/node_modules/@chainsafe/libp2p-gossipsub/dist/test/message-cache.spec.js.map +new file mode 100644 +index 0000000..9eb3cf6 +--- /dev/null ++++ b/node_modules/@chainsafe/libp2p-gossipsub/dist/test/message-cache.spec.js.map +@@ -0,0 +1 @@ ++{"version":3,"file":"message-cache.spec.js","sourceRoot":"","sources":["../../test/message-cache.spec.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,sBAAsB,CAAA;AAC7C,OAAO,EAAE,MAAM,EAAE,MAAM,YAAY,CAAA;AACnC,OAAO,EAAE,UAAU,IAAI,oBAAoB,EAAE,MAAM,yBAAyB,CAAA;AAC5E,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAA;AACtD,OAAO,EAAE,iBAAiB,EAAE,MAAM,mCAAmC,CAAA;AACrE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CAAC,QAAQ,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,YAAY,CAAC,CAAC,CAAC,EAAE,SAAS,CAAC,CAAA;QACtF,CAAC;QAED,SAAS,GAAG,YAAY,CAAC,YAAY,EAAE,KAAK,CAAC,CAAA;QAC7C,MAAM,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC,CAAA;QACvC,mCAAmC;QACnC,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;YAC3B,MAAM,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,YAAY,CAAC,CAAC,GAAG,EAAE,CAAC,CAAC,EAAE,8BAA8B,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC,CAAA;QAChH,CAAC;IACH,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"} +\ No newline at end of file +diff --git a/node_modules/@chainsafe/libp2p-gossipsub/dist/test/peer-score-params.spec.d.ts b/node_modules/@chainsafe/libp2p-gossipsub/dist/test/peer-score-params.spec.d.ts +new file mode 100644 +index 0000000..91d19ba +--- /dev/null ++++ b/node_modules/@chainsafe/libp2p-gossipsub/dist/test/peer-score-params.spec.d.ts +@@ -0,0 +1,2 @@ ++export {}; ++//# sourceMappingURL=peer-score-params.spec.d.ts.map +\ No newline at end of file +diff --git a/node_modules/@chainsafe/libp2p-gossipsub/dist/test/peer-score-params.spec.d.ts.map b/node_modules/@chainsafe/libp2p-gossipsub/dist/test/peer-score-params.spec.d.ts.map +new file mode 100644 +index 0000000..c913b75 +--- /dev/null ++++ b/node_modules/@chainsafe/libp2p-gossipsub/dist/test/peer-score-params.spec.d.ts.map +@@ -0,0 +1 @@ ++{"version":3,"file":"peer-score-params.spec.d.ts","sourceRoot":"","sources":["../../test/peer-score-params.spec.ts"],"names":[],"mappings":""} +\ No newline at end of file +diff --git a/node_modules/@chainsafe/libp2p-gossipsub/dist/test/peer-score-params.spec.js b/node_modules/@chainsafe/libp2p-gossipsub/dist/test/peer-score-params.spec.js +new file mode 100644 +index 0000000..42d1af5 +--- /dev/null ++++ b/node_modules/@chainsafe/libp2p-gossipsub/dist/test/peer-score-params.spec.js +@@ -0,0 +1,372 @@ ++import { expect } from 'aegir/chai'; ++import * as constants from '../src/constants.js'; ++import { createTopicScoreParams, validateTopicScoreParams, createPeerScoreParams, validatePeerScoreParams } from '../src/score/index.js'; ++describe('TopicScoreParams validation', () => { ++ it('should not throw on default TopicScoreParams', () => { ++ expect(() => { validateTopicScoreParams(createTopicScoreParams({})); }).to.not.throw(); ++ }); ++ it('should throw on invalid TopicScoreParams', () => { ++ expect(() => { ++ validateTopicScoreParams(createTopicScoreParams({ ++ topicWeight: -1 ++ })); ++ }, 'topicWeight must be >= 0').to.throw(); ++ expect(() => { ++ validateTopicScoreParams(createTopicScoreParams({ ++ timeInMeshWeight: -1, ++ timeInMeshQuantum: 1000 ++ })); ++ }, 'timeInMeshWeight must be positive (or 0 to disable)').to.throw(); ++ expect(() => { ++ validateTopicScoreParams(createTopicScoreParams({ ++ timeInMeshWeight: 1, ++ timeInMeshQuantum: -1 ++ })); ++ }, 'timeInMeshQuantum must be positive').to.throw(); ++ expect(() => { ++ validateTopicScoreParams(createTopicScoreParams({ ++ timeInMeshWeight: 1, ++ timeInMeshQuantum: 1000, ++ timeInMeshCap: -1 ++ })); ++ }, 'timeInMeshCap must be positive').to.throw(); ++ expect(() => { ++ validateTopicScoreParams(createTopicScoreParams({ ++ timeInMeshQuantum: 1000, ++ firstMessageDeliveriesWeight: -1 ++ })); ++ }, 'firstMessageDeliveriesWeight must be positive (or 0 to disable)').to.throw(); ++ expect(() => { ++ validateTopicScoreParams(createTopicScoreParams({ ++ timeInMeshQuantum: 1000, ++ firstMessageDeliveriesWeight: 1, ++ firstMessageDeliveriesDecay: -1 ++ })); ++ }, 'firstMessageDeliveriesDecay must be between 0 and 1').to.throw(); ++ expect(() => { ++ validateTopicScoreParams(createTopicScoreParams({ ++ timeInMeshQuantum: 1000, ++ firstMessageDeliveriesWeight: 1, ++ firstMessageDeliveriesDecay: 2 ++ })); ++ }, 'firstMessageDeliveriesDecay must be between 0 and 1').to.throw(); ++ expect(() => { ++ validateTopicScoreParams(createTopicScoreParams({ ++ timeInMeshQuantum: 1000, ++ firstMessageDeliveriesWeight: 1, ++ firstMessageDeliveriesDecay: 0.5, ++ firstMessageDeliveriesCap: -1 ++ })); ++ }, 'firstMessageDeliveriesCap must be positive').to.throw(); ++ expect(() => { ++ validateTopicScoreParams(createTopicScoreParams({ ++ timeInMeshQuantum: 1000, ++ meshMessageDeliveriesWeight: 1 ++ })); ++ }, 'meshMessageDeliveriesWeight must be negative (or 0 to disable)').to.throw(); ++ expect(() => { ++ validateTopicScoreParams(createTopicScoreParams({ ++ timeInMeshQuantum: 1000, ++ meshMessageDeliveriesWeight: -1, ++ meshMessageDeliveriesDecay: -1 ++ })); ++ }, 'meshMessageDeliveriesDecay must be between 0 and 1').to.throw(); ++ expect(() => { ++ validateTopicScoreParams(createTopicScoreParams({ ++ timeInMeshQuantum: 1000, ++ meshMessageDeliveriesWeight: -1, ++ meshMessageDeliveriesDecay: 2 ++ })); ++ }, 'meshMessageDeliveriesDecay must be between 0 and 1').to.throw(); ++ expect(() => { ++ validateTopicScoreParams(createTopicScoreParams({ ++ timeInMeshQuantum: 1000, ++ meshMessageDeliveriesWeight: -1, ++ meshMessageDeliveriesDecay: 0.5, ++ meshMessageDeliveriesCap: -1 ++ })); ++ }, 'meshMessageDeliveriesCap must be positive').to.throw(); ++ expect(() => { ++ validateTopicScoreParams(createTopicScoreParams({ ++ timeInMeshQuantum: 1000, ++ meshMessageDeliveriesWeight: -1, ++ meshMessageDeliveriesDecay: 5, ++ meshMessageDeliveriesThreshold: -3 ++ })); ++ }, 'meshMessageDeliveriesDecay must be between 0 and 1').to.throw(); ++ expect(() => { ++ validateTopicScoreParams(createTopicScoreParams({ ++ timeInMeshQuantum: 1000, ++ meshMessageDeliveriesWeight: -1, ++ meshMessageDeliveriesDecay: 0.5, ++ meshMessageDeliveriesThreshold: -3, ++ meshMessageDeliveriesWindow: -1 ++ })); ++ }, 'meshMessageDeliveriesThreshold must be positive').to.throw(); ++ expect(() => { ++ validateTopicScoreParams(createTopicScoreParams({ ++ timeInMeshQuantum: 1000, ++ meshMessageDeliveriesWeight: -1, ++ meshMessageDeliveriesDecay: 0.5, ++ meshMessageDeliveriesThreshold: 3, ++ meshMessageDeliveriesWindow: -1, ++ meshMessageDeliveriesActivation: 1 ++ })); ++ }, 'meshMessageDeliveriesWindow must be non-negative').to.throw(); ++ expect(() => { ++ validateTopicScoreParams(createTopicScoreParams({ ++ timeInMeshQuantum: 1000, ++ meshFailurePenaltyWeight: 1 ++ })); ++ }, 'meshFailurePenaltyWeight must be negative').to.throw(); ++ expect(() => { ++ validateTopicScoreParams(createTopicScoreParams({ ++ timeInMeshQuantum: 1000, ++ meshFailurePenaltyWeight: -1, ++ meshFailurePenaltyDecay: -1 ++ })); ++ }, 'meshFailurePenaltyDecay must be between 0 and 1').to.throw(); ++ expect(() => { ++ validateTopicScoreParams(createTopicScoreParams({ ++ timeInMeshQuantum: 1000, ++ meshFailurePenaltyWeight: -1, ++ meshFailurePenaltyDecay: 2 ++ })); ++ }, 'meshFailurePenaltyDecay must be between 0 and 1').to.throw(); ++ expect(() => { ++ validateTopicScoreParams(createTopicScoreParams({ ++ timeInMeshQuantum: 1000, ++ invalidMessageDeliveriesWeight: 1 ++ })); ++ }, 'invalidMessageDeliveriesWeight must be negative').to.throw(); ++ expect(() => { ++ validateTopicScoreParams(createTopicScoreParams({ ++ timeInMeshQuantum: 1000, ++ invalidMessageDeliveriesWeight: -1, ++ invalidMessageDeliveriesDecay: -1 ++ })); ++ }, 'invalidMessageDeliveriesDecay must be between 0 and 1').to.throw(); ++ expect(() => { ++ validateTopicScoreParams(createTopicScoreParams({ ++ timeInMeshQuantum: 1000, ++ invalidMessageDeliveriesWeight: -1, ++ invalidMessageDeliveriesDecay: 2 ++ })); ++ }, 'invalidMessageDeliveriesDecay must be between 0 and 1').to.throw(); ++ }); ++ it('should not throw on valid TopicScoreParams', () => { ++ expect(() => { ++ validateTopicScoreParams(createTopicScoreParams({ ++ topicWeight: 2, ++ timeInMeshWeight: 0.01, ++ timeInMeshQuantum: 1000, ++ timeInMeshCap: 10, ++ firstMessageDeliveriesWeight: 1, ++ firstMessageDeliveriesDecay: 0.5, ++ firstMessageDeliveriesCap: 10, ++ meshMessageDeliveriesWeight: -1, ++ meshMessageDeliveriesDecay: 0.5, ++ meshMessageDeliveriesCap: 10, ++ meshMessageDeliveriesThreshold: 5, ++ meshMessageDeliveriesWindow: 1, ++ meshMessageDeliveriesActivation: 1000, ++ meshFailurePenaltyWeight: -1, ++ meshFailurePenaltyDecay: 0.5, ++ invalidMessageDeliveriesWeight: -1, ++ invalidMessageDeliveriesDecay: 0.5 ++ })); ++ }).to.not.throw(); ++ }); ++}); ++describe('PeerScoreParams validation', () => { ++ const appScore = () => 0; ++ it('should throw on invalid PeerScoreParams', () => { ++ expect(() => { ++ validatePeerScoreParams(createPeerScoreParams({ ++ topicScoreCap: -1, ++ appSpecificScore: appScore, ++ decayInterval: 1000, ++ decayToZero: 0.01 ++ })); ++ }, 'topicScoreCap must be positive').to.throw(); ++ expect(() => { ++ validatePeerScoreParams(createPeerScoreParams({ ++ topicScoreCap: 1, ++ decayInterval: 999, ++ decayToZero: 0.01 ++ })); ++ }, 'decayInterval must be at least 1s').to.throw(); ++ expect(() => { ++ validatePeerScoreParams(createPeerScoreParams({ ++ topicScoreCap: 1, ++ appSpecificScore: appScore, ++ decayInterval: 1000, ++ decayToZero: 0.01, ++ IPColocationFactorWeight: 1 ++ })); ++ }, 'IPColocationFactorWeight should be negative').to.throw(); ++ expect(() => { ++ validatePeerScoreParams(createPeerScoreParams({ ++ topicScoreCap: 1, ++ appSpecificScore: appScore, ++ decayInterval: 1000, ++ decayToZero: 0.01, ++ IPColocationFactorWeight: -1, ++ IPColocationFactorThreshold: -1 ++ })); ++ }, 'IPColocationFactorThreshold should be at least 1').to.throw(); ++ /* ++ TODO: appears to be valid config? ++ expect(() => ++ validatePeerScoreParams( ++ createPeerScoreParams({ ++ topicScoreCap: 1, ++ appSpecificScore: appScore, ++ decayInterval: 1000, ++ decayToZero: 0.01, ++ IPColocationFactorWeight: -1, ++ IPColocationFactorThreshold: 0.99 ++ }) ++ ), "IPColocationFactorThreshold should be at least 1" ++ ).to.throw() ++ */ ++ expect(() => { ++ validatePeerScoreParams(createPeerScoreParams({ ++ topicScoreCap: 1, ++ appSpecificScore: appScore, ++ decayInterval: 1000, ++ decayToZero: -1, ++ IPColocationFactorWeight: -1, ++ IPColocationFactorThreshold: 1 ++ })); ++ }, 'decayToZero must be between 0 and 1').to.throw(); ++ expect(() => { ++ validatePeerScoreParams(createPeerScoreParams({ ++ topicScoreCap: 1, ++ appSpecificScore: appScore, ++ decayInterval: 1000, ++ decayToZero: 2, ++ IPColocationFactorWeight: -1, ++ IPColocationFactorThreshold: 1 ++ })); ++ }, 'decayToZero must be between 0 and 1').to.throw(); ++ expect(() => { ++ validatePeerScoreParams(createPeerScoreParams({ ++ appSpecificScore: appScore, ++ decayInterval: 1000, ++ decayToZero: 0.01, ++ behaviourPenaltyWeight: 1 ++ })); ++ }).to.throw(); ++ /* ++ TODO: appears to be valid config? ++ expect(() => ++ validatePeerScoreParams( ++ createPeerScoreParams({ ++ appSpecificScore: appScore, ++ decayInterval: 1000, ++ decayToZero: 0.01, ++ behaviourPenaltyWeight: -1 ++ }) ++ ), "behaviourPenaltyWeight MUST be negative (or zero to disable)" ++ ).to.throw() ++ */ ++ expect(() => { ++ validatePeerScoreParams(createPeerScoreParams({ ++ appSpecificScore: appScore, ++ decayInterval: 1000, ++ decayToZero: 0.01, ++ behaviourPenaltyWeight: -1, ++ behaviourPenaltyDecay: 2 ++ })); ++ }, 'behaviourPenaltyDecay must be between 0 and 1').to.throw(); ++ expect(() => { ++ validatePeerScoreParams(createPeerScoreParams({ ++ topicScoreCap: 1, ++ appSpecificScore: appScore, ++ decayInterval: 1000, ++ decayToZero: 0.01, ++ IPColocationFactorWeight: -1, ++ IPColocationFactorThreshold: 1, ++ topics: { ++ test: { ++ topicWeight: -1, ++ timeInMeshWeight: 0.01, ++ timeInMeshQuantum: Number(constants.second), ++ timeInMeshCap: 10, ++ firstMessageDeliveriesWeight: 1, ++ firstMessageDeliveriesDecay: 0.5, ++ firstMessageDeliveriesCap: 10, ++ meshMessageDeliveriesWeight: -1, ++ meshMessageDeliveriesDecay: 0.5, ++ meshMessageDeliveriesCap: 10, ++ meshMessageDeliveriesThreshold: 5, ++ meshMessageDeliveriesWindow: 1, ++ meshMessageDeliveriesActivation: 1000, ++ meshFailurePenaltyWeight: -1, ++ meshFailurePenaltyDecay: 0.5, ++ invalidMessageDeliveriesWeight: -1, ++ invalidMessageDeliveriesDecay: 0.5 ++ } ++ } ++ })); ++ }).to.throw(); ++ }); ++ it('should not throw on valid PeerScoreParams', () => { ++ expect(() => { ++ validatePeerScoreParams(createPeerScoreParams({ ++ appSpecificScore: appScore, ++ decayInterval: 1000, ++ decayToZero: 0.01, ++ IPColocationFactorWeight: -1, ++ IPColocationFactorThreshold: 1, ++ behaviourPenaltyWeight: -1, ++ behaviourPenaltyDecay: 0.999 ++ })); ++ }).to.not.throw(); ++ expect(() => { ++ validatePeerScoreParams(createPeerScoreParams({ ++ topicScoreCap: 1, ++ appSpecificScore: appScore, ++ decayInterval: 1000, ++ decayToZero: 0.01, ++ IPColocationFactorWeight: -1, ++ IPColocationFactorThreshold: 1, ++ behaviourPenaltyWeight: -1, ++ behaviourPenaltyDecay: 0.999 ++ })); ++ }).to.not.throw(); ++ expect(() => { ++ validatePeerScoreParams(createPeerScoreParams({ ++ topicScoreCap: 1, ++ appSpecificScore: appScore, ++ decayInterval: Number(constants.second), ++ decayToZero: 0.01, ++ IPColocationFactorWeight: -1, ++ IPColocationFactorThreshold: 1, ++ topics: { ++ test: { ++ topicWeight: 1, ++ timeInMeshWeight: 0.01, ++ timeInMeshQuantum: 1000, ++ timeInMeshCap: 10, ++ firstMessageDeliveriesWeight: 1, ++ firstMessageDeliveriesDecay: 0.5, ++ firstMessageDeliveriesCap: 10, ++ meshMessageDeliveriesWeight: -1, ++ meshMessageDeliveriesDecay: 0.5, ++ meshMessageDeliveriesCap: 10, ++ meshMessageDeliveriesThreshold: 5, ++ meshMessageDeliveriesWindow: 1, ++ meshMessageDeliveriesActivation: 1000, ++ meshFailurePenaltyWeight: -1, ++ meshFailurePenaltyDecay: 0.5, ++ invalidMessageDeliveriesWeight: -1, ++ invalidMessageDeliveriesDecay: 0.5 ++ } ++ } ++ })); ++ }).to.not.throw(); ++ }); ++}); ++//# sourceMappingURL=peer-score-params.spec.js.map +\ No newline at end of file +diff --git a/node_modules/@chainsafe/libp2p-gossipsub/dist/test/peer-score-params.spec.js.map b/node_modules/@chainsafe/libp2p-gossipsub/dist/test/peer-score-params.spec.js.map +new file mode 100644 +index 0000000..d860ff5 +--- /dev/null ++++ b/node_modules/@chainsafe/libp2p-gossipsub/dist/test/peer-score-params.spec.js.map +@@ -0,0 +1 @@ ++{"version":3,"file":"peer-score-params.spec.js","sourceRoot":"","sources":["../../test/peer-score-params.spec.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,YAAY,CAAA;AACnC,OAAO,KAAK,SAAS,MAAM,qBAAqB,CAAA;AAChD,OAAO,EACL,sBAAsB,EACtB,wBAAwB,EACxB,qBAAqB,EACrB,uBAAuB,EACxB,MAAM,uBAAuB,CAAA;AAE9B,QAAQ,CAAC,6BAA6B,EAAE,GAAG,EAAE;IAC3C,EAAE,CAAC,8CAA8C,EAAE,GAAG,EAAE;QACtD,MAAM,CAAC,GAAG,EAAE,GAAG,wBAAwB,CAAC,sBAAsB,CAAC,EAAE,CAA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CAAC,GAAG,CAAC,KAAK,EAAE,CAAA;IAClB,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"} +\ No newline at end of file +diff --git a/node_modules/@chainsafe/libp2p-gossipsub/dist/test/peer-score-thresholds.spec.d.ts b/node_modules/@chainsafe/libp2p-gossipsub/dist/test/peer-score-thresholds.spec.d.ts +new file mode 100644 +index 0000000..69d5ae7 +--- /dev/null ++++ b/node_modules/@chainsafe/libp2p-gossipsub/dist/test/peer-score-thresholds.spec.d.ts +@@ -0,0 +1,2 @@ ++export {}; ++//# sourceMappingURL=peer-score-thresholds.spec.d.ts.map +\ No newline at end of file +diff --git a/node_modules/@chainsafe/libp2p-gossipsub/dist/test/peer-score-thresholds.spec.d.ts.map b/node_modules/@chainsafe/libp2p-gossipsub/dist/test/peer-score-thresholds.spec.d.ts.map +new file mode 100644 +index 0000000..0777360 +--- /dev/null ++++ b/node_modules/@chainsafe/libp2p-gossipsub/dist/test/peer-score-thresholds.spec.d.ts.map +@@ -0,0 +1 @@ ++{"version":3,"file":"peer-score-thresholds.spec.d.ts","sourceRoot":"","sources":["../../test/peer-score-thresholds.spec.ts"],"names":[],"mappings":""} +\ No newline at end of file +diff --git a/node_modules/@chainsafe/libp2p-gossipsub/dist/test/peer-score-thresholds.spec.js b/node_modules/@chainsafe/libp2p-gossipsub/dist/test/peer-score-thresholds.spec.js +new file mode 100644 +index 0000000..65e98c2 +--- /dev/null ++++ b/node_modules/@chainsafe/libp2p-gossipsub/dist/test/peer-score-thresholds.spec.js +@@ -0,0 +1,55 @@ ++import { expect } from 'aegir/chai'; ++import { createPeerScoreThresholds, validatePeerScoreThresholds } from '../src/score/index.js'; ++describe('PeerScoreThresholds validation', () => { ++ it('should throw on invalid PeerScoreThresholds', () => { ++ expect(() => { ++ validatePeerScoreThresholds(createPeerScoreThresholds({ ++ gossipThreshold: 1 ++ })); ++ }, 'gossipThreshold must be <= 0').to.throw(); ++ expect(() => { ++ validatePeerScoreThresholds(createPeerScoreThresholds({ ++ publishThreshold: 1 ++ })); ++ }, 'publishThreshold must be <= 0 and <= gossip threshold').to.throw(); ++ expect(() => { ++ validatePeerScoreThresholds(createPeerScoreThresholds({ ++ gossipThreshold: -1, ++ publishThreshold: 0 ++ })); ++ }, 'publishThreshold must be <= 0 and <= gossip threshold').to.throw(); ++ expect(() => { ++ validatePeerScoreThresholds(createPeerScoreThresholds({ ++ graylistThreshold: 1 ++ })); ++ }, 'graylistThreshold must be <= 0 and <= publish threshold').to.throw(); ++ expect(() => { ++ validatePeerScoreThresholds(createPeerScoreThresholds({ ++ publishThreshold: -1, ++ graylistThreshold: -2 ++ })); ++ }, 'graylistThreshold must be <= 0 and <= publish threshold').to.throw(); ++ expect(() => { ++ validatePeerScoreThresholds(createPeerScoreThresholds({ ++ acceptPXThreshold: -1 ++ })); ++ }, 'acceptPXThreshold must be >= 0').to.throw(); ++ expect(() => { ++ validatePeerScoreThresholds(createPeerScoreThresholds({ ++ opportunisticGraftThreshold: -1 ++ })); ++ }, 'opportunisticGraftThreshold must be >= 0').to.throw(); ++ }); ++ it('should not throw on valid PeerScoreThresholds', () => { ++ expect(() => { ++ validatePeerScoreThresholds(createPeerScoreThresholds({ ++ gossipThreshold: -1, ++ publishThreshold: -2, ++ graylistThreshold: -3, ++ acceptPXThreshold: 1, ++ opportunisticGraftThreshold: 2 ++ })); ++ }).to.not.throw(); ++ }); ++}); ++//# sourceMappingURL=peer-score-thresholds.spec.js.map +\ No newline at end of file +diff --git a/node_modules/@chainsafe/libp2p-gossipsub/dist/test/peer-score-thresholds.spec.js.map b/node_modules/@chainsafe/libp2p-gossipsub/dist/test/peer-score-thresholds.spec.js.map +new file mode 100644 +index 0000000..0aba0d7 +--- /dev/null ++++ b/node_modules/@chainsafe/libp2p-gossipsub/dist/test/peer-score-thresholds.spec.js.map +@@ -0,0 +1 @@ ++{"version":3,"file":"peer-score-thresholds.spec.js","sourceRoot":"","sources":["../../test/peer-score-thresholds.spec.ts"],"names":[],"mappings":"AAA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AyB,CAAC;gBACxB,iBAAiB,EAAE,CAAC,CAAC;aACtB,CAAC,CACH,CAAA;QACH,CAAC,EACD,gCAAgC,CACjC,CAAC,EAAE,CAAC,KAAK,EAAE,CAAA;QACZ,MAAM,CACJ,GAAG,EAAE;YACH,2BAA2B,CACzB,yBAAyB,CAAC;gBACxB,2BAA2B,EAAE,CAAC,CAAC;aAChC,CAAC,CACH,CAAA;QACH,CAAC,EACD,0CAA0C,CAC3C,CAAC,EAAE,CAAC,KAAK,EAAE,CAAA;IACd,CAAC,CAAC,CAAA;IACF,EAAE,CAAC,+CAA+C,EAAE,GAAG,EAAE;QACvD,MAAM,CAAC,GAAG,EAAE;YACV,2BAA2B,CACzB,yBAAyB,CAAC;gBACxB,eAAe,EAAE,CAAC,CAAC;gBACnB,gBAAgB,EAAE,CAAC,CAAC;gBACpB,iBAAiB,EAAE,CAAC,CAAC;gBACrB,iBAAiB,EAAE,CAAC;gBACpB,2BAA2B,EAAE,CAAC;aAC/B,CAAC,CACH,CAAA;QACH,CAAC,CACA,CAAC,EAAE,CAAC,GAAG,CAAC,KAAK,EAAE,CAAA;IAClB,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"} +\ No newline at end of file +diff --git a/node_modules/@chainsafe/libp2p-gossipsub/dist/test/peer-score.spec.d.ts b/node_modules/@chainsafe/libp2p-gossipsub/dist/test/peer-score.spec.d.ts +new file mode 100644 +index 0000000..6e333bb +--- /dev/null ++++ b/node_modules/@chainsafe/libp2p-gossipsub/dist/test/peer-score.spec.d.ts +@@ -0,0 +1,2 @@ ++export {}; ++//# sourceMappingURL=peer-score.spec.d.ts.map +\ No newline at end of file +diff --git a/node_modules/@chainsafe/libp2p-gossipsub/dist/test/peer-score.spec.d.ts.map b/node_modules/@chainsafe/libp2p-gossipsub/dist/test/peer-score.spec.d.ts.map +new file mode 100644 +index 0000000..ebbb846 +--- /dev/null ++++ b/node_modules/@chainsafe/libp2p-gossipsub/dist/test/peer-score.spec.d.ts.map +@@ -0,0 +1 @@ ++{"version":3,"file":"peer-score.spec.d.ts","sourceRoot":"","sources":["../../test/peer-score.spec.ts"],"names":[],"mappings":""} +\ No newline at end of file +diff --git a/node_modules/@chainsafe/libp2p-gossipsub/dist/test/peer-score.spec.js b/node_modules/@chainsafe/libp2p-gossipsub/dist/test/peer-score.spec.js +new file mode 100644 +index 0000000..4dddf04 +--- /dev/null ++++ b/node_modules/@chainsafe/libp2p-gossipsub/dist/test/peer-score.spec.js +@@ -0,0 +1,652 @@ ++import { generateKeyPair } from '@libp2p/crypto/keys'; ++import { defaultLogger } from '@libp2p/logger'; ++import { peerIdFromPrivateKey } from '@libp2p/peer-id'; ++import { expect } from 'aegir/chai'; ++import delay from 'delay'; ++import sinon from 'sinon'; ++import { ScorePenalty } from '../src/metrics.js'; ++import { PeerScore, createPeerScoreParams, createTopicScoreParams } from '../src/score/index.js'; ++import { RejectReason } from '../src/types.js'; ++import { getMsgIdStr, makeTestMessage } from './utils/index.js'; ++/** Placeholder for some ScorePenalty value, only used for metrics */ ++const scorePenaltyAny = ScorePenalty.BrokenPromise; ++describe('PeerScore', () => { ++ const logger = defaultLogger(); ++ it('should score based on time in mesh', async () => { ++ // Create parameters with reasonable default values ++ const mytopic = 'mytopic'; ++ const params = createPeerScoreParams({ ++ topicScoreCap: 1000 ++ }); ++ const tparams = (params.topics[mytopic] = createTopicScoreParams({ ++ topicWeight: 0.5, ++ timeInMeshWeight: 1, ++ timeInMeshQuantum: 1, ++ timeInMeshCap: 3600 ++ })); ++ const peerA = peerIdFromPrivateKey(await generateKeyPair('Ed25519')).toString(); ++ // Peer score should start at 0 ++ const ps = new PeerScore(params, null, logger, { scoreCacheValidityMs: 0 }); ++ ps.addPeer(peerA); ++ let aScore = ps.score(peerA); ++ expect(aScore, 'expected score to start at zero').to.equal(0); ++ // The time in mesh depends on how long the peer has been grafted ++ ps.graft(peerA, mytopic); ++ const elapsed = tparams.timeInMeshQuantum * 100; ++ await delay(elapsed + 10); ++ ps.refreshScores(); ++ aScore = ps.score(peerA); ++ expect(aScore).to.be.gte(((tparams.topicWeight * tparams.timeInMeshWeight) / tparams.timeInMeshQuantum) * elapsed); ++ }); ++ it('should cap time in mesh score', async () => { ++ // Create parameters with reasonable default values ++ const mytopic = 'mytopic'; ++ const params = createPeerScoreParams({}); ++ const tparams = (params.topics[mytopic] = createTopicScoreParams({ ++ topicWeight: 0.5, ++ timeInMeshWeight: 1, ++ timeInMeshQuantum: 1, ++ timeInMeshCap: 10, ++ invalidMessageDeliveriesDecay: 0.1 ++ })); ++ const peerA = peerIdFromPrivateKey(await generateKeyPair('Ed25519')).toString(); ++ // Peer score should start at 0 ++ const ps = new PeerScore(params, null, logger, { scoreCacheValidityMs: 0 }); ++ ps.addPeer(peerA); ++ let aScore = ps.score(peerA); ++ expect(aScore, 'expected score to start at zero').to.equal(0); ++ // The time in mesh depends on how long the peer has been grafted ++ ps.graft(peerA, mytopic); ++ const elapsed = tparams.timeInMeshQuantum * 40; ++ await delay(elapsed); ++ ps.refreshScores(); ++ aScore = ps.score(peerA); ++ expect(aScore).to.be.gt(tparams.topicWeight * tparams.timeInMeshWeight * tparams.timeInMeshCap * 0.5); ++ expect(aScore).to.be.lt(tparams.topicWeight * tparams.timeInMeshWeight * tparams.timeInMeshCap * 1.5); ++ }); ++ it('should score first message deliveries', async () => { ++ // Create parameters with reasonable default values ++ const mytopic = 'mytopic'; ++ const params = createPeerScoreParams({ ++ topicScoreCap: 1000 ++ }); ++ const tparams = (params.topics[mytopic] = createTopicScoreParams({ ++ topicWeight: 1, ++ firstMessageDeliveriesWeight: 1, ++ firstMessageDeliveriesDecay: 0.9, ++ firstMessageDeliveriesCap: 50000, ++ timeInMeshWeight: 0 ++ })); ++ const peerA = peerIdFromPrivateKey(await generateKeyPair('Ed25519')).toString(); ++ // Peer score should start at 0 ++ const ps = new PeerScore(params, null, logger, { scoreCacheValidityMs: 0 }); ++ ps.addPeer(peerA); ++ ps.graft(peerA, mytopic); ++ // deliver a bunch of messages from peer A ++ const nMessages = 100; ++ for (let i = 0; i < nMessages; i++) { ++ const msg = makeTestMessage(i, mytopic); ++ ps.validateMessage(getMsgIdStr(msg)); ++ ps.deliverMessage(peerA, getMsgIdStr(msg), msg.topic); ++ } ++ ps.refreshScores(); ++ const aScore = ps.score(peerA); ++ expect(aScore).to.be.equal(tparams.topicWeight * tparams.firstMessageDeliveriesWeight * nMessages * tparams.firstMessageDeliveriesDecay); ++ }); ++ it('should cap first message deliveries score', async () => { ++ // Create parameters with reasonable default values ++ const mytopic = 'mytopic'; ++ const params = createPeerScoreParams({ ++ topicScoreCap: 1000 ++ }); ++ const tparams = (params.topics[mytopic] = createTopicScoreParams({ ++ topicWeight: 1, ++ firstMessageDeliveriesWeight: 1, ++ firstMessageDeliveriesDecay: 0.9, ++ invalidMessageDeliveriesDecay: 0.9, ++ firstMessageDeliveriesCap: 50, ++ timeInMeshWeight: 0 ++ })); ++ const peerA = peerIdFromPrivateKey(await generateKeyPair('Ed25519')).toString(); ++ // Peer score should start at 0 ++ const ps = new PeerScore(params, null, logger, { scoreCacheValidityMs: 0 }); ++ ps.addPeer(peerA); ++ let aScore = ps.score(peerA); ++ expect(aScore, 'expected score to start at zero').to.equal(0); ++ // The time in mesh depends on how long the peer has been grafted ++ ps.graft(peerA, mytopic); ++ // deliver a bunch of messages from peer A ++ const nMessages = 100; ++ for (let i = 0; i < nMessages; i++) { ++ const msg = makeTestMessage(i, mytopic); ++ ps.validateMessage(getMsgIdStr(msg)); ++ ps.deliverMessage(peerA, getMsgIdStr(msg), msg.topic); ++ } ++ ps.refreshScores(); ++ aScore = ps.score(peerA); ++ expect(aScore).to.be.equal(tparams.topicWeight * ++ tparams.firstMessageDeliveriesWeight * ++ tparams.firstMessageDeliveriesCap * ++ tparams.firstMessageDeliveriesDecay); ++ }); ++ it('should decay first message deliveries score', async () => { ++ // Create parameters with reasonable default values ++ const mytopic = 'mytopic'; ++ const params = createPeerScoreParams({ ++ topicScoreCap: 1000 ++ }); ++ const tparams = (params.topics[mytopic] = createTopicScoreParams({ ++ topicWeight: 1, ++ firstMessageDeliveriesWeight: 1, ++ firstMessageDeliveriesDecay: 0.9, // decay 10% per decay interval ++ invalidMessageDeliveriesDecay: 0.9, ++ firstMessageDeliveriesCap: 50, ++ timeInMeshWeight: 0 ++ })); ++ const peerA = peerIdFromPrivateKey(await generateKeyPair('Ed25519')).toString(); ++ // Peer score should start at 0 ++ const ps = new PeerScore(params, null, logger, { scoreCacheValidityMs: 0 }); ++ ps.addPeer(peerA); ++ let aScore = ps.score(peerA); ++ expect(aScore, 'expected score to start at zero').to.equal(0); ++ // The time in mesh depends on how long the peer has been grafted ++ ps.graft(peerA, mytopic); ++ // deliver a bunch of messages from peer A ++ const nMessages = 100; ++ for (let i = 0; i < nMessages; i++) { ++ const msg = makeTestMessage(i, mytopic); ++ ps.validateMessage(getMsgIdStr(msg)); ++ ps.deliverMessage(peerA, getMsgIdStr(msg), msg.topic); ++ } ++ ps.refreshScores(); ++ aScore = ps.score(peerA); ++ let expected = tparams.topicWeight * ++ tparams.firstMessageDeliveriesWeight * ++ tparams.firstMessageDeliveriesCap * ++ tparams.firstMessageDeliveriesDecay; ++ expect(aScore).to.be.equal(expected); ++ // refreshing the scores applies the decay param ++ const decayInterals = 10; ++ for (let i = 0; i < decayInterals; i++) { ++ ps.refreshScores(); ++ expected *= tparams.firstMessageDeliveriesDecay; ++ } ++ aScore = ps.score(peerA); ++ expect(aScore).to.be.equal(expected); ++ }); ++ it('should score mesh message deliveries', async function () { ++ this.timeout(10000); ++ // Create parameters with reasonable default values ++ const mytopic = 'mytopic'; ++ const params = createPeerScoreParams({}); ++ const tparams = (params.topics[mytopic] = createTopicScoreParams({ ++ topicWeight: 1, ++ meshMessageDeliveriesWeight: -1, ++ meshMessageDeliveriesActivation: 1000, ++ meshMessageDeliveriesWindow: 10, ++ meshMessageDeliveriesThreshold: 20, ++ meshMessageDeliveriesCap: 100, ++ meshMessageDeliveriesDecay: 0.9, ++ invalidMessageDeliveriesDecay: 0.9, ++ firstMessageDeliveriesWeight: 0, ++ timeInMeshWeight: 0 ++ })); ++ // peer A always delivers the message first ++ // peer B delivers next (within the delivery window) ++ // peer C delivers outside the delivery window ++ // we expect peers A and B to have a score of zero, since all other param weights are zero ++ // peer C should have a negative score ++ const peerA = peerIdFromPrivateKey(await generateKeyPair('Ed25519')).toString(); ++ const peerB = peerIdFromPrivateKey(await generateKeyPair('Ed25519')).toString(); ++ const peerC = peerIdFromPrivateKey(await generateKeyPair('Ed25519')).toString(); ++ const peers = [peerA, peerB, peerC]; ++ // Peer score should start at 0 ++ const ps = new PeerScore(params, null, logger, { scoreCacheValidityMs: 0 }); ++ peers.forEach((p) => { ++ ps.addPeer(p); ++ ps.graft(p, mytopic); ++ }); ++ // assert that nobody has been penalized yet for not delivering messages before activation time ++ ps.refreshScores(); ++ peers.forEach((p) => { ++ const score = ps.score(p); ++ expect(score, 'expected no mesh delivery penalty before activation time').to.equal(0); ++ }); ++ // wait for the activation time to kick in ++ await delay(tparams.meshMessageDeliveriesActivation); ++ // deliver a bunch of messages from peers ++ const nMessages = 100; ++ for (let i = 0; i < nMessages; i++) { ++ const msg = makeTestMessage(i, mytopic); ++ ps.validateMessage(getMsgIdStr(msg)); ++ ps.deliverMessage(peerA, getMsgIdStr(msg), msg.topic); ++ ps.duplicateMessage(peerB, getMsgIdStr(msg), msg.topic); ++ // deliver duplicate from peer C after the window ++ await delay(tparams.meshMessageDeliveriesWindow + 5); ++ ps.duplicateMessage(peerC, getMsgIdStr(msg), msg.topic); ++ } ++ ps.refreshScores(); ++ const aScore = ps.score(peerA); ++ const bScore = ps.score(peerB); ++ const cScore = ps.score(peerC); ++ expect(aScore).to.be.gte(0); ++ expect(bScore).to.be.gte(0); ++ // the penalty is the difference between the threshold and the actual mesh deliveries, squared. ++ // since we didn't deliver anything, this is just the value of the threshold ++ const penalty = tparams.meshMessageDeliveriesThreshold * tparams.meshMessageDeliveriesThreshold; ++ const expected = tparams.topicWeight * tparams.meshMessageDeliveriesWeight * penalty; ++ expect(cScore).to.be.equal(expected); ++ }); ++ it('should decay mesh message deliveries score', async function () { ++ this.timeout(10000); ++ // Create parameters with reasonable default values ++ const mytopic = 'mytopic'; ++ const params = createPeerScoreParams({}); ++ const tparams = (params.topics[mytopic] = createTopicScoreParams({ ++ topicWeight: 1, ++ meshMessageDeliveriesWeight: -1, ++ meshMessageDeliveriesActivation: 1000, ++ meshMessageDeliveriesWindow: 10, ++ meshMessageDeliveriesThreshold: 20, ++ meshMessageDeliveriesCap: 100, ++ meshMessageDeliveriesDecay: 0.9, ++ invalidMessageDeliveriesDecay: 0.9, ++ firstMessageDeliveriesWeight: 0, ++ timeInMeshWeight: 0 ++ })); ++ const peerA = peerIdFromPrivateKey(await generateKeyPair('Ed25519')).toString(); ++ // Peer score should start at 0 ++ const ps = new PeerScore(params, null, logger, { scoreCacheValidityMs: 0 }); ++ ps.addPeer(peerA); ++ ps.graft(peerA, mytopic); ++ // wait for the activation time to kick in ++ await delay(tparams.meshMessageDeliveriesActivation + 10); ++ // deliver a bunch of messages from peer A ++ const nMessages = 40; ++ for (let i = 0; i < nMessages; i++) { ++ const msg = makeTestMessage(i, mytopic); ++ ps.validateMessage(getMsgIdStr(msg)); ++ ps.deliverMessage(peerA, getMsgIdStr(msg), msg.topic); ++ } ++ ps.refreshScores(); ++ let aScore = ps.score(peerA); ++ expect(aScore).to.be.gte(0); ++ // we need to refresh enough times for the decay to bring us below the threshold ++ let decayedDeliveryCount = nMessages * tparams.meshMessageDeliveriesDecay; ++ for (let i = 0; i < 20; i++) { ++ ps.refreshScores(); ++ decayedDeliveryCount *= tparams.meshMessageDeliveriesDecay; ++ } ++ aScore = ps.score(peerA); ++ // the penalty is the difference between the threshold and the (decayed) mesh deliveries, squared. ++ const deficit = tparams.meshMessageDeliveriesThreshold - decayedDeliveryCount; ++ const penalty = deficit * deficit; ++ const expected = tparams.topicWeight * tparams.meshMessageDeliveriesWeight * penalty; ++ expect(aScore).to.be.equal(expected); ++ }); ++ it('should score mesh message failures', async function () { ++ this.timeout(10000); ++ // Create parameters with reasonable default values ++ const mytopic = 'mytopic'; ++ const params = createPeerScoreParams({}); ++ // the mesh failure penalty is applied when a peer is pruned while their ++ // mesh deliveries are under the threshold. ++ // for this test, we set the mesh delivery threshold, but set ++ // meshMessageDeliveriesWeight to zero, so the only affect on the score ++ // is from the mesh failure penalty ++ const tparams = (params.topics[mytopic] = createTopicScoreParams({ ++ topicWeight: 1, ++ meshFailurePenaltyWeight: -1, ++ meshFailurePenaltyDecay: 0.9, ++ meshMessageDeliveriesWeight: 0, ++ meshMessageDeliveriesActivation: 1000, ++ meshMessageDeliveriesWindow: 10, ++ meshMessageDeliveriesThreshold: 20, ++ meshMessageDeliveriesCap: 100, ++ meshMessageDeliveriesDecay: 0.9, ++ firstMessageDeliveriesWeight: 0, ++ timeInMeshWeight: 0 ++ })); ++ const peerA = peerIdFromPrivateKey(await generateKeyPair('Ed25519')).toString(); ++ const peerB = peerIdFromPrivateKey(await generateKeyPair('Ed25519')).toString(); ++ const peers = [peerA, peerB]; ++ const ps = new PeerScore(params, null, logger, { scoreCacheValidityMs: 0 }); ++ peers.forEach((p) => { ++ ps.addPeer(p); ++ ps.graft(p, mytopic); ++ }); ++ // wait for the activation time to kick in ++ await delay(tparams.meshMessageDeliveriesActivation + 10); ++ // deliver a bunch of messages from peer A. peer B does nothing ++ const nMessages = 100; ++ for (let i = 0; i < nMessages; i++) { ++ const msg = makeTestMessage(i, mytopic); ++ ps.validateMessage(getMsgIdStr(msg)); ++ ps.deliverMessage(peerA, getMsgIdStr(msg), msg.topic); ++ } ++ // peers A and B should both have zero scores, since the failure penalty hasn't been applied yet ++ ps.refreshScores(); ++ let aScore = ps.score(peerA); ++ let bScore = ps.score(peerB); ++ expect(aScore).to.be.equal(0); ++ expect(bScore).to.be.equal(0); ++ // prune peer B to apply the penalty ++ ps.prune(peerB, mytopic); ++ ps.refreshScores(); ++ aScore = ps.score(peerA); ++ bScore = ps.score(peerB); ++ expect(aScore).to.be.equal(0); ++ // penalty calculation is the same as for meshMessageDeliveries, but multiplied by meshFailurePenaltyWeight ++ // instead of meshMessageDeliveriesWeight ++ const penalty = tparams.meshMessageDeliveriesThreshold * tparams.meshMessageDeliveriesThreshold; ++ const expected = tparams.topicWeight * tparams.meshFailurePenaltyWeight * penalty * tparams.meshFailurePenaltyDecay; ++ expect(bScore).to.be.equal(expected); ++ }); ++ it('should score invalid message deliveries', async function () { ++ // Create parameters with reasonable default values ++ const mytopic = 'mytopic'; ++ const params = createPeerScoreParams({}); ++ const tparams = (params.topics[mytopic] = createTopicScoreParams({ ++ topicWeight: 1, ++ invalidMessageDeliveriesWeight: -1, ++ invalidMessageDeliveriesDecay: 0.9, ++ timeInMeshWeight: 0 ++ })); ++ const peerA = peerIdFromPrivateKey(await generateKeyPair('Ed25519')).toString(); ++ const ps = new PeerScore(params, null, logger, { scoreCacheValidityMs: 0 }); ++ ps.addPeer(peerA); ++ ps.graft(peerA, mytopic); ++ // deliver a bunch of messages from peer A ++ const nMessages = 100; ++ for (let i = 0; i < nMessages; i++) { ++ const msg = makeTestMessage(i, mytopic); ++ ps.rejectMessage(peerA, getMsgIdStr(msg), msg.topic, RejectReason.Reject); ++ } ++ ps.refreshScores(); ++ const aScore = ps.score(peerA); ++ const expected = tparams.topicWeight * ++ tparams.invalidMessageDeliveriesWeight * ++ (nMessages * tparams.invalidMessageDeliveriesDecay) ** 2; ++ expect(aScore).to.be.equal(expected); ++ }); ++ it('should decay invalid message deliveries score', async function () { ++ // Create parameters with reasonable default values ++ const mytopic = 'mytopic'; ++ const params = createPeerScoreParams({}); ++ const tparams = (params.topics[mytopic] = createTopicScoreParams({ ++ topicWeight: 1, ++ invalidMessageDeliveriesWeight: -1, ++ invalidMessageDeliveriesDecay: 0.9, ++ timeInMeshWeight: 0 ++ })); ++ const peerA = peerIdFromPrivateKey(await generateKeyPair('Ed25519')).toString(); ++ const ps = new PeerScore(params, null, logger, { scoreCacheValidityMs: 0 }); ++ ps.addPeer(peerA); ++ ps.graft(peerA, mytopic); ++ // deliver a bunch of messages from peer A ++ const nMessages = 100; ++ for (let i = 0; i < nMessages; i++) { ++ const msg = makeTestMessage(i, mytopic); ++ ps.rejectMessage(peerA, getMsgIdStr(msg), msg.topic, RejectReason.Reject); ++ } ++ ps.refreshScores(); ++ let aScore = ps.score(peerA); ++ let expected = tparams.topicWeight * ++ tparams.invalidMessageDeliveriesWeight * ++ (nMessages * tparams.invalidMessageDeliveriesDecay) ** 2; ++ expect(aScore).to.be.equal(expected); ++ // refresh scores a few times to apply decay ++ for (let i = 0; i < 10; i++) { ++ ps.refreshScores(); ++ expected *= tparams.invalidMessageDeliveriesDecay ** 2; ++ } ++ aScore = ps.score(peerA); ++ expect(aScore).to.be.equal(expected); ++ }); ++ it('should score invalid/ignored messages', async function () { ++ // this test adds coverage for the dark corners of message rejection ++ const mytopic = 'mytopic'; ++ const params = createPeerScoreParams({}); ++ params.topics[mytopic] = createTopicScoreParams({ ++ topicWeight: 1, ++ invalidMessageDeliveriesWeight: -1, ++ invalidMessageDeliveriesDecay: 0.9, ++ timeInMeshQuantum: 1000 ++ }); ++ const peerA = peerIdFromPrivateKey(await generateKeyPair('Ed25519')).toString(); ++ const peerB = peerIdFromPrivateKey(await generateKeyPair('Ed25519')).toString(); ++ const ps = new PeerScore(params, null, logger, { scoreCacheValidityMs: 0 }); ++ ps.addPeer(peerA); ++ ps.addPeer(peerB); ++ const msg = makeTestMessage(0, mytopic); ++ // insert a record ++ ps.validateMessage(getMsgIdStr(msg)); ++ // this should have no effect in the score, and subsequent duplicate messages should have no effect either ++ ps.rejectMessage(peerA, getMsgIdStr(msg), msg.topic, RejectReason.Ignore); ++ ps.duplicateMessage(peerB, getMsgIdStr(msg), msg.topic); ++ let aScore = ps.score(peerA); ++ let bScore = ps.score(peerB); ++ let expected = 0; ++ expect(aScore).to.equal(expected); ++ expect(bScore).to.equal(expected); ++ // now clear the delivery record ++ let record = ps.deliveryRecords.queue.peekFront(); ++ if (record == null) { ++ throw new Error('No record found'); ++ } ++ record.expire = Date.now(); ++ await delay(5); ++ ps.deliveryRecords.gc(); ++ // insert a new record in the message deliveries ++ ps.validateMessage(getMsgIdStr(msg)); ++ // and reject the message to make sure duplicates are also penalized ++ ps.rejectMessage(peerA, getMsgIdStr(msg), msg.topic, RejectReason.Reject); ++ ps.duplicateMessage(peerB, getMsgIdStr(msg), msg.topic); ++ aScore = ps.score(peerA); ++ bScore = ps.score(peerB); ++ expected = -1; ++ expect(aScore).to.equal(expected); ++ expect(bScore).to.equal(expected); ++ // now clear the delivery record again ++ record = ps.deliveryRecords.queue.peekFront(); ++ if (record == null) { ++ throw new Error('No record found'); ++ } ++ record.expire = Date.now(); ++ await delay(5); ++ ps.deliveryRecords.gc(); ++ // insert a new record in the message deliveries ++ ps.validateMessage(getMsgIdStr(msg)); ++ // and reject the message after a duplicate has arrived ++ ps.duplicateMessage(peerB, getMsgIdStr(msg), msg.topic); ++ ps.rejectMessage(peerA, getMsgIdStr(msg), msg.topic, RejectReason.Reject); ++ aScore = ps.score(peerA); ++ bScore = ps.score(peerB); ++ expected = -4; ++ expect(aScore).to.equal(expected); ++ expect(bScore).to.equal(expected); ++ }); ++ it('should score w/ application score', async function () { ++ const mytopic = 'mytopic'; ++ let appScoreValue = 0; ++ const params = createPeerScoreParams({ ++ appSpecificScore: () => appScoreValue, ++ appSpecificWeight: 0.5 ++ }); ++ const peerA = peerIdFromPrivateKey(await generateKeyPair('Ed25519')).toString(); ++ const ps = new PeerScore(params, null, logger, { scoreCacheValidityMs: 0 }); ++ ps.addPeer(peerA); ++ ps.graft(peerA, mytopic); ++ for (let i = -100; i < 100; i++) { ++ appScoreValue = i; ++ ps.refreshScores(); ++ const aScore = ps.score(peerA); ++ const expected = i * params.appSpecificWeight; ++ expect(aScore).to.equal(expected); ++ } ++ }); ++ it('should score w/ IP colocation', async function () { ++ const mytopic = 'mytopic'; ++ const params = createPeerScoreParams({ ++ IPColocationFactorThreshold: 1, ++ IPColocationFactorWeight: -1 ++ }); ++ const peerA = peerIdFromPrivateKey(await generateKeyPair('Ed25519')).toString(); ++ const peerB = peerIdFromPrivateKey(await generateKeyPair('Ed25519')).toString(); ++ const peerC = peerIdFromPrivateKey(await generateKeyPair('Ed25519')).toString(); ++ const peerD = peerIdFromPrivateKey(await generateKeyPair('Ed25519')).toString(); ++ const peers = [peerA, peerB, peerC, peerD]; ++ const ps = new PeerScore(params, null, logger, { scoreCacheValidityMs: 0 }); ++ peers.forEach((p) => { ++ ps.addPeer(p); ++ ps.graft(p, mytopic); ++ }); ++ const setIPsForPeer = (p, ips) => { ++ for (const ip of ips) { ++ ps.addIP(p, ip); ++ } ++ }; ++ // peerA should have no penalty, but B, C, and D should be penalized for sharing an IP ++ setIPsForPeer(peerA, ['1.2.3.4']); ++ setIPsForPeer(peerB, ['2.3.4.5']); ++ setIPsForPeer(peerC, ['2.3.4.5', '3.4.5.6']); ++ setIPsForPeer(peerD, ['2.3.4.5']); ++ ps.refreshScores(); ++ const aScore = ps.score(peerA); ++ const bScore = ps.score(peerB); ++ const cScore = ps.score(peerC); ++ const dScore = ps.score(peerD); ++ expect(aScore).to.equal(0); ++ const nShared = 3; ++ const ipSurplus = nShared - params.IPColocationFactorThreshold; ++ const penalty = ipSurplus ** 2; ++ const expected = params.IPColocationFactorWeight * penalty; ++ expect(bScore).to.equal(expected); ++ expect(cScore).to.equal(expected); ++ expect(dScore).to.equal(expected); ++ }); ++ it('should score w/ behavior penalty', async function () { ++ const params = createPeerScoreParams({ ++ behaviourPenaltyWeight: -1, ++ behaviourPenaltyDecay: 0.99 ++ }); ++ const peerA = peerIdFromPrivateKey(await generateKeyPair('Ed25519')).toString(); ++ const ps = new PeerScore(params, null, logger, { scoreCacheValidityMs: 0 }); ++ // add penalty on a non-existent peer ++ ps.addPenalty(peerA, 1, ScorePenalty.MessageDeficit); ++ let aScore = ps.score(peerA); ++ expect(aScore).to.equal(0); ++ // add the peer and test penalties ++ ps.addPeer(peerA); ++ aScore = ps.score(peerA); ++ expect(aScore).to.equal(0); ++ ps.addPenalty(peerA, 1, scorePenaltyAny); ++ aScore = ps.score(peerA); ++ expect(aScore).to.equal(-1); ++ ps.addPenalty(peerA, 1, scorePenaltyAny); ++ aScore = ps.score(peerA); ++ expect(aScore).to.equal(-4); ++ ps.refreshScores(); ++ aScore = ps.score(peerA); ++ expect(aScore).to.equal(-3.9204); ++ }); ++ it('should handle score retention', async function () { ++ const mytopic = 'mytopic'; ++ const params = createPeerScoreParams({ ++ appSpecificScore: () => -1000, ++ appSpecificWeight: 1, ++ retainScore: 800 ++ }); ++ const peerA = peerIdFromPrivateKey(await generateKeyPair('Ed25519')).toString(); ++ const ps = new PeerScore(params, null, logger, { scoreCacheValidityMs: 0 }); ++ ps.addPeer(peerA); ++ ps.graft(peerA, mytopic); ++ // score should equal -1000 (app-specific score) ++ const expected = -1000; ++ ps.refreshScores(); ++ let aScore = ps.score(peerA); ++ expect(aScore).to.equal(expected); ++ // disconnect & wait half of the retainScoreTime ++ // should still have negative score ++ ps.removePeer(peerA); ++ const _delay = params.retainScore / 2; ++ await delay(_delay); ++ ps.refreshScores(); ++ aScore = ps.score(peerA); ++ expect(aScore).to.equal(expected); ++ // wait remaining time (plus a little slop) and the score should reset to 0 ++ await delay(_delay + 5); ++ ps.refreshScores(); ++ aScore = ps.score(peerA); ++ expect(aScore).to.equal(0); ++ }); ++}); ++// TODO: https://github.com/ChainSafe/js-libp2p-gossipsub/issues/238 ++describe.skip('PeerScore score cache', function () { ++ const peerA = '16Uiu2HAmMkH6ZLen2tbhiuNCTZLLvrZaDgufNdT5MPjtC9Hr9YNG'; ++ const logger = defaultLogger(); ++ let sandbox; ++ let computeStoreStub; ++ const params = createPeerScoreParams({ ++ appSpecificScore: () => -1000, ++ appSpecificWeight: 1, ++ retainScore: 800, ++ decayInterval: 1000, ++ // eslint-disable-next-line @typescript-eslint/consistent-type-assertions ++ topics: { a: { topicWeight: 10 } } ++ }); ++ let ps2; ++ beforeEach(() => { ++ sandbox = sinon.createSandbox(); ++ const now = Date.now(); ++ sandbox.useFakeTimers(now); ++ computeStoreStub = sinon.stub(); ++ ps2 = new PeerScore(params, null, logger, { ++ scoreCacheValidityMs: 10, ++ computeScore: computeStoreStub ++ }); ++ }); ++ afterEach(() => { ++ sandbox.restore(); ++ }); ++ it('should compute first time', function () { ++ computeStoreStub.returns(10); ++ ps2.addPeer(peerA); ++ expect(computeStoreStub.calledOnce).to.be.false(); ++ ps2.score(peerA); ++ expect(computeStoreStub.calledOnce).to.be.true(); ++ // this time peerA score is cached ++ ps2.score(peerA); ++ expect(computeStoreStub.calledOnce).to.be.true(); ++ }); ++ const testCases = [ ++ { name: 'decayInterval timeout', fun: () => sandbox.clock.tick(params.decayInterval) }, ++ { name: 'refreshScores', fun: () => { ps2.refreshScores(); } }, ++ { name: 'addPenalty', fun: () => { ps2.addPenalty(peerA, 10, scorePenaltyAny); } }, ++ { name: 'graft', fun: () => { ps2.graft(peerA, 'a'); } }, ++ { name: 'prune', fun: () => { ps2.prune(peerA, 'a'); } }, ++ { name: 'markInvalidMessageDelivery', fun: () => { ps2.markInvalidMessageDelivery(peerA, 'a'); } }, ++ { name: 'markFirstMessageDelivery', fun: () => { ps2.markFirstMessageDelivery(peerA, 'a'); } }, ++ { name: 'markDuplicateMessageDelivery', fun: () => { ps2.markDuplicateMessageDelivery(peerA, 'a'); } }, ++ { name: 'removeIPs', fun: () => { ps2.removeIP(peerA, '127.0.0.1'); } } ++ ]; ++ for (const { name, fun } of testCases) { ++ // eslint-disable-next-line no-loop-func ++ it(`should invalidate the cache after ${name}`, function () { ++ // eslint-disable-line no-loop-func ++ computeStoreStub.returns(10); ++ ps2.addPeer(peerA); ++ ps2.score(peerA); ++ expect(computeStoreStub.calledOnce).to.be.true(); ++ // the score is cached ++ ps2.score(peerA); ++ expect(computeStoreStub.calledOnce).to.be.true(); ++ // invalidate the cache ++ fun(); ++ // should not use the cache ++ ps2.score(peerA); ++ expect(computeStoreStub.calledTwice).to.be.true(); ++ }); ++ } ++}); ++//# sourceMappingURL=peer-score.spec.js.map +\ No newline at end of file +diff --git a/node_modules/@chainsafe/libp2p-gossipsub/dist/test/peer-score.spec.js.map b/node_modules/@chainsafe/libp2p-gossipsub/dist/test/peer-score.spec.js.map +new file mode 100644 +index 0000000..cb47e20 +--- /dev/null ++++ b/node_modules/@chainsafe/libp2p-gossipsub/dist/test/peer-score.spec.js.map +@@ -0,0 +1 @@ ++{"version":3,"file":"peer-score.spec.js","sourceRoot":"","sources":["../../test/peer-score.spec.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAA;AACrD,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAA;AAC9C,OAAO,EAAE,oBAAoB,EAAE,MAAM,iBAAiB,CAAA;AACtD,OAAO,EAAE,MAAM,EAAE,MAAM,YAAY,CAAA;AACnC,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAA;AAChD,OAAO,EAAE,SAAS,EAAE,qBAAqB,EAAE,sBAAsB,EAAE,MAAM,uBAAuB,CAAA;AAChG,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAA;AAC9C,OAAO,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAA;AAI/D,qEAAqE;AACrE,MAAM,eAAe,GAAG,YAAY,CAAC,aAAa,CAAA;AAElD,QAAQ,CAAC,WAAW,EAAE,GAAG,EAAE;IACzB,MAAM,MAAM,GAAG,aAAa,EAAE,CAAA;IAE9B,EAAE,CAAC,oCAAoC,EAAE,KAAK,IAAI,EAAE;QAClD,mDAAmD;QACnD,MAAM,OAAO,GAAG,SAAS,CAAA;QACzB,MAAM,MAAM,GAAG,qBAAqB,CAAC;YACnC,aAAa,EAAE,IAAI;SACpB,CAAC,CAAA;QACF,M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AC,CAAC,EAAE,CAAC,EAAE,CAAC,IAAI,EAAE,CAAA;YAChD,sBAAsB;YACtB,GAAG,CAAC,KAAK,CAAC,KAAK,CAAC,CAAA;YAChB,MAAM,CAAC,gBAAgB,CAAC,UAAU,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,IAAI,EAAE,CAAA;YAChD,uBAAuB;YACvB,GAAG,EAAE,CAAA;YACL,2BAA2B;YAC3B,GAAG,CAAC,KAAK,CAAC,KAAK,CAAC,CAAA;YAChB,MAAM,CAAC,gBAAgB,CAAC,WAAW,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,IAAI,EAAE,CAAA;QACnD,CAAC,CAAC,CAAA;IACJ,CAAC;AACH,CAAC,CAAC,CAAA"} +\ No newline at end of file +diff --git a/node_modules/@chainsafe/libp2p-gossipsub/dist/test/scoreMetrics.spec.d.ts b/node_modules/@chainsafe/libp2p-gossipsub/dist/test/scoreMetrics.spec.d.ts +new file mode 100644 +index 0000000..6fe5864 +--- /dev/null ++++ b/node_modules/@chainsafe/libp2p-gossipsub/dist/test/scoreMetrics.spec.d.ts +@@ -0,0 +1,2 @@ ++export {}; ++//# sourceMappingURL=scoreMetrics.spec.d.ts.map +\ No newline at end of file +diff --git a/node_modules/@chainsafe/libp2p-gossipsub/dist/test/scoreMetrics.spec.d.ts.map b/node_modules/@chainsafe/libp2p-gossipsub/dist/test/scoreMetrics.spec.d.ts.map +new file mode 100644 +index 0000000..2ff42f2 +--- /dev/null ++++ b/node_modules/@chainsafe/libp2p-gossipsub/dist/test/scoreMetrics.spec.d.ts.map +@@ -0,0 +1 @@ ++{"version":3,"file":"scoreMetrics.spec.d.ts","sourceRoot":"","sources":["../../test/scoreMetrics.spec.ts"],"names":[],"mappings":""} +\ No newline at end of file +diff --git a/node_modules/@chainsafe/libp2p-gossipsub/dist/test/scoreMetrics.spec.js b/node_modules/@chainsafe/libp2p-gossipsub/dist/test/scoreMetrics.spec.js +new file mode 100644 +index 0000000..a308ac3 +--- /dev/null ++++ b/node_modules/@chainsafe/libp2p-gossipsub/dist/test/scoreMetrics.spec.js +@@ -0,0 +1,40 @@ ++import { generateKeyPair } from '@libp2p/crypto/keys'; ++import { defaultLogger } from '@libp2p/logger'; ++import { peerIdFromPrivateKey } from '@libp2p/peer-id'; ++import { expect } from 'aegir/chai'; ++import { ScorePenalty } from '../src/metrics.js'; ++import { createPeerScoreParams, createTopicScoreParams, PeerScore } from '../src/score/index.js'; ++import { computeAllPeersScoreWeights } from '../src/score/scoreMetrics.js'; ++describe('score / scoreMetrics', () => { ++ const logger = defaultLogger(); ++ it('computeScoreWeights', async () => { ++ // Create parameters with reasonable default values ++ const topic = 'test_topic'; ++ const params = createPeerScoreParams({ ++ topicScoreCap: 1000 ++ }); ++ params.topics[topic] = createTopicScoreParams({ ++ topicWeight: 0.5, ++ timeInMeshWeight: 1, ++ timeInMeshQuantum: 1, ++ timeInMeshCap: 3600 ++ }); ++ // Add Map for metrics ++ const topicStrToLabel = new Map(); ++ topicStrToLabel.set(topic, topic); ++ const peerA = peerIdFromPrivateKey(await generateKeyPair('Ed25519')).toString(); ++ // Peer score should start at 0 ++ const ps = new PeerScore(params, null, logger, { scoreCacheValidityMs: 0 }); ++ ps.addPeer(peerA); ++ // Do some actions that penalize the peer ++ const msgId = 'aaaaaaaaaaaaaaaa'; ++ ps.addPenalty(peerA, 1, ScorePenalty.BrokenPromise); ++ ps.validateMessage(msgId); ++ ps.deliverMessage(peerA, msgId, topic); ++ const sw = computeAllPeersScoreWeights([peerA], ps.peerStats, ps.params, ps.peerIPs, topicStrToLabel); ++ // Ensure score is the same ++ expect(sw.score).to.deep.equal([ps.score(peerA)], 'Score from metrics and actual score not equal'); ++ expect(sw.byTopic.get(topic)).to.deep.equal({ p1w: [0], p2w: [1], p3w: [0], p3bw: [0], p4w: [0] }, 'Wrong score weights by topic'); ++ }); ++}); ++//# sourceMappingURL=scoreMetrics.spec.js.map +\ No newline at end of file +diff --git a/node_modules/@chainsafe/libp2p-gossipsub/dist/test/scoreMetrics.spec.js.map b/node_modules/@chainsafe/libp2p-gossipsub/dist/test/scoreMetrics.spec.js.map +new file mode 100644 +index 0000000..17c0f97 +--- /dev/null ++++ b/node_modules/@chainsafe/libp2p-gossipsub/dist/test/scoreMetrics.spec.js.map +@@ -0,0 +1 @@ ++{"version":3,"file":"scoreMetrics.spec.js","sourceRoot":"","sources":["../../test/scoreMetrics.spec.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAA;AACrD,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAA;AAC9C,OAAO,EAAE,oBAAoB,EAAE,MAAM,iBAAiB,CAAA;AACtD,OAAO,EAAE,MAAM,EAAE,MAAM,YAAY,CAAA;AACnC,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAA;AAChD,OAAO,EAAE,qBAAqB,EAAE,sBAAsB,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAA;AAChG,OAAO,EAAE,2BAA2B,EAAE,MAAM,8BAA8B,CAAA;AAE1E,QAAQ,CAAC,sBAAsB,EAAE,GAAG,EAAE;IACpC,MAAM,MAAM,GAAG,aAAa,EAAE,CAAA;IAE9B,EAAE,CAAC,qBAAqB,EAAE,KAAK,IAAI,EAAE;QACnC,mDAAmD;QACnD,MAAM,KAAK,GAAG,YAAY,CAAA;QAE1B,MAAM,MAAM,GAAG,qBAAqB,CAAC;YACnC,aAAa,EAAE,IAAI;SACpB,CAAC,CAAA;QACF,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,sBAAsB,CAAC;YAC5C,WAAW,EAAE,GAAG;YAChB,gBAAgB,EAAE,CAAC;YACnB,iBAAiB,EAAE,CAAC;YACpB,aAAa,EAAE,IAAI;SACpB,CAAC,CAAA;QAEF,sBAAsB;QACtB,MAAM,eAAe,GAAG,IAAI,GAAG,EAAkB,CAAA;QACjD,eAAe,CAAC,GAAG,CAAC,KAAK,EAAE,KAAK,CAAC,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A;AACJ,CAAC,CAAC,CAAA"} +\ No newline at end of file +diff --git a/node_modules/@chainsafe/libp2p-gossipsub/dist/test/signature-policy.spec.d.ts b/node_modules/@chainsafe/libp2p-gossipsub/dist/test/signature-policy.spec.d.ts +new file mode 100644 +index 0000000..94b8dbe +--- /dev/null ++++ b/node_modules/@chainsafe/libp2p-gossipsub/dist/test/signature-policy.spec.d.ts +@@ -0,0 +1,2 @@ ++export {}; ++//# sourceMappingURL=signature-policy.spec.d.ts.map +\ No newline at end of file +diff --git a/node_modules/@chainsafe/libp2p-gossipsub/dist/test/signature-policy.spec.d.ts.map b/node_modules/@chainsafe/libp2p-gossipsub/dist/test/signature-policy.spec.d.ts.map +new file mode 100644 +index 0000000..046b484 +--- /dev/null ++++ b/node_modules/@chainsafe/libp2p-gossipsub/dist/test/signature-policy.spec.d.ts.map +@@ -0,0 +1 @@ ++{"version":3,"file":"signature-policy.spec.d.ts","sourceRoot":"","sources":["../../test/signature-policy.spec.ts"],"names":[],"mappings":""} +\ No newline at end of file +diff --git a/node_modules/@chainsafe/libp2p-gossipsub/dist/test/signature-policy.spec.js b/node_modules/@chainsafe/libp2p-gossipsub/dist/test/signature-policy.spec.js +new file mode 100644 +index 0000000..dcb1a8b +--- /dev/null ++++ b/node_modules/@chainsafe/libp2p-gossipsub/dist/test/signature-policy.spec.js +@@ -0,0 +1,160 @@ ++import { stop } from '@libp2p/interface'; ++import { mockNetwork } from '@libp2p/interface-compliance-tests/mocks'; ++import { expect } from 'aegir/chai'; ++import { pEvent } from 'p-event'; ++import { connectAllPubSubNodes, connectPubsubNodes, createComponents, createComponentsArray } from './utils/create-pubsub.js'; ++describe('signature policy', () => { ++ describe('strict-sign', () => { ++ const numNodes = 3; ++ let nodes; ++ beforeEach(async () => { ++ mockNetwork.reset(); ++ nodes = await createComponentsArray({ ++ number: numNodes, ++ connected: false, ++ init: { ++ scoreParams: { ++ IPColocationFactorThreshold: 3 ++ }, ++ // crucial line ++ globalSignaturePolicy: 'StrictSign' ++ } ++ }); ++ }); ++ afterEach(async () => { ++ await stop(...nodes.reduce((acc, curr) => acc.concat(curr.pubsub, ...Object.entries(curr.components)), [])); ++ mockNetwork.reset(); ++ }); ++ it('should publish a message', async () => { ++ const topic = 'foo'; ++ // add subscriptions to each node ++ nodes.forEach((n) => { n.pubsub.subscribe(topic); }); ++ // connect all nodes ++ await connectAllPubSubNodes(nodes); ++ // wait for subscriptions to be transmitted ++ await Promise.all(nodes.map(async (n) => pEvent(n.pubsub, 'subscription-change'))); ++ // await mesh rebalancing ++ await Promise.all(nodes.map(async (n) => pEvent(n.pubsub, 'gossipsub:heartbeat'))); ++ // publish a message on the topic ++ const result = await nodes[0].pubsub.publish(topic, new Uint8Array()); ++ expect(result.recipients).to.length(numNodes - 1); ++ }); ++ it('should forward a valid message', async () => { ++ const topic = 'foo'; ++ // add subscriptions to each node ++ nodes.forEach((n) => { n.pubsub.subscribe(topic); }); ++ // connect in a line ++ await Promise.all(Array.from({ length: numNodes - 1 }, async (_, i) => connectPubsubNodes(nodes[i], nodes[i + 1]))); ++ // wait for subscriptions to be transmitted ++ await Promise.all(nodes.map(async (n) => pEvent(n.pubsub, 'subscription-change'))); ++ // await mesh rebalancing ++ await Promise.all(nodes.map(async (n) => pEvent(n.pubsub, 'gossipsub:heartbeat'))); ++ // publish a message on the topic ++ const result = await nodes[0].pubsub.publish(topic, new Uint8Array()); ++ expect(result.recipients).to.length(1); ++ // the last node should get the message ++ await pEvent(nodes[nodes.length - 1].pubsub, 'gossipsub:message'); ++ }); ++ it('should not forward an strict-no-sign message', async () => { ++ const topic = 'foo'; ++ // add a no-sign peer to nodes ++ nodes.unshift(await createComponents({ ++ init: { ++ globalSignaturePolicy: 'StrictNoSign' ++ } ++ })); ++ // add subscriptions to each node ++ nodes.forEach((n) => { n.pubsub.subscribe(topic); }); ++ // connect in a line ++ await Promise.all(Array.from({ length: numNodes - 1 }, async (_, i) => connectPubsubNodes(nodes[i], nodes[i + 1]))); ++ // await mesh rebalancing ++ await Promise.all(nodes.map(async (n) => pEvent(n.pubsub, 'gossipsub:heartbeat'))); ++ // publish a message on the topic ++ const result = await nodes[0].pubsub.publish(topic, new Uint8Array()); ++ expect(result.recipients).to.length(1); ++ // the last node should NOT get the message ++ try { ++ await pEvent(nodes[nodes.length - 1].pubsub, 'gossipsub:message', { timeout: 200 }); ++ expect.fail('no-sign message should not be emitted from strict-sign peer'); ++ } ++ catch (e) { } ++ }); ++ }); ++ describe('strict-no-sign', () => { ++ const numNodes = 3; ++ let nodes; ++ beforeEach(async () => { ++ mockNetwork.reset(); ++ nodes = await createComponentsArray({ ++ number: numNodes, ++ connected: false, ++ init: { ++ scoreParams: { ++ IPColocationFactorThreshold: 3 ++ }, ++ // crucial line ++ globalSignaturePolicy: 'StrictNoSign' ++ } ++ }); ++ }); ++ afterEach(async () => { ++ await stop(...nodes.reduce((acc, curr) => acc.concat(curr.pubsub, ...Object.entries(curr.components)), [])); ++ mockNetwork.reset(); ++ }); ++ it('should publish a message', async () => { ++ const topic = 'foo'; ++ // add subscriptions to each node ++ nodes.forEach((n) => { n.pubsub.subscribe(topic); }); ++ // connect all nodes ++ await connectAllPubSubNodes(nodes); ++ // wait for subscriptions to be transmitted ++ await Promise.all(nodes.map(async (n) => pEvent(n.pubsub, 'subscription-change'))); ++ // await mesh rebalancing ++ await Promise.all(nodes.map(async (n) => pEvent(n.pubsub, 'gossipsub:heartbeat'))); ++ // publish a message on the topic ++ const result = await nodes[0].pubsub.publish(topic, new Uint8Array()); ++ expect(result.recipients).to.length(numNodes - 1); ++ }); ++ it('should forward a valid message', async () => { ++ const topic = 'foo'; ++ // add subscriptions to each node ++ nodes.forEach((n) => { n.pubsub.subscribe(topic); }); ++ // connect in a line ++ await Promise.all(Array.from({ length: numNodes - 1 }, async (_, i) => connectPubsubNodes(nodes[i], nodes[i + 1]))); ++ // wait for subscriptions to be transmitted ++ await Promise.all(nodes.map(async (n) => pEvent(n.pubsub, 'subscription-change'))); ++ // await mesh rebalancing ++ await Promise.all(nodes.map(async (n) => pEvent(n.pubsub, 'gossipsub:heartbeat'))); ++ // publish a message on the topic ++ const result = await nodes[0].pubsub.publish(topic, new Uint8Array()); ++ expect(result.recipients).to.length(1); ++ // the last node should get the message ++ await pEvent(nodes[nodes.length - 1].pubsub, 'gossipsub:message'); ++ }); ++ it('should not forward an strict-sign message', async () => { ++ const topic = 'foo'; ++ // add a no-sign peer to nodes ++ nodes.unshift(await createComponents({ ++ init: { ++ globalSignaturePolicy: 'StrictSign' ++ } ++ })); ++ // add subscriptions to each node ++ nodes.forEach((n) => { n.pubsub.subscribe(topic); }); ++ // connect in a line ++ await Promise.all(Array.from({ length: numNodes - 1 }, async (_, i) => connectPubsubNodes(nodes[i], nodes[i + 1]))); ++ // await mesh rebalancing ++ await Promise.all(nodes.map(async (n) => pEvent(n.pubsub, 'gossipsub:heartbeat'))); ++ // publish a message on the topic ++ const result = await nodes[0].pubsub.publish(topic, new Uint8Array()); ++ expect(result.recipients).to.length(1); ++ // the last node should NOT get the message ++ try { ++ await pEvent(nodes[nodes.length - 1].pubsub, 'gossipsub:message', { timeout: 200 }); ++ expect.fail('no-sign message should not be emitted from strict-sign peer'); ++ } ++ catch (e) { } ++ }); ++ }); ++}); ++//# sourceMappingURL=signature-policy.spec.js.map +\ No newline at end of file +diff --git a/node_modules/@chainsafe/libp2p-gossipsub/dist/test/signature-policy.spec.js.map b/node_modules/@chainsafe/libp2p-gossipsub/dist/test/signature-policy.spec.js.map +new file mode 100644 +index 0000000..3f42977 +--- /dev/null ++++ b/node_modules/@chainsafe/libp2p-gossipsub/dist/test/signature-policy.spec.js.map +@@ -0,0 +1 @@ ++{"version":3,"file":"signature-policy.spec.js","sourceRoot":"","sources":["../../test/signature-policy.spec.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAA;AACxC,OAAO,EAAE,WAAW,EAAE,MAAM,0CAA0C,CAAA;AACtE,OAAO,EAAE,MAAM,EAAE,MA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AAC;gBACH,MAAM,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,MAAM,EAAE,mBAAmB,EAAE,EAAE,OAAO,EAAE,GAAG,EAAE,CAAC,CAAA;gBACnF,MAAM,CAAC,IAAI,CAAC,6DAA6D,CAAC,CAAA;YAC5E,CAAC;YAAC,OAAO,CAAC,EAAE,CAAC,CAAA,CAAC;QAChB,CAAC,CAAC,CAAA;IACJ,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"} +\ No newline at end of file +diff --git a/node_modules/@chainsafe/libp2p-gossipsub/dist/test/time-cache.spec.d.ts b/node_modules/@chainsafe/libp2p-gossipsub/dist/test/time-cache.spec.d.ts +new file mode 100644 +index 0000000..ca5a5fc +--- /dev/null ++++ b/node_modules/@chainsafe/libp2p-gossipsub/dist/test/time-cache.spec.d.ts +@@ -0,0 +1,2 @@ ++export {}; ++//# sourceMappingURL=time-cache.spec.d.ts.map +\ No newline at end of file +diff --git a/node_modules/@chainsafe/libp2p-gossipsub/dist/test/time-cache.spec.d.ts.map b/node_modules/@chainsafe/libp2p-gossipsub/dist/test/time-cache.spec.d.ts.map +new file mode 100644 +index 0000000..1c82004 +--- /dev/null ++++ b/node_modules/@chainsafe/libp2p-gossipsub/dist/test/time-cache.spec.d.ts.map +@@ -0,0 +1 @@ ++{"version":3,"file":"time-cache.spec.d.ts","sourceRoot":"","sources":["../../test/time-cache.spec.ts"],"names":[],"mappings":""} +\ No newline at end of file +diff --git a/node_modules/@chainsafe/libp2p-gossipsub/dist/test/time-cache.spec.js b/node_modules/@chainsafe/libp2p-gossipsub/dist/test/time-cache.spec.js +new file mode 100644 +index 0000000..423d535 +--- /dev/null ++++ b/node_modules/@chainsafe/libp2p-gossipsub/dist/test/time-cache.spec.js +@@ -0,0 +1,52 @@ ++import { expect } from 'aegir/chai'; ++import sinon from 'sinon'; ++import { SimpleTimeCache } from '../src/utils/time-cache.js'; ++describe('SimpleTimeCache', () => { ++ const validityMs = 1000; ++ const timeCache = new SimpleTimeCache({ validityMs }); ++ const sandbox = sinon.createSandbox(); ++ beforeEach(() => { ++ sandbox.useFakeTimers(); ++ }); ++ afterEach(() => { ++ sandbox.restore(); ++ }); ++ it('should delete items after 1sec', () => { ++ timeCache.put('aFirst'); ++ timeCache.put('bFirst'); ++ timeCache.put('cFirst'); ++ expect(timeCache.has('aFirst')).to.be.true(); ++ expect(timeCache.has('bFirst')).to.be.true(); ++ expect(timeCache.has('cFirst')).to.be.true(); ++ sandbox.clock.tick(validityMs + 1); ++ // https://github.com/ChainSafe/js-libp2p-gossipsub/issues/232#issuecomment-1109589919 ++ timeCache.prune(); ++ timeCache.put('aSecond'); ++ timeCache.put('bSecond'); ++ timeCache.put('cSecond'); ++ expect(timeCache.has('aSecond')).to.be.true(); ++ expect(timeCache.has('bSecond')).to.be.true(); ++ expect(timeCache.has('cSecond')).to.be.true(); ++ expect(timeCache.has('aFirst')).to.be.false(); ++ expect(timeCache.has('bFirst')).to.be.false(); ++ expect(timeCache.has('cFirst')).to.be.false(); ++ }); ++ it('Map insertion order', () => { ++ const key1 = 'key1'; ++ const key2 = 'key2'; ++ const key3 = 'key3'; ++ const map = new Map(); ++ map.set(key1, Date.now()); ++ map.set(key2, Date.now()); ++ map.set(key3, Date.now()); ++ expect(Array.from(map.keys())).deep.equals([key1, key2, key3], 'Map iterator order'); ++ // Does not change key position ++ map.set(key2, Date.now()); ++ expect(Array.from(map.keys())).deep.equals([key1, key2, key3], 'Map iterator order after re-set'); ++ // Changes key position ++ map.delete(key2); ++ map.set(key2, Date.now()); ++ expect(Array.from(map.keys())).deep.equals([key1, key3, key2], 'Map iterator order after delete set'); ++ }); ++}); ++//# sourceMappingURL=time-cache.spec.js.map +\ No newline at end of file +diff --git a/node_modules/@chainsafe/libp2p-gossipsub/dist/test/time-cache.spec.js.map b/node_modules/@chainsafe/libp2p-gossipsub/dist/test/time-cache.spec.js.map +new file mode 100644 +index 0000000..b2549a8 +--- /dev/null ++++ b/node_modules/@chainsafe/libp2p-gossipsub/dist/test/time-cache.spec.js.map +@@ -0,0 +1 @@ ++{"version":3,"file":"time-cache.spec.js","sourceRoot":"","sources":["../../test/time-cache.spec.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,YAAY,CAAA;AACnC,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAA;AAE5D,QAAQ,CAAC,iBAAiB,EAAE,GAAG,EAAE;IAC/B,MAAM,UAAU,GAAG,IAAI,CAAA;IACvB,MAAM,SAAS,GAAG,IAAI,eAAe,CAAO,EAAE,UAAU,EAAE,CAAC,CAAA;IAC3D,MAAM,OAAO,GAAG,KAAK,CAAC,aAAa,EAAE,CAAA;IAErC,UAAU,CAAC,GAAG,EAAE;QACd,OAAO,CAAC,aAAa,EAAE,CAAA;IACzB,CAAC,CAAC,CAAA;IAEF,SAAS,CAAC,GAAG,EAAE;QACb,OAAO,CAAC,OAAO,EAAE,CAAA;IACnB,CAAC,CAAC,CAAA;IAEF,EAAE,CAAC,gCAAgC,EAAE,GAAG,EAAE;QACxC,SAAS,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAA;QACvB,SAAS,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAA;QACvB,SAAS,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAA;QAEvB,MAAM,CAAC,SAAS,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,IAAI,EAAE,CAAA;QAC5C,MAAM,CAAC,SAAS,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,IAAI,EAAE,CAAA;QAC5C,MAAM,CAAC,SAAS,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,IAAI,EAAE,CAAA;QAE5C,OAAO,CAAC,KAAK,CAAC,I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C,IAAI,EAAE,IAAI,CAAC,GAAG,EAAE,CAAC,CAAA;QACzB,GAAG,CAAC,GAAG,CAAC,IAAI,EAAE,IAAI,CAAC,GAAG,EAAE,CAAC,CAAA;QAEzB,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC,EAAE,oBAAoB,CAAC,CAAA;QAEpF,+BAA+B;QAC/B,GAAG,CAAC,GAAG,CAAC,IAAI,EAAE,IAAI,CAAC,GAAG,EAAE,CAAC,CAAA;QAEzB,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC,EAAE,iCAAiC,CAAC,CAAA;QAEjG,uBAAuB;QACvB,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,CAAA;QAChB,GAAG,CAAC,GAAG,CAAC,IAAI,EAAE,IAAI,CAAC,GAAG,EAAE,CAAC,CAAA;QAEzB,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC,EAAE,qCAAqC,CAAC,CAAA;IACvG,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"} +\ No newline at end of file +diff --git a/node_modules/@chainsafe/libp2p-gossipsub/dist/test/tracer.spec.d.ts b/node_modules/@chainsafe/libp2p-gossipsub/dist/test/tracer.spec.d.ts +new file mode 100644 +index 0000000..99d44dd +--- /dev/null ++++ b/node_modules/@chainsafe/libp2p-gossipsub/dist/test/tracer.spec.d.ts +@@ -0,0 +1,2 @@ ++export {}; ++//# sourceMappingURL=tracer.spec.d.ts.map +\ No newline at end of file +diff --git a/node_modules/@chainsafe/libp2p-gossipsub/dist/test/tracer.spec.d.ts.map b/node_modules/@chainsafe/libp2p-gossipsub/dist/test/tracer.spec.d.ts.map +new file mode 100644 +index 0000000..55036e0 +--- /dev/null ++++ b/node_modules/@chainsafe/libp2p-gossipsub/dist/test/tracer.spec.d.ts.map +@@ -0,0 +1 @@ ++{"version":3,"file":"tracer.spec.d.ts","sourceRoot":"","sources":["../../test/tracer.spec.ts"],"names":[],"mappings":""} +\ No newline at end of file +diff --git a/node_modules/@chainsafe/libp2p-gossipsub/dist/test/tracer.spec.js b/node_modules/@chainsafe/libp2p-gossipsub/dist/test/tracer.spec.js +new file mode 100644 +index 0000000..fb26af0 +--- /dev/null ++++ b/node_modules/@chainsafe/libp2p-gossipsub/dist/test/tracer.spec.js +@@ -0,0 +1,55 @@ ++import { generateKeyPair } from '@libp2p/crypto/keys'; ++import { peerIdFromPrivateKey } from '@libp2p/peer-id'; ++import { expect } from 'aegir/chai'; ++import delay from 'delay'; ++import * as constants from '../src/constants.js'; ++import { IWantTracer } from '../src/tracer.js'; ++import { messageIdToString } from '../src/utils/messageIdToString.js'; ++import { makeTestMessage, getMsgId, getMsgIdStr } from './utils/index.js'; ++describe('IWantTracer', () => { ++ it('should track broken promises', async function () { ++ // tests that unfulfilled promises are tracked correctly ++ this.timeout(6000); ++ const t = new IWantTracer(constants.GossipsubIWantFollowupTime, messageIdToString, null); ++ const peerA = peerIdFromPrivateKey(await generateKeyPair('Ed25519')).toString(); ++ const peerB = peerIdFromPrivateKey(await generateKeyPair('Ed25519')).toString(); ++ const msgIds = []; ++ for (let i = 0; i < 100; i++) { ++ const m = makeTestMessage(i, 'test_topic'); ++ msgIds.push(getMsgId(m)); ++ } ++ t.addPromise(peerA, msgIds); ++ t.addPromise(peerB, msgIds); ++ // no broken promises yet ++ let brokenPromises = t.getBrokenPromises(); ++ expect(brokenPromises.size).to.be.equal(0); ++ // make promises break ++ await delay(constants.GossipsubIWantFollowupTime + 10); ++ brokenPromises = t.getBrokenPromises(); ++ expect(brokenPromises.size).to.be.equal(2); ++ expect(brokenPromises.get(peerA)).to.be.equal(1); ++ expect(brokenPromises.get(peerB)).to.be.equal(1); ++ }); ++ it('should track unbroken promises', async function () { ++ // like above, but this time we deliver messages to fullfil the promises ++ this.timeout(6000); ++ const t = new IWantTracer(constants.GossipsubIWantFollowupTime, messageIdToString, null); ++ const peerA = peerIdFromPrivateKey(await generateKeyPair('Ed25519')).toString(); ++ const peerB = peerIdFromPrivateKey(await generateKeyPair('Ed25519')).toString(); ++ const msgs = []; ++ const msgIds = []; ++ for (let i = 0; i < 100; i++) { ++ const m = makeTestMessage(i, 'test_topic'); ++ msgs.push(m); ++ msgIds.push(getMsgId(m)); ++ } ++ t.addPromise(peerA, msgIds); ++ t.addPromise(peerB, msgIds); ++ msgs.forEach((msg) => { t.deliverMessage(getMsgIdStr(msg)); }); ++ await delay(constants.GossipsubIWantFollowupTime + 10); ++ // there should be no broken promises ++ const brokenPromises = t.getBrokenPromises(); ++ expect(brokenPromises.size).to.be.equal(0); ++ }); ++}); ++//# sourceMappingURL=tracer.spec.js.map +\ No newline at end of file +diff --git a/node_modules/@chainsafe/libp2p-gossipsub/dist/test/tracer.spec.js.map b/node_modules/@chainsafe/libp2p-gossipsub/dist/test/tracer.spec.js.map +new file mode 100644 +index 0000000..d860887 +--- /dev/null ++++ b/node_modules/@chainsafe/libp2p-gossipsub/dist/test/tracer.spec.js.map +@@ -0,0 +1 @@ ++{"version":3,"file":"tracer.spec.js","sourceRoot":"","sources":["../../test/tracer.spec.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAA;AACrD,OAAO,EAAE,oBAAoB,EAAE,MAAM,iBAAiB,CAAA;AACtD,OAAO,EAAE,MAAM,EAAE,MAAM,YAAY,CAAA;AACnC,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,KAAK,SAAS,MAAM,qBAAqB,CAAA;AAChD,OAAO,EAAE,W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AC,UAAU,CAAC,KAAK,EAAE,MAAM,CAAC,CAAA;QAC3B,CAAC,CAAC,UAAU,CAAC,KAAK,EAAE,MAAM,CAAC,CAAA;QAE3B,IAAI,CAAC,OAAO,CAAC,CAAC,GAAG,EAAE,EAAE,GAAG,CAAC,CAAC,cAAc,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC,CAAA,CAAC,CAAC,CAAC,CAAA;QAE7D,MAAM,KAAK,CAAC,SAAS,CAAC,0BAA0B,GAAG,EAAE,CAAC,CAAA;QAEtD,qCAAqC;QACrC,MAAM,cAAc,GAAG,CAAC,CAAC,iBAAiB,EAAE,CAAA;QAC5C,MAAM,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC,CAAA;IAC5C,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"} +\ No newline at end of file +diff --git a/node_modules/@chainsafe/libp2p-gossipsub/dist/test/unit/set.test.d.ts b/node_modules/@chainsafe/libp2p-gossipsub/dist/test/unit/set.test.d.ts +new file mode 100644 +index 0000000..76be891 +--- /dev/null ++++ b/node_modules/@chainsafe/libp2p-gossipsub/dist/test/unit/set.test.d.ts +@@ -0,0 +1,2 @@ ++export {}; ++//# sourceMappingURL=set.test.d.ts.map +\ No newline at end of file +diff --git a/node_modules/@chainsafe/libp2p-gossipsub/dist/test/unit/set.test.d.ts.map b/node_modules/@chainsafe/libp2p-gossipsub/dist/test/unit/set.test.d.ts.map +new file mode 100644 +index 0000000..4810f51 +--- /dev/null ++++ b/node_modules/@chainsafe/libp2p-gossipsub/dist/test/unit/set.test.d.ts.map +@@ -0,0 +1 @@ ++{"version":3,"file":"set.test.d.ts","sourceRoot":"","sources":["../../../test/unit/set.test.ts"],"names":[],"mappings":""} +\ No newline at end of file +diff --git a/node_modules/@chainsafe/libp2p-gossipsub/dist/test/unit/set.test.js b/node_modules/@chainsafe/libp2p-gossipsub/dist/test/unit/set.test.js +new file mode 100644 +index 0000000..4f676c1 +--- /dev/null ++++ b/node_modules/@chainsafe/libp2p-gossipsub/dist/test/unit/set.test.js +@@ -0,0 +1,41 @@ ++import { expect } from 'aegir/chai'; ++import { removeFirstNItemsFromSet, removeItemsFromSet } from '../../src/utils/set.js'; ++describe('Set util', function () { ++ describe('removeItemsFromSet', function () { ++ let s; ++ this.beforeEach(() => { ++ s = new Set([1, 2, 3, 4, 5]); ++ }); ++ const testCases = [ ++ { id: 'remove even numbers - need 0', ineed: 0, fn: (item) => item % 2 === 0, result: new Set([]) }, ++ { id: 'remove even numbers - need 1', ineed: 1, fn: (item) => item % 2 === 0, result: new Set([2]) }, ++ { id: 'remove even numbers - need 2', ineed: 2, fn: (item) => item % 2 === 0, result: new Set([2, 4]) }, ++ { id: 'remove even numbers - need 10', ineed: 2, fn: (item) => item % 2 === 0, result: new Set([2, 4]) } ++ ]; ++ for (const { id, ineed, fn, result } of testCases) { ++ // eslint-disable-next-line no-loop-func ++ it(id, () => { ++ expect(removeItemsFromSet(s, ineed, fn)).to.deep.equal(result); ++ }); ++ } ++ }); ++ describe('removeFirstNItemsFromSet', function () { ++ let s; ++ this.beforeEach(() => { ++ s = new Set([1, 2, 3, 4, 5]); ++ }); ++ const testCases = [ ++ { id: 'remove first 0 item', ineed: 0, result: new Set([]) }, ++ { id: 'remove first 1 item', ineed: 1, result: new Set([1]) }, ++ { id: 'remove first 2 item', ineed: 2, result: new Set([1, 2]) }, ++ { id: 'remove first 10 item', ineed: 10, result: new Set([1, 2, 3, 4, 5]) } ++ ]; ++ for (const { id, ineed, result } of testCases) { ++ // eslint-disable-next-line no-loop-func ++ it(id, () => { ++ expect(removeFirstNItemsFromSet(s, ineed)).to.deep.equal(result); ++ }); ++ } ++ }); ++}); ++//# sourceMappingURL=set.test.js.map +\ No newline at end of file +diff --git a/node_modules/@chainsafe/libp2p-gossipsub/dist/test/unit/set.test.js.map b/node_modules/@chainsafe/libp2p-gossipsub/dist/test/unit/set.test.js.map +new file mode 100644 +index 0000000..dff2ad3 +--- /dev/null ++++ b/node_modules/@chainsafe/libp2p-gossipsub/dist/test/unit/set.test.js.map +@@ -0,0 +1 @@ ++{"version":3,"file":"set.test.js","sourceRoot":"","sources":["../../../test/unit/set.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,YAAY,CAAA;AACnC,OAAO,EAAE,wBAAwB,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAA;AAErF,QAAQ,CAAC,UAAU,EAAE;IACnB,QAAQ,CAAC,oBAAoB,EAAE;QAC7B,IAAI,CAAc,CAAA;QAClB,IAAI,CAAC,UAAU,CAAC,GAAG,EAAE;YACnB,CAAC,GAAG,IAAI,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,CAAA;QAC9B,CAAC,CAAC,CAAA;QAEF,MAAM,SAAS,GAAyF;YACtG,EAAE,EAAE,EAAE,8BAA8B,EAAE,KAAK,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,GAAG,CAAC,KAAK,CAAC,EAAE,MAAM,EAAE,IAAI,GAAG,CAAC,EAAE,CAAC,EAAE;YACnG,EAAE,EAAE,EAAE,8BAA8B,EAAE,KAAK,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,GAAG,CAAC,KAAK,CAAC,EAAE,MAAM,EAAE,IAAI,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE;YACpG,EAAE,EAAE,EAAE,8BAA8B,EAAE,KAAK,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,GAAG,CAAC,KAAK,CAAC,EAAE,MAAM,EAAE,IAAI,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE;YACvG,EAAE,EAAE,EAAE,+BAA+B,EAAE,KAAK,EAA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,IAAI,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE;SAC5E,CAAA;QAED,KAAK,MAAM,EAAE,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,SAAS,EAAE,CAAC;YAC9C,wCAAwC;YACxC,EAAE,CAAC,EAAE,EAAE,GAAG,EAAE;gBACV,MAAM,CAAC,wBAAwB,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,CAAA;YAClE,CAAC,CAAC,CAAA;QACJ,CAAC;IACH,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"} +\ No newline at end of file +diff --git a/node_modules/@chainsafe/libp2p-gossipsub/dist/test/utils/create-pubsub.d.ts b/node_modules/@chainsafe/libp2p-gossipsub/dist/test/utils/create-pubsub.d.ts +new file mode 100644 +index 0000000..2a71f79 +--- /dev/null ++++ b/node_modules/@chainsafe/libp2p-gossipsub/dist/test/utils/create-pubsub.d.ts +@@ -0,0 +1,32 @@ ++import { GossipSub, type GossipSubComponents, type GossipsubOpts } from '../../src/index.js'; ++import type { TypedEventTarget, Libp2pEvents, PubSub } from '@libp2p/interface'; ++export interface CreateComponentsOpts { ++ init?: Partial; ++ pubsub?: { ++ new (opts?: any): PubSub; ++ }; ++} ++export interface GossipSubTestComponents extends GossipSubComponents { ++ events: TypedEventTarget; ++} ++export interface GossipSubAndComponents { ++ pubsub: GossipSub; ++ components: GossipSubTestComponents; ++} ++export declare const createComponents: (opts: CreateComponentsOpts) => Promise; ++export declare const createComponentsArray: (opts?: CreateComponentsOpts & { ++ number: number; ++ connected?: boolean; ++}) => Promise; ++export declare const connectPubsubNodes: (a: GossipSubAndComponents, b: GossipSubAndComponents) => Promise; ++export declare const connectAllPubSubNodes: (components: GossipSubAndComponents[]) => Promise; ++/** ++ * Connect some gossipsub nodes to others, ensure each has num peers ++ * ++ * @param {GossipSubAndComponents[]} gss ++ * @param {number} num - number of peers to connect ++ */ ++export declare function connectSome(gss: GossipSubAndComponents[], num: number): Promise; ++export declare function sparseConnect(gss: GossipSubAndComponents[]): Promise; ++export declare function denseConnect(gss: GossipSubAndComponents[]): Promise; ++//# sourceMappingURL=create-pubsub.d.ts.map +\ No newline at end of file +diff --git a/node_modules/@chainsafe/libp2p-gossipsub/dist/test/utils/create-pubsub.d.ts.map b/node_modules/@chainsafe/libp2p-gossipsub/dist/test/utils/create-pubsub.d.ts.map +new file mode 100644 +index 0000000..c45d061 +--- /dev/null ++++ b/node_modules/@chainsafe/libp2p-gossipsub/dist/test/utils/create-pubsub.d.ts.map +@@ -0,0 +1 @@ ++{"version":3,"file":"create-pubsub.d.ts","sourceRoot":"","sources":["../../../test/utils/create-pubsub.ts"],"names":[],"mappings":"AASA,OAAO,EAAE,SAAS,EAAE,KAAK,mBAAmB,EAAE,KAAK,aAAa,EAAE,MAAM,oBAAoB,CAAA;AAC5F,OAAO,KAAK,EAAE,gBAAgB,EAAE,YAAY,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAA;AAG/E,MAAM,WAAW,oBAAoB;IACnC,IAAI,CAAC,EAAE,OAAO,CAAC,aAAa,CAAC,CAAA;IAC7B,MAAM,CAAC,EAAE;QAAE,KAAK,IAAI,CAAC,EAAE,GAAG,GAAG,MAAM,CAAA;KAAE,CAAA;CACtC;AAED,MAAM,WAAW,uBAAwB,SAAQ,mBAAmB;IAClE,MAAM,EAAE,gBAAgB,CAAC,YAAY,CAAC,CAAA;CACvC;AAED,MAAM,WAAW,sBAAsB;IACrC,MAAM,EAAE,SAAS,CAAA;IACjB,UAAU,EAAE,uBAAuB,CAAA;CACpC;AAED,eAAO,MAAM,gBAAgB,SAAgB,oBAAoB,KAAG,QAAQ,sBAAsB,CAoCjG,CAAA;AAED,eAAO,MAAM,qBAAqB,UAC1B,oBAAoB,GAAG;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,SAAS,CAAC,EAAE,OAAO,CAAA;CAAE,KACnE,QAAQ,sBAAsB,EAAE,CAYlC,CAAA;AAED,eAAO,MAAM,kBAAkB,MAAa,sBAAsB,KAAK,sBAAsB,KAAG,QAAQ,IAAI,CAU3G,CAAA;AAED,eAAO,MAAM,qBAAqB,eAAsB,sBAAsB,EAAE,KAAG,QAAQ,IAAI,CAM9F,CAAA;AAED;;;;;GAKG;AACH,wBAAsB,WAAW,CAAE,GAAG,EAAE,sBAAsB,EAAE,EAAE,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAoB5F;AAED,wBAAsB,aAAa,CAAE,GAAG,EAAE,sBAAsB,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAEjF;AAED,wBAAsB,YAAY,CAAE,GAAG,EAAE,sBAAsB,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAEhF"} +\ No newline at end of file +diff --git a/node_modules/@chainsafe/libp2p-gossipsub/dist/test/utils/create-pubsub.js b/node_modules/@chainsafe/libp2p-gossipsub/dist/test/utils/create-pubsub.js +new file mode 100644 +index 0000000..7296d09 +--- /dev/null ++++ b/node_modules/@chainsafe/libp2p-gossipsub/dist/test/utils/create-pubsub.js +@@ -0,0 +1,98 @@ ++import { setMaxListeners } from 'events'; ++import { generateKeyPair } from '@libp2p/crypto/keys'; ++import { TypedEventEmitter, start } from '@libp2p/interface'; ++import { mockRegistrar, mockConnectionManager, mockNetwork } from '@libp2p/interface-compliance-tests/mocks'; ++import { defaultLogger } from '@libp2p/logger'; ++import { peerIdFromPrivateKey } from '@libp2p/peer-id'; ++import { PersistentPeerStore } from '@libp2p/peer-store'; ++import { MemoryDatastore } from 'datastore-core'; ++import { stubInterface } from 'ts-sinon'; ++import { GossipSub } from '../../src/index.js'; ++export const createComponents = async (opts) => { ++ const Ctor = opts.pubsub ?? GossipSub; ++ const privateKey = await generateKeyPair('Ed25519'); ++ const peerId = peerIdFromPrivateKey(privateKey); ++ const events = new TypedEventEmitter(); ++ const logger = defaultLogger(); ++ const components = { ++ privateKey, ++ peerId, ++ registrar: mockRegistrar(), ++ connectionManager: stubInterface(), ++ peerStore: new PersistentPeerStore({ ++ peerId, ++ datastore: new MemoryDatastore(), ++ events, ++ logger ++ }), ++ events, ++ logger ++ }; ++ components.connectionManager = mockConnectionManager(components); ++ const pubsub = new Ctor(components, opts.init); ++ await start(...Object.entries(components), pubsub); ++ mockNetwork.addNode(components); ++ try { ++ // not available everywhere ++ setMaxListeners(Infinity, pubsub); ++ } ++ catch { } ++ return { pubsub, components }; ++}; ++export const createComponentsArray = async (opts = { number: 1, connected: true }) => { ++ const output = await Promise.all(Array.from({ length: opts.number }).map(async (_, i) => createComponents({ ...opts, init: { ...opts.init, debugName: `libp2p:gossipsub:${i}` } }))); ++ if (opts.connected ?? false) { ++ await connectAllPubSubNodes(output); ++ } ++ return output; ++}; ++export const connectPubsubNodes = async (a, b) => { ++ const multicodecs = new Set([...a.pubsub.multicodecs, ...b.pubsub.multicodecs]); ++ const connection = await a.components.connectionManager.openConnection(b.components.peerId); ++ for (const multicodec of multicodecs) { ++ for (const topology of a.components.registrar.getTopologies(multicodec)) { ++ topology.onConnect?.(b.components.peerId, connection); ++ } ++ } ++}; ++export const connectAllPubSubNodes = async (components) => { ++ for (let i = 0; i < components.length; i++) { ++ for (let j = i + 1; j < components.length; j++) { ++ await connectPubsubNodes(components[i], components[j]); ++ } ++ } ++}; ++/** ++ * Connect some gossipsub nodes to others, ensure each has num peers ++ * ++ * @param {GossipSubAndComponents[]} gss ++ * @param {number} num - number of peers to connect ++ */ ++export async function connectSome(gss, num) { ++ for (let i = 0; i < gss.length; i++) { ++ let count = 0; ++ // merely do a Math.random() and check for duplicate may take a lot of time to run a test ++ // so we make an array of candidate peers ++ // initially, don't populate i as a candidate to connect: candidatePeers[i] = i + 1 ++ const candidatePeers = Array.from({ length: gss.length - 1 }, (_, j) => (j >= i ? j + 1 : j)); ++ while (count < num) { ++ const n = Math.floor(Math.random() * candidatePeers.length); ++ const peer = candidatePeers[n]; ++ await connectPubsubNodes(gss[i], gss[peer]); ++ // after connecting to a peer, update candidatePeers so that we don't connect to it again ++ for (let j = n; j < candidatePeers.length - 1; j++) { ++ candidatePeers[j] = candidatePeers[j + 1]; ++ } ++ // remove the last item ++ candidatePeers.splice(candidatePeers.length - 1, 1); ++ count++; ++ } ++ } ++} ++export async function sparseConnect(gss) { ++ await connectSome(gss, 3); ++} ++export async function denseConnect(gss) { ++ await connectSome(gss, Math.min(gss.length - 1, 10)); ++} ++//# sourceMappingURL=create-pubsub.js.map +\ No newline at end of file +diff --git a/node_modules/@chainsafe/libp2p-gossipsub/dist/test/utils/create-pubsub.js.map b/node_modules/@chainsafe/libp2p-gossipsub/dist/test/utils/create-pubsub.js.map +new file mode 100644 +index 0000000..8692d38 +--- /dev/null ++++ b/node_modules/@chainsafe/libp2p-gossipsub/dist/test/utils/create-pubsub.js.map +@@ -0,0 +1 @@ ++{"version":3,"file":"create-pubsub.js","sourceRoot":"","sources":["../../../test/utils/create-pubsub.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,QAAQ,CAAA;AACxC,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAA;AACrD,OAAO,EAAE,iBAAiB,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAA;AAC5D,OAAO,EAAE,aAAa,EAAE,qBAAqB,EAAE,WAAW,EAAE,MAAM,0CAA0C,CAAA;AAC5G,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAA;AAC9C,OAAO,EAAE,oBAAoB,EAAE,MAAM,iBAAiB,CAAA;AACtD,OAAO,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAA;AACxD,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAA;AAChD,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAA;AACxC,OAAO,EAAE,SAAS,EAAgD,MAAM,oBAAoB,CAAA;AAkB5F,MAAM,CAA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BACnD,cAAc,CAAC,CAAC,CAAC,GAAG,cAAc,CAAC,CAAC,GAAG,CAAC,CAAC,CAAA;YAC3C,CAAC;YACD,uBAAuB;YACvB,cAAc,CAAC,MAAM,CAAC,cAAc,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC,CAAC,CAAA;YACnD,KAAK,EAAE,CAAA;QACT,CAAC;IACH,CAAC;AACH,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,aAAa,CAAE,GAA6B;IAChE,MAAM,WAAW,CAAC,GAAG,EAAE,CAAC,CAAC,CAAA;AAC3B,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,YAAY,CAAE,GAA6B;IAC/D,MAAM,WAAW,CAAC,GAAG,EAAE,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,MAAM,GAAG,CAAC,EAAE,EAAE,CAAC,CAAC,CAAA;AACtD,CAAC"} +\ No newline at end of file +diff --git a/node_modules/@chainsafe/libp2p-gossipsub/dist/test/utils/events.d.ts b/node_modules/@chainsafe/libp2p-gossipsub/dist/test/utils/events.d.ts +new file mode 100644 +index 0000000..3c7aab7 +--- /dev/null ++++ b/node_modules/@chainsafe/libp2p-gossipsub/dist/test/utils/events.d.ts +@@ -0,0 +1,7 @@ ++import type { GossipSubAndComponents } from './create-pubsub.js'; ++import type { GossipsubEvents } from '../../src/index.js'; ++import type { TypedEventTarget } from '@libp2p/interface'; ++export declare const checkReceivedSubscription: (node: GossipSubAndComponents, peerIdStr: string, topic: string, peerIdx: number, timeout?: number) => Promise; ++export declare const checkReceivedSubscriptions: (node: GossipSubAndComponents, peerIdStrs: string[], topic: string, timeout?: number) => Promise; ++export declare const awaitEvents: = GossipsubEvents>(emitter: TypedEventTarget, event: keyof Events, number: number, timeout?: number) => Promise; ++//# sourceMappingURL=events.d.ts.map +\ No newline at end of file +diff --git a/node_modules/@chainsafe/libp2p-gossipsub/dist/test/utils/events.d.ts.map b/node_modules/@chainsafe/libp2p-gossipsub/dist/test/utils/events.d.ts.map +new file mode 100644 +index 0000000..a5ecee9 +--- /dev/null ++++ b/node_modules/@chainsafe/libp2p-gossipsub/dist/test/utils/events.d.ts.map +@@ -0,0 +1 @@ ++{"version":3,"file":"events.d.ts","sourceRoot":"","sources":["../../../test/utils/events.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAA;AAChE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAA;AACzD,OAAO,KAAK,EAAE,gBAAgB,EAA0B,MAAM,mBAAmB,CAAA;AAEjF,eAAO,MAAM,yBAAyB,SAC9B,sBAAsB,aACjB,MAAM,SACV,MAAM,WACJ,MAAM,uBAEd,QAAQ,IAAI,CA0BX,CAAA;AAEJ,eAAO,MAAM,0BAA0B,SAC/B,sBAAsB,cAChB,MAAM,EAAE,SACb,MAAM,uBAEZ,QAAQ,IAAI,CAcd,CAAA;AAED,eAAO,MAAM,WAAW,kEACb,iBAAiB,MAAM,CAAC,SAC1B,MAAM,MAAM,UACX,MAAM,uBAEb,QAAQ,IAAI,CAiBd,CAAA"} +\ No newline at end of file +diff --git a/node_modules/@chainsafe/libp2p-gossipsub/dist/test/utils/events.js b/node_modules/@chainsafe/libp2p-gossipsub/dist/test/utils/events.js +new file mode 100644 +index 0000000..85f468e +--- /dev/null ++++ b/node_modules/@chainsafe/libp2p-gossipsub/dist/test/utils/events.js +@@ -0,0 +1,55 @@ ++import { expect } from 'aegir/chai'; ++import pWaitFor from 'p-wait-for'; ++export const checkReceivedSubscription = async (node, peerIdStr, topic, peerIdx, timeout = 1000) => new Promise((resolve, reject) => { ++ const event = 'subscription-change'; ++ const t = setTimeout(() => { reject(new Error(`Not received subscriptions of psub ${peerIdx}, topic ${topic}`)); }, timeout); ++ const cb = (evt) => { ++ const { peerId, subscriptions } = evt.detail; ++ // console.log('@@@ in test received subscriptions from peer id', peerId.toString()) ++ if (peerId.toString() === peerIdStr && subscriptions[0].topic === topic && subscriptions[0].subscribe) { ++ clearTimeout(t); ++ node.pubsub.removeEventListener(event, cb); ++ if (Array.from(node.pubsub.getSubscribers(topic)) ++ .map((p) => p.toString()) ++ .includes(peerIdStr)) { ++ resolve(); ++ } ++ else { ++ reject(Error('topics should include the peerId')); ++ } ++ } ++ }; ++ node.pubsub.addEventListener(event, cb); ++}); ++export const checkReceivedSubscriptions = async (node, peerIdStrs, topic, timeout = 5000) => { ++ const recvPeerIdStrs = peerIdStrs.filter((peerIdStr) => peerIdStr !== node.components.peerId.toString()); ++ const promises = recvPeerIdStrs.map(async (peerIdStr, idx) => checkReceivedSubscription(node, peerIdStr, topic, idx, timeout)); ++ await Promise.all(promises); ++ for (const str of recvPeerIdStrs) { ++ expect(Array.from(node.pubsub.getSubscribers(topic)).map((p) => p.toString())).to.include(str); ++ } ++ await pWaitFor(() => { ++ return recvPeerIdStrs.every((peerIdStr) => { ++ return (node.pubsub).streamsOutbound.has(peerIdStr); ++ }); ++ }); ++}; ++export const awaitEvents = async (emitter, event, number, timeout = 30000) => { ++ return new Promise((resolve, reject) => { ++ let counter = 0; ++ const t = setTimeout(() => { ++ emitter.removeEventListener(event, cb); ++ reject(new Error(`${counter} of ${number} '${String(event)}' events received after ${timeout}ms`)); ++ }, timeout); ++ const cb = () => { ++ counter++; ++ if (counter >= number) { ++ clearTimeout(t); ++ emitter.removeEventListener(event, cb); ++ resolve(); ++ } ++ }; ++ emitter.addEventListener(event, cb); ++ }); ++}; ++//# sourceMappingURL=events.js.map +\ No newline at end of file +diff --git a/node_modules/@chainsafe/libp2p-gossipsub/dist/test/utils/events.js.map b/node_modules/@chainsafe/libp2p-gossipsub/dist/test/utils/events.js.map +new file mode 100644 +index 0000000..8e6c4af +--- /dev/null ++++ b/node_modules/@chainsafe/libp2p-gossipsub/dist/test/utils/events.js.map +@@ -0,0 +1 @@ ++{"version":3,"file":"events.js","sourceRoot":"","sources":["../../../test/utils/events.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,YAA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AAK,EACA,EAAE;IACjB,OAAO,IAAI,OAAO,CAAO,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;QAC3C,IAAI,OAAO,GAAG,CAAC,CAAA;QACf,MAAM,CAAC,GAAG,UAAU,CAAC,GAAG,EAAE;YACxB,OAAO,CAAC,mBAAmB,CAAC,KAAK,EAAE,EAAE,CAAC,CAAA;YACtC,MAAM,CAAC,IAAI,KAAK,CAAC,GAAG,OAAO,OAAO,MAAM,KAAK,MAAM,CAAC,KAAK,CAAC,2BAA2B,OAAO,IAAI,CAAC,CAAC,CAAA;QACpG,CAAC,EAAE,OAAO,CAAC,CAAA;QACX,MAAM,EAAE,GAAG,GAAS,EAAE;YACpB,OAAO,EAAE,CAAA;YACT,IAAI,OAAO,IAAI,MAAM,EAAE,CAAC;gBACtB,YAAY,CAAC,CAAC,CAAC,CAAA;gBACf,OAAO,CAAC,mBAAmB,CAAC,KAAK,EAAE,EAAE,CAAC,CAAA;gBACtC,OAAO,EAAE,CAAA;YACX,CAAC;QACH,CAAC,CAAA;QACD,OAAO,CAAC,gBAAgB,CAAC,KAAK,EAAE,EAAE,CAAC,CAAA;IACrC,CAAC,CAAC,CAAA;AACJ,CAAC,CAAA"} +\ No newline at end of file +diff --git a/node_modules/@chainsafe/libp2p-gossipsub/dist/test/utils/index.d.ts b/node_modules/@chainsafe/libp2p-gossipsub/dist/test/utils/index.d.ts +new file mode 100644 +index 0000000..1060a53 +--- /dev/null ++++ b/node_modules/@chainsafe/libp2p-gossipsub/dist/test/utils/index.d.ts +@@ -0,0 +1,7 @@ ++import type { RPC } from '../../src/message/rpc.js'; ++import type { TopicStr } from '../../src/types.js'; ++import type { PeerId } from '@libp2p/interface'; ++export * from './msgId.js'; ++export declare const createPeerId: () => Promise; ++export declare function makeTestMessage(i: number, topic: TopicStr, from?: PeerId): RPC.Message; ++//# sourceMappingURL=index.d.ts.map +\ No newline at end of file +diff --git a/node_modules/@chainsafe/libp2p-gossipsub/dist/test/utils/index.d.ts.map b/node_modules/@chainsafe/libp2p-gossipsub/dist/test/utils/index.d.ts.map +new file mode 100644 +index 0000000..89a9a0e +--- /dev/null ++++ b/node_modules/@chainsafe/libp2p-gossipsub/dist/test/utils/index.d.ts.map +@@ -0,0 +1 @@ ++{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../test/utils/index.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,0BAA0B,CAAA;AACnD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAA;AAClD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAA;AAE/C,cAAc,YAAY,CAAA;AAE1B,eAAO,MAAM,YAAY,QAAa,QAAQ,MAAM,CAInD,CAAA;AAKD,wBAAgB,eAAe,CAAE,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,QAAQ,EAAE,IAAI,CAAC,EAAE,MAAM,GAAG,GAAG,CAAC,OAAO,CAOvF"} +\ No newline at end of file +diff --git a/node_modules/@chainsafe/libp2p-gossipsub/dist/test/utils/index.js b/node_modules/@chainsafe/libp2p-gossipsub/dist/test/utils/index.js +new file mode 100644 +index 0000000..d948edf +--- /dev/null ++++ b/node_modules/@chainsafe/libp2p-gossipsub/dist/test/utils/index.js +@@ -0,0 +1,19 @@ ++import { generateKeyPair } from '@libp2p/crypto/keys'; ++import { peerIdFromPrivateKey } from '@libp2p/peer-id'; ++import { fromString as uint8ArrayFromString } from 'uint8arrays/from-string'; ++export * from './msgId.js'; ++export const createPeerId = async () => { ++ const peerId = peerIdFromPrivateKey(await generateKeyPair('Ed25519')); ++ return peerId; ++}; ++let seq = 0n; ++const defaultPeer = uint8ArrayFromString('12D3KooWBsYhazxNL7aeisdwttzc6DejNaM48889t5ifiS6tTrBf', 'base58btc'); ++export function makeTestMessage(i, topic, from) { ++ return { ++ seqno: uint8ArrayFromString((seq++).toString(16).padStart(16, '0'), 'base16'), ++ data: Uint8Array.from([i]), ++ from: from?.toMultihash().bytes ?? defaultPeer, ++ topic ++ }; ++} ++//# sourceMappingURL=index.js.map +\ No newline at end of file +diff --git a/node_modules/@chainsafe/libp2p-gossipsub/dist/test/utils/index.js.map b/node_modules/@chainsafe/libp2p-gossipsub/dist/test/utils/index.js.map +new file mode 100644 +index 0000000..e1d182b +--- /dev/null ++++ b/node_modules/@chainsafe/libp2p-gossipsub/dist/test/utils/index.js.map +@@ -0,0 +1 @@ ++{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../test/utils/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAA;AACrD,OAAO,EAAE,oBAAoB,EAAE,MAAM,iBAAiB,CAAA;AACtD,OAAO,EAAE,UAAU,IAAI,oBAAoB,EAAE,MAAM,yBAAyB,CAAA;AAK5E,cAAc,YAAY,CAAA;AAE1B,MAAM,CAAC,MAAM,YAAY,GAAG,KAAK,IAAqB,EAAE;IACtD,MAAM,MAAM,GAAG,oBAAoB,CAAC,MAAM,eAAe,CAAC,SAAS,CAAC,CAAC,CAAA;IAErE,OAAO,MAAM,CAAA;AACf,CAAC,CAAA;AAED,IAAI,GAAG,GAAG,EAAE,CAAA;AACZ,MAAM,WAAW,GAAG,oBAAoB,CAAC,sDAAsD,EAAE,WAAW,CAAC,CAAA;AAE7G,MAAM,UAAU,eAAe,CAAE,CAAS,EAAE,KAAe,EAAE,IAAa;IACxE,OAAO;QACL,KAAK,EAAE,oBAAoB,CAAC,CAAC,GAAG,EAAE,CAAC,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,QAAQ,CAAC,EAAE,EAAE,GAAG,CAAC,EAAE,QAAQ,CAAC;QAC7E,IAAI,EAAE,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC;QAC1B,IAAI,EAAE,IAAI,EAAE,WAAW,EAAE,CAAC,KAAK,IAAI,WAAW;QAC9C,KAAK;KACN,CAAA;AACH,CAAC"} +\ No newline at end of file +diff --git a/node_modules/@chainsafe/libp2p-gossipsub/dist/test/utils/msgId.d.ts b/node_modules/@chainsafe/libp2p-gossipsub/dist/test/utils/msgId.d.ts +new file mode 100644 +index 0000000..4f1d17c +--- /dev/null ++++ b/node_modules/@chainsafe/libp2p-gossipsub/dist/test/utils/msgId.d.ts +@@ -0,0 +1,5 @@ ++import type { RPC } from '../../src/message/rpc.js'; ++export declare const getMsgId: (msg: RPC.Message) => Uint8Array; ++export declare const getMsgIdStr: (msg: RPC.Message) => string; ++export declare const fastMsgIdFn: (msg: RPC.Message) => string; ++//# sourceMappingURL=msgId.d.ts.map +\ No newline at end of file +diff --git a/node_modules/@chainsafe/libp2p-gossipsub/dist/test/utils/msgId.d.ts.map b/node_modules/@chainsafe/libp2p-gossipsub/dist/test/utils/msgId.d.ts.map +new file mode 100644 +index 0000000..08d2530 +--- /dev/null ++++ b/node_modules/@chainsafe/libp2p-gossipsub/dist/test/utils/msgId.d.ts.map +@@ -0,0 +1 @@ ++{"version":3,"file":"msgId.d.ts","sourceRoot":"","sources":["../../../test/utils/msgId.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,0BAA0B,CAAA;AAEnD,eAAO,MAAM,QAAQ,QAAS,IAAI,OAAO,KAAG,UAO3C,CAAA;AAED,eAAO,MAAM,WAAW,QAAS,IAAI,OAAO,KAAG,MAA0C,CAAA;AAEzF,eAAO,MAAM,WAAW,QAAS,IAAI,OAAO,KAAG,MAEe,CAAA"} +\ No newline at end of file +diff --git a/node_modules/@chainsafe/libp2p-gossipsub/dist/test/utils/msgId.js b/node_modules/@chainsafe/libp2p-gossipsub/dist/test/utils/msgId.js +new file mode 100644 +index 0000000..9b2dac8 +--- /dev/null ++++ b/node_modules/@chainsafe/libp2p-gossipsub/dist/test/utils/msgId.js +@@ -0,0 +1,16 @@ ++import { digest } from '@chainsafe/as-sha256'; ++import { fromString as uint8ArrayFromString } from 'uint8arrays/from-string'; ++import { messageIdToString } from '../../src/utils/messageIdToString.js'; ++export const getMsgId = (msg) => { ++ const from = msg.from != null ? msg.from : new Uint8Array(0); ++ const seqno = msg.seqno instanceof Uint8Array ? msg.seqno : uint8ArrayFromString(msg.seqno ?? ''); ++ const result = new Uint8Array(from.length + seqno.length); ++ result.set(from, 0); ++ result.set(seqno, from.length); ++ return result; ++}; ++export const getMsgIdStr = (msg) => messageIdToString(getMsgId(msg)); ++export const fastMsgIdFn = (msg) => ++// eslint-disable-next-line @typescript-eslint/ban-ts-comment ++msg.data != null ? messageIdToString(digest(msg.data)) : '0'; ++//# sourceMappingURL=msgId.js.map +\ No newline at end of file +diff --git a/node_modules/@chainsafe/libp2p-gossipsub/dist/test/utils/msgId.js.map b/node_modules/@chainsafe/libp2p-gossipsub/dist/test/utils/msgId.js.map +new file mode 100644 +index 0000000..e59402f +--- /dev/null ++++ b/node_modules/@chainsafe/libp2p-gossipsub/dist/test/utils/msgId.js.map +@@ -0,0 +1 @@ ++{"version":3,"file":"msgId.js","sourceRoot":"","sources":["../../../test/utils/msgId.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAA;AAC7C,OAAO,EAAE,UAAU,IAAI,oBAAoB,EAAE,MAAM,yBAAyB,CAAA;AAC5E,OAAO,EAAE,iBAAiB,EAAE,MAAM,sCAAsC,CAAA;AAGxE,MAAM,CAAC,MAAM,QAAQ,GAAG,CAAC,GAAgB,EAAc,EAAE;IACvD,MAAM,IAAI,GAAG,GAAG,CAAC,IAAI,IAAI,IAAI,CAAC,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,UAAU,CAAC,CAAC,CAAC,CAAA;IAC5D,MAAM,KAAK,GAAG,GAAG,CAAC,KAAK,YAAY,UAAU,CAAC,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,oBAAoB,CAAC,GAAG,CAAC,KAAK,IAAI,EAAE,CAAC,CAAA;IACjG,MAAM,MAAM,GAAG,IAAI,UAAU,CAAC,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC,MAAM,CAAC,CAAA;IACzD,MAAM,CAAC,GAAG,CAAC,IAAI,EAAE,CAAC,CAAC,CAAA;IACnB,MAAM,CAAC,GAAG,CAAC,KAAK,EAAE,IAAI,CAAC,MAAM,CAAC,CAAA;IAC9B,OAAO,MAAM,CAAA;AACf,CAAC,CAAA;AAED,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,GAAgB,EAAU,EAAE,CAAC,iBAAiB,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAA;AAEzF,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,GAAgB,EAAU,EAAE;AACtD,6DAA6D;AAC7D,GAAG,CAAC,IAAI,IAAI,IAAI,CAAC,CAAC,CAAC,iBAAiB,CAAC,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAA"} +\ No newline at end of file +diff --git a/node_modules/@chainsafe/libp2p-gossipsub/dist/tsconfig.tsbuildinfo b/node_modules/@chainsafe/libp2p-gossipsub/dist/tsconfig.tsbuildinfo +new file mode 100644 +index 0000000..147c94d +--- /dev/null ++++ b/node_modules/@chainsafe/libp2p-gossipsub/dist/tsconfig.tsbuildinfo +@@ -0,0 +1 @@ ++{"program":{"fileNames":["../node_modules/typescript/lib/lib.es5.d.ts","../node_modules/typescript/lib/lib.es2015.d.ts","../node_modules/typescript/lib/lib.es2016.d.ts","../node_modules/typescript/lib/lib.es2017.d.ts","../node_modules/typescript/lib/lib.es2018.d.ts","../node_modules/typescript/lib/lib.es2019.d.ts","../node_modules/typescript/lib/lib.es2020.d.ts","../node_modules/typescript/lib/lib.es2021.d.ts","../node_modules/typescript/lib/lib.es2022.d.ts","../node_modules/typescript/lib/lib.es2023.d.ts","../node_modules/typescript/lib/lib.dom.d.ts","../node_modules/typescript/lib/lib.dom.iterable.d.ts","../node_modules/typescript/lib/lib.webworker.d.ts","../node_modules/typescript/lib/lib.es2015.core.d.ts","../node_modules/typescript/lib/lib.es2015.collection.d.ts","../node_modules/typescript/lib/lib.es2015.generator.d.ts","../node_modules/typescript/lib/lib.es2015.iterable.d.ts","../node_modules/typescript/lib/lib.es2015.promise.d.ts","../node_modules/typescript/lib/lib.es2015.proxy.d.ts","../node_modules/typescript/lib/lib.es2015.reflect.d.ts","../node_modules/typescript/lib/lib.es2015.symbol.d.ts","../node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts","../node_modules/typescript/lib/lib.es2016.array.include.d.ts","../node_modules/typescript/lib/lib.es2016.intl.d.ts","../node_modules/typescript/lib/lib.es2017.date.d.ts","../node_modules/typescript/lib/lib.es2017.object.d.ts","../node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts","../node_modules/typescript/lib/lib.es2017.string.d.ts","../node_modules/typescript/lib/lib.es2017.intl.d.ts","../node_modules/typescript/lib/lib.es2017.typedarrays.d.ts","../node_modules/typescript/lib/lib.es2018.asyncgenerator.d.ts","../node_modules/typescript/lib/lib.es2018.asynciterable.d.ts","../node_modules/typescript/lib/lib.es2018.intl.d.ts","../node_modules/typescript/lib/lib.es2018.promise.d.ts","../node_modules/typescript/lib/lib.es2018.regexp.d.ts","../node_modules/typescript/lib/lib.es2019.array.d.ts","../node_modules/typescript/lib/lib.es2019.object.d.ts","../node_modules/typescript/lib/lib.es2019.string.d.ts","../node_modules/typescript/lib/lib.es2019.symbol.d.ts","../node_modules/typescript/lib/lib.es2019.intl.d.ts","../node_modules/typescript/lib/lib.es2020.bigint.d.ts","../node_modules/typescript/lib/lib.es2020.date.d.ts","../node_modules/typescript/lib/lib.es2020.promise.d.ts","../node_modules/typescript/lib/lib.es2020.sharedmemory.d.ts","../node_modules/typescript/lib/lib.es2020.string.d.ts","../node_modules/typescript/lib/lib.es2020.symbol.wellknown.d.ts","../node_modules/typescript/lib/lib.es2020.intl.d.ts","../node_modules/typescript/lib/lib.es2020.number.d.ts","../node_modules/typescript/lib/lib.es2021.promise.d.ts","../node_modules/typescript/lib/lib.es2021.string.d.ts","../node_modules/typescript/lib/lib.es2021.weakref.d.ts","../node_modules/typescript/lib/lib.es2021.intl.d.ts","../node_modules/typescript/lib/lib.es2022.array.d.ts","../node_modules/typescript/lib/lib.es2022.error.d.ts","../node_modules/typescript/lib/lib.es2022.intl.d.ts","../node_modules/typescript/lib/lib.es2022.object.d.ts","../node_modules/typescript/lib/lib.es2022.sharedmemory.d.ts","../node_modules/typescript/lib/lib.es2022.string.d.ts","../node_modules/typescript/lib/lib.es2022.regexp.d.ts","../node_modules/typescript/lib/lib.es2023.array.d.ts","../node_modules/typescript/lib/lib.es2023.collection.d.ts","../node_modules/typescript/lib/lib.esnext.intl.d.ts","../node_modules/typescript/lib/lib.decorators.d.ts","../node_modules/typescript/lib/lib.decorators.legacy.d.ts","../src/config.ts","../src/constants.ts","../src/errors.ts","../node_modules/multiformats/dist/src/bases/interface.d.ts","../node_modules/multiformats/dist/src/block/interface.d.ts","../node_modules/multiformats/dist/src/hashes/interface.d.ts","../node_modules/multiformats/dist/src/link/interface.d.ts","../node_modules/multiformats/dist/src/cid.d.ts","../node_modules/uint8arraylist/dist/src/index.d.ts","../node_modules/@libp2p/interface/dist/src/keys/index.d.ts","../node_modules/@libp2p/interface/dist/src/peer-id/index.d.ts","../node_modules/@multiformats/multiaddr/dist/src/protocols-table.d.ts","../node_modules/@multiformats/dns/dist/src/resolvers/dns-over-https.d.ts","../node_modules/@multiformats/dns/dist/src/resolvers/dns-json-over-https.d.ts","../node_modules/@multiformats/dns/dist/src/resolvers/index.d.ts","../node_modules/progress-events/dist/src/index.d.ts","../node_modules/@multiformats/dns/dist/src/index.d.ts","../node_modules/@multiformats/multiaddr/dist/src/resolvers/dnsaddr.d.ts","../node_modules/@multiformats/multiaddr/dist/src/resolvers/index.d.ts","../node_modules/@multiformats/multiaddr/dist/src/filter/multiaddr-filter.d.ts","../node_modules/@multiformats/multiaddr/dist/src/index.d.ts","../node_modules/it-stream-types/dist/src/index.d.ts","../node_modules/@libp2p/interface/dist/src/connection/index.d.ts","../node_modules/@libp2p/interface/dist/src/peer-info/index.d.ts","../node_modules/@libp2p/interface/dist/src/content-routing/index.d.ts","../node_modules/@libp2p/interface/dist/src/event-target.d.ts","../node_modules/@libp2p/interface/dist/src/metrics/index.d.ts","../node_modules/@libp2p/interface/dist/src/peer-routing/index.d.ts","../node_modules/@libp2p/interface/dist/src/peer-store/index.d.ts","../node_modules/@libp2p/interface/dist/src/startable.d.ts","../node_modules/@libp2p/interface/dist/src/stream-handler/index.d.ts","../node_modules/@libp2p/interface/dist/src/topology/index.d.ts","../node_modules/@libp2p/interface/dist/src/stream-muxer/index.d.ts","../node_modules/@libp2p/interface/dist/src/transport/index.d.ts","../node_modules/@libp2p/interface/dist/src/connection-encrypter/index.d.ts","../node_modules/@libp2p/interface/dist/src/connection-gater/index.d.ts","../node_modules/@libp2p/interface/dist/src/peer-discovery/index.d.ts","../node_modules/@libp2p/interface/dist/src/peer-store/tags.d.ts","../node_modules/it-pushable/dist/src/index.d.ts","../node_modules/@libp2p/interface/dist/src/pubsub/index.d.ts","../node_modules/@libp2p/interface/dist/src/record/index.d.ts","../node_modules/@libp2p/interface/dist/src/errors.d.ts","../node_modules/@types/node/assert.d.ts","../node_modules/@types/node/assert/strict.d.ts","../node_modules/buffer/index.d.ts","../node_modules/undici-types/header.d.ts","../node_modules/undici-types/readable.d.ts","../node_modules/undici-types/file.d.ts","../node_modules/undici-types/fetch.d.ts","../node_modules/undici-types/formdata.d.ts","../node_modules/undici-types/connector.d.ts","../node_modules/undici-types/client.d.ts","../node_modules/undici-types/errors.d.ts","../node_modules/undici-types/dispatcher.d.ts","../node_modules/undici-types/global-dispatcher.d.ts","../node_modules/undici-types/global-origin.d.ts","../node_modules/undici-types/pool-stats.d.ts","../node_modules/undici-types/pool.d.ts","../node_modules/undici-types/handlers.d.ts","../node_modules/undici-types/balanced-pool.d.ts","../node_modules/undici-types/agent.d.ts","../node_modules/undici-types/mock-interceptor.d.ts","../node_modules/undici-types/mock-agent.d.ts","../node_modules/undici-types/mock-client.d.ts","../node_modules/undici-types/mock-pool.d.ts","../node_modules/undici-types/mock-errors.d.ts","../node_modules/undici-types/proxy-agent.d.ts","../node_modules/undici-types/env-http-proxy-agent.d.ts","../node_modules/undici-types/retry-handler.d.ts","../node_modules/undici-types/retry-agent.d.ts","../node_modules/undici-types/api.d.ts","../node_modules/undici-types/interceptors.d.ts","../node_modules/undici-types/util.d.ts","../node_modules/undici-types/cookies.d.ts","../node_modules/undici-types/patch.d.ts","../node_modules/undici-types/websocket.d.ts","../node_modules/undici-types/eventsource.d.ts","../node_modules/undici-types/filereader.d.ts","../node_modules/undici-types/diagnostics-channel.d.ts","../node_modules/undici-types/content-type.d.ts","../node_modules/undici-types/cache.d.ts","../node_modules/undici-types/index.d.ts","../node_modules/@types/node/globals.d.ts","../node_modules/@types/node/async_hooks.d.ts","../node_modules/@types/node/buffer.d.ts","../node_modules/@types/node/child_process.d.ts","../node_modules/@types/node/cluster.d.ts","../node_modules/@types/node/console.d.ts","../node_modules/@types/node/constants.d.ts","../node_modules/@types/node/crypto.d.ts","../node_modules/@types/node/dgram.d.ts","../node_modules/@types/node/diagnostics_channel.d.ts","../node_modules/@types/node/dns.d.ts","../node_modules/@types/node/dns/promises.d.ts","../node_modules/@types/node/domain.d.ts","../node_modules/@types/node/dom-events.d.ts","../node_modules/@types/node/events.d.ts","../node_modules/@types/node/fs.d.ts","../node_modules/@types/node/fs/promises.d.ts","../node_modules/@types/node/http.d.ts","../node_modules/@types/node/http2.d.ts","../node_modules/@types/node/https.d.ts","../node_modules/@types/node/inspector.d.ts","../node_modules/@types/node/module.d.ts","../node_modules/@types/node/net.d.ts","../node_modules/@types/node/os.d.ts","../node_modules/@types/node/path.d.ts","../node_modules/@types/node/perf_hooks.d.ts","../node_modules/@types/node/process.d.ts","../node_modules/@types/node/punycode.d.ts","../node_modules/@types/node/querystring.d.ts","../node_modules/@types/node/readline.d.ts","../node_modules/@types/node/readline/promises.d.ts","../node_modules/@types/node/repl.d.ts","../node_modules/@types/node/sea.d.ts","../node_modules/@types/node/stream.d.ts","../node_modules/@types/node/stream/promises.d.ts","../node_modules/@types/node/stream/consumers.d.ts","../node_modules/@types/node/stream/web.d.ts","../node_modules/@types/node/string_decoder.d.ts","../node_modules/@types/node/test.d.ts","../node_modules/@types/node/timers.d.ts","../node_modules/@types/node/timers/promises.d.ts","../node_modules/@types/node/tls.d.ts","../node_modules/@types/node/trace_events.d.ts","../node_modules/@types/node/tty.d.ts","../node_modules/@types/node/url.d.ts","../node_modules/@types/node/util.d.ts","../node_modules/@types/node/v8.d.ts","../node_modules/@types/node/vm.d.ts","../node_modules/@types/node/wasi.d.ts","../node_modules/@types/node/worker_threads.d.ts","../node_modules/@types/node/zlib.d.ts","../node_modules/@types/node/globals.global.d.ts","../node_modules/@types/node/index.d.ts","../node_modules/@libp2p/interface/dist/src/events.d.ts","../node_modules/@libp2p/interface/dist/src/index.d.ts","../node_modules/@libp2p/peer-id/dist/src/index.d.ts","../node_modules/it-length-prefixed/dist/src/encode.d.ts","../node_modules/it-reader/dist/src/index.d.ts","../node_modules/it-length-prefixed/dist/src/decode.d.ts","../node_modules/it-length-prefixed/dist/src/index.d.ts","../node_modules/it-pipe/dist/src/index.d.ts","../node_modules/multiformats/dist/src/hashes/digest.d.ts","../src/message/decoderpc.ts","../node_modules/protons-runtime/dist/src/codec.d.ts","../node_modules/protons-runtime/dist/src/decode.d.ts","../node_modules/protons-runtime/dist/src/encode.d.ts","../node_modules/protons-runtime/dist/src/codecs/enum.d.ts","../node_modules/protons-runtime/dist/src/codecs/message.d.ts","../node_modules/protons-runtime/dist/src/utils/reader.d.ts","../node_modules/protons-runtime/dist/src/utils/writer.d.ts","../node_modules/protons-runtime/dist/src/index.d.ts","../src/message/rpc.ts","../src/types.ts","../src/message-cache.ts","../src/score/peer-score-thresholds.ts","../src/metrics.ts","../src/score/peer-score-params.ts","../src/utils/set.ts","../src/score/peer-stats.ts","../src/score/compute-score.ts","../node_modules/denque/index.d.ts","../src/score/message-deliveries.ts","../src/score/peer-score.ts","../src/score/index.ts","../src/score/scoremetrics.ts","../src/stream.ts","../src/tracer.ts","../node_modules/@libp2p/crypto/dist/src/hmac/index.d.ts","../node_modules/multiformats/dist/src/bytes.d.ts","../node_modules/multiformats/dist/src/hashes/hasher.d.ts","../node_modules/multiformats/dist/src/varint.d.ts","../node_modules/multiformats/dist/src/codecs/interface.d.ts","../node_modules/multiformats/dist/src/interface.d.ts","../node_modules/multiformats/dist/src/index.d.ts","../node_modules/@libp2p/crypto/dist/src/keys/interface.d.ts","../node_modules/@libp2p/crypto/dist/src/keys/ecdh/index.d.ts","../node_modules/@libp2p/crypto/dist/src/keys/key-stretcher.d.ts","../node_modules/@libp2p/crypto/dist/src/keys/index.d.ts","../node_modules/@libp2p/crypto/dist/src/pbkdf2.d.ts","../node_modules/@libp2p/crypto/dist/src/random-bytes.d.ts","../node_modules/@libp2p/crypto/dist/src/index.d.ts","../node_modules/uint8arrays/dist/src/concat.d.ts","../node_modules/multiformats/dist/src/codecs/json.d.ts","../node_modules/multiformats/dist/src/codecs/raw.d.ts","../node_modules/multiformats/dist/src/bases/base.d.ts","../node_modules/multiformats/dist/src/basics.d.ts","../node_modules/uint8arrays/dist/src/util/bases.d.ts","../node_modules/uint8arrays/dist/src/from-string.d.ts","../node_modules/uint8arrays/dist/src/to-string.d.ts","../src/utils/buildrawmessage.ts","../src/utils/create-gossip-rpc.ts","../src/utils/shuffle.ts","../src/utils/messageidtostring.ts","../src/utils/publishconfig.ts","../src/utils/index.ts","../node_modules/@libp2p/pubsub/dist/src/utils.d.ts","../node_modules/multiformats/dist/src/hashes/sha2.d.ts","../src/utils/msgidfn.ts","../node_modules/@chainsafe/netmask/dist/src/util.d.ts","../node_modules/@chainsafe/netmask/dist/src/ip.d.ts","../node_modules/@chainsafe/netmask/dist/src/ipnet.d.ts","../node_modules/@chainsafe/netmask/dist/src/cidr.d.ts","../node_modules/@chainsafe/netmask/dist/src/index.d.ts","../node_modules/@multiformats/multiaddr/dist/src/convert.d.ts","../src/utils/multiaddr.ts","../src/utils/time-cache.ts","../node_modules/@libp2p/interface-internal/dist/src/address-manager/index.d.ts","../node_modules/@libp2p/peer-collections/dist/src/map.d.ts","../node_modules/@libp2p/peer-collections/dist/src/set.d.ts","../node_modules/@libp2p/peer-collections/dist/src/list.d.ts","../node_modules/@libp2p/peer-collections/dist/src/filter.d.ts","../node_modules/@libp2p/peer-collections/dist/src/tracked-map.d.ts","../node_modules/@libp2p/peer-collections/dist/src/tracked-set.d.ts","../node_modules/@libp2p/peer-collections/dist/src/tracked-list.d.ts","../node_modules/@libp2p/peer-collections/dist/src/index.d.ts","../node_modules/@libp2p/interface-internal/dist/src/connection-manager/index.d.ts","../node_modules/@libp2p/interface-internal/dist/src/random-walk/index.d.ts","../node_modules/@libp2p/interface-internal/dist/src/record/index.d.ts","../node_modules/@libp2p/interface-internal/dist/src/registrar/index.d.ts","../node_modules/@libp2p/interface-internal/dist/src/transport-manager/index.d.ts","../node_modules/@libp2p/interface-internal/dist/src/index.d.ts","../src/index.ts","../src/message/index.ts","../node_modules/@libp2p/interface-compliance-tests/dist/src/mocks/connection-gater.d.ts","../node_modules/@libp2p/interface-compliance-tests/dist/src/mocks/connection-manager.d.ts","../node_modules/@libp2p/interface-compliance-tests/dist/src/mocks/connection.d.ts","../node_modules/@libp2p/interface-compliance-tests/dist/src/mocks/multiaddr-connection.d.ts","../node_modules/@libp2p/logger/dist/src/index.d.ts","../node_modules/@libp2p/utils/dist/src/abstract-stream.d.ts","../node_modules/@libp2p/interface-compliance-tests/dist/src/mocks/muxer.d.ts","../node_modules/@libp2p/interface-compliance-tests/dist/src/mocks/registrar.d.ts","../node_modules/@libp2p/interface-compliance-tests/dist/src/mocks/upgrader.d.ts","../node_modules/@libp2p/interface-compliance-tests/dist/src/mocks/duplex.d.ts","../node_modules/@libp2p/interface-compliance-tests/dist/src/mocks/metrics.d.ts","../node_modules/@libp2p/interface-compliance-tests/dist/src/mocks/index.d.ts","../node_modules/@types/chai/index.d.ts","../node_modules/@types/chai-as-promised/index.d.ts","../node_modules/chai-parentheses/index.d.ts","../node_modules/@types/chai-subset/index.d.ts","../node_modules/chai-bites/index.d.ts","../node_modules/@types/chai-string/index.d.ts","../node_modules/aegir/dist/utils/chai.d.ts","../node_modules/p-defer/index.d.ts","../node_modules/p-timeout/index.d.ts","../node_modules/p-event/index.d.ts","../node_modules/p-wait-for/index.d.ts","../node_modules/interface-datastore/dist/src/key.d.ts","../node_modules/interface-datastore/node_modules/interface-store/dist/src/errors.d.ts","../node_modules/interface-datastore/node_modules/interface-store/dist/src/index.d.ts","../node_modules/interface-datastore/dist/src/index.d.ts","../node_modules/@libp2p/peer-store/dist/src/index.d.ts","../node_modules/datastore-core/dist/src/errors.d.ts","../node_modules/datastore-core/dist/src/shard.d.ts","../node_modules/interface-store/dist/src/index.d.ts","../node_modules/datastore-core/dist/src/base.d.ts","../node_modules/datastore-core/dist/src/memory.d.ts","../node_modules/datastore-core/dist/src/keytransform.d.ts","../node_modules/datastore-core/dist/src/sharding.d.ts","../node_modules/datastore-core/dist/src/mount.d.ts","../node_modules/datastore-core/dist/src/tiered.d.ts","../node_modules/datastore-core/dist/src/namespace.d.ts","../node_modules/datastore-core/dist/src/index.d.ts","../node_modules/@types/sinonjs__fake-timers/index.d.ts","../node_modules/@types/sinon/index.d.ts","../node_modules/ts-sinon/dist/index.d.ts","../test/utils/create-pubsub.ts","../test/2-nodes.spec.ts","../node_modules/@chainsafe/as-sha256/lib/hashobject.d.ts","../node_modules/@chainsafe/as-sha256/lib/wasm.d.ts","../node_modules/@chainsafe/as-sha256/lib/sha256.d.ts","../node_modules/@chainsafe/as-sha256/lib/index.d.ts","../test/utils/msgid.ts","../test/accept-from.spec.ts","../test/allowedtopics.spec.ts","../node_modules/@libp2p/interface-compliance-tests/dist/src/index.d.ts","../node_modules/@libp2p/interface-compliance-tests/dist/src/pubsub/index.d.ts","../test/compliance.spec.ts","../node_modules/eventemitter3/index.d.ts","../node_modules/p-queue/dist/queue.d.ts","../node_modules/p-queue/dist/options.d.ts","../node_modules/p-queue/dist/priority-queue.d.ts","../node_modules/p-queue/dist/index.d.ts","../node_modules/@libp2p/pubsub/dist/src/index.d.ts","../node_modules/@libp2p/floodsub/dist/src/cache.d.ts","../node_modules/@libp2p/floodsub/dist/src/config.d.ts","../node_modules/@libp2p/floodsub/dist/src/index.d.ts","../node_modules/delay/index.d.ts","../node_modules/@types/retry/index.d.ts","../node_modules/p-retry/index.d.ts","../test/floodsub.spec.ts","../test/gossip.spec.ts","../test/heartbeat.spec.ts","../test/mesh.spec.ts","../test/utils/index.ts","../test/message-cache.spec.ts","../test/peer-score-params.spec.ts","../test/peer-score-thresholds.spec.ts","../test/peer-score.spec.ts","../test/scoremetrics.spec.ts","../test/signature-policy.spec.ts","../test/time-cache.spec.ts","../test/tracer.spec.ts","../node_modules/@dapplion/benchmark/lib/utils/mochacliexports.d.ts","../node_modules/@dapplion/benchmark/lib/types.d.ts","../node_modules/@dapplion/benchmark/lib/mochaplugin/runbenchfn.d.ts","../node_modules/@dapplion/benchmark/lib/mochaplugin/index.d.ts","../node_modules/@dapplion/benchmark/lib/index.d.ts","../node_modules/abortable-iterator/dist/src/abort-error.d.ts","../node_modules/abortable-iterator/dist/src/index.d.ts","../node_modules/it-all/dist/src/index.d.ts","../test/benchmark/asynciterable.test.ts","../test/utils/events.ts","../test/benchmark/index.test.ts","../test/benchmark/protobuf.test.ts","../test/benchmark/time-cache.test.ts","../node_modules/uint8arrays/dist/src/equals.d.ts","../test/e2e/go-gossipsub.spec.ts","../test/unit/set.test.ts","../node_modules/keyv/src/index.d.ts","../node_modules/@types/http-cache-semantics/index.d.ts","../node_modules/@types/responselike/index.d.ts","../node_modules/@types/cacheable-request/index.d.ts","../node_modules/@types/ms/index.d.ts","../node_modules/@types/debug/index.d.ts","../node_modules/@types/dns-packet/index.d.ts","../node_modules/@types/istanbul-lib-coverage/index.d.ts","../node_modules/@types/json-schema/index.d.ts","../node_modules/@types/json5/index.d.ts","../node_modules/@types/keyv/index.d.ts","../node_modules/@types/linkify-it/build/index.cjs.d.ts","../node_modules/@types/linkify-it/index.d.ts","../node_modules/@types/mdurl/build/index.cjs.d.ts","../node_modules/@types/mdurl/index.d.ts","../node_modules/@types/markdown-it/dist/index.cjs.d.ts","../node_modules/@types/markdown-it/index.d.ts","../node_modules/@types/unist/index.d.ts","../node_modules/@types/mdast/index.d.ts","../node_modules/@types/minimatch/index.d.ts","../node_modules/@types/minimist/index.d.ts","../node_modules/@types/mocha/index.d.ts","../node_modules/@types/murmurhash3js-revisited/index.d.ts","../node_modules/@types/normalize-package-data/index.d.ts","../node_modules/@types/parse-json/index.d.ts","../node_modules/@types/semver/classes/semver.d.ts","../node_modules/@types/semver/functions/parse.d.ts","../node_modules/@types/semver/functions/valid.d.ts","../node_modules/@types/semver/functions/clean.d.ts","../node_modules/@types/semver/functions/inc.d.ts","../node_modules/@types/semver/functions/diff.d.ts","../node_modules/@types/semver/functions/major.d.ts","../node_modules/@types/semver/functions/minor.d.ts","../node_modules/@types/semver/functions/patch.d.ts","../node_modules/@types/semver/functions/prerelease.d.ts","../node_modules/@types/semver/functions/compare.d.ts","../node_modules/@types/semver/functions/rcompare.d.ts","../node_modules/@types/semver/functions/compare-loose.d.ts","../node_modules/@types/semver/functions/compare-build.d.ts","../node_modules/@types/semver/functions/sort.d.ts","../node_modules/@types/semver/functions/rsort.d.ts","../node_modules/@types/semver/functions/gt.d.ts","../node_modules/@types/semver/functions/lt.d.ts","../node_modules/@types/semver/functions/eq.d.ts","../node_modules/@types/semver/functions/neq.d.ts","../node_modules/@types/semver/functions/gte.d.ts","../node_modules/@types/semver/functions/lte.d.ts","../node_modules/@types/semver/functions/cmp.d.ts","../node_modules/@types/semver/functions/coerce.d.ts","../node_modules/@types/semver/classes/comparator.d.ts","../node_modules/@types/semver/classes/range.d.ts","../node_modules/@types/semver/functions/satisfies.d.ts","../node_modules/@types/semver/ranges/max-satisfying.d.ts","../node_modules/@types/semver/ranges/min-satisfying.d.ts","../node_modules/@types/semver/ranges/to-comparators.d.ts","../node_modules/@types/semver/ranges/min-version.d.ts","../node_modules/@types/semver/ranges/valid.d.ts","../node_modules/@types/semver/ranges/outside.d.ts","../node_modules/@types/semver/ranges/gtr.d.ts","../node_modules/@types/semver/ranges/ltr.d.ts","../node_modules/@types/semver/ranges/intersects.d.ts","../node_modules/@types/semver/ranges/simplify.d.ts","../node_modules/@types/semver/ranges/subset.d.ts","../node_modules/@types/semver/internals/identifiers.d.ts","../node_modules/@types/semver/index.d.ts","../node_modules/@types/sinon-chai/index.d.ts","../node_modules/@types/strip-bom/index.d.ts","../node_modules/@types/strip-json-comments/index.d.ts","../node_modules/@types/yargs-parser/index.d.ts","../node_modules/@types/yargs/index.d.ts","../node_modules/@types/yauzl/index.d.ts"],"fileInfos":[{"version":"824cb491a40f7e8fdeb56f1df5edf91b23f3e3ee6b4cde84d4a99be32338faee","affectsGlobalScope":true},"45b7ab580deca34ae9729e97c13cfd999df04416a79116c3bfb483804f85ded4","3facaf05f0c5fc569c5649dd359892c98a85557e3e0c847964caeb67076f4d75","9a68c0c07ae2fa71b44384a839b7b8d81662a236d4b9ac30916718f7510b1b2d","5e1c4c362065a6b95ff952c0eab010f04dcd2c3494e813b493ecfd4fcb9fc0d8","68d73b4a11549f9c0b7d352d10e91e5dca8faa3322bfb77b661839c42b1ddec7","5efce4fc3c29ea84e8928f97adec086e3dc876365e0982cc8479a07954a3efd4","feecb1be483ed332fad555aff858affd90a48ab19ba7272ee084704eb7167569","5514e54f17d6d74ecefedc73c504eadffdeda79c7ea205cf9febead32d45c4bc","1c0cdb8dc619bc549c3e5020643e7cf7ae7940058e8c7e5aefa5871b6d86f44b",{"version":"87d693a4920d794a73384b3c779cadcb8548ac6945aa7a925832fe2418c9527a","affectsGlobalScope":true},{"version":"76f838d5d49b65de83bc345c04aa54c62a3cfdb72a477dc0c0fce89a30596c30","affectsGlobalScope":true},{"version":"db88e2781075c7bca86634724f38a132de718ddf3a470a3a2cdb182f4364af9e","affectsGlobalScope":true},{"version":"138fb588d26538783b78d1e3b2c2cc12d55840b97bf5e08bca7f7a174fbe2f17","affectsGlobalScope":true},{"version":"dc2df20b1bcdc8c2d34af4926e2c3ab15ffe1160a63e58b7e09833f616efff44","affectsGlobalScope":true},{"version":"4443e68b35f3332f753eacc66a04ac1d2053b8b035a0e0ac1d455392b5e243b3","affectsGlobalScope":true},{"version":"bc47685641087c015972a3f072480889f0d6c65515f12bd85222f49a98952ed7","affectsGlobalScope":true},{"version":"0dc1e7ceda9b8b9b455c3a2d67b0412feab00bd2f66656cd8850e8831b08b537","affectsGlobalScope":true},{"version":"ce691fb9e5c64efb9547083e4a34091bcbe5bdb41027e310ebba8f7d96a98671","affectsGlobalScope":true},{"version":"8d697a2a929a5fcb38b7a65594020fcef05ec1630804a33748829c5ff53640d0","affectsGlobalScope":true},{"version":"4ff2a353abf8a80ee399af572debb8faab2d33ad38c4b4474cff7f26e7653b8d","affectsGlobalScope":true},{"version":"93495ff27b8746f55d19fcbcdbaccc99fd95f19d057aed1bd2c0cafe1335fbf0","affectsGlobalScope":true},{"version":"6fc23bb8c3965964be8c597310a2878b53a0306edb71d4b5a4dfe760186bcc01","affectsGlobalScope":true},{"version":"ea011c76963fb15ef1cdd7ce6a6808b46322c527de2077b6cfdf23ae6f5f9ec7","affectsGlobalScope":true},{"version":"38f0219c9e23c915ef9790ab1d680440d95419ad264816fa15009a8851e79119","affectsGlobalScope":true},{"version":"bb42a7797d996412ecdc5b2787720de477103a0b2e53058569069a0e2bae6c7e","affectsGlobalScope":true},{"version":"4738f2420687fd85629c9efb470793bb753709c2379e5f85bc1815d875ceadcd","affectsGlobalScope":true},{"version":"2f11ff796926e0832f9ae148008138ad583bd181899ab7dd768a2666700b1893","affectsGlobalScope":true},{"version":"4de680d5bb41c17f7f68e0419412ca23c98d5749dcaaea1896172f06435891fc","affectsGlobalScope":true},{"version":"9fc46429fbe091ac5ad2608c657201eb68b6f1b8341bd6d670047d32ed0a88fa","affectsGlobalScope":true},{"version":"61c37c1de663cf4171e1192466e52c7a382afa58da01b1dc75058f032ddf0839","affectsGlobalScope":true},{"version":"b541a838a13f9234aba650a825393ffc2292dc0fc87681a5d81ef0c96d281e7a","affectsGlobalScope":true},{"version":"b20fe0eca9a4e405f1a5ae24a2b3290b37cf7f21eba6cbe4fc3fab979237d4f3","affectsGlobalScope":true},{"version":"811ec78f7fefcabbda4bfa93b3eb67d9ae166ef95f9bff989d964061cbf81a0c","affectsGlobalScope":true},{"version":"717937616a17072082152a2ef351cb51f98802fb4b2fdabd32399843875974ca","affectsGlobalScope":true},{"version":"d7e7d9b7b50e5f22c915b525acc5a49a7a6584cf8f62d0569e557c5cfc4b2ac2","affectsGlobalScope":true},{"version":"71c37f4c9543f31dfced6c7840e068c5a5aacb7b89111a4364b1d5276b852557","affectsGlobalScope":true},{"version":"576711e016cf4f1804676043e6a0a5414252560eb57de9faceee34d79798c850","affectsGlobalScope":true},{"version":"89c1b1281ba7b8a96efc676b11b264de7a8374c5ea1e6617f11880a13fc56dc6","affectsGlobalScope":true},{"version":"49ed889be54031e1044af0ad2c603d627b8bda8b50c1a68435fe85583901d072","affectsGlobalScope":true},{"version":"e93d098658ce4f0c8a0779e6cab91d0259efb88a318137f686ad76f8410ca270","affectsGlobalScope":true},{"version":"063600664504610fe3e99b717a1223f8b1900087fab0b4cad1496a114744f8df","affectsGlobalScope":true},{"version":"934019d7e3c81950f9a8426d093458b65d5aff2c7c1511233c0fd5b941e608ab","affectsGlobalScope":true},{"version":"bf14a426dbbf1022d11bd08d6b8e709a2e9d246f0c6c1032f3b2edb9a902adbe","affectsGlobalScope":true},{"version":"5e07ed3809d48205d5b985642a59f2eba47c402374a7cf8006b686f79efadcbd","affectsGlobalScope":true},{"version":"2b72d528b2e2fe3c57889ca7baef5e13a56c957b946906d03767c642f386bbc3","affectsGlobalScope":true},{"version":"8073890e29d2f46fdbc19b8d6d2eb9ea58db9a2052f8640af20baff9afbc8640","affectsGlobalScope":true},{"version":"368af93f74c9c932edd84c58883e736c9e3d53cec1fe24c0b0ff451f529ceab1","affectsGlobalScope":true},{"version":"af3dd424cf267428f30ccfc376f47a2c0114546b55c44d8c0f1d57d841e28d74","affectsGlobalScope":true},{"version":"995c005ab91a498455ea8dfb63aa9f83fa2ea793c3d8aa344be4a1678d06d399","affectsGlobalScope":true},{"version":"51e547984877a62227042850456de71a5c45e7fe86b7c975c6e68896c86fa23b","affectsGlobalScope":true},{"version":"956d27abdea9652e8368ce029bb1e0b9174e9678a273529f426df4b3d90abd60","affectsGlobalScope":true},{"version":"4fa6ed14e98aa80b91f61b9805c653ee82af3502dc21c9da5268d3857772ca05","affectsGlobalScope":true},{"version":"e6633e05da3ff36e6da2ec170d0d03ccf33de50ca4dc6f5aeecb572cedd162fb","affectsGlobalScope":true},{"version":"d8670852241d4c6e03f2b89d67497a4bbefe29ecaa5a444e2c11a9b05e6fccc6","affectsGlobalScope":true},{"version":"8444af78980e3b20b49324f4a16ba35024fef3ee069a0eb67616ea6ca821c47a","affectsGlobalScope":true},{"version":"caccc56c72713969e1cfe5c3d44e5bab151544d9d2b373d7dbe5a1e4166652be","affectsGlobalScope":true},{"version":"3287d9d085fbd618c3971944b65b4be57859f5415f495b33a6adc994edd2f004","affectsGlobalScope":true},{"version":"50d53ccd31f6667aff66e3d62adf948879a3a16f05d89882d1188084ee415bbc","affectsGlobalScope":true},{"version":"08a58483392df5fcc1db57d782e87734f77ae9eab42516028acbfe46f29a3ef7","affectsGlobalScope":true},{"version":"436aaf437562f276ec2ddbee2f2cdedac7664c1e4c1d2c36839ddd582eeb3d0a","affectsGlobalScope":true},{"version":"13f6e6380c78e15e140243dc4be2fa546c287c6d61f4729bc2dd7cf449605471","affectsGlobalScope":true},{"version":"33358442698bb565130f52ba79bfd3d4d484ac85fe33f3cb1759c54d18201393","affectsGlobalScope":true},{"version":"782dec38049b92d4e85c1585fbea5474a219c6984a35b004963b00beb1aab538","affectsGlobalScope":true},{"version":"8dd05b63a186702e76716cb824a892741fe274c82ec741669f6704e336b31bec","signature":"87c73268165bf20f01c101ac785e8a9d1d95ff203d05d3548a6c49952597e321"},{"version":"11f59b2fe369086ae532118462306d4d8622d2ceada716e834adfa26b456f914","signature":"ea438e982614f14ddf033f957aec98c89f09d9979734eee158f1d74c1a555f70"},{"version":"05dd3e847e286f95abb3a15d150acd3d54d5641baa75bf3dc042209f7cd6d2fe","signature":"0cb9fd85715d6d6e8a6cb449e73262f9b96654a8d7dc7ff6d42b7f6c3d0a7664"},"4a3605bef1a5ef29fd5a1696dd95b0b4e2259e2d07a4d88fac79f3a9765c44a2","370079895f1acdd4bb5194a403c85bf60cfbb2654bced9430a6c7210e7246be8","90240231e730deed31569f6c686766a538e4a024bbc33ea1738fe924f477ba61","552223520e823223ee13c5764e9b69b1819c985818a8bcda435d8d1dbd909bee","49b7c3ddd683c09aa437dd92681699387441f522524b14d2331ce494a9bf2f27","d35b5db21a04a45ae6323c4d4b25acc983dfe2870fc670fd05249eb19d839a5e","637b97f727f21c07a73f09130dc7bf5ac94d04511b179b5eb3e9a4d85a16147a","51720c0374406647b50f84f24c7b623f1d01e1955f7e929da7c5c0629b4390ad","5212dd78d1d63ab33332c8846a0ea5ce248159e74033cde16de48373036b4704","954b3c04ee9f94ca1e262f3e5a6e833b0da0066514b3d4b97b92b7f0c85f8700","a2fc9ce1ae5bed7068d701d8aeebf13321de0f42c217dc2e10f1622dcaa53a7f","8e81f220cb935d551e88cff11541d5e89d3a3494a52fe6247e98016a9dbd4c2d","6b2576a04253626ba41b7dc7ec5977bec07f3b6952b16249d9fa8a3a0d79901c","9de17491f2bfbccea92500e174079d53bdedae34dbebe5d4a12a06ab09814710","e88481085a8576fa52efc913e631c1a833d16179486469b8538d8c4fab2f7381","aec68502c8f4ffaecb4440b37363473582fec0bfee4fb8668a87daa7f700f708","d71577e78c7a4257074aaf82f595724175210c89e8b467ef82f949a6cbd891bc","cf548af8b03cbbc79fdc4f357b5560f618c6d2f68c8688e6eb759c3c11d962c3","c84146dbc9d2e5f43d2cbf15485a4eabf90219dbb66c0d481f20f12d3851bffc","9dc5a1d8f09f9faf21207253a92b461190d59c81ee12c9ac612630e699749990","99c24f331c9f4e75a779b9a988e942442db3cf29923ceb820d3bdd4ed1edfef2","25b1f20d5868ef9ef18132f7dd76b40b7038688ff7c56c58930537a8dff9f231","4105fa0ecfaffb578c8051c3de22e8c984191aac8de14641ee99beed9c5e5bd9","af080582e94b991e099383c1da15f189ca240c12ff5e2338344b7263ab10e305","8c92080253bac0506d82b83d555a029582595f0944abb349954ea732322baa5c","45d4c8d63a67224af62bebff18da32bb2817e306c9fd9e5d1dac6ef8d2da7ead","230eb449f719119cab1728252f20ecdd36d7a20cef659e4a51ada1a232a8aaad","5f264ca312dfcbf23917febc8d7a73ef5be9c248af605939de1c7c4129aa65f2","c1c7b50665ce0b8aa4b95f3843167ac7ac25d1f724d77c2a07b597abb9cf394c","1bf687d978bdd6d5aff10b9eb0ff0695179f8594d4446946fd0182d6d25fa433","ec26029e3a4eccf8ee79d5c76093fbe928cedc83d813fca9be4f055d61530013","e0ff6a627dfbfb9d32e49f34879a763680e37758c509ddd809cb316b96f34390","2113d72680c7ddad6d3b6f70a29432a35c074c94ec6823a7c16ccd69847d965c","c8ffd61bf2db2e7bccb996dd70c9499805cb338f1b1c781987e38ba99dd5b296","55e5a976b594dc02f054860fb59a5299872a5b3c8c90e96733a5c9c9d4ed1fb8","fac83d4c6898d5bf90c508cc84409ded40fdc14611cf42d7fb750fb2c7847979","1668310e691181966c371fce881c88cb1c2e65ac832ef5470434ad926998da2f","4f1eb6b9c2b666278e09019281953fc4ecadad3b2ba2781b2602445743eaaeca","b0c64c942cb2e55bf49e513dfe46ae15b85754829d6639d1ab69a56c388cc2eb","2db0dd3aaa2ed285950273ce96ae8a450b45423aa9da2d10e194570f1233fa6b","7394959e5a741b185456e1ef5d64599c36c60a323207450991e7a42e08911419","4967529644e391115ca5592184d4b63980569adf60ee685f968fd59ab1557188","5929864ce17fba74232584d90cb721a89b7ad277220627cc97054ba15a98ea8f","24bd580b5743dc56402c440dc7f9a4f5d592ad7a419f25414d37a7bfe11e342b","25c8056edf4314820382a5fdb4bb7816999acdcb929c8f75e3f39473b87e85bc","c464d66b20788266e5353b48dc4aa6bc0dc4a707276df1e7152ab0c9ae21fad8","78d0d27c130d35c60b5e5566c9f1e5be77caf39804636bc1a40133919a949f21","c6fd2c5a395f2432786c9cb8deb870b9b0e8ff7e22c029954fabdd692bff6195","1d6e127068ea8e104a912e42fc0a110e2aa5a66a356a917a163e8cf9a65e4a75","5ded6427296cdf3b9542de4471d2aa8d3983671d4cac0f4bf9c637208d1ced43","6bdc71028db658243775263e93a7db2fd2abfce3ca569c3cca5aee6ed5eb186d","cadc8aced301244057c4e7e73fbcae534b0f5b12a37b150d80e5a45aa4bebcbd","385aab901643aa54e1c36f5ef3107913b10d1b5bb8cbcd933d4263b80a0d7f20","9670d44354bab9d9982eca21945686b5c24a3f893db73c0dae0fd74217a4c219","0b8a9268adaf4da35e7fa830c8981cfa22adbbe5b3f6f5ab91f6658899e657a7","11396ed8a44c02ab9798b7dca436009f866e8dae3c9c25e8c1fbc396880bf1bb","ba7bc87d01492633cb5a0e5da8a4a42a1c86270e7b3d2dea5d156828a84e4882","4893a895ea92c85345017a04ed427cbd6a1710453338df26881a6019432febdd","c21dc52e277bcfc75fac0436ccb75c204f9e1b3fa5e12729670910639f27343e","13f6f39e12b1518c6650bbb220c8985999020fe0f21d818e28f512b7771d00f9","9b5369969f6e7175740bf51223112ff209f94ba43ecd3bb09eefff9fd675624a","4fe9e626e7164748e8769bbf74b538e09607f07ed17c2f20af8d680ee49fc1da","24515859bc0b836719105bb6cc3d68255042a9f02a6022b3187948b204946bd2","ea0148f897b45a76544ae179784c95af1bd6721b8610af9ffa467a518a086a43","24c6a117721e606c9984335f71711877293a9651e44f59f3d21c1ea0856f9cc9","dd3273ead9fbde62a72949c97dbec2247ea08e0c6952e701a483d74ef92d6a17","405822be75ad3e4d162e07439bac80c6bcc6dbae1929e179cf467ec0b9ee4e2e","0db18c6e78ea846316c012478888f33c11ffadab9efd1cc8bcc12daded7a60b6","4d2b0eb911816f66abe4970898f97a2cfc902bcd743cbfa5017fad79f7ef90d8","bd0532fd6556073727d28da0edfd1736417a3f9f394877b6d5ef6ad88fba1d1a","89167d696a849fce5ca508032aabfe901c0868f833a8625d5a9c6e861ef935d2","e53a3c2a9f624d90f24bf4588aacd223e7bec1b9d0d479b68d2f4a9e6011147f","24b8685c62562f5d98615c5a0c1d05f297cf5065f15246edfe99e81ec4c0e011","93507c745e8f29090efb99399c3f77bec07db17acd75634249dc92f961573387","339dc5265ee5ed92e536a93a04c4ebbc2128f45eeec6ed29f379e0085283542c","4732aec92b20fb28c5fe9ad99521fb59974289ed1e45aecb282616202184064f","2e85db9e6fd73cfa3d7f28e0ab6b55417ea18931423bd47b409a96e4a169e8e6","c46e079fe54c76f95c67fb89081b3e399da2c7d109e7dca8e4b58d83e332e605","bf67d53d168abc1298888693338cb82854bdb2e69ef83f8a0092093c2d562107",{"version":"c75ac0682b74face8d051331544f633445f5d203dc773d579fa109a7cbee9f06","affectsGlobalScope":true},"3d77c73be94570813f8cadd1f05ebc3dc5e2e4fdefe4d340ca20cd018724ee36",{"version":"e8dbde089a4b9d5b2124764ebbcfe577ffcb3a1df5cfb512a504c708ddfc7262","affectsGlobalScope":true},"62f1c00d3d246e0e3cf0224f91e122d560428ec1ccc36bb51d4574a84f1dbad0","53f0960fdcc53d097918adfd8861ffbe0db989c56ffc16c052197bf115da5ed6",{"version":"662163e5327f260b23ca0a1a1ad8a74078aabb587c904fcb5ef518986987eaff","affectsGlobalScope":true},"a40826e8476694e90da94aa008283a7de50d1dafd37beada623863f1901cb7fb",{"version":"f85c06e750743acf31f0cfd3be284a364d469761649e29547d0dd6be48875150","affectsGlobalScope":true},"b0c0d1d13be149f790a75b381b413490f98558649428bb916fd2d71a3f47a134","3c884d9d9ec454bdf0d5a0b8465bf8297d2caa4d853851d92cc417ac6f30b969","0364f8bb461d6e84252412d4e5590feda4eb582f77d47f7a024a7a9ff105dfdc","5433f7f77cd1fd53f45bd82445a4e437b2f6a72a32070e907530a4fea56c30c8","d0ca5d7df114035258a9d01165be309371fcccf0cccd9d57b1453204686d1ed0",{"version":"ee1ee365d88c4c6c0c0a5a5701d66ebc27ccd0bcfcfaa482c6e2e7fe7b98edf7","affectsGlobalScope":true},{"version":"9a30b7fefd7f8abbca4828d481c61c18e40fe5ff107e113b1c1fcd2c8dcf2743","affectsGlobalScope":true},"173b6275a81ebdb283b180654890f46516c21199734fed01a773b1c168b8c45c","304f66274aa8119e8d65a49b1cff84cbf803def6afe1b2cc987386e9a9890e22","1b9adafe8a7fefaeaf9099a0e06f602903f6268438147b843a33a5233ac71745","98273274f2dbb79b0b2009b20f74eca4a7146a3447c912d580cd5d2d94a7ae30","c933f7ba4b201c98b14275fd11a14abb950178afd2074703250fe3654fc10cd2","dccdf1677e531e33f8ac961a68bc537418c9a414797c1ea7e91307501cdc3f5e",{"version":"ea455cc68871b049bcecd9f56d4cf27b852d6dafd5e3b54468ca87cc11604e4d","affectsGlobalScope":true},"8f5814f29dbaf8bacd1764aebdf1c8a6eb86381f6a188ddbac0fcbaab855ce52","a63d03de72adfb91777784015bd3b4125abd2f5ef867fc5a13920b5649e8f52b","d20e003f3d518a7c1f749dbe27c6ab5e3be7b3c905a48361b04a9557de4a6900",{"version":"452e8a437aa57fe832dece2a5d3ea8dd0ab1de03ca778d09798c56ece0a29e80","affectsGlobalScope":true},{"version":"a20f1e119615bf7632729fd89b6c0b5ffdc2df3b512d6304146294528e3ebe19","affectsGlobalScope":true},"575fb200043b11b464db8e42cc64379c5fd322b6d787638e005b5ee98a64486d","6de2f225d942562733e231a695534b30039bdf1875b377bb7255881f0df8ede8","56249fd3ef1f6b90888e606f4ea648c43978ef43a7263aafad64f8d83cd3b8aa","139ad1dc93a503da85b7a0d5f615bddbae61ad796bc68fedd049150db67a1e26","7b166975fdbd3b37afb64707b98bca88e46577bbc6c59871f9383a7df2daacd1","9eece5e586312581ccd106d4853e861aaaa1a39f8e3ea672b8c3847eedd12f6e","81505c54d7cad0009352eaa21bd923ab7cdee7ec3405357a54d9a5da033a2084","269929a24b2816343a178008ac9ae9248304d92a8ba8e233055e0ed6dbe6ef71","93452d394fdd1dc551ec62f5042366f011a00d342d36d50793b3529bfc9bd633",{"version":"73aa178e8fb1449ef3666093d8dca25f96302a80ee45f8ff027df8e4792bf9fd","affectsGlobalScope":true},"2ee1645e0df9d84467cfe1d67b0ad3003c2f387de55874d565094464ee6f2927",{"version":"f61ec7355ade6c4cffc2b121bab7bd6882a262c44b498f4fedbbbc8c8830a8cd","affectsGlobalScope":true},{"version":"9cf780e96b687e4bdfd1907ed26a688c18b89797490a00598fa8b8ab683335dd","affectsGlobalScope":true},"98e00f3613402504bc2a2c9a621800ab48e0a463d1eed062208a4ae98ad8f84c","9ae88ce9f73446c24b2d2452e993b676da1b31fca5ceb7276e7f36279f693ed1","e49d7625faff2a7842e4e7b9b197f972633fca685afcf6b4403400c97d087c36","b82c38abc53922b1b3670c3af6f333c21b735722a8f156e7d357a2da7c53a0a0",{"version":"b423f53647708043299ded4daa68d95c967a2ac30aa1437adc4442129d7d0a6c","affectsGlobalScope":true},{"version":"21fcdcb618236f0feaca7e511e2da10c19970f86e09c934cef2d45b340ad92b5","affectsGlobalScope":true},"4f0fc7b7f54422bd97cfaf558ddb4bca86893839367b746a8f86b60ac7619673","4cdd8b6b51599180a387cc7c1c50f49eca5ce06595d781638fd0216520d98246","d91a7d8b5655c42986f1bdfe2105c4408f472831c8f20cf11a8c3345b6b56c8c",{"version":"8704423bf338bff381ebc951ed819935d0252d90cd6de7dffe5b0a5debb65d07","affectsGlobalScope":true},"b33379077284c9e55d2410d814b71b15522c5f71f9e93e15a8c3c41d463b00f6",{"version":"ab9b9a36e5284fd8d3bf2f7d5fcbc60052f25f27e4d20954782099282c60d23e","affectsGlobalScope":true},"a42be67ed1ddaec743582f41fc219db96a1b69719fccac6d1464321178d610fc","c663a7e4ee2cb54d99cf095479a5bcf1dd18d762ffdfa038aa1b2d79b070b0d7","5463c98206a890ea7a759fbcc97b0c042ab1a740b3e24037f7fbf40bae70a3c5","5bccd6ffc11fed820a432ac819200e6af38f8c3625e6eae0cf0f07ca85856392","f30cfcfff28ee8f87563225b47239bb07b9b11edd09dda0ea6499b18cca1a30e","0edb8a97ead1fefd337458449050857e80740e31a3f76cffa656262f4e651a50","6d2d14bb016a70a5ee1afb1cc7718d4369fb645979c725454c688f791ac7218f","8d7622e53b676dfd20828ba435649c217a5d9dee9cdc3713ee808fa2140513da","56558ae167446acf230ea2cc072a835309a37ae63d286b484308afd8c504c2d6","8510595d2ca2660e6407be65d8bf95f0c53877dbb812e269cdd980fc34de5f78",{"version":"d9411d8047fa05102fa6a7ac24678d912d7fa8cf5f977543cc1c68b6879db77d","signature":"7ad3e0aaeb840047fa4711306188cac803514091f251b6baecb9b2aacf15b976"},"6d268309f0e15dd820b2df9806234166554cb4e2fe00d11737adcb4e5489f700","58cf96187feb10cc8ad3bb080871cd30888ef63bc5db131f11458850ef8f6245","9102986ff52326a2016e8cddc1cf3092f0808ac916dcc8dc2d2c7195cd181987","fa82b7b22d9df87323e31e9e2ad75911028f3e544647fd212424b3c4452fee3f","01f20dac9dc14f0d306e5d1215c5c1c3b4d1805905e60ae92fabac4031eae7da","9ceec2a882368c0160a8a3879aa0efce0fb985751fc23ff6191006030969cfa4","cad5d6451789234434c28dd2d6a8267b0d64c479b1ad267321faa31ba90d570b","6516fc98fa10b0cb22c7e332bacea4a7ea80257e113f6cdddd924d03bfde218e",{"version":"bfa4bb83799e6951616f1c9ddcdf8667fb2fcf10d916e511b483a7629d826b90","signature":"3cd33c37432c2de7bdd9f1d48b3ea4fd03afad4969cfc5ba88d81e6ed03f432c"},{"version":"bb3c6e08fd9ba9ecdff61464835611a6f4e3cfc481a93dbcca54955f1520b497","signature":"6db29cf7af1d68c8194d98f1c444cea3b30a2c65deda3428452efaa05717b81d"},{"version":"b372f7c0506cdd643db284d1236961d64af030b3620d5d24a37bd2838432294e","signature":"561ef05d7e369040c28800d878d7e6461af62e459460263e911d508f319c8d5d"},{"version":"a33d38497edafe33166b68a9a66b66b940370aa86d34e2a404a031af6abc2e0a","signature":"a1b60bd2328318dcbec30bdf529dad31a13315ff2df60c8bd71630c58a575b06"},{"version":"13cfe6635f9c03a7e6cf8a2292bcb958a5472b61f8571b13d344223fa3b55341","signature":"a399dd9b73e4bbfbed2ad1c1259d707f5f147f40dc5e3eeb541bf0bf2da42b25"},{"version":"ba761e7d79bacd46b8492fa7853c2f8f5f689cec8292f41ab6fa15beeb166a39","signature":"8cc6a35806cd10d448b0f2ab01fe0b6194ca57fdaced2d71781b68e83c55bd88"},{"version":"8bcf62f57052931576536b09b50c9f1e777b0cbb87ccdc6afb1a53ec8517cca1","signature":"8f364fec0ef20506aa9cf00b5cd8b620c1c0389687b11a3a32b0b5d4716ad894"},{"version":"438a50f997e321d98f7f6b46407e2a46acc5de9550569ed2d82ad3245bf83548","signature":"5d11703e2c5d4dbe00bbe79f3bc864d178cf8d6ebccc2d1448ea29e93654f029"},{"version":"0b188566ea6bb7f4251794faba6d0534505f75e08af589c5ce2497a34435c56e","signature":"f4e82c91aac3b61f3ad04f11a44c5b79f724ff8a09281d0afa24a6624633ff25"},"ed849d616865076f44a41c87f27698f7cdf230290c44bafc71d7c2bc6919b202",{"version":"f27753c06cdb9072f8ff706d23c24bfabb0224e575debf10ea01b7c1efe1cf1c","signature":"7b8b9017156ef8bf3bbe42785fac8956e5c9869f4a494536d7f548a7c1c7d98a"},{"version":"1c8dbedbe10722901b2da628b22a26921b8d1b11bfaaa220117850263cabba6f","signature":"07c34d1f83dfc5746de4229e01f0cb4d388a9f128eab6beadb4ae1621ebb87c6"},{"version":"a8985c08f974af3ba240ad89d4a2e483678fdfa3ed0d2741a6e9ed67d57d12d4","signature":"763bb8df872cbb8783e29e19bd7a1dea0f88f7fd7398343af38be8509a65df82"},{"version":"a031e8f05e3d040582f30fdf02a2b92dcee98ec44adb1a974a27ea47b7f46561","signature":"1950f058bfb5c505c748f9282d279455393e01b4c8670e7cc550d4f05613f981"},{"version":"4aab28c4bd16b397705467cce237518b886147480bedf08416294ea503e2728e","signature":"372b3681eb9618821c0e0e10bcc775b838e45b51912b8998bc5ba035100dc9e5"},{"version":"2ea09bfb3c0bc2a8f2dde6bd453b616d03a4a0372e8de6ba41a163a5015cc97e","signature":"c286b410193495d067668bcdbd13ea3f3a39001edff02edee248babf2652e563"},"18e2ed308bb90cde2d3d2b4ed6de12abe41b6f73e321616176b7f258de3c2774","929fc31f7523aaa1d19735b77e637af06e58d76007648ec088ecfbec1521cbfe","a6eb23f2a83113ce0ab7203bfda2be0888720f8d694a20abaef83b9f62832061","363dca5004ac5a3d9c2bba12812b97a64461911762f0b8f9320a8856ec53bcad","1447d46bff9e7c5c77da14515a7456ea5e919ce6e28f5e6746edf99818e4be47","557b8c7481296f4b7ed362320f3bbb40bb87404edf880c81224f365a8d1e17f3","283ed3d075bf7d3e8793f63b2a52f475ed84d95b7b6351c5d5bcc6c49d4b845b","7a6f74294b8fb90f5e3832be21e25898dd81b2a1adc36dda6929813ba4135311","3f1370424c252aed11747282fc619f04497e426f63917bf2182fd46d51adc58a","5d40e6a7071d0d1e6e558e17214ff786ecb3ea73e31b25a88c2cbe2435fa1252","9e1d4141a748616ed5138f4c01853738a6e06b24c92520aff77a6b0deadcf431","60cbc38a9b402c14c388a7254781752b279017b3adeb94b840dcbf4872a6a410","3d2ec84143e6462a786b5d9ecf06f4f6f67a59a1f16c5a3a5e41721ba8478b7f","96b8f393e636547f0477e387138cd7ca9a7c556343b89f446cfc5672dee5e643","2e34b7e7c07624978db18b34c8a528928a7c24bc4b047add3e9d90bdc49e267f","ba3f6f0ee47f46cdce55620aec5726de80e92a930982634afe9918c114c38f0b","6f38045547cdfd54ec19abcd943cace72c775fde739c5e0e1d917cf3030c16b5","6544dab49004fecb69a4ef775e9ad2773a6148b1f9bfd9b75508e3afa11f5d35","bd4c741820ec3574b7ed3b782c8d78034d6e4631d11997e701e6b955b86a87c1","e2dd36a524ea5b13de1ed104ede9cea79696588175c1df1940d6a29113a4aee0","ac63a01fcac70315fc9b416e9a57e568b18032c7cfcaa314e1751f03ef71286f","a878d4c7237a7af50e96534295fcf723134d70cbb1e9bfd8365266b912aee6ec",{"version":"74d37a17c3cdb67e03ede296c123bb0a4590f64614b6a303c857a50c76fd1f48","signature":"d5dc186100e52b4b8f97c9d09c6462cf6fa359a7d62d2403ebd596e843f68271"},{"version":"d26ee30a8f7c1bfe0b9954618224c24412832c8a91add7aa80d6fdf2a0a7745a","signature":"387e1f9577d2a83aca689b6abf6e3e86abae87f578e8788635baeb675f13e1df"},{"version":"51cb9f385c5ae02d228005eaabded3a1e9b51ee78cbae0a4f172f6ff9c3c8fc0","signature":"2ad4a77b1a4c9215f0391871d4da4afc3f23b1a813147a13ca9b3ad8ff85bd85"},{"version":"579945f69bb73bdbc126af5b84d68012733084dfb2e81bf178338e4567c46838","signature":"f88e179eb581dd7c9e8da094cd3505e7708ec9f973854b5d3c60ecaf3ebaa6b9"},{"version":"a6219ab754d1c77302f2fc9fe3437aa0dff7ba7dc614e38691f9d47e838536cc","signature":"85d9b79d06f74b9da7c0572065e3e71f5184e88523049dc61f2f31e1570fbb5f"},{"version":"0d2671b56be9f27055595b2f52a2b5ea130dbab296e0963a63aadc8f7416a5b3","signature":"27d091afaec0fb41ee0186f689a2f4be48f898600ee063a296b04a8cfea8429e"},"cc9ac6b245413dc56348b6c588ef2371e5d2f2179c62f272880ac41d36fba11f","130e4655e30a6d7a8004566642e24bf3016b5e5a2e5dcd72c0a61b663f7df711",{"version":"612f4324198c98cc596d05dbd8e02c93e64c19bf81d74ed44e2e3bc26c7a3dc3","signature":"62aba97d8d0ff6caa48694bc249de47bb92ad690ea5357ce3d8e44c44d186607"},"603177107b8f7d1e5b993470f4cdec86b61d48a052c5c12e51e340b93531334e","3fff2e6159326d7dbb59c163736a0c522f1cbba6730dc01823a973452666fccd","6a445cf1acf23219aac91c5909f5c338b9408fb7ae6467a434f0e15eff913814","6aa9a466f775ad6d8d48a4d69eac063e4ed47365dfa7aec82a8b554b70938bb4","c1dba063181dfe84123cc9e8afdb0e5a20a0ec72300def7786447499b67a61ff","fba062292ee802cb4f5de98f6f7fe10727fa0f3b8b5dfc5bc0ccb8f77a33ca4d",{"version":"35aed20164f7e1e9c8fa0e0dbe6c4baaf2042459251caba0d532af216af8cd7e","signature":"d67e678d1a4372e83c689185fe828ca49262a16ecdc9f53f9d0b190b26fb0ecc"},{"version":"65be30c9d1273048c3a137fcd7f88bcc584a3ce4b09a11f2c88e470057fe5cc8","signature":"ec9395ba50d412a16586a6951264ce0fad2e77d5be49f9b0b7d8c500d3fb8078"},"af89ab13b40dd28cd91818fc6329914d2b9663591831f032ff0f0cb4a028d4a5","63007f1618ada5041fb3b47630b64a9987d268bf740dd72334c38b5d23f5239b","3395f90467d2bb9db039a5c22ed6659ca2ff6f0b4f7ee5f223b0f77288f54ea7","20df2907d398e369d49e8906d6e0f096c465501e9ceff9d61293bf0f4e9020f1","302aa8248dab7c689c103162e542224aa7f3b0db46e29d0fb468fac721cf1c41","ea0a3bb69845621165c21e80ebb0d2b28dad22cd9920564516ce8e927a828f79","6a81475a67505af60be3242841c65ce4bf6d0b624d8b3fada646ba459a3eaad8","6834dd6cc060648604278cdb920a9316fa916e9116134b17dfad90e42800ca47","19fba62f1aab90f0110738261ed8bc1da82c89433fc43265f14870d4380d10b8","fbb2df54f4778b4d691bbc7c0a6e1e241dfffaca19f443cc9f230f450458bf89","da98d8109f379be48d459a6821ebd7cc728af62557e1c44f864e04360686af93","ef6e6d838cc600162626a53167046484f38e9a4bab9454e72350bed76c497228","cfe60041768a999abb3287444372ffedc9589ba9ba449548226b17a6da46ce35","c8b50ecedc9ff1b0e83c96f0a334d022874199f7c2d00d182ca6672176b0ea9d","b66ede73039e8751e06e3cab843e5a4265c1124a3285c3d854092c37a966b1f5",{"version":"1b33f32780e4d3da2bd1ba84fd71994e87a2bd37d2561b8d8e3b32637b2cd4b6","signature":"5456ba18b24c4a9a77f123c3a794df7a9023f0e8f9a6666b5ed31a939734a7a6"},{"version":"bce6042b814db95d7da4bdf53cc3010ac7f09330d20509523450e33387d9132e","signature":"d324925dc9b0f2349ea9c38e8cd0fc151f5520a02a7a44b50d4becac60d827ea"},"1f63ac6272e4d2d43cb25552b4ed8a89ffc86244ea655f685e8e3685433c7b23","91351db4fac763d38a774a29f00ffcaf186a88ef7a8d487acb9e03577d5fc8bc","094be99dc9410d3cb517ba523ae031864c5e258a3904ed8058773672768c2c6c","fafe1e5b2114bc57a6da341cad2bb44298543caa3fd7680e6bb0f29215048aa2","841f7ca2af7f4d9cca1f9fa2288a4849fc9d49ca15b47336892efd06a14dd1d8","796eea44840b57d4c6741d119d767c5ea294fdf610151158fd0a2f236cf21367","309ab701fcc8aa7f3c9b53fe84cb5ef7cbd579888de19423c8fc54402be9e8d9","5ad6d882be6f8e602795bc0bd0fac7806b16ba7715be494fe0279e2c5e3e23c0","596ab45ef67fa8dae4996a2a61dc5055ae2b3dc5102cf3b43ee7965a7088943b","a3f9f52ce73700565c8d9ba2aa75823ab8fc8e7258a27ecb828cd4257b8f918d","5f4884638ab10b753ec0c7406916fc746bb99cc0044b9a4a67b2006b7e57e8af","4b5603a1ccca455500cfb39517d41ec011f31ba84bb6de44473344a237d89168",{"version":"6a9eb9c5d3f7474937973fe4b0a9e53025634c2e39118eda436d89f3e9df976f","affectsGlobalScope":true},{"version":"86e56d97b13ef0a58bc9c59aee782ae7d47d63802b5b32129ec5e5d62c20dbfa","affectsGlobalScope":true},{"version":"c1f79c6d85cd84518fd7349588b3c61bdc189f58e3866f925cbf4631c81e31f9","affectsGlobalScope":true},{"version":"54db406753da16e177f094aa66da79840f447de6d87ddd1543a80c9418c52545","affectsGlobalScope":true},{"version":"42f28f4cfca4a70bd89c1d55d76c7978275030b894f6793f36890265c11a83a4","affectsGlobalScope":true},{"version":"7cf1027da9599f056355b46bbea31dbf7f715f797dffb9cbb3402d4490c503e5","affectsGlobalScope":true},"96dbd0787b57ae02981d26d5f2441f0f8444fb46d7578c56527eab89cff13a7d","68f02ba57c531227ef5804dd57f2e940b10c544c96dadd3c0ef958ba4b6fdbc1","91764b36fe5e1c5d688f5f90eeea47703a059ab9a81bf80f7bbc9b04507b7bd3","115327b8e1f68c03004d841b83e332ed16b8f48af59ac00f38313887d7ec2920","adb5ad16c19ff8dbfa9daa3a7dc8e1b039c381a2b94383144a53368681ad8ca0","a1f708ddf34053065f8f53682123421af299cee37ae110a86ba07851adf940da","395e6fa1fc8f46f827a5f7d3b7dabc836627ae57e41338f93c221b88d4978f15","749effab6d7e72df8d126868c82b8166cdde84d48453e44f65cbad42ad900b06","11705a4aad6e2e724b82ffee6c4fa271d798f0fb68806ace4b1c425c266f8d98","d68afd5ea85e35c4c4e8995e55f10d6861439ea9dc2666293c0cf4124bf56f32","d626f2c25d5d6daddb082576771a8e7b591233a7893a1739513c44f35a3f7489","7c59943d77166c1aecd731af8683a7b5a0984e1bc0427fa35be504d77c41fdcd","89dd83418d3c93418929123f21a02434537b5c79ede3c0c6ab5a495d602db155","8b1b666fe96fd9e713f1279a3e446f16ee824f46ca0c2c075e4e89f0b1258e6c","6aecbb60c2216da24acb86490f7c6270a820fd85424c8a509e3d284aa47f7a56","d357e56d630bcd0f63cfc678e306702555b4f791c2d8e07f037de39171be4cd3","238f87de951ed064c7ec3e30a987f386d4821bacfc8c7548cdccf848b8b6035c","a93ae01c9ed49ba423599144ffa3cd520db83e53b32471865905a65113bb3e59","6088973936033e869d3616b63d25c15363862b491f46af77d40a5215ee8cc1a8","9a4b7c467be504c4500cf6e54b0a3b8afdfbe0ed2c1da640202f44a7cef721b2","6de78fade656d64b03de50a84597d74c76e3ff5436a7ad082d01ce1d74099bf8","7d2a0ba1297be385a89b5515b88cd31b4a1eeef5236f710166dc1b36b1741e1b","9d92b037978bb9525bc4b673ebddd443277542e010c0aef019c03a170ccdaa73","54384a11c0f6ca8d5d8bab90d4bdab2c722aa8676a716340eb08082a02ca9ad6",{"version":"9253f5aa9552bf74e567cf957c0d019e3175cfaf39806d1e237bb6ac1030de37","signature":"c690e95d11aff99412d1ca20b622b02cb1603b032162a09621d7b0279a42b68e"},{"version":"f9c64057681304a919f6f6e8c5c102682d5f83cdd88c3227b6848e6dc59b7b90","signature":"8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881"},"a62a02c433e6fee26404825310ad462433320ef2e9f80fa7b9156135fd975f8f","22f15ae5c80b3e795da92636aa03d8f981811d067d82bff01ca54093c0535ec0","b56d4bc83ec01834829979ad57de59b4947cd62f71b102ab0040b6960d5bdc81","a10213415bf98670b026b77a90c7933594f0b5c34bde5b74e80134fdf0331bba",{"version":"ebeb47324e6f4c9ce1e1aae7bee0383907e554b45dc5efd6cc02570e2f04dec4","signature":"b6d8db2aba9da17434e5b89238a83f61c4351117eb983386099cb2da471e3fc0"},{"version":"0229ccedabd55ed02687fb1c7f0754a4b3e492dd962abe84c693734a25d383d6","signature":"8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881"},{"version":"f57a831a821c73281c1a1ff6aea7a77979a935c38dd054b6bb0d17d5a88de16f","signature":"8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881"},"5bca2169d85cde638dc45542bb3674c42e5a0eea70ac2737cb48848a0c9e10b4","3319e44b7252ab86cf9e519b9bdf95ac5a2cacfb859fecf2fee171ce1c0a35b5",{"version":"bdb020c4b9eafeed0f0dab872b2dc231d048a024638f5ab8643427b04aca8a60","signature":"8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881"},"27679e96d1bd38c5938178aaf4abe8627493090b63d6bae2ce8436e6a87ebe4d","136f00f14878a614113b221f2797dd7f5a7fb2220f95cbbbc390a85675f991c0","b04de4c5a5e9e0cc6b6b3d99b0e046705d9226fc384cb89c73014b2be4a84417","af4eea486904e256eb4e3a79c21355b9b065298952e9f2a0a921e8d75168f4a7","1841e57d29c33dd1798d82ceca05b7a95430b7976f14dabd4bcf81f6d114f235","cd4ee8e901877e80dcb0d073d489cb18a512993164a531332b88279c0874664e","db4d7c9c5038c75e1df338d780a6c06c79589b5105f138dd29b62310aab749fe","b056f955c85dd0eb196ff290138eb4a83787c3f413505b9ae2676a602be7d40d","02f124f948535d4bbf50970ed38a8adb34c8c4289148fb0e6287eef4d86a0be5","27573b15894c6311146838fa3b45786bacc013a4bca6c84adc1b11a4e7c8a4c0","510616459e6edd01acbce333fb256e06bdffdad43ca233a9090164bf8bb83912","3725da27619321470183eb7dd61190b139e5bcc4cf9366d6d828906a76e31742",{"version":"972db20765d00e12aeac350389e9232348f910d12eb7f9c73024c41201977a02","signature":"8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881"},{"version":"d4c318be1af78176bc87a945dbf5ffee8c3aa4430071b0b9a9040b348332c526","signature":"8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881"},{"version":"e37a60516fbd37a8e1b5754e0c4d83dcdebf8caa69af9e2f85128d2ad3a14671","signature":"8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881"},{"version":"badc99c99a2a4937bbc9c0b45d1fe87fdb76de541ecc4df06190c6b176576a26","signature":"8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881"},{"version":"57cc9477892b65bc1ac29fe692bf94b09e99a4aef71de4ad43deba65d517fd4e","signature":"e8e1588ea2f394850673db82c023d00334ee1adc8020f878dec1397f29599310"},{"version":"be6841ef527743e78855852946f910a72c13a7c958e3b23291623c3b473039e4","signature":"8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881"},{"version":"e9de90ec37c779c529f4ed850b6061e7614f656a3e9b28d58da922d25abc001f","signature":"8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881"},{"version":"28edc4982430b64f209794844087f5211a7a10e69b923f08b26496032901425a","signature":"8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881"},{"version":"fcc9bfbc389ea5ba817d368038a8d11f8c30f3e92ec89722503fbe088602ed17","signature":"8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881"},{"version":"b38fb980b2970ce5ee0961f36fc1caf8b021a9d93bdef7375936cbcc701f2afe","signature":"8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881"},{"version":"dc00f4ea8deeeeda44f2ada171bdb3e225a35d47d2995133bd6b0692d15fd965","signature":"8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881"},{"version":"2e5bc0aaa314127b7a9eb69781d884e83778aa1ab188c39fa44ca915848862d5","signature":"8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881"},{"version":"37abf966f15aea02fef48da8fb22a179f24cd0bbe365d44e1925d6496d722adb","signature":"8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881"},"4ef576c5a52f34423f6328a6834c6fc874c6683a0626c0f21d6b2209f460dffd","7b195dbf43d2194d18627fe3e190979b5bd2f0752001193260c89b01c36460e2","7350c835566c20d980134ad870a072daa93754c6b65d602a46f2bc2e2ae12165","ee9b614565fe2e96c3202c092ea4e4bc902f51d1508bf8015d8f2275686ab040","f6f278c43d4e70fe1abb2c826a0b1c1ea7c4f6ff50b272aacdda3b39c51f4d61","c4e851542f10b993f5eff6dc91f4ca474e570b7c4c4098ebc4bb3ec84528504e","e86f647e06504800fe4b635e5f4a208d9518a47d317e55735764d4261957f1a0","5ccc3c7f73ef48c223635cd4506f21133560de7abc4c09c623327bb1b54386dc",{"version":"68e64f59387b867ac2095c6703ae2b29cf9238182c0d2f6c819c137c7b7e477c","signature":"8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881"},{"version":"21af2545d0971da878ee5759ecfabcd607bb4c2c7e37f6e8bdf1e9afa7c2cb09","signature":"cef616486b509f32ffa4cfc089081383e016ce41b2be7c3feabcb93a0de727d6"},{"version":"13181ae8f64d6d1c1845f8e57a4e1e52dc72993bd3a439360ae135f45992377d","signature":"8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881"},{"version":"a47dab43c145ad4ac232acd1d87313adbf913f0457947fa82759f97318df54f5","signature":"8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881"},{"version":"b9369fb6d4997b2aa16b9e736c7816cc35a8d1f60dc9a09592bb5e9654597ca6","signature":"8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881"},"66336b5a5d5e897e932cbf1e306ff8ac8a9929971409a8049c8c8a249cd8b57c",{"version":"92cea114cd7f8323105dfed55e06ea98770ceae98facf77e1815c70cef032e50","signature":"8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881"},{"version":"5b31a8edcc52ba5af5085fa8477f51fb723d0c2f71edb5e648ec24c1ba0a1f72","signature":"8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881"},"42baf4ca38c38deaf411ea73f37bc39ff56c6e5c761a968b64ac1b25c92b5cd8","d7dbe0ad36bdca8a6ecf143422a48e72cc8927bab7b23a1a2485c2f78a7022c6","8718fa41d7cf4aa91de4e8f164c90f88e0bf343aa92a1b9b725a9c675c64e16b","f992cd6cc0bcbaa4e6c810468c90f2d8595f8c6c3cf050c806397d3de8585562","68cc8d6fcc2f270d7108f02f3ebc59480a54615be3e09a47e14527f349e9d53e","3eb11dbf3489064a47a2e1cf9d261b1f100ef0b3b50ffca6c44dd99d6dd81ac1","bc222163edcb8df6ba9b506d053d6c5afcae50e85695151cf4636a3107deaba9","035a5df183489c2e22f3cf59fc1ed2b043d27f357eecc0eb8d8e840059d44245","f3d8c757e148ad968f0d98697987db363070abada5f503da3c06aefd9d4248c1","96d14f21b7652903852eef49379d04dbda28c16ed36468f8c9fa08f7c14c9538","fec943fdb3275eb6e006b35e04a8e2e99e9adf3f4b969ddf15315ac7575a93e4","742f21debb3937c3839a63245648238555bdab1ea095d43fd10c88a64029bf76","7cfdf3b9a5ba934a058bfc9390c074104dc7223b7e3c16fd5335206d789bc3d3","0944f27ebff4b20646b71e7e3faaaae50a6debd40bc63e225de1320dd15c5795","5d30565583300c9256072a013ac0318cc603ff769b4c5cafc222394ea93963e1","8a7219b41d3c1c93f3f3b779146f313efade2404eeece88dcd366df7e2364977","a109c4289d59d9019cfe1eeab506fe57817ee549499b02a83a7e9d3bdf662d63","89121c1bf2990f5219bfd802a3e7fc557de447c62058d6af68d6b6348d64499a","d4a22007b481fe2a2e6bfd3a42c00cd62d41edb36d30fc4697df2692e9891fc8","8841e2aa774b89bd23302dede20663306dc1b9902431ac64b24be8b8d0e3f649","fbca5ffaebf282ec3cdac47b0d1d4a138a8b0bb32105251a38acb235087d3318",{"version":"90ebf5865e27d8966ef44b073e6e83b0ddd45058bab1d58b1e4b5a47d36396c4","affectsGlobalScope":true},"cb482592bfcbdfcefa8d155590399e8bff66277e60e17bfada7c2f31322e7b87","22293bd6fa12747929f8dfca3ec1684a3fe08638aa18023dd286ab337e88a592","916be7d770b0ae0406be9486ac12eb9825f21514961dd050594c4b250617d5a8","cf3d384d082b933d987c4e2fe7bfb8710adfd9dc8155190056ed6695a25a559e","9871b7ee672bc16c78833bdab3052615834b08375cb144e4d2cba74473f4a589","c863198dae89420f3c552b5a03da6ed6d0acfa3807a64772b895db624b0de707","8b03a5e327d7db67112ebbc93b4f744133eda2c1743dbb0a990c61a8007823ef","86c73f2ee1752bac8eeeece234fd05dfcf0637a4fbd8032e4f5f43102faa8eec","42fad1f540271e35ca37cecda12c4ce2eef27f0f5cf0f8dd761d723c744d3159","ff3743a5de32bee10906aff63d1de726f6a7fd6ee2da4b8229054dfa69de2c34","83acd370f7f84f203e71ebba33ba61b7f1291ca027d7f9a662c6307d74e4ac22","1445cec898f90bdd18b2949b9590b3c012f5b7e1804e6e329fb0fe053946d5ec","0e5318ec2275d8da858b541920d9306650ae6ac8012f0e872fe66eb50321a669","cf530297c3fb3a92ec9591dd4fa229d58b5981e45fe6702a0bd2bea53a5e59be","c1f6f7d08d42148ddfe164d36d7aba91f467dbcb3caa715966ff95f55048b3a4","f4e9bf9103191ef3b3612d3ec0044ca4044ca5be27711fe648ada06fad4bcc85","0c1ee27b8f6a00097c2d6d91a21ee4d096ab52c1e28350f6362542b55380059a","7677d5b0db9e020d3017720f853ba18f415219fb3a9597343b1b1012cfd699f7","bc1c6bc119c1784b1a2be6d9c47addec0d83ef0d52c8fbe1f14a51b4dfffc675","52cf2ce99c2a23de70225e252e9822a22b4e0adb82643ab0b710858810e00bf1","770625067bb27a20b9826255a8d47b6b5b0a2d3dfcbd21f89904c731f671ba77","d1ed6765f4d7906a05968fb5cd6d1db8afa14dbe512a4884e8ea5c0f5e142c80","799c0f1b07c092626cf1efd71d459997635911bb5f7fc1196efe449bba87e965","2a184e4462b9914a30b1b5c41cf80c6d3428f17b20d3afb711fff3f0644001fd","9eabde32a3aa5d80de34af2c2206cdc3ee094c6504a8d0c2d6d20c7c179503cc","397c8051b6cfcb48aa22656f0faca2553c5f56187262135162ee79d2b2f6c966","a8ead142e0c87dcd5dc130eba1f8eeed506b08952d905c47621dc2f583b1bff9","a02f10ea5f73130efca046429254a4e3c06b5475baecc8f7b99a0014731be8b3","c2576a4083232b0e2d9bd06875dd43d371dee2e090325a9eac0133fd5650c1cb","4c9a0564bb317349de6a24eb4efea8bb79898fa72ad63a1809165f5bd42970dd","f40ac11d8859092d20f953aae14ba967282c3bb056431a37fced1866ec7a2681","cc11e9e79d4746cc59e0e17473a59d6f104692fd0eeea1bdb2e206eabed83b03","b444a410d34fb5e98aa5ee2b381362044f4884652e8bc8a11c8fe14bbd85518e","c35808c1f5e16d2c571aa65067e3cb95afeff843b259ecfa2fc107a9519b5392","14d5dc055143e941c8743c6a21fa459f961cbc3deedf1bfe47b11587ca4b3ef5","a3ad4e1fc542751005267d50a6298e6765928c0c3a8dce1572f2ba6ca518661c","f237e7c97a3a89f4591afd49ecb3bd8d14f51a1c4adc8fcae3430febedff5eb6","3ffdfbec93b7aed71082af62b8c3e0cc71261cc68d796665faa1e91604fbae8f","662201f943ed45b1ad600d03a90dffe20841e725203ced8b708c91fcd7f9379a","c9ef74c64ed051ea5b958621e7fb853fe3b56e8787c1587aefc6ea988b3c7e79","2462ccfac5f3375794b861abaa81da380f1bbd9401de59ffa43119a0b644253d","34baf65cfee92f110d6653322e2120c2d368ee64b3c7981dff08ed105c4f19b0","7d8ddf0f021c53099e34ee831a06c394d50371816caa98684812f089b4c6b3d4",{"version":"525b52b38b44420fb1758c0917e7b67cf379f7f9477d2ba7343f3d5f50a44258","affectsGlobalScope":true},"4006c872e38a2c4e09c593bc0cdd32b7b4f5c4843910bea0def631c483fff6c5","ab6aa3a65d473871ee093e3b7b71ed0f9c69e07d1d4295f45c9efd91a771241d","bae8d023ef6b23df7da26f51cea44321f95817c190342a36882e93b80d07a960","26a770cec4bd2e7dbba95c6e536390fffe83c6268b78974a93727903b515c4e7","74d5a87c3616cd5d8691059d531504403aa857e09cbaecb1c64dfb9ace0db185"],"root":[[65,67],209,[218,226],[228,233],[256,261],264,271,272,288,289,332,333,[338,340],343,[356,368],[377,381],383,384],"options":{"allowJs":true,"checkJs":true,"composite":true,"declaration":true,"declarationMap":true,"emitDeclarationOnly":false,"esModuleInterop":true,"importsNotUsedAsValues":0,"module":7,"noEmitOnError":true,"noFallthroughCasesInSwitch":true,"noImplicitReturns":true,"noUnusedLocals":true,"noUnusedParameters":false,"outDir":"./","removeComments":false,"skipLibCheck":true,"sourceMap":true,"strict":true,"stripInternal":true,"target":9,"useUnknownInCatchVariables":true},"fileIdsList":[[334,336],[335],[265,266,267,268],[372],[370,371],[370],[369],[234,244,245,246],[241],[201,240,242,243],[73,201,349,350,351],[201],[85,201,287],[73,86,201,287],[73,86],[290,291,292,293,296,297,298,299,300],[73,85,86,201],[103,201,295],[201,287],[201,287,341],[85],[80,85,201,281],[273,282,283,284,285,286],[73,201],[80,85,201],[73,75,86,87,201],[75,85,87],[73,75,85,86,201],[72,88,201],[161,199],[74,75,80,85,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,104,105,106,200],[70,72,73],[87],[88,90],[70,72,74],[75,85],[75,88,201],[74,75,85],[73,74,75,87,90,103],[73,74],[73,86,87,201],[75,87],[80,85,87,90,97,201],[274,275,276,277,278,279,280],[201,276],[201,274],[201,275],[70,72,201],[85,201,316],[73,201,281,287,348],[73,86,201,294],[79,80],[79],[77,78,81],[85,269],[76,81,83,84],[81,83,85],[82,85],[161,164,191,199,385,386,387],[302],[389],[199],[396],[397,399],[400],[402],[398],[107],[148],[149,154,183],[150,155,161,162,169,180,191],[150,151,161,169],[152,192],[153,154,162,170],[154,180,188],[155,157,161,169],[148,156],[157,158],[161],[159,161],[148,161],[161,162,163,180,191],[161,162,163,176,180,183],[146,196],[157,161,164,169,180,191],[161,162,164,165,169,180,188,191],[164,166,180,188,191],[107,108,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198],[161,167],[168,191,196],[157,161,169,180],[170],[171],[148,172],[107,108,148,149,150,151,152,153,154,155,156,157,158,159,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197],[174],[175],[161,176,177],[176,178,192,194],[149,161,180,181,182,183],[149,180,182],[180,181],[183],[184],[107,180],[161,186,187],[186,187],[154,169,180,188],[189],[169,190],[149,164,175,191],[154,192],[180,193],[168,194],[195],[149,154,161,163,172,180,191,194,196],[180,197],[164,180,199],[410,449],[410,434,449],[449],[410],[410,435,449],[410,411,412,413,414,415,416,417,418,419,420,421,422,423,424,425,426,427,428,429,430,431,432,433,434,435,436,437,438,439,440,441,442,443,444,445,446,447,448],[435,449],[302,330],[329],[453],[161,180,199],[86,374],[302,303,304,305,306,307],[302,303],[316,320],[316,318,319,321,322,323,324,325,326,327],[316,320,321,328],[313,316,320,321],[316,320,321],[316,320,323],[316,328],[313,315],[255],[314],[73,86,204,206],[73,86,206],[73,203,205],[86],[68],[240,249,250,251],[71,72],[71],[69],[238],[70],[70,208],[236],[72,208,235,236,237,239],[68,69,70,71,238],[68,69,70],[310],[344,345,346,347],[345],[345,346],[354],[217],[210],[73,210],[210,211,212,213,214,215,216],[73,217],[330],[253],[240,252],[118,122,191],[118,180,191],[113],[115,118,188,191],[169,188],[113,199],[115,118,169,191],[110,111,114,117,149,161,180,191],[118,125],[110,116],[118,139,140],[114,118,149,183,191,199],[149,199],[139,149,199],[112,113,199],[118],[112,113,114,115,116,117,118,119,120,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,140,141,142,143,144,145],[118,133],[118,125,126],[116,118,126,127],[117],[110,113,118],[118,122,126,127],[122],[116,118,121,191],[110,115,118,125],[149,180],[113,118,139,149,196,199],[65,66,73,85,103,201,202,206,207,208,209,218,219,220,222,224,230,231,232,233,256,257,260,261,264,271,272,287],[218,219],[218],[201,218,219,221],[223,225],[221,223,229],[66,227],[67],[201,219,222,223,224,225,226,228],[219],[73,103,201,206,207],[219,222],[85,201,218],[201,202,208,218,219,244,247,248,254,255],[258,259,260],[201,262,263],[85,270],[201,219,244],[201,254,255,301,308,309,311,312,332],[201,202,244,287,288,294,308,330,331,338],[201,301,308,311,332],[207,373,375,376],[254,308,332,373,378],[154,218,373],[272,373],[201,288,294,317,328,342],[66,201,218,223,254,301,308,312,332,352,353,355,360,378,382],[201,254,301,308,311,332,352,353,355],[66,201,202,244,254,287,288,294,301,308,311,330,331,332],[66,201,301,308,311,332],[66,201,301,308,311,332,353],[218,219,220,254,259,262,308,360],[66,230,308],[230,308],[202,219,222,223,225,230,244,294,308,330,353,360],[202,222,230,231,244,294,308],[272,308,330],[66,202,233,244,259,308,353,360],[224,308],[161,201,202,244,287,288,294,301,317,328,331],[201,288,308,312,332],[201,202,218,219,244,254,338],[218,254,259,337],[65,201,209,218,219,220,222,230,232,233,287],[227],[201,218,219],[201,219],[201,288],[201,288,332],[201,218,219,338]],"referencedMap":[[337,1],[336,2],[269,3],[373,4],[372,5],[371,6],[370,7],[247,8],[242,9],[244,10],[243,9],[352,11],[290,12],[291,13],[292,14],[299,15],[301,16],[300,12],[293,17],[296,18],[297,19],[298,19],[342,20],[273,21],[282,22],[287,23],[283,12],[284,24],[285,12],[286,25],[99,26],[100,27],[87,28],[89,29],[200,30],[201,31],[74,32],[91,33],[101,34],[75,35],[88,36],[92,37],[93,38],[104,39],[105,40],[95,33],[97,41],[96,42],[98,43],[294,12],[277,12],[281,44],[276,12],[274,12],[275,12],[280,45],[278,46],[279,47],[202,48],[317,49],[349,50],[262,12],[295,51],[81,52],[78,53],[77,53],[79,54],[270,55],[84,21],[85,56],[76,21],[82,57],[83,58],[388,59],[303,60],[307,60],[305,60],[390,61],[391,62],[395,30],[397,63],[400,64],[401,65],[403,66],[399,67],[107,68],[108,68],[148,69],[149,70],[150,71],[151,72],[152,73],[153,74],[154,75],[155,76],[156,77],[157,78],[158,78],[160,79],[159,80],[161,81],[162,82],[163,83],[147,84],[164,85],[165,86],[166,87],[199,88],[167,89],[168,90],[169,91],[170,92],[171,93],[172,94],[173,95],[174,96],[175,97],[176,98],[177,98],[178,99],[180,100],[182,101],[181,102],[183,103],[184,104],[185,105],[186,106],[187,107],[188,108],[189,109],[190,110],[191,111],[192,112],[193,113],[194,114],[195,115],[196,116],[197,117],[387,118],[434,119],[435,120],[410,121],[413,121],[432,119],[433,119],[423,119],[422,122],[420,119],[415,119],[428,119],[426,119],[430,119],[414,119],[427,119],[431,119],[416,119],[417,119],[429,119],[411,119],[418,119],[419,119],[421,119],[425,119],[436,123],[424,119],[412,119],[449,124],[443,123],[445,125],[444,123],[437,123],[438,123],[440,123],[442,123],[446,125],[447,125],[439,125],[441,125],[450,126],[330,127],[454,128],[455,129],[375,130],[308,131],[306,60],[304,132],[321,133],[328,134],[323,135],[322,136],[325,137],[327,138],[319,139],[324,135],[326,137],[316,140],[313,141],[315,142],[205,143],[203,144],[206,145],[207,146],[204,15],[385,79],[251,147],[252,148],[69,149],[72,150],[238,151],[249,152],[250,152],[208,153],[236,154],[263,155],[240,156],[239,157],[71,158],[311,159],[348,160],[346,161],[347,162],[355,163],[312,159],[210,164],[213,165],[214,165],[211,166],[212,165],[217,167],[215,168],[216,164],[331,169],[254,170],[255,170],[253,171],[125,172],[135,173],[124,172],[145,174],[116,175],[115,176],[144,62],[138,177],[143,178],[118,179],[132,180],[117,181],[141,182],[113,183],[112,184],[142,185],[114,186],[119,187],[123,187],[146,188],[136,189],[127,190],[128,191],[130,192],[126,193],[129,194],[139,62],[121,195],[122,196],[131,197],[111,198],[134,189],[133,187],[140,199],[288,200],[220,201],[289,202],[218,168],[222,203],[226,204],[230,205],[228,206],[223,207],[221,207],[229,208],[225,209],[231,204],[232,210],[233,211],[219,212],[256,213],[257,202],[261,214],[259,141],[264,215],[271,216],[260,217],[333,218],[339,219],[340,220],[377,221],[379,222],[380,223],[381,224],[343,225],[383,226],[356,227],[357,228],[358,229],[359,230],[361,231],[362,232],[363,233],[364,234],[365,235],[366,220],[367,236],[368,237],[384,238],[332,239],[378,240],[360,241],[338,242]],"exportedModulesMap":[[337,1],[336,2],[269,3],[373,4],[372,5],[371,6],[370,7],[247,8],[242,9],[244,10],[243,9],[352,11],[290,12],[291,13],[292,14],[299,15],[301,16],[300,12],[293,17],[296,18],[297,19],[298,19],[342,20],[273,21],[282,22],[287,23],[283,12],[284,24],[285,12],[286,25],[99,26],[100,27],[87,28],[89,29],[200,30],[201,31],[74,32],[91,33],[101,34],[75,35],[88,36],[92,37],[93,38],[104,39],[105,40],[95,33],[97,41],[96,42],[98,43],[294,12],[277,12],[281,44],[276,12],[274,12],[275,12],[280,45],[278,46],[279,47],[202,48],[317,49],[349,50],[262,12],[295,51],[81,52],[78,53],[77,53],[79,54],[270,55],[84,21],[85,56],[76,21],[82,57],[83,58],[388,59],[303,60],[307,60],[305,60],[390,61],[391,62],[395,30],[397,63],[400,64],[401,65],[403,66],[399,67],[107,68],[108,68],[148,69],[149,70],[150,71],[151,72],[152,73],[153,74],[154,75],[155,76],[156,77],[157,78],[158,78],[160,79],[159,80],[161,81],[162,82],[163,83],[147,84],[164,85],[165,86],[166,87],[199,88],[167,89],[168,90],[169,91],[170,92],[171,93],[172,94],[173,95],[174,96],[175,97],[176,98],[177,98],[178,99],[180,100],[182,101],[181,102],[183,103],[184,104],[185,105],[186,106],[187,107],[188,108],[189,109],[190,110],[191,111],[192,112],[193,113],[194,114],[195,115],[196,116],[197,117],[387,118],[434,119],[435,120],[410,121],[413,121],[432,119],[433,119],[423,119],[422,122],[420,119],[415,119],[428,119],[426,119],[430,119],[414,119],[427,119],[431,119],[416,119],[417,119],[429,119],[411,119],[418,119],[419,119],[421,119],[425,119],[436,123],[424,119],[412,119],[449,124],[443,123],[445,125],[444,123],[437,123],[438,123],[440,123],[442,123],[446,125],[447,125],[439,125],[441,125],[450,126],[330,127],[454,128],[455,129],[375,130],[308,131],[306,60],[304,132],[321,133],[328,134],[323,135],[322,136],[325,137],[327,138],[319,139],[324,135],[326,137],[316,140],[313,141],[315,142],[205,143],[203,144],[206,145],[207,146],[204,15],[385,79],[251,147],[252,148],[69,149],[72,150],[238,151],[249,152],[250,152],[208,153],[236,154],[263,155],[240,156],[239,157],[71,158],[311,159],[348,160],[346,161],[347,162],[355,163],[312,159],[210,164],[213,165],[214,165],[211,166],[212,165],[217,167],[215,168],[216,164],[331,169],[254,170],[255,170],[253,171],[125,172],[135,173],[124,172],[145,174],[116,175],[115,176],[144,62],[138,177],[143,178],[118,179],[132,180],[117,181],[141,182],[113,183],[112,184],[142,185],[114,186],[119,187],[123,187],[146,188],[136,189],[127,190],[128,191],[130,192],[126,193],[129,194],[139,62],[121,195],[122,196],[131,197],[111,198],[134,189],[133,187],[140,199],[288,243],[220,201],[289,202],[218,168],[222,203],[226,204],[230,205],[228,244],[229,208],[225,209],[231,204],[232,24],[233,211],[219,212],[256,245],[257,202],[261,214],[264,12],[271,21],[260,246],[332,247],[378,248],[360,249],[338,202]],"semanticDiagnosticsPerFile":[334,337,336,335,268,269,266,267,265,373,372,371,370,369,234,247,242,244,241,243,245,246,350,351,352,341,290,291,292,299,301,300,293,296,297,298,342,273,282,287,283,284,285,286,99,100,87,89,106,90,200,201,74,91,101,75,88,92,93,102,104,105,94,95,97,96,98,294,277,281,276,274,275,280,278,279,202,317,349,262,295,81,78,77,79,270,84,85,76,82,83,388,303,307,305,302,390,391,386,392,393,394,395,396,397,400,401,403,398,399,404,405,406,389,407,107,108,148,149,150,151,152,153,154,155,156,157,158,160,159,161,162,163,147,198,164,165,166,199,167,168,169,170,171,172,173,174,175,176,177,178,179,180,182,181,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,408,409,387,354,434,435,410,413,432,433,423,422,420,415,428,426,430,414,427,431,416,417,429,411,418,419,421,425,436,424,412,449,448,443,445,444,437,438,440,442,446,447,439,441,450,330,329,451,452,402,453,454,455,374,375,308,109,306,304,321,318,328,323,322,325,327,319,324,326,353,227,344,316,313,314,315,320,376,205,203,206,207,103,204,86,385,251,68,252,69,235,72,238,249,250,208,236,70,263,240,239,71,237,309,311,348,346,347,345,355,310,312,80,210,213,214,211,212,217,215,216,331,63,64,11,12,15,14,2,16,17,18,19,20,21,22,23,3,24,4,25,29,26,27,28,30,31,32,5,33,34,35,36,6,40,37,38,39,41,7,42,47,48,43,44,45,46,8,52,49,50,51,53,9,54,55,56,59,57,58,60,61,10,1,62,13,73,248,382,254,255,253,125,135,124,145,116,115,144,138,143,118,132,117,141,113,112,142,114,119,120,123,110,146,136,127,128,130,126,129,139,121,122,131,111,134,133,137,140,65,66,67,288,220,209,289,218,222,226,230,228,223,221,229,225,231,232,233,219,256,257,261,259,264,271,260,224,258,272,333,339,340,377,379,380,381,343,383,356,357,358,359,361,362,363,364,365,366,367,368,384,332,378,360,338],"latestChangedDtsFile":"./test/unit/set.test.d.ts"},"version":"5.4.5"} +\ No newline at end of file +diff --git a/node_modules/@chainsafe/libp2p-gossipsub/src/errors.ts b/node_modules/@chainsafe/libp2p-gossipsub/src/errors.ts +new file mode 100644 +index 0000000..19723cf +--- /dev/null ++++ b/node_modules/@chainsafe/libp2p-gossipsub/src/errors.ts +@@ -0,0 +1,17 @@ ++export class InvalidPeerScoreParamsError extends Error { ++ static name = 'InvalidPeerScoreParamsError' ++ ++ constructor (message = 'Invalid peer score params') { ++ super(message) ++ this.name = 'InvalidPeerScoreParamsError' ++ } ++} ++ ++export class InvalidPeerScoreThresholdsError extends Error { ++ static name = 'InvalidPeerScoreThresholdsError' ++ ++ constructor (message = 'Invalid peer score thresholds') { ++ super(message) ++ this.name = 'InvalidPeerScoreThresholdsError' ++ } ++} +diff --git a/node_modules/@chainsafe/libp2p-gossipsub/src/index.ts b/node_modules/@chainsafe/libp2p-gossipsub/src/index.ts +index 1f821e2..782c053 100644 +--- a/node_modules/@chainsafe/libp2p-gossipsub/src/index.ts ++++ b/node_modules/@chainsafe/libp2p-gossipsub/src/index.ts +@@ -1,8 +1,9 @@ + import { TypedEventEmitter, StrictSign, StrictNoSign, TopicValidatorResult, serviceCapabilities, serviceDependencies } from '@libp2p/interface' +-import { peerIdFromBytes, peerIdFromString } from '@libp2p/peer-id' ++import { peerIdFromMultihash, peerIdFromString } from '@libp2p/peer-id' + import { encode } from 'it-length-prefixed' + import { pipe } from 'it-pipe' + import { pushable } from 'it-pushable' ++import * as Digest from 'multiformats/hashes/digest' + import * as constants from './constants.js' + import { + ACCEPT_FROM_WHITELIST_DURATION_MS, +@@ -73,7 +74,8 @@ import type { + TopicValidatorFn, + Logger, + ComponentLogger, +- Topology ++ Topology, ++ PrivateKey + } from '@libp2p/interface' + import type { ConnectionManager, IncomingStreamData, Registrar } from '@libp2p/interface-internal' + import type { Multiaddr } from '@multiformats/multiaddr' +@@ -166,13 +168,13 @@ export interface GossipsubOpts extends GossipsubOptsSpec, PubSubInit { + maxOutboundStreams?: number + + /** +- * Pass true to run on transient connections - data or time-limited ++ * Pass true to run on limited connections - data or time-limited + * connections that may be closed at any time such as circuit relay + * connections. + * + * @default false + */ +- runOnTransientConnection?: boolean ++ runOnLimitedConnection?: boolean + + /** + * Specify max buffer size in bytes for OutboundStream. +@@ -259,6 +261,7 @@ interface AcceptFromWhitelistEntry { + } + + export interface GossipSubComponents { ++ privateKey: PrivateKey + peerId: PeerId + peerStore: PeerStore + registrar: Registrar +@@ -420,7 +423,7 @@ export class GossipSub extends TypedEventEmitter implements Pub + private status: GossipStatus = { code: GossipStatusCode.stopped } + private readonly maxInboundStreams?: number + private readonly maxOutboundStreams?: number +- private readonly runOnTransientConnection?: boolean ++ private readonly runOnLimitedConnection?: boolean + private readonly allowedTopics: Set | null + + private heartbeatTimer: { +@@ -554,7 +557,7 @@ export class GossipSub extends TypedEventEmitter implements Pub + + this.maxInboundStreams = options.maxInboundStreams + this.maxOutboundStreams = options.maxOutboundStreams +- this.runOnTransientConnection = options.runOnTransientConnection ++ this.runOnLimitedConnection = options.runOnLimitedConnection + + this.allowedTopics = (opts.allowedTopics != null) ? new Set(opts.allowedTopics) : null + } +@@ -591,7 +594,7 @@ export class GossipSub extends TypedEventEmitter implements Pub + + this.log('starting') + +- this.publishConfig = await getPublishConfigFromPeerId(this.globalSignaturePolicy, this.components.peerId) ++ this.publishConfig = getPublishConfigFromPeerId(this.globalSignaturePolicy, this.components.peerId, this.components.privateKey) + + // Create the outbound inflight queue + // This ensures that outbound stream creation happens sequentially +@@ -619,7 +622,7 @@ export class GossipSub extends TypedEventEmitter implements Pub + registrar.handle(multicodec, this.onIncomingStream.bind(this), { + maxInboundStreams: this.maxInboundStreams, + maxOutboundStreams: this.maxOutboundStreams, +- runOnTransientConnection: this.runOnTransientConnection ++ runOnLimitedConnection: this.runOnLimitedConnection + }) + ) + ) +@@ -646,7 +649,7 @@ export class GossipSub extends TypedEventEmitter implements Pub + const topology: Topology = { + onConnect: this.onPeerConnected.bind(this), + onDisconnect: this.onPeerDisconnected.bind(this), +- notifyOnTransient: this.runOnTransientConnection ++ notifyOnLimitedConnection: this.runOnLimitedConnection + } + const registrarTopologyIds = await Promise.all( + this.multicodecs.map(async (multicodec) => registrar.register(multicodec, topology)) +@@ -817,7 +820,7 @@ export class GossipSub extends TypedEventEmitter implements Pub + try { + const stream = new OutboundStream( + await connection.newStream(this.multicodecs, { +- runOnTransientConnection: this.runOnTransientConnection ++ runOnLimitedConnection: this.runOnLimitedConnection + }), + (e) => { this.log.error('outbound pipe error', e) }, + { maxBufferSize: this.opts.maxOutboundBufferSize } +@@ -1778,7 +1781,7 @@ export class GossipSub extends TypedEventEmitter implements Pub + return + } + +- const peer = peerIdFromBytes(pi.peerID) ++ const peer = peerIdFromMultihash(Digest.decode(pi.peerID)) + const p = peer.toString() + + if (this.peers.has(p)) { +@@ -2610,13 +2613,13 @@ export class GossipSub extends TypedEventEmitter implements Pub + try { + peerInfo = await this.components.peerStore.get(id) + } catch (err: any) { +- if (err.code !== 'ERR_NOT_FOUND') { ++ if (err.name !== 'NotFoundError') { + throw err + } + } + + return { +- peerID: id.toBytes(), ++ peerID: id.toMultihash().bytes, + signedPeerRecord: peerInfo?.peerRecordEnvelope + } + }) +diff --git a/node_modules/@chainsafe/libp2p-gossipsub/src/message/rpc.ts b/node_modules/@chainsafe/libp2p-gossipsub/src/message/rpc.ts +index a31ab91..32990a7 100644 +--- a/node_modules/@chainsafe/libp2p-gossipsub/src/message/rpc.ts ++++ b/node_modules/@chainsafe/libp2p-gossipsub/src/message/rpc.ts +@@ -4,7 +4,7 @@ + /* eslint-disable @typescript-eslint/no-unnecessary-boolean-literal-compare */ + /* eslint-disable @typescript-eslint/no-empty-interface */ + +-import { type Codec, CodeError, decodeMessage, type DecodeOptions, encodeMessage, message } from 'protons-runtime' ++import { type Codec, decodeMessage, type DecodeOptions, encodeMessage, MaxLengthError, message } from 'protons-runtime' + import type { Uint8ArrayList } from 'uint8arraylist' + + export interface RPC { +@@ -256,34 +256,42 @@ export namespace RPC { + switch (tag >>> 3) { + case 1: { + if (opts.limits?.ihave != null && obj.ihave.length === opts.limits.ihave) { +- throw new CodeError('decode error - map field "ihave" had too many elements', 'ERR_MAX_LENGTH') ++ throw new MaxLengthError('Decode error - map field "ihave" had too many elements') + } + +- obj.ihave.push(RPC.ControlIHave.codec().decode(reader, reader.uint32())) ++ obj.ihave.push(RPC.ControlIHave.codec().decode(reader, reader.uint32(), { ++ limits: opts.limits?.ihave$ ++ })) + break + } + case 2: { + if (opts.limits?.iwant != null && obj.iwant.length === opts.limits.iwant) { +- throw new CodeError('decode error - map field "iwant" had too many elements', 'ERR_MAX_LENGTH') ++ throw new MaxLengthError('Decode error - map field "iwant" had too many elements') + } + +- obj.iwant.push(RPC.ControlIWant.codec().decode(reader, reader.uint32())) ++ obj.iwant.push(RPC.ControlIWant.codec().decode(reader, reader.uint32(), { ++ limits: opts.limits?.iwant$ ++ })) + break + } + case 3: { + if (opts.limits?.graft != null && obj.graft.length === opts.limits.graft) { +- throw new CodeError('decode error - map field "graft" had too many elements', 'ERR_MAX_LENGTH') ++ throw new MaxLengthError('Decode error - map field "graft" had too many elements') + } + +- obj.graft.push(RPC.ControlGraft.codec().decode(reader, reader.uint32())) ++ obj.graft.push(RPC.ControlGraft.codec().decode(reader, reader.uint32(), { ++ limits: opts.limits?.graft$ ++ })) + break + } + case 4: { + if (opts.limits?.prune != null && obj.prune.length === opts.limits.prune) { +- throw new CodeError('decode error - map field "prune" had too many elements', 'ERR_MAX_LENGTH') ++ throw new MaxLengthError('Decode error - map field "prune" had too many elements') + } + +- obj.prune.push(RPC.ControlPrune.codec().decode(reader, reader.uint32())) ++ obj.prune.push(RPC.ControlPrune.codec().decode(reader, reader.uint32(), { ++ limits: opts.limits?.prune$ ++ })) + break + } + default: { +@@ -356,7 +364,7 @@ export namespace RPC { + } + case 2: { + if (opts.limits?.messageIDs != null && obj.messageIDs.length === opts.limits.messageIDs) { +- throw new CodeError('decode error - map field "messageIDs" had too many elements', 'ERR_MAX_LENGTH') ++ throw new MaxLengthError('Decode error - map field "messageIDs" had too many elements') + } + + obj.messageIDs.push(reader.bytes()) +@@ -422,7 +430,7 @@ export namespace RPC { + switch (tag >>> 3) { + case 1: { + if (opts.limits?.messageIDs != null && obj.messageIDs.length === opts.limits.messageIDs) { +- throw new CodeError('decode error - map field "messageIDs" had too many elements', 'ERR_MAX_LENGTH') ++ throw new MaxLengthError('Decode error - map field "messageIDs" had too many elements') + } + + obj.messageIDs.push(reader.bytes()) +@@ -562,10 +570,12 @@ export namespace RPC { + } + case 2: { + if (opts.limits?.peers != null && obj.peers.length === opts.limits.peers) { +- throw new CodeError('decode error - map field "peers" had too many elements', 'ERR_MAX_LENGTH') ++ throw new MaxLengthError('Decode error - map field "peers" had too many elements') + } + +- obj.peers.push(RPC.PeerInfo.codec().decode(reader, reader.uint32())) ++ obj.peers.push(RPC.PeerInfo.codec().decode(reader, reader.uint32(), { ++ limits: opts.limits?.peers$ ++ })) + break + } + case 3: { +@@ -708,22 +718,28 @@ export namespace RPC { + switch (tag >>> 3) { + case 1: { + if (opts.limits?.subscriptions != null && obj.subscriptions.length === opts.limits.subscriptions) { +- throw new CodeError('decode error - map field "subscriptions" had too many elements', 'ERR_MAX_LENGTH') ++ throw new MaxLengthError('Decode error - map field "subscriptions" had too many elements') + } + +- obj.subscriptions.push(RPC.SubOpts.codec().decode(reader, reader.uint32())) ++ obj.subscriptions.push(RPC.SubOpts.codec().decode(reader, reader.uint32(), { ++ limits: opts.limits?.subscriptions$ ++ })) + break + } + case 2: { + if (opts.limits?.messages != null && obj.messages.length === opts.limits.messages) { +- throw new CodeError('decode error - map field "messages" had too many elements', 'ERR_MAX_LENGTH') ++ throw new MaxLengthError('Decode error - map field "messages" had too many elements') + } + +- obj.messages.push(RPC.Message.codec().decode(reader, reader.uint32())) ++ obj.messages.push(RPC.Message.codec().decode(reader, reader.uint32(), { ++ limits: opts.limits?.messages$ ++ })) + break + } + case 3: { +- obj.control = RPC.ControlMessage.codec().decode(reader, reader.uint32()) ++ obj.control = RPC.ControlMessage.codec().decode(reader, reader.uint32(), { ++ limits: opts.limits?.control ++ }) + break + } + default: { +diff --git a/node_modules/@chainsafe/libp2p-gossipsub/src/score/constants.ts b/node_modules/@chainsafe/libp2p-gossipsub/src/score/constants.ts +deleted file mode 100644 +index 6647428..0000000 +--- a/node_modules/@chainsafe/libp2p-gossipsub/src/score/constants.ts ++++ /dev/null +@@ -1,2 +0,0 @@ +-export const ERR_INVALID_PEER_SCORE_PARAMS = 'ERR_INVALID_PEER_SCORE_PARAMS' +-export const ERR_INVALID_PEER_SCORE_THRESHOLDS = 'ERR_INVALID_PEER_SCORE_THRESHOLDS' +diff --git a/node_modules/@chainsafe/libp2p-gossipsub/src/score/peer-score-params.ts b/node_modules/@chainsafe/libp2p-gossipsub/src/score/peer-score-params.ts +index cf2761c..8048d28 100644 +--- a/node_modules/@chainsafe/libp2p-gossipsub/src/score/peer-score-params.ts ++++ b/node_modules/@chainsafe/libp2p-gossipsub/src/score/peer-score-params.ts +@@ -1,5 +1,4 @@ +-import { CodeError } from '@libp2p/interface' +-import { ERR_INVALID_PEER_SCORE_PARAMS } from './constants.js' ++import { InvalidPeerScoreParamsError } from '../errors.js' + + // This file defines PeerScoreParams and TopicScoreParams interfaces + // as well as constructors, default constructors, and validation functions +@@ -203,51 +202,42 @@ export function validatePeerScoreParams (p: PeerScoreParams): void { + try { + validateTopicScoreParams(params) + } catch (e) { +- throw new CodeError( +- `invalid score parameters for topic ${topic}: ${(e as Error).message}`, +- ERR_INVALID_PEER_SCORE_PARAMS +- ) ++ throw new InvalidPeerScoreParamsError(`invalid score parameters for topic ${topic}: ${(e as Error).message}`) + } + } + + // check that the topic score is 0 or something positive + if (p.topicScoreCap < 0) { +- throw new CodeError('invalid topic score cap; must be positive (or 0 for no cap)', ERR_INVALID_PEER_SCORE_PARAMS) ++ throw new InvalidPeerScoreParamsError('invalid topic score cap; must be positive (or 0 for no cap)') + } + + // check that we have an app specific score; the weight can be anything (but expected positive) + if (p.appSpecificScore === null || p.appSpecificScore === undefined) { +- throw new CodeError('missing application specific score function', ERR_INVALID_PEER_SCORE_PARAMS) ++ throw new InvalidPeerScoreParamsError('missing application specific score function') + } + + // check the IP colocation factor + if (p.IPColocationFactorWeight > 0) { +- throw new CodeError( +- 'invalid IPColocationFactorWeight; must be negative (or 0 to disable)', +- ERR_INVALID_PEER_SCORE_PARAMS +- ) ++ throw new InvalidPeerScoreParamsError('invalid IPColocationFactorWeight; must be negative (or 0 to disable)') + } + if (p.IPColocationFactorWeight !== 0 && p.IPColocationFactorThreshold < 1) { +- throw new CodeError('invalid IPColocationFactorThreshold; must be at least 1', ERR_INVALID_PEER_SCORE_PARAMS) ++ throw new InvalidPeerScoreParamsError('invalid IPColocationFactorThreshold; must be at least 1') + } + + // check the behaviour penalty + if (p.behaviourPenaltyWeight > 0) { +- throw new CodeError( +- 'invalid BehaviourPenaltyWeight; must be negative (or 0 to disable)', +- ERR_INVALID_PEER_SCORE_PARAMS +- ) ++ throw new InvalidPeerScoreParamsError('invalid BehaviourPenaltyWeight; must be negative (or 0 to disable)') + } + if (p.behaviourPenaltyWeight !== 0 && (p.behaviourPenaltyDecay <= 0 || p.behaviourPenaltyDecay >= 1)) { +- throw new CodeError('invalid BehaviourPenaltyDecay; must be between 0 and 1', ERR_INVALID_PEER_SCORE_PARAMS) ++ throw new InvalidPeerScoreParamsError('invalid BehaviourPenaltyDecay; must be between 0 and 1') + } + + // check the decay parameters + if (p.decayInterval < 1000) { +- throw new CodeError('invalid DecayInterval; must be at least 1s', ERR_INVALID_PEER_SCORE_PARAMS) ++ throw new InvalidPeerScoreParamsError('invalid DecayInterval; must be at least 1s') + } + if (p.decayToZero <= 0 || p.decayToZero >= 1) { +- throw new CodeError('invalid DecayToZero; must be between 0 and 1', ERR_INVALID_PEER_SCORE_PARAMS) ++ throw new InvalidPeerScoreParamsError('invalid DecayToZero; must be between 0 and 1') + } + + // no need to check the score retention; a value of 0 means that we don't retain scores +@@ -257,82 +247,70 @@ export function validatePeerScoreParams (p: PeerScoreParams): void { + export function validateTopicScoreParams (p: TopicScoreParams): void { + // make sure we have a sane topic weight + if (p.topicWeight < 0) { +- throw new CodeError('invalid topic weight; must be >= 0', ERR_INVALID_PEER_SCORE_PARAMS) ++ throw new InvalidPeerScoreParamsError('invalid topic weight; must be >= 0') + } + + // check P1 + if (p.timeInMeshQuantum === 0) { +- throw new CodeError('invalid TimeInMeshQuantum; must be non zero', ERR_INVALID_PEER_SCORE_PARAMS) ++ throw new InvalidPeerScoreParamsError('invalid TimeInMeshQuantum; must be non zero') + } + if (p.timeInMeshWeight < 0) { +- throw new CodeError('invalid TimeInMeshWeight; must be positive (or 0 to disable)', ERR_INVALID_PEER_SCORE_PARAMS) ++ throw new InvalidPeerScoreParamsError('invalid TimeInMeshWeight; must be positive (or 0 to disable)') + } + if (p.timeInMeshWeight !== 0 && p.timeInMeshQuantum <= 0) { +- throw new CodeError('invalid TimeInMeshQuantum; must be positive', ERR_INVALID_PEER_SCORE_PARAMS) ++ throw new InvalidPeerScoreParamsError('invalid TimeInMeshQuantum; must be positive') + } + if (p.timeInMeshWeight !== 0 && p.timeInMeshCap <= 0) { +- throw new CodeError('invalid TimeInMeshCap; must be positive', ERR_INVALID_PEER_SCORE_PARAMS) ++ throw new InvalidPeerScoreParamsError('invalid TimeInMeshCap; must be positive') + } + + // check P2 + if (p.firstMessageDeliveriesWeight < 0) { +- throw new CodeError( +- 'invallid FirstMessageDeliveriesWeight; must be positive (or 0 to disable)', +- ERR_INVALID_PEER_SCORE_PARAMS +- ) ++ throw new InvalidPeerScoreParamsError('invallid FirstMessageDeliveriesWeight; must be positive (or 0 to disable)') + } + if ( + p.firstMessageDeliveriesWeight !== 0 && + (p.firstMessageDeliveriesDecay <= 0 || p.firstMessageDeliveriesDecay >= 1) + ) { +- throw new CodeError('invalid FirstMessageDeliveriesDecay; must be between 0 and 1', ERR_INVALID_PEER_SCORE_PARAMS) ++ throw new InvalidPeerScoreParamsError('invalid FirstMessageDeliveriesDecay; must be between 0 and 1') + } + if (p.firstMessageDeliveriesWeight !== 0 && p.firstMessageDeliveriesCap <= 0) { +- throw new CodeError('invalid FirstMessageDeliveriesCap; must be positive', ERR_INVALID_PEER_SCORE_PARAMS) ++ throw new InvalidPeerScoreParamsError('invalid FirstMessageDeliveriesCap; must be positive') + } + + // check P3 + if (p.meshMessageDeliveriesWeight > 0) { +- throw new CodeError( +- 'invalid MeshMessageDeliveriesWeight; must be negative (or 0 to disable)', +- ERR_INVALID_PEER_SCORE_PARAMS +- ) ++ throw new InvalidPeerScoreParamsError('invalid MeshMessageDeliveriesWeight; must be negative (or 0 to disable)') + } + if (p.meshMessageDeliveriesWeight !== 0 && (p.meshMessageDeliveriesDecay <= 0 || p.meshMessageDeliveriesDecay >= 1)) { +- throw new CodeError('invalid MeshMessageDeliveriesDecay; must be between 0 and 1', ERR_INVALID_PEER_SCORE_PARAMS) ++ throw new InvalidPeerScoreParamsError('invalid MeshMessageDeliveriesDecay; must be between 0 and 1') + } + if (p.meshMessageDeliveriesWeight !== 0 && p.meshMessageDeliveriesCap <= 0) { +- throw new CodeError('invalid MeshMessageDeliveriesCap; must be positive', ERR_INVALID_PEER_SCORE_PARAMS) ++ throw new InvalidPeerScoreParamsError('invalid MeshMessageDeliveriesCap; must be positive') + } + if (p.meshMessageDeliveriesWeight !== 0 && p.meshMessageDeliveriesThreshold <= 0) { +- throw new CodeError('invalid MeshMessageDeliveriesThreshold; must be positive', ERR_INVALID_PEER_SCORE_PARAMS) ++ throw new InvalidPeerScoreParamsError('invalid MeshMessageDeliveriesThreshold; must be positive') + } + if (p.meshMessageDeliveriesWindow < 0) { +- throw new CodeError('invalid MeshMessageDeliveriesWindow; must be non-negative', ERR_INVALID_PEER_SCORE_PARAMS) ++ throw new InvalidPeerScoreParamsError('invalid MeshMessageDeliveriesWindow; must be non-negative') + } + if (p.meshMessageDeliveriesWeight !== 0 && p.meshMessageDeliveriesActivation < 1000) { +- throw new CodeError('invalid MeshMessageDeliveriesActivation; must be at least 1s', ERR_INVALID_PEER_SCORE_PARAMS) ++ throw new InvalidPeerScoreParamsError('invalid MeshMessageDeliveriesActivation; must be at least 1s') + } + + // check P3b + if (p.meshFailurePenaltyWeight > 0) { +- throw new CodeError( +- 'invalid MeshFailurePenaltyWeight; must be negative (or 0 to disable)', +- ERR_INVALID_PEER_SCORE_PARAMS +- ) ++ throw new InvalidPeerScoreParamsError('invalid MeshFailurePenaltyWeight; must be negative (or 0 to disable)') + } + if (p.meshFailurePenaltyWeight !== 0 && (p.meshFailurePenaltyDecay <= 0 || p.meshFailurePenaltyDecay >= 1)) { +- throw new CodeError('invalid MeshFailurePenaltyDecay; must be between 0 and 1', ERR_INVALID_PEER_SCORE_PARAMS) ++ throw new InvalidPeerScoreParamsError('invalid MeshFailurePenaltyDecay; must be between 0 and 1') + } + + // check P4 + if (p.invalidMessageDeliveriesWeight > 0) { +- throw new CodeError( +- 'invalid InvalidMessageDeliveriesWeight; must be negative (or 0 to disable)', +- ERR_INVALID_PEER_SCORE_PARAMS +- ) ++ throw new InvalidPeerScoreParamsError('invalid InvalidMessageDeliveriesWeight; must be negative (or 0 to disable)') + } + if (p.invalidMessageDeliveriesDecay <= 0 || p.invalidMessageDeliveriesDecay >= 1) { +- throw new CodeError('invalid InvalidMessageDeliveriesDecay; must be between 0 and 1', ERR_INVALID_PEER_SCORE_PARAMS) ++ throw new InvalidPeerScoreParamsError('invalid InvalidMessageDeliveriesDecay; must be between 0 and 1') + } + } +diff --git a/node_modules/@chainsafe/libp2p-gossipsub/src/score/peer-score-thresholds.ts b/node_modules/@chainsafe/libp2p-gossipsub/src/score/peer-score-thresholds.ts +index b2e8dcc..b50225b 100644 +--- a/node_modules/@chainsafe/libp2p-gossipsub/src/score/peer-score-thresholds.ts ++++ b/node_modules/@chainsafe/libp2p-gossipsub/src/score/peer-score-thresholds.ts +@@ -1,5 +1,4 @@ +-import { CodeError } from '@libp2p/interface' +-import { ERR_INVALID_PEER_SCORE_THRESHOLDS } from './constants.js' ++import { InvalidPeerScoreThresholdsError } from '../errors.js' + + // This file defines PeerScoreThresholds interface + // as well as a constructor, default constructor, and validation function +@@ -54,24 +53,18 @@ export function createPeerScoreThresholds (p: Partial = {}) + + export function validatePeerScoreThresholds (p: PeerScoreThresholds): void { + if (p.gossipThreshold > 0) { +- throw new CodeError('invalid gossip threshold; it must be <= 0', ERR_INVALID_PEER_SCORE_THRESHOLDS) ++ throw new InvalidPeerScoreThresholdsError('invalid gossip threshold; it must be <= 0') + } + if (p.publishThreshold > 0 || p.publishThreshold > p.gossipThreshold) { +- throw new CodeError( +- 'invalid publish threshold; it must be <= 0 and <= gossip threshold', +- ERR_INVALID_PEER_SCORE_THRESHOLDS +- ) ++ throw new InvalidPeerScoreThresholdsError('invalid publish threshold; it must be <= 0 and <= gossip threshold') + } + if (p.graylistThreshold > 0 || p.graylistThreshold > p.publishThreshold) { +- throw new CodeError( +- 'invalid graylist threshold; it must be <= 0 and <= publish threshold', +- ERR_INVALID_PEER_SCORE_THRESHOLDS +- ) ++ throw new InvalidPeerScoreThresholdsError('invalid graylist threshold; it must be <= 0 and <= publish threshold') + } + if (p.acceptPXThreshold < 0) { +- throw new CodeError('invalid accept PX threshold; it must be >= 0', ERR_INVALID_PEER_SCORE_THRESHOLDS) ++ throw new InvalidPeerScoreThresholdsError('invalid accept PX threshold; it must be >= 0') + } + if (p.opportunisticGraftThreshold < 0) { +- throw new CodeError('invalid opportunistic grafting threshold; it must be >= 0', ERR_INVALID_PEER_SCORE_THRESHOLDS) ++ throw new InvalidPeerScoreThresholdsError('invalid opportunistic grafting threshold; it must be >= 0') + } + } +diff --git a/node_modules/@chainsafe/libp2p-gossipsub/src/utils/buildRawMessage.ts b/node_modules/@chainsafe/libp2p-gossipsub/src/utils/buildRawMessage.ts +index 71b4007..3771dea 100644 +--- a/node_modules/@chainsafe/libp2p-gossipsub/src/utils/buildRawMessage.ts ++++ b/node_modules/@chainsafe/libp2p-gossipsub/src/utils/buildRawMessage.ts +@@ -1,9 +1,9 @@ + import { randomBytes } from '@libp2p/crypto' +-import { marshalPublicKey, unmarshalPublicKey } from '@libp2p/crypto/keys' ++import { publicKeyFromProtobuf } from '@libp2p/crypto/keys' + import { StrictSign, StrictNoSign, type Message, type PublicKey, type PeerId } from '@libp2p/interface' +-import { peerIdFromBytes } from '@libp2p/peer-id' ++import { peerIdFromMultihash } from '@libp2p/peer-id' ++import * as Digest from 'multiformats/hashes/digest' + import { concat as uint8ArrayConcat } from 'uint8arrays/concat' +-import { equals as uint8ArrayEquals } from 'uint8arrays/equals' + import { fromString as uint8ArrayFromString } from 'uint8arrays/from-string' + import { toString as uint8ArrayToString } from 'uint8arrays/to-string' + import { RPC } from '../message/rpc.js' +@@ -25,7 +25,7 @@ export async function buildRawMessage ( + switch (publishConfig.type) { + case PublishConfigType.Signing: { + const rpcMsg: RPC.Message = { +- from: publishConfig.author.toBytes(), ++ from: publishConfig.author.toMultihash().bytes, + data: transformedData, + seqno: randomBytes(8), + topic, +@@ -47,7 +47,7 @@ export async function buildRawMessage ( + sequenceNumber: BigInt(`0x${uint8ArrayToString(rpcMsg.seqno as Uint8Array, 'base16')}`), + topic, + signature: rpcMsg.signature, +- key: rpcMsg.key ++ key: publicKeyFromProtobuf(rpcMsg.key) + } + return { + raw: rpcMsg, +@@ -108,7 +108,7 @@ export async function validateToRawMessage ( + let fromPeerId: PeerId + try { + // TODO: Fix PeerId types +- fromPeerId = peerIdFromBytes(msg.from) ++ fromPeerId = peerIdFromMultihash(Digest.decode(msg.from)) + } catch (e) { + return { valid: false, error: ValidateError.InvalidPeerId } + } +@@ -122,16 +122,16 @@ export async function validateToRawMessage ( + + let publicKey: PublicKey + if (msg.key != null) { +- publicKey = unmarshalPublicKey(msg.key) ++ publicKey = publicKeyFromProtobuf(msg.key) + // TODO: Should `fromPeerId.pubKey` be optional? +- if (fromPeerId.publicKey !== undefined && !uint8ArrayEquals(publicKey.bytes, fromPeerId.publicKey)) { ++ if (fromPeerId.publicKey !== undefined && !publicKey.equals(fromPeerId.publicKey)) { + return { valid: false, error: ValidateError.InvalidPeerId } + } + } else { + if (fromPeerId.publicKey == null) { + return { valid: false, error: ValidateError.InvalidPeerId } + } +- publicKey = unmarshalPublicKey(fromPeerId.publicKey) ++ publicKey = fromPeerId.publicKey + } + + const rpcMsgPreSign: RPC.Message = { +@@ -160,7 +160,7 @@ export async function validateToRawMessage ( + sequenceNumber: BigInt(`0x${uint8ArrayToString(msg.seqno, 'base16')}`), + topic: msg.topic, + signature: msg.signature, +- key: msg.key ?? marshalPublicKey(publicKey) ++ key: msg.key != null ? publicKeyFromProtobuf(msg.key) : publicKey + } + } + } +diff --git a/node_modules/@chainsafe/libp2p-gossipsub/src/utils/msgIdFn.ts b/node_modules/@chainsafe/libp2p-gossipsub/src/utils/msgIdFn.ts +index a36d40a..510378d 100644 +--- a/node_modules/@chainsafe/libp2p-gossipsub/src/utils/msgIdFn.ts ++++ b/node_modules/@chainsafe/libp2p-gossipsub/src/utils/msgIdFn.ts +@@ -13,7 +13,7 @@ export function msgIdFnStrictSign (msg: Message): Uint8Array { + if (msg.sequenceNumber == null) throw Error('missing seqno field') + + // TODO: Should use .from here or key? +- return msgId(msg.from.toBytes(), msg.sequenceNumber) ++ return msgId(msg.from.publicKey ?? msg.key, msg.sequenceNumber) + } + + /** +diff --git a/node_modules/@chainsafe/libp2p-gossipsub/src/utils/publishConfig.ts b/node_modules/@chainsafe/libp2p-gossipsub/src/utils/publishConfig.ts +index 7d3acda..cec74c9 100644 +--- a/node_modules/@chainsafe/libp2p-gossipsub/src/utils/publishConfig.ts ++++ b/node_modules/@chainsafe/libp2p-gossipsub/src/utils/publishConfig.ts +@@ -1,36 +1,22 @@ +-import { unmarshalPrivateKey } from '@libp2p/crypto/keys' ++import { publicKeyToProtobuf } from '@libp2p/crypto/keys' + import { StrictSign, StrictNoSign } from '@libp2p/interface' + import { type PublishConfig, PublishConfigType } from '../types.js' +-import type { PeerId } from '@libp2p/interface' ++import type { PeerId, PrivateKey } from '@libp2p/interface' + + /** + * Prepare a PublishConfig object from a PeerId. + */ +-export async function getPublishConfigFromPeerId ( ++export function getPublishConfigFromPeerId ( + signaturePolicy: typeof StrictSign | typeof StrictNoSign, +- peerId?: PeerId +-): Promise { ++ peerId: PeerId, ++ privateKey: PrivateKey ++): PublishConfig { + switch (signaturePolicy) { + case StrictSign: { +- if (peerId == null) { +- throw Error('Must provide PeerId') +- } +- +- if (peerId.privateKey == null) { +- throw Error('Cannot sign message, no private key present') +- } +- +- if (peerId.publicKey == null) { +- throw Error('Cannot sign message, no public key present') +- } +- +- // Transform privateKey once at initialization time instead of once per message +- const privateKey = await unmarshalPrivateKey(peerId.privateKey) +- + return { + type: PublishConfigType.Signing, + author: peerId, +- key: peerId.publicKey, ++ key: publicKeyToProtobuf(privateKey.publicKey), + privateKey + } + }