diff --git a/package.json b/package.json index 7399b4ba6c1e..e6de076cf494 100644 --- a/package.json +++ b/package.json @@ -60,7 +60,7 @@ "https-browserify": "^1.0.0", "jsdom": "^23.0.1", "lerna": "^7.3.0", - "libp2p": "1.4.3", + "libp2p": "2.1.7", "mocha": "^10.2.0", "node-gyp": "^9.4.0", "npm-run-all": "^4.1.5", diff --git a/packages/beacon-node/package.json b/packages/beacon-node/package.json index 8b46bc0038c7..e3d095b6f1e0 100644 --- a/packages/beacon-node/package.json +++ b/packages/beacon-node/package.json @@ -96,11 +96,10 @@ "dependencies": { "@chainsafe/as-sha256": "^0.5.0", "@chainsafe/blst": "^2.0.3", - "@chainsafe/discv5": "^9.0.0", - "@chainsafe/enr": "^3.0.0", - "@chainsafe/libp2p-gossipsub": "^13.0.0", - "@chainsafe/libp2p-identify": "^1.0.0", - "@chainsafe/libp2p-noise": "^15.0.0", + "@chainsafe/discv5": "^10.0.1", + "@chainsafe/enr": "^4.0.1", + "@chainsafe/libp2p-gossipsub": "^14.1.0", + "@chainsafe/libp2p-noise": "^16.0.0", "@chainsafe/persistent-merkle-tree": "^0.8.0", "@chainsafe/prometheus-gc-stats": "^1.0.0", "@chainsafe/ssz": "^0.17.1", @@ -111,15 +110,15 @@ "@fastify/cors": "^10.0.1", "@fastify/swagger": "^9.0.0", "@fastify/swagger-ui": "^5.0.1", - "@libp2p/bootstrap": "^10.0.21", - "@libp2p/identify": "^1.0.20", - "@libp2p/interface": "^1.3.0", - "@libp2p/mdns": "^10.0.21", - "@libp2p/mplex": "^10.0.21", - "@libp2p/peer-id": "^4.1.0", - "@libp2p/peer-id-factory": "^4.1.0", - "@libp2p/prometheus-metrics": "^3.0.21", - "@libp2p/tcp": "9.0.23", + "@libp2p/bootstrap": "^11.0.4", + "@libp2p/crypto": "^5.0.4", + "@libp2p/identify": "^3.0.4", + "@libp2p/interface": "^2.1.2", + "@libp2p/mdns": "^11.0.4", + "@libp2p/mplex": "^11.0.4", + "@libp2p/peer-id": "^5.0.4", + "@libp2p/prometheus-metrics": "^4.1.2", + "@libp2p/tcp": "10.0.4", "@lodestar/api": "^1.22.0", "@lodestar/config": "^1.22.0", "@lodestar/db": "^1.22.0", @@ -134,15 +133,15 @@ "@lodestar/validator": "^1.22.0", "@multiformats/multiaddr": "^12.1.3", "c-kzg": "^2.1.2", - "datastore-core": "^9.1.1", - "datastore-level": "^10.1.1", + "datastore-core": "^10.0.0", + "datastore-level": "^11.0.0", "deepmerge": "^4.3.1", "fastify": "^5.0.0", - "interface-datastore": "^8.2.7", + "interface-datastore": "^8.3.0", "it-all": "^3.0.4", "it-pipe": "^3.0.1", "jwt-simple": "0.5.6", - "libp2p": "1.4.3", + "libp2p": "2.1.7", "multiformats": "^11.0.1", "prom-client": "^15.1.0", "qs": "^6.11.1", diff --git a/packages/beacon-node/src/network/core/networkCore.ts b/packages/beacon-node/src/network/core/networkCore.ts index 1a497925e4fd..9d075c730558 100644 --- a/packages/beacon-node/src/network/core/networkCore.ts +++ b/packages/beacon-node/src/network/core/networkCore.ts @@ -1,4 +1,4 @@ -import {Connection, PeerId} from "@libp2p/interface"; +import {Connection, PrivateKey} from "@libp2p/interface"; import {multiaddr} from "@multiformats/multiaddr"; import {PublishOpts} from "@chainsafe/libp2p-gossipsub/types"; import {PeerScoreStatsDump} from "@chainsafe/libp2p-gossipsub/dist/src/score/peer-score.js"; @@ -55,7 +55,7 @@ type Mods = { export type BaseNetworkInit = { opts: NetworkOptions; config: BeaconConfig; - peerId: PeerId; + privateKey: PrivateKey; peerStoreDir: string | undefined; logger: LoggerNode; metricsRegistry: RegistryMetricCreator | null; @@ -126,7 +126,7 @@ export class NetworkCore implements INetworkCore { static async init({ opts, config, - peerId, + privateKey, peerStoreDir, logger, metricsRegistry, @@ -136,7 +136,7 @@ export class NetworkCore implements INetworkCore { activeValidatorCount, initialStatus, }: BaseNetworkInit): Promise { - const libp2p = await createNodeJsLibp2p(peerId, opts, { + const libp2p = await createNodeJsLibp2p(privateKey, opts, { peerStoreDir, metrics: Boolean(metricsRegistry), metricsRegistry: metricsRegistry ?? undefined, @@ -200,8 +200,9 @@ export class NetworkCore implements INetworkCore { const peerManager = await PeerManager.init( { + privateKey, libp2p, - gossip: gossip, + gossip, reqResp, attnetsService, syncnetsService, @@ -359,7 +360,11 @@ export class NetworkCore implements INetworkCore { } getConnectionsByPeer(): Map { - return getConnectionsMap(this.libp2p); + const m = new Map(); + for (const [k, v] of getConnectionsMap(this.libp2p).entries()) { + m.set(k, v.value); + } + return m; } async getConnectedPeers(): Promise { diff --git a/packages/beacon-node/src/network/core/networkCoreWorker.ts b/packages/beacon-node/src/network/core/networkCoreWorker.ts index 5e4b057402d8..07b6de828b6c 100644 --- a/packages/beacon-node/src/network/core/networkCoreWorker.ts +++ b/packages/beacon-node/src/network/core/networkCoreWorker.ts @@ -3,7 +3,8 @@ import path from "node:path"; import worker from "node:worker_threads"; import type {ModuleThread} from "@chainsafe/threads"; import {expose} from "@chainsafe/threads/worker"; -import {createFromProtobuf} from "@libp2p/peer-id-factory"; +import {privateKeyFromProtobuf} from "@libp2p/crypto/keys"; +import {peerIdFromPrivateKey} from "@libp2p/peer-id"; import {chainConfigFromJson, createBeaconConfig} from "@lodestar/config"; import {getNodeLogger} from "@lodestar/logger/node"; import {RegistryMetricCreator, collectNodeJSMetrics} from "../../metrics/index.js"; @@ -32,7 +33,8 @@ if (!workerData) throw Error("workerData must be defined"); if (!parentPort) throw Error("parentPort must be defined"); const config = createBeaconConfig(chainConfigFromJson(workerData.chainConfigJson), workerData.genesisValidatorsRoot); -const peerId = await createFromProtobuf(workerData.peerIdProto); +const privateKey = privateKeyFromProtobuf(workerData.privateKeyProto); +const peerId = peerIdFromPrivateKey(privateKey); // TODO: Pass options from main thread for logging // TODO: Logging won't be visible in file loggers @@ -92,7 +94,7 @@ if (networkCoreWorkerMetrics) { const core = await NetworkCore.init({ opts: workerData.opts, config, - peerId, + privateKey, peerStoreDir: workerData.peerStoreDir, logger, metricsRegistry: metricsRegister, diff --git a/packages/beacon-node/src/network/core/networkCoreWorkerHandler.ts b/packages/beacon-node/src/network/core/networkCoreWorkerHandler.ts index bd66a21e726b..e883476b5e65 100644 --- a/packages/beacon-node/src/network/core/networkCoreWorkerHandler.ts +++ b/packages/beacon-node/src/network/core/networkCoreWorkerHandler.ts @@ -3,8 +3,8 @@ import workerThreads from "node:worker_threads"; import {PeerScoreStatsDump} from "@chainsafe/libp2p-gossipsub/dist/src/score/peer-score.js"; import {PublishOpts} from "@chainsafe/libp2p-gossipsub/types"; import {ModuleThread, Thread, Worker, spawn} from "@chainsafe/threads"; -import {PeerId, Secp256k1PeerId} from "@libp2p/interface"; -import {exportToProtobuf} from "@libp2p/peer-id-factory"; +import {PrivateKey} from "@libp2p/interface"; +import {privateKeyToProtobuf} from "@libp2p/crypto/keys"; import {routes} from "@lodestar/api"; import {BeaconConfig, chainConfigToJson} from "@lodestar/config"; import type {LoggerNode} from "@lodestar/logger/node"; @@ -44,7 +44,7 @@ export type WorkerNetworkCoreInitModules = { opts: WorkerNetworkCoreOpts; config: BeaconConfig; logger: LoggerNode; - peerId: PeerId; + privateKey: PrivateKey; events: NetworkEventBus; metrics: Metrics | null; getReqRespHandler: GetReqRespHandlerFn; @@ -103,14 +103,14 @@ export class WorkerNetworkCore implements INetworkCore { } static async init(modules: WorkerNetworkCoreInitModules): Promise { - const {opts, config, peerId} = modules; + const {opts, config, privateKey} = modules; const {genesisTime, peerStoreDir, activeValidatorCount, localMultiaddrs, metricsEnabled, initialStatus} = opts; const workerData: NetworkWorkerData = { opts, chainConfigJson: chainConfigToJson(config), genesisValidatorsRoot: config.genesisValidatorsRoot, - peerIdProto: exportToProtobuf(peerId as Secp256k1PeerId), + privateKeyProto: privateKeyToProtobuf(privateKey), localMultiaddrs, metricsEnabled, peerStoreDir, diff --git a/packages/beacon-node/src/network/core/types.ts b/packages/beacon-node/src/network/core/types.ts index 4eeaf96e1903..d2f56c8fa2f1 100644 --- a/packages/beacon-node/src/network/core/types.ts +++ b/packages/beacon-node/src/network/core/types.ts @@ -78,7 +78,7 @@ export type NetworkWorkerData = { genesisTime: number; activeValidatorCount: number; initialStatus: phase0.Status; - peerIdProto: Uint8Array; + privateKeyProto: Uint8Array; localMultiaddrs: string[]; metricsEnabled: boolean; peerStoreDir?: string; diff --git a/packages/beacon-node/src/network/discv5/index.ts b/packages/beacon-node/src/network/discv5/index.ts index 745b3171c38d..34990d404c90 100644 --- a/packages/beacon-node/src/network/discv5/index.ts +++ b/packages/beacon-node/src/network/discv5/index.ts @@ -1,8 +1,8 @@ import EventEmitter from "node:events"; -import {PeerId, Secp256k1PeerId} from "@libp2p/interface"; +import {privateKeyToProtobuf} from "@libp2p/crypto/keys"; +import {PrivateKey} from "@libp2p/interface"; import {StrictEventEmitter} from "strict-event-emitter-types"; -import {exportToProtobuf} from "@libp2p/peer-id-factory"; -import {createPrivateKeyFromPeerId, ENR, ENRData, SignableENR} from "@chainsafe/enr"; +import {ENR, ENRData, SignableENR} from "@chainsafe/enr"; import {spawn, Thread, Worker} from "@chainsafe/threads"; import {chainConfigFromJson, chainConfigToJson, BeaconConfig} from "@lodestar/config"; import {LoggerNode} from "@lodestar/logger/node"; @@ -10,7 +10,7 @@ import {NetworkCoreMetrics} from "../core/metrics.js"; import {Discv5WorkerApi, Discv5WorkerData, LodestarDiscv5Opts} from "./types.js"; export type Discv5Opts = { - peerId: PeerId; + privateKey: PrivateKey; discv5: LodestarDiscv5Opts; logger: LoggerNode; config: BeaconConfig; @@ -25,7 +25,6 @@ export type Discv5Events = { * Wrapper class abstracting the details of discv5 worker instantiation and message-passing */ export class Discv5Worker extends (EventEmitter as {new (): StrictEventEmitter}) { - private readonly keypair; private readonly subscription: {unsubscribe: () => void}; private closed = false; @@ -35,14 +34,13 @@ export class Discv5Worker extends (EventEmitter as {new (): StrictEventEmitter this.onDiscovered(enrObj)); } static async init(opts: Discv5Opts): Promise { const workerData: Discv5WorkerData = { enr: opts.discv5.enr, - peerIdProto: exportToProtobuf(opts.peerId as Secp256k1PeerId), + privateKeyProto: privateKeyToProtobuf(opts.privateKey), bindAddrs: opts.discv5.bindAddrs, config: opts.discv5.config ?? {}, bootEnrs: opts.discv5.bootEnrs, @@ -80,7 +78,7 @@ export class Discv5Worker extends (EventEmitter as {new (): StrictEventEmitter { const obj = await this.workerApi.enr(); - return new SignableENR(obj.kvs, obj.seq, this.keypair.privateKey); + return new SignableENR(obj.kvs, obj.seq, this.opts.privateKey.raw); } setEnrValue(key: string, value: Uint8Array): Promise { diff --git a/packages/beacon-node/src/network/discv5/types.ts b/packages/beacon-node/src/network/discv5/types.ts index 63c5cd52b6fe..cbaf2423f87f 100644 --- a/packages/beacon-node/src/network/discv5/types.ts +++ b/packages/beacon-node/src/network/discv5/types.ts @@ -31,7 +31,7 @@ export type LodestarDiscv5Opts = { /** discv5 worker constructor data */ export interface Discv5WorkerData { enr: string; - peerIdProto: Uint8Array; + privateKeyProto: Uint8Array; bindAddrs: BindAddrs; config: Discv5Config; bootEnrs: string[]; diff --git a/packages/beacon-node/src/network/discv5/worker.ts b/packages/beacon-node/src/network/discv5/worker.ts index 8e96751d5fe7..40eb08f7af92 100644 --- a/packages/beacon-node/src/network/discv5/worker.ts +++ b/packages/beacon-node/src/network/discv5/worker.ts @@ -1,12 +1,13 @@ import worker from "node:worker_threads"; import path from "node:path"; import fs from "node:fs"; -import {createFromProtobuf} from "@libp2p/peer-id-factory"; import {Multiaddr, multiaddr} from "@multiformats/multiaddr"; import {expose} from "@chainsafe/threads/worker"; import {Observable, Subject} from "@chainsafe/threads/observable"; import {Discv5} from "@chainsafe/discv5"; -import {createPrivateKeyFromPeerId, ENR, ENRData, SignableENR, SignableENRData} from "@chainsafe/enr"; +import {ENR, ENRData, SignableENR, SignableENRData} from "@chainsafe/enr"; +import {privateKeyFromProtobuf} from "@libp2p/crypto/keys"; +import {peerIdFromPrivateKey} from "@libp2p/peer-id"; import {createBeaconConfig} from "@lodestar/config"; import {getNodeLogger} from "@lodestar/logger/node"; import {Gauge} from "@lodestar/utils"; @@ -42,15 +43,15 @@ if (workerData.metrics) { }); } -const peerId = await createFromProtobuf(workerData.peerIdProto); -const keypair = createPrivateKeyFromPeerId(peerId); +const privateKey = privateKeyFromProtobuf(workerData.privateKeyProto); +const peerId = peerIdFromPrivateKey(privateKey); const config = createBeaconConfig(workerData.chainConfig, workerData.genesisValidatorsRoot); // Initialize discv5 const discv5 = Discv5.create({ - enr: SignableENR.decodeTxt(workerData.enr, keypair.privateKey), - peerId, + enr: SignableENR.decodeTxt(workerData.enr, privateKey.raw), + privateKey, bindAddrs: { ip4: (workerData.bindAddrs.ip4 ? multiaddr(workerData.bindAddrs.ip4) : undefined) as Multiaddr, ip6: workerData.bindAddrs.ip6 ? multiaddr(workerData.bindAddrs.ip6) : undefined, diff --git a/packages/beacon-node/src/network/gossip/gossipsub.ts b/packages/beacon-node/src/network/gossip/gossipsub.ts index 1fc326ba1e58..debcbaf89854 100644 --- a/packages/beacon-node/src/network/gossip/gossipsub.ts +++ b/packages/beacon-node/src/network/gossip/gossipsub.ts @@ -135,6 +135,10 @@ export class Eth2Gossipsub extends GossipSub { // if this is false, only publish to mesh peers. If there is not enough GOSSIP_D mesh peers, // publish to some more topic peers to make sure we always publish to at least GOSSIP_D peers floodPublish: !opts?.disableFloodPublish, + // Only send IDONTWANT messages if the message size is larger than this + // This should be large enough to not send IDONTWANT for "small" messages + // See https://github.com/ChainSafe/lodestar/pull/7077#issuecomment-2383679472 + idontwantMinDataSize: 16829, }); this.scoreParams = scoreParams; this.config = config; diff --git a/packages/beacon-node/src/network/interface.ts b/packages/beacon-node/src/network/interface.ts index 8d73379af221..ccb5ddecb557 100644 --- a/packages/beacon-node/src/network/interface.ts +++ b/packages/beacon-node/src/network/interface.ts @@ -12,10 +12,11 @@ import { PeerRouting, PeerStore, Upgrader, + PrivateKey, } from "@libp2p/interface"; import type {AddressManager, ConnectionManager, Registrar, TransportManager} from "@libp2p/interface-internal"; import type {Datastore} from "interface-datastore"; -import {Identify} from "@chainsafe/libp2p-identify"; +import {Identify} from "@libp2p/identify"; import { LightClientFinalityUpdate, LightClientOptimisticUpdate, @@ -93,6 +94,7 @@ export interface INetwork extends INetworkCorePublic { export type LodestarComponents = { peerId: PeerId; + privateKey: PrivateKey; nodeInfo: NodeInfo; logger: ComponentLogger; events: TypedEventTarget; diff --git a/packages/beacon-node/src/network/libp2p/index.ts b/packages/beacon-node/src/network/libp2p/index.ts index a0d58033cf2f..7697dbcb49a7 100644 --- a/packages/beacon-node/src/network/libp2p/index.ts +++ b/packages/beacon-node/src/network/libp2p/index.ts @@ -1,8 +1,7 @@ -import {PeerId} from "@libp2p/interface"; +import {PrivateKey} from "@libp2p/interface"; import {Registry} from "prom-client"; import {ENR} from "@chainsafe/enr"; -// TODO: We should use this fork until https://github.com/libp2p/js-libp2p/pull/2387 -import {identify} from "@chainsafe/libp2p-identify"; +import {identify} from "@libp2p/identify"; import {bootstrap} from "@libp2p/bootstrap"; import {mdns} from "@libp2p/mdns"; import {createLibp2p} from "libp2p"; @@ -34,7 +33,7 @@ export async function getDiscv5Multiaddrs(bootEnrs: string[]): Promise } export async function createNodeJsLibp2p( - peerId: PeerId, + privateKey: PrivateKey, networkOpts: Partial = {}, nodeJsLibp2pOpts: NodeJsLibp2pOpts = {} ): Promise { @@ -65,12 +64,12 @@ export async function createNodeJsLibp2p( } return createLibp2p({ - peerId, + privateKey, addresses: { listen: localMultiaddrs, announce: [], }, - connectionEncryption: [noise()], + connectionEncrypters: [noise()], // Reject connections when the server's connection count gets high transports: [ tcp({ @@ -99,15 +98,14 @@ export async function createNodeJsLibp2p( maxParallelDials: 100, maxPeerAddrsToDial: 4, dialTimeout: 30_000, - - // Rely entirely on lodestar's peer manager to prune connections - //maxConnections: options.maxConnections, - // DOCS: There is no way to turn off autodial other than setting minConnections to 0 - minConnections: 0, // the maximum number of pending connections libp2p will accept before it starts rejecting incoming connections. // make it the same to backlog option above maxIncomingPendingConnections: 5, }, + // rely on lodestar's peer manager to ping peers + connectionMonitor: { + enabled: false, + }, datastore, services: { identify: identify({ @@ -118,6 +116,7 @@ export async function createNodeJsLibp2p( // and passing it here directly causes problems downstream, not to mention is slowwww components: (components: LodestarComponents) => ({ peerId: components.peerId, + privateKey: components.privateKey, nodeInfo: components.nodeInfo, logger: components.logger, events: components.events, diff --git a/packages/beacon-node/src/network/network.ts b/packages/beacon-node/src/network/network.ts index 1b3ccaaaf75a..73208f497d66 100644 --- a/packages/beacon-node/src/network/network.ts +++ b/packages/beacon-node/src/network/network.ts @@ -1,6 +1,7 @@ -import {PeerId} from "@libp2p/interface"; +import {PeerId, PrivateKey} from "@libp2p/interface"; import {PublishOpts} from "@chainsafe/libp2p-gossipsub/types"; import {PeerScoreStatsDump} from "@chainsafe/libp2p-gossipsub/score"; +import {peerIdFromPrivateKey} from "@libp2p/peer-id"; import {BeaconConfig} from "@lodestar/config"; import {sleep} from "@lodestar/utils"; import {LoggerNode} from "@lodestar/logger/node"; @@ -50,7 +51,7 @@ import {getActiveForks} from "./forks.js"; type NetworkModules = { opts: NetworkOptions; - peerId: PeerId; + privateKey: PrivateKey; config: BeaconConfig; logger: LoggerNode; chain: IBeaconChain; @@ -63,7 +64,7 @@ type NetworkModules = { export type NetworkInitModules = { opts: NetworkOptions; config: BeaconConfig; - peerId: PeerId; + privateKey: PrivateKey; peerStoreDir?: string; logger: LoggerNode; metrics: Metrics | null; @@ -104,7 +105,7 @@ export class Network implements INetwork { private regossipBlsChangesPromise: Promise | null = null; constructor(modules: NetworkModules) { - this.peerId = modules.peerId; + this.peerId = peerIdFromPrivateKey(modules.privateKey); this.config = modules.config; this.logger = modules.logger; this.chain = modules.chain; @@ -134,7 +135,7 @@ export class Network implements INetwork { chain, db, gossipHandlers, - peerId, + privateKey, peerStoreDir, getReqRespHandler, }: NetworkInitModules): Promise { @@ -159,7 +160,7 @@ export class Network implements INetwork { initialStatus, }, config, - peerId, + privateKey, logger, events, metrics, @@ -168,7 +169,7 @@ export class Network implements INetwork { : await NetworkCore.init({ opts, config, - peerId, + privateKey, peerStoreDir, logger, clock: chain.clock, @@ -185,11 +186,12 @@ export class Network implements INetwork { ); const multiaddresses = opts.localMultiaddrs?.join(","); + const peerId = peerIdFromPrivateKey(privateKey); logger.info(`PeerId ${peerIdToString(peerId)}, Multiaddrs ${multiaddresses}`); return new Network({ opts, - peerId, + privateKey, config, logger, chain, diff --git a/packages/beacon-node/src/network/peers/datastore.ts b/packages/beacon-node/src/network/peers/datastore.ts index 88a7a6f5f2d6..e0f2001c26ee 100644 --- a/packages/beacon-node/src/network/peers/datastore.ts +++ b/packages/beacon-node/src/network/peers/datastore.ts @@ -1,3 +1,4 @@ +import {AbortOptions} from "@libp2p/interface"; import {BaseDatastore} from "datastore-core"; import {LevelDatastore} from "datastore-level"; import {Key, KeyQuery, Query, Pair} from "interface-datastore"; @@ -57,7 +58,7 @@ export class Eth2PeerDataStore extends BaseDatastore { return this._dbDatastore.close(); } - async put(key: Key, val: Uint8Array): Promise { + async put(key: Key, val: Uint8Array, _options?: AbortOptions): Promise { return this._put(key, val, false); } diff --git a/packages/beacon-node/src/network/peers/discover.ts b/packages/beacon-node/src/network/peers/discover.ts index 9e06a39b4fb4..d3bfd2d2aab4 100644 --- a/packages/beacon-node/src/network/peers/discover.ts +++ b/packages/beacon-node/src/network/peers/discover.ts @@ -1,5 +1,5 @@ import {Multiaddr} from "@multiformats/multiaddr"; -import type {PeerId, PeerInfo} from "@libp2p/interface"; +import type {PeerId, PeerInfo, PrivateKey} from "@libp2p/interface"; import {ENR} from "@chainsafe/enr"; import {BeaconConfig} from "@lodestar/config"; import {pruneSetToMax, sleep} from "@lodestar/utils"; @@ -27,6 +27,7 @@ export type PeerDiscoveryOpts = { }; export type PeerDiscoveryModules = { + privateKey: PrivateKey; libp2p: Libp2p; peerRpcScores: IPeerRpcScoreStore; metrics: NetworkCoreMetrics | null; @@ -158,7 +159,7 @@ export class PeerDiscovery { static async init(modules: PeerDiscoveryModules, opts: PeerDiscoveryOpts): Promise { const discv5 = await Discv5Worker.init({ discv5: opts.discv5, - peerId: modules.libp2p.peerId, + privateKey: modules.privateKey, metrics: modules.metrics ?? undefined, logger: modules.logger, config: modules.config, @@ -323,8 +324,7 @@ export class PeerDiscovery { if (this.randomNodeQuery.code === QueryStatusCode.Active) { this.randomNodeQuery.count++; } - // async due to some crypto that's no longer necessary - const peerId = await enr.peerId(); + const peerId = enr.peerId; // tcp multiaddr is known to be be present, checked inside the worker const multiaddrTCP = enr.getLocationMultiaddr(ENRKey.tcp); if (!multiaddrTCP) { @@ -473,7 +473,7 @@ export class PeerDiscovery { /** Check if there is 1+ open connection with this peer */ private isPeerConnected(peerIdStr: PeerIdStr): boolean { const connections = getConnectionsMap(this.libp2p).get(peerIdStr); - return Boolean(connections && connections.some((connection) => connection.status === "open")); + return Boolean(connections && connections.value.some((connection) => connection.status === "open")); } } diff --git a/packages/beacon-node/src/network/peers/peerManager.ts b/packages/beacon-node/src/network/peers/peerManager.ts index 3971e2147707..7894b63e0be2 100644 --- a/packages/beacon-node/src/network/peers/peerManager.ts +++ b/packages/beacon-node/src/network/peers/peerManager.ts @@ -1,4 +1,4 @@ -import {Connection, PeerId} from "@libp2p/interface"; +import {Connection, PeerId, PrivateKey} from "@libp2p/interface"; import {BitArray} from "@chainsafe/ssz"; import {SYNC_COMMITTEE_SUBNET_COUNT} from "@lodestar/params"; import {BeaconConfig} from "@lodestar/config"; @@ -94,6 +94,7 @@ export interface IReqRespBeaconNodePeerManager { } export type PeerManagerModules = { + privateKey: PrivateKey; libp2p: Libp2p; logger: LoggerNode; metrics: NetworkCoreMetrics | null; @@ -685,7 +686,7 @@ export class PeerManager { } for (const connections of getConnectionsMap(this.libp2p).values()) { - const openCnx = connections.find((cnx) => cnx.status === "open"); + const openCnx = connections.value.find((cnx) => cnx.status === "open"); if (openCnx) { const direction = openCnx.direction; peersByDirection.set(direction, 1 + (peersByDirection.get(direction) ?? 0)); diff --git a/packages/beacon-node/src/network/peers/utils/getConnectedPeerIds.ts b/packages/beacon-node/src/network/peers/utils/getConnectedPeerIds.ts index 8542df605b06..d001c0d8892a 100644 --- a/packages/beacon-node/src/network/peers/utils/getConnectedPeerIds.ts +++ b/packages/beacon-node/src/network/peers/utils/getConnectedPeerIds.ts @@ -8,7 +8,7 @@ import {getConnectionsMap} from "../../util.js"; export function getConnectedPeerIds(libp2p: Libp2p): PeerId[] { const peerIds: PeerId[] = []; for (const connections of getConnectionsMap(libp2p).values()) { - const openConnection = connections.find(isConnectionOpen); + const openConnection = connections.value.find(isConnectionOpen); if (openConnection) { peerIds.push(openConnection.remotePeer); } @@ -21,7 +21,7 @@ export function getConnectedPeerIds(libp2p: Libp2p): PeerId[] { */ export function hasSomeConnectedPeer(libp2p: Libp2p): boolean { for (const connections of getConnectionsMap(libp2p).values()) { - if (connections.some(isConnectionOpen)) { + if (connections.value.some(isConnectionOpen)) { return true; } } diff --git a/packages/beacon-node/src/network/util.ts b/packages/beacon-node/src/network/util.ts index 835096afbfc8..2be4756fe693 100644 --- a/packages/beacon-node/src/network/util.ts +++ b/packages/beacon-node/src/network/util.ts @@ -14,12 +14,12 @@ export function prettyPrintPeerIdStr(id: PeerIdStr): string { * Get the connections map from a connection manager */ // Compat function for efficiency reasons -export function getConnectionsMap(libp2p: Libp2p): Map { +export function getConnectionsMap(libp2p: Libp2p): Map { return libp2p.services.components.connectionManager.getConnectionsMap()["map"]; } export function getConnection(libp2p: Libp2p, peerIdStr: string): Connection | undefined { - return getConnectionsMap(libp2p).get(peerIdStr)?.[0] ?? undefined; + return getConnectionsMap(libp2p).get(peerIdStr)?.value[0] ?? undefined; } // https://github.com/ChainSafe/js-libp2p-gossipsub/blob/3475242ed254f7647798ab7f36b21909f6cb61da/src/index.ts#L2009 diff --git a/packages/beacon-node/src/node/nodejs.ts b/packages/beacon-node/src/node/nodejs.ts index 088541a6b5d5..7b42f0daceb2 100644 --- a/packages/beacon-node/src/node/nodejs.ts +++ b/packages/beacon-node/src/node/nodejs.ts @@ -1,7 +1,7 @@ import {setMaxListeners} from "node:events"; import {Registry} from "prom-client"; -import {PeerId} from "@libp2p/interface"; +import {PrivateKey} from "@libp2p/interface"; import {BeaconConfig} from "@lodestar/config"; import {phase0} from "@lodestar/types"; import {sleep} from "@lodestar/utils"; @@ -49,7 +49,7 @@ export type BeaconNodeInitModules = { db: IBeaconDb; logger: LoggerNode; processShutdownCallback: ProcessShutdownCallback; - peerId: PeerId; + privateKey: PrivateKey; peerStoreDir?: string; anchorState: BeaconStateAllForks; wsCheckpoint?: phase0.Checkpoint; @@ -146,7 +146,7 @@ export class BeaconNode { db, logger, processShutdownCallback, - peerId, + privateKey, peerStoreDir, anchorState, wsCheckpoint, @@ -243,7 +243,7 @@ export class BeaconNode { metrics, chain, db, - peerId, + privateKey, peerStoreDir, getReqRespHandler: getReqRespHandlers({db, chain}), }); diff --git a/packages/beacon-node/src/util/peerId.ts b/packages/beacon-node/src/util/peerId.ts index 2afb9bed390e..c62f5416cdfe 100644 --- a/packages/beacon-node/src/util/peerId.ts +++ b/packages/beacon-node/src/util/peerId.ts @@ -12,5 +12,5 @@ export type PeerIdStr = string; export {peerIdFromString}; export function peerIdToString(peerId: PeerId): string { - return base58btc.encode(peerId.multihash.bytes).slice(1); + return base58btc.encode(peerId.toMultihash().bytes).slice(1); } diff --git a/packages/beacon-node/test/e2e/network/mdns.test.ts b/packages/beacon-node/test/e2e/network/mdns.test.ts index 4c49ca319a42..5c796df985b9 100644 --- a/packages/beacon-node/test/e2e/network/mdns.test.ts +++ b/packages/beacon-node/test/e2e/network/mdns.test.ts @@ -1,8 +1,8 @@ import {describe, it, afterEach, beforeEach, expect, vi} from "vitest"; -import {PeerId} from "@libp2p/interface"; +import {PrivateKey} from "@libp2p/interface"; import {multiaddr} from "@multiformats/multiaddr"; -import {createSecp256k1PeerId} from "@libp2p/peer-id-factory"; import {SignableENR} from "@chainsafe/enr"; +import {generateKeyPair} from "@libp2p/crypto/keys"; import {createBeaconConfig} from "@lodestar/config"; import {config} from "@lodestar/config/default"; import {ssz} from "@lodestar/types"; @@ -34,9 +34,9 @@ describe.skip("mdns", function () { }); afterEach(() => controller.abort()); - async function getOpts(peerId: PeerId): Promise { + async function getOpts(privateKey: PrivateKey): Promise { const bindAddrUdp = `/ip4/0.0.0.0/udp/${port++}`; - const enr = SignableENR.createFromPeerId(peerId); + const enr = SignableENR.createFromPrivateKey(privateKey); enr.setLocationMultiaddr(multiaddr(bindAddrUdp)); return { @@ -80,12 +80,12 @@ describe.skip("mdns", function () { const db = getMockedBeaconDb(); const gossipHandlers = {} as GossipHandlers; - const peerId = await createSecp256k1PeerId(); + const privateKey = await generateKeyPair("secp256k1"); const logger = testLogger(nodeName); - const opts = await getOpts(peerId); + const opts = await getOpts(privateKey); - const modules: Omit = { + const modules: Omit = { config, chain, db, @@ -96,7 +96,7 @@ describe.skip("mdns", function () { const network = await Network.init({ ...modules, - ...(await createNetworkModules(mu, peerId, {...opts, mdns: true})), + ...(await createNetworkModules(mu, privateKey, {...opts, mdns: true})), logger, }); diff --git a/packages/beacon-node/test/e2e/network/peers/peerManager.test.ts b/packages/beacon-node/test/e2e/network/peers/peerManager.test.ts index b690b9ab4988..e872a3882945 100644 --- a/packages/beacon-node/test/e2e/network/peers/peerManager.test.ts +++ b/packages/beacon-node/test/e2e/network/peers/peerManager.test.ts @@ -1,7 +1,7 @@ import {describe, it, afterEach, expect, vi} from "vitest"; import {Connection} from "@libp2p/interface"; -import {CustomEvent} from "@libp2p/interface"; import {BitArray} from "@chainsafe/ssz"; +import {generateKeyPair} from "@libp2p/crypto/keys"; import {config} from "@lodestar/config/default"; import {altair, phase0, ssz} from "@lodestar/types"; import {sleep} from "@lodestar/utils"; @@ -47,7 +47,8 @@ describe("network / peers / PeerManager", function () { const clock = new Clock({config: beaconConfig, genesisTime: 0, signal: controller.signal}); const status = ssz.phase0.Status.defaultValue(); const statusCache = new LocalStatusCache(status); - const libp2p = await createNode("/ip4/127.0.0.1/tcp/0"); + const privateKey = await generateKeyPair("secp256k1"); + const libp2p = await createNode("/ip4/127.0.0.1/tcp/0", privateKey); afterEachCallbacks.push(async () => { controller.abort(); @@ -68,6 +69,7 @@ describe("network / peers / PeerManager", function () { const peerManager = new PeerManager( { + privateKey, libp2p, reqResp, logger, @@ -158,7 +160,7 @@ describe("network / peers / PeerManager", function () { const {statusCache, libp2p, networkEventBus} = await mockModules(); // Simualate a peer connection, get() should return truthy - getConnectionsMap(libp2p).set(peerId1.toString(), [libp2pConnectionOutboud]); + getConnectionsMap(libp2p).set(peerId1.toString(), {key: peerId1, value: [libp2pConnectionOutboud]}); // Subscribe to `peerConnected` event, which must fire after checking peer relevance const peerConnectedPromise = waitForEvent(networkEventBus, NetworkEvent.peerConnected, 2000); @@ -177,7 +179,7 @@ describe("network / peers / PeerManager", function () { const {statusCache, libp2p, reqResp, peerManager, networkEventBus} = await mockModules(); // Simualate a peer connection, get() should return truthy - getConnectionsMap(libp2p).set(peerId1.toString(), [libp2pConnectionOutboud]); + getConnectionsMap(libp2p).set(peerId1.toString(), {key: peerId1, value: [libp2pConnectionOutboud]}); // Subscribe to `peerConnected` event, which must fire after checking peer relevance const peerConnectedPromise = waitForEvent(networkEventBus, NetworkEvent.peerConnected, 2000); @@ -190,7 +192,7 @@ describe("network / peers / PeerManager", function () { reqResp.sendMetadata.mockResolvedValue(remoteMetadata); // Simualate a peer connection, get() should return truthy - getConnectionsMap(libp2p).set(peerId1.toString(), [libp2pConnectionOutboud]); + getConnectionsMap(libp2p).set(peerId1.toString(), {key: peerId1, value: [libp2pConnectionOutboud]}); libp2p.services.components.events.dispatchEvent( new CustomEvent("connection:open", {detail: libp2pConnectionOutboud}) ); diff --git a/packages/beacon-node/test/e2e/network/reqrespEncode.test.ts b/packages/beacon-node/test/e2e/network/reqrespEncode.test.ts index d8d02c203dd9..123a4da420f0 100644 --- a/packages/beacon-node/test/e2e/network/reqrespEncode.test.ts +++ b/packages/beacon-node/test/e2e/network/reqrespEncode.test.ts @@ -40,7 +40,7 @@ describe("reqresp encoder", () => { const libp2p = await createLibp2p({ transports: [tcp()], streamMuxers: [mplex()], - connectionEncryption: [noise()], + connectionEncrypters: [noise()], addresses: { listen: [listen], }, diff --git a/packages/beacon-node/test/perf/network/noise/sendData.test.ts b/packages/beacon-node/test/perf/network/noise/sendData.test.ts index 35538a417adf..49e37980a598 100644 --- a/packages/beacon-node/test/perf/network/noise/sendData.test.ts +++ b/packages/beacon-node/test/perf/network/noise/sendData.test.ts @@ -1,11 +1,12 @@ import {itBench} from "@dapplion/benchmark"; import {duplexPair} from "it-pair/duplex"; -import {createSecp256k1PeerId} from "@libp2p/peer-id-factory"; import {pipe} from "it-pipe"; import drain from "it-drain"; import {defaultLogger} from "@libp2p/logger"; import {noise} from "@chainsafe/libp2p-noise"; import {Uint8ArrayList} from "uint8arraylist"; +import {generateKeyPair} from "@libp2p/crypto/keys"; +import {peerIdFromPrivateKey} from "@libp2p/peer-id"; describe("network / noise / sendData", () => { const numberOfMessages = 1000; @@ -24,15 +25,17 @@ describe("network / noise / sendData", () => { itBench({ id: `send data - ${numberOfMessages} ${messageLength}B messages`, beforeEach: async () => { - const peerA = await createSecp256k1PeerId(); - const peerB = await createSecp256k1PeerId(); - const noiseA = noise()({logger: defaultLogger()}); - const noiseB = noise()({logger: defaultLogger()}); + const privateKeyA = await generateKeyPair("secp256k1"); + const privateKeyB = await generateKeyPair("secp256k1"); + const peerA = peerIdFromPrivateKey(privateKeyA); + const peerB = peerIdFromPrivateKey(privateKeyB); + const noiseA = noise()({logger: defaultLogger(), privateKey: privateKeyA, peerId: peerA}); + const noiseB = noise()({logger: defaultLogger(), privateKey: privateKeyB, peerId: peerB}); const [inboundConnection, outboundConnection] = duplexPair(); const [outbound, inbound] = await Promise.all([ - noiseA.secureOutbound(peerA, outboundConnection, peerB), - noiseB.secureInbound(peerB, inboundConnection, peerA), + noiseA.secureOutbound(outboundConnection, {remotePeer: peerB}), + noiseB.secureInbound(inboundConnection, {remotePeer: peerA}), ]); return {connA: outbound.conn, connB: inbound.conn, data: new Uint8Array(messageLength)}; diff --git a/packages/beacon-node/test/perf/network/peers/util/prioritizePeers.test.ts b/packages/beacon-node/test/perf/network/peers/util/prioritizePeers.test.ts index a0d648a161ea..ecc30ebacef9 100644 --- a/packages/beacon-node/test/perf/network/peers/util/prioritizePeers.test.ts +++ b/packages/beacon-node/test/perf/network/peers/util/prioritizePeers.test.ts @@ -1,6 +1,7 @@ import {itBench} from "@dapplion/benchmark"; import {PeerId} from "@libp2p/interface"; -import {createSecp256k1PeerId} from "@libp2p/peer-id-factory"; +import {generateKeyPair} from "@libp2p/crypto/keys"; +import {peerIdFromPrivateKey} from "@libp2p/peer-id"; import {ATTESTATION_SUBNET_COUNT, SYNC_COMMITTEE_SUBNET_COUNT} from "@lodestar/params"; import {altair, phase0} from "@lodestar/types"; import {defaultNetworkOptions} from "../../../../../src/network/options.js"; @@ -12,7 +13,8 @@ describe("prioritizePeers", () => { before(async function () { for (let i = 0; i < defaultNetworkOptions.maxPeers; i++) { - const peer = await createSecp256k1PeerId(); + const pk = await generateKeyPair("secp256k1"); + const peer = peerIdFromPrivateKey(pk); peer.toString = () => `peer-${i}`; seedPeers.push({ id: peer, diff --git a/packages/beacon-node/test/unit/network/peers/priorization.test.ts b/packages/beacon-node/test/unit/network/peers/priorization.test.ts index cc9ef9b7d711..5b318a9b007f 100644 --- a/packages/beacon-node/test/unit/network/peers/priorization.test.ts +++ b/packages/beacon-node/test/unit/network/peers/priorization.test.ts @@ -1,7 +1,8 @@ import {PeerId} from "@libp2p/interface"; -import {createSecp256k1PeerId} from "@libp2p/peer-id-factory"; import {BitArray} from "@chainsafe/ssz"; import {describe, it, expect} from "vitest"; +import {generateKeyPair} from "@libp2p/crypto/keys"; +import {peerIdFromPrivateKey} from "@libp2p/peer-id"; import {ATTESTATION_SUBNET_COUNT} from "@lodestar/params"; import { ExcessPeerDisconnectReason, @@ -17,7 +18,8 @@ type Result = ReturnType; describe("network / peers / priorization", async () => { const peers: PeerId[] = []; for (let i = 0; i < 8; i++) { - const peer = await createSecp256k1PeerId(); + const pk = await generateKeyPair("secp256k1"); + const peer = peerIdFromPrivateKey(pk); peer.toString = () => `peer-${i}`; peers.push(peer); } @@ -266,7 +268,8 @@ describe("network / peers / priorization", async () => { describe("sortPeersToPrune", async function () { const peers: PeerId[] = []; for (let i = 0; i < 8; i++) { - const peer = await createSecp256k1PeerId(); + const pk = await generateKeyPair("secp256k1"); + const peer = peerIdFromPrivateKey(pk); peer.toString = () => `peer-${i}`; peers.push(peer); } diff --git a/packages/beacon-node/test/utils/network.ts b/packages/beacon-node/test/utils/network.ts index 56c831b269f5..71bb0bd255da 100644 --- a/packages/beacon-node/test/utils/network.ts +++ b/packages/beacon-node/test/utils/network.ts @@ -1,6 +1,6 @@ import {BitArray} from "@chainsafe/ssz"; -import {PeerId} from "@libp2p/interface"; -import {createSecp256k1PeerId} from "@libp2p/peer-id-factory"; +import {PrivateKey} from "@libp2p/interface"; +import {generateKeyPair} from "@libp2p/crypto/keys"; import {ATTESTATION_SUBNET_COUNT, SYNC_COMMITTEE_SUBNET_COUNT} from "@lodestar/params"; import {INetwork, Network, NetworkEvent} from "../../src/network/index.js"; import {Libp2p} from "../../src/network/interface.js"; @@ -8,18 +8,17 @@ import {createNodeJsLibp2p} from "../../src/network/libp2p/index.js"; import {NetworkOptions, defaultNetworkOptions} from "../../src/network/options.js"; import {PeerIdStr} from "../../src/util/peerId.js"; -export async function createNode(multiaddr: string, inPeerId?: PeerId): Promise { - const peerId = inPeerId || (await createSecp256k1PeerId()); - return createNodeJsLibp2p(peerId, {localMultiaddrs: [multiaddr]}); +export async function createNode(multiaddr: string, privateKey?: PrivateKey): Promise { + return createNodeJsLibp2p(privateKey ?? (await generateKeyPair("secp256k1")), {localMultiaddrs: [multiaddr]}); } export async function createNetworkModules( multiaddr: string, - peerId?: PeerId, + privateKey?: PrivateKey, opts?: Partial -): Promise<{opts: NetworkOptions; peerId: PeerId}> { +): Promise<{opts: NetworkOptions; privateKey: PrivateKey}> { return { - peerId: peerId ?? (await createSecp256k1PeerId()), + privateKey: privateKey ?? (await generateKeyPair("secp256k1")), opts: {...defaultNetworkOptions, ...opts, localMultiaddrs: [multiaddr]}, }; } diff --git a/packages/beacon-node/test/utils/networkWithMockDb.ts b/packages/beacon-node/test/utils/networkWithMockDb.ts index f8a4a6181d2f..b1c4293588d2 100644 --- a/packages/beacon-node/test/utils/networkWithMockDb.ts +++ b/packages/beacon-node/test/utils/networkWithMockDb.ts @@ -1,4 +1,4 @@ -import {createSecp256k1PeerId} from "@libp2p/peer-id-factory"; +import {generateKeyPair} from "@libp2p/crypto/keys"; import {ChainForkConfig, createBeaconConfig} from "@lodestar/config"; import {ssz} from "@lodestar/types"; import {BeaconChain} from "../../src/chain/chain.js"; @@ -70,7 +70,7 @@ export async function getNetworkForTest( } ); - const modules: Omit = { + const modules: Omit = { config: beaconConfig, chain, db, @@ -81,7 +81,7 @@ export async function getNetworkForTest( const network = await Network.init({ ...modules, - peerId: await createSecp256k1PeerId(), + privateKey: await generateKeyPair("secp256k1"), opts: { ...defaultNetworkOptions, maxPeers: 1, diff --git a/packages/beacon-node/test/utils/node/beacon.ts b/packages/beacon-node/test/utils/node/beacon.ts index 0163fa148102..746c2cde5fd4 100644 --- a/packages/beacon-node/test/utils/node/beacon.ts +++ b/packages/beacon-node/test/utils/node/beacon.ts @@ -1,7 +1,7 @@ import deepmerge from "deepmerge"; import tmp from "tmp"; -import {PeerId} from "@libp2p/interface"; -import {createSecp256k1PeerId} from "@libp2p/peer-id-factory"; +import {PrivateKey} from "@libp2p/interface"; +import {generateKeyPair} from "@libp2p/crypto/keys"; import {config as minimalConfig} from "@lodestar/config/default"; import {createBeaconConfig, createChainForkConfig, ChainConfig} from "@lodestar/config"; import {RecursivePartial} from "@lodestar/utils"; @@ -26,16 +26,16 @@ export async function getDevBeaconNode( options?: RecursivePartial; validatorCount?: number; logger?: LoggerNode; - peerId?: PeerId; + privateKey?: PrivateKey; peerStoreDir?: string; anchorState?: BeaconStateAllForks; wsCheckpoint?: phase0.Checkpoint; } & InteropStateOpts ): Promise { const {params, validatorCount = 8, peerStoreDir} = opts; - let {options = {}, logger, peerId} = opts; + let {options = {}, logger, privateKey} = opts; - if (!peerId) peerId = await createSecp256k1PeerId(); + if (!privateKey) privateKey = await generateKeyPair("secp256k1"); const tmpDir = tmp.dirSync({unsafeCleanup: true}); const config = createChainForkConfig({...minimalConfig, ...params}); logger = logger ?? testLogger(); @@ -93,7 +93,7 @@ export async function getDevBeaconNode( db, logger, processShutdownCallback: () => {}, - peerId, + privateKey, peerStoreDir, anchorState, wsCheckpoint: opts.wsCheckpoint, diff --git a/packages/beacon-node/test/utils/peer.ts b/packages/beacon-node/test/utils/peer.ts index 8bd5c6c67be8..aeec92bf994e 100644 --- a/packages/beacon-node/test/utils/peer.ts +++ b/packages/beacon-node/test/utils/peer.ts @@ -1,6 +1,6 @@ import {PeerId} from "@libp2p/interface"; -import {createSecp256k1PeerId} from "@libp2p/peer-id-factory"; -import {peerIdFromBytes} from "@libp2p/peer-id"; +import {peerIdFromPrivateKey, peerIdFromPublicKey} from "@libp2p/peer-id"; +import {generateKeyPair, publicKeyFromProtobuf} from "@libp2p/crypto/keys"; import {peerIdToString} from "../../src/util/peerId.js"; /** @@ -9,11 +9,11 @@ import {peerIdToString} from "../../src/util/peerId.js"; */ export function getValidPeerId(): PeerId { const id = Buffer.from("002508021221039481269fe831799b1a0f1d521c1395b4831514859e4559c44d155eae46f03819", "hex"); - return peerIdFromBytes(id); + return peerIdFromPublicKey(publicKeyFromProtobuf(id)); } export async function getRandPeerIdStr(): Promise { - return peerIdToString(await createSecp256k1PeerId()); + return peerIdToString(peerIdFromPrivateKey(await generateKeyPair("secp256k1"))); } export const validPeerIdStr = peerIdToString(getValidPeerId()); diff --git a/packages/cli/package.json b/packages/cli/package.json index b4fc206e5a44..67d0dfd332cc 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -54,14 +54,14 @@ "@chainsafe/bls-keygen": "^0.4.0", "@chainsafe/bls-keystore": "^3.1.0", "@chainsafe/blst": "^2.0.3", - "@chainsafe/discv5": "^9.0.0", - "@chainsafe/enr": "^3.0.0", + "@chainsafe/discv5": "^10.0.1", + "@chainsafe/enr": "^4.0.1", "@chainsafe/persistent-merkle-tree": "^0.8.0", "@chainsafe/ssz": "^0.17.1", "@chainsafe/threads": "^1.11.1", - "@libp2p/crypto": "^4.1.0", - "@libp2p/peer-id": "^4.1.0", - "@libp2p/peer-id-factory": "^4.1.0", + "@libp2p/crypto": "^5.0.4", + "@libp2p/interface": "^2.1.2", + "@libp2p/peer-id": "^5.0.4", "@lodestar/api": "^1.22.0", "@lodestar/beacon-node": "^1.22.0", "@lodestar/config": "^1.22.0", diff --git a/packages/cli/src/cmds/beacon/handler.ts b/packages/cli/src/cmds/beacon/handler.ts index ea424e04824a..2a0238fede20 100644 --- a/packages/cli/src/cmds/beacon/handler.ts +++ b/packages/cli/src/cmds/beacon/handler.ts @@ -24,7 +24,7 @@ import {LogArgs} from "../../options/logOptions.js"; import {BeaconArgs} from "./options.js"; import {getBeaconPaths} from "./paths.js"; import {initBeaconState} from "./initBeaconState.js"; -import {initPeerIdAndEnr} from "./initPeerIdAndEnr.js"; +import {initPrivateKeyAndEnr} from "./initPeerIdAndEnr.js"; const DEFAULT_RETENTION_SSZ_OBJECTS_HOURS = 15 * 24; const HOURS_TO_MS = 3600 * 1000; @@ -34,7 +34,7 @@ const EIGHT_GB = 8 * 1024 * 1024 * 1024; * Runs a beacon node. */ export async function beaconHandler(args: BeaconArgs & GlobalArgs): Promise { - const {config, options, beaconPaths, network, version, commit, peerId, logger} = await beaconHandlerInit(args); + const {config, options, beaconPaths, network, version, commit, privateKey, logger} = await beaconHandlerInit(args); const heapSizeLimit = getHeapStatistics().heap_size_limit; if (heapSizeLimit < EIGHT_GB) { @@ -80,7 +80,7 @@ export async function beaconHandler(args: BeaconArgs & GlobalArgs): Promise { +): Promise<{privateKey: PrivateKey; enr: SignableENR}> { const {persistNetworkIdentity} = args; - const newPeerIdAndENR = async (): Promise<{peerId: PeerId; enr: SignableENR}> => { - const peerId = await createSecp256k1PeerId(); - const enr = SignableENR.createV4(createPrivateKeyFromPeerId(peerId).privateKey); - return {peerId, enr}; + const newPrivateKeyAndENR = async (): Promise<{privateKey: PrivateKey; enr: SignableENR}> => { + const privateKey = await generateKeyPair("secp256k1"); + const enr = SignableENR.createFromPrivateKey(privateKey); + return {privateKey, enr}; }; - const readPersistedPeerIdAndENR = async ( + const readPersistedPrivateKeyAndENR = async ( peerIdFile: string, enrFile: string - ): Promise<{peerId: PeerId; enr: SignableENR; newEnr: boolean}> => { - let peerId: PeerId; + ): Promise<{privateKey: PrivateKey; enr: SignableENR; newEnr: boolean}> => { + let privateKey: PrivateKey; let enr: SignableENR; // attempt to read stored peer id try { - peerId = await readPeerId(peerIdFile); + privateKey = readPrivateKey(peerIdFile); } catch (_e) { logger.warn("Unable to read peerIdFile, creating a new peer id"); - return {...(await newPeerIdAndENR()), newEnr: true}; + return {...(await newPrivateKeyAndENR()), newEnr: true}; } // attempt to read stored enr try { - enr = SignableENR.decodeTxt(fs.readFileSync(enrFile, "utf-8"), createPrivateKeyFromPeerId(peerId).privateKey); + enr = SignableENR.decodeTxt(fs.readFileSync(enrFile, "utf-8"), privateKey.raw); } catch (_e) { logger.warn("Unable to decode stored local ENR, creating a new ENR"); - enr = SignableENR.createV4(createPrivateKeyFromPeerId(peerId).privateKey); - return {peerId, enr, newEnr: true}; + enr = SignableENR.createFromPrivateKey(privateKey); + return {privateKey, enr, newEnr: true}; } // check stored peer id against stored enr - if (!peerId.equals(await enr.peerId())) { + if (!privateKey.equals(enr.peerId)) { logger.warn("Stored local ENR doesn't match peerIdFile, creating a new ENR"); - enr = SignableENR.createV4(createPrivateKeyFromPeerId(peerId).privateKey); - return {peerId, enr, newEnr: true}; + enr = SignableENR.createFromPrivateKey(privateKey); + return {privateKey, enr, newEnr: true}; } - return {peerId, enr, newEnr: false}; + return {privateKey, enr, newEnr: false}; }; if (persistNetworkIdentity) { const enrFile = path.join(beaconDir, "enr"); const peerIdFile = path.join(beaconDir, "peer-id.json"); - const {peerId, enr, newEnr} = await readPersistedPeerIdAndENR(peerIdFile, enrFile); + const {privateKey, enr, newEnr} = await readPersistedPrivateKeyAndENR(peerIdFile, enrFile); overwriteEnrWithCliArgs(enr, args, logger, {newEnr, bootnode}); // Re-persist peer-id and enr - writeFile600Perm(peerIdFile, exportToJSON(peerId)); + writeFile600Perm(peerIdFile, exportToJSON(privateKey)); writeFile600Perm(enrFile, enr.encodeTxt()); - return {peerId, enr}; + return {privateKey, enr}; } else { - const {peerId, enr} = await newPeerIdAndENR(); + const {privateKey, enr} = await newPrivateKeyAndENR(); overwriteEnrWithCliArgs(enr, args, logger, {newEnr: true, bootnode}); - return {peerId, enr}; + return {privateKey, enr}; } } diff --git a/packages/cli/src/cmds/bootnode/handler.ts b/packages/cli/src/cmds/bootnode/handler.ts index 8a262d8f12b7..9c093eed1272 100644 --- a/packages/cli/src/cmds/bootnode/handler.ts +++ b/packages/cli/src/cmds/bootnode/handler.ts @@ -10,7 +10,7 @@ import {getBeaconConfigFromArgs} from "../../config/index.js"; import {getNetworkBootnodes, isKnownNetworkName, readBootnodes} from "../../networks/index.js"; import {onGracefulShutdown, mkdir, writeFile600Perm} from "../../util/index.js"; import {getVersionData} from "../../util/version.js"; -import {initPeerIdAndEnr} from "../beacon/initPeerIdAndEnr.js"; +import {initPrivateKeyAndEnr} from "../beacon/initPeerIdAndEnr.js"; import {parseArgs as parseMetricsArgs} from "../../options/beaconNodeOptions/metrics.js"; import {parseArgs as parseNetworkArgs} from "../../options/beaconNodeOptions/network.js"; import {getBeaconPaths} from "../beacon/paths.js"; @@ -22,7 +22,7 @@ import {BootnodeArgs} from "./options.js"; * Runs a bootnode. */ export async function bootnodeHandler(args: BootnodeArgs & GlobalArgs): Promise { - const {discv5Args, metricsArgs, bootnodeDir, network, version, commit, peerId, enr, logger} = + const {discv5Args, metricsArgs, bootnodeDir, network, version, commit, privateKey, enr, logger} = await bootnodeHandlerInit(args); const abortController = new AbortController(); @@ -34,7 +34,7 @@ export async function bootnodeHandler(args: BootnodeArgs & GlobalArgs): Promise< ip4: enr.getLocationMultiaddr("udp4")?.toString(), ip6: enr.getLocationMultiaddr("udp6")?.toString(), }); - logger.info("Identity", {peerId: peerId.toString(), nodeId: enr.nodeId}); + logger.info("Identity", {peerId: enr.peerId.toString(), nodeId: enr.nodeId}); logger.info("ENR", {enr: enr.encodeTxt()}); // bootnode setup @@ -53,7 +53,7 @@ export async function bootnodeHandler(args: BootnodeArgs & GlobalArgs): Promise< const discv5 = Discv5.create({ enr, - peerId, + privateKey, bindAddrs: { ip4: (bindAddrs.ip4 ? multiaddr(bindAddrs.ip4) : undefined) as Multiaddr, ip6: bindAddrs.ip6 ? multiaddr(bindAddrs.ip6) : undefined, @@ -68,7 +68,7 @@ export async function bootnodeHandler(args: BootnodeArgs & GlobalArgs): Promise< logger.info("Adding bootnode", { ip4: bootEnr.getLocationMultiaddr("udp4")?.toString(), ip6: bootEnr.getLocationMultiaddr("udp6")?.toString(), - peerId: (await bootEnr.peerId()).toString(), + peerId: bootEnr.peerId.toString(), nodeId: enr.nodeId, }); discv5.addEnr(bootEnr); @@ -180,7 +180,7 @@ export async function bootnodeHandlerInit(args: BootnodeArgs & GlobalArgs) { ); const logger = initLogger(args, beaconPaths.dataDir, config, "bootnode.log"); - const {peerId, enr} = await initPeerIdAndEnr(args as unknown as BeaconArgs, bootnodeDir, logger, true); + const {privateKey, enr} = await initPrivateKeyAndEnr(args as unknown as BeaconArgs, bootnodeDir, logger, true); - return {discv5Args, metricsArgs, bootnodeDir, network, version, commit, peerId, enr, logger}; + return {discv5Args, metricsArgs, bootnodeDir, network, version, commit, privateKey, enr, logger}; } diff --git a/packages/cli/src/config/peerId.ts b/packages/cli/src/config/peerId.ts index d4906c716ba7..91390696c2f4 100644 --- a/packages/cli/src/config/peerId.ts +++ b/packages/cli/src/config/peerId.ts @@ -1,7 +1,11 @@ -import type {PeerId} from "@libp2p/interface"; -import {peerIdFromBytes} from "@libp2p/peer-id"; -import {createFromPrivKey, createFromPubKey} from "@libp2p/peer-id-factory"; -import {unmarshalPrivateKey, unmarshalPublicKey} from "@libp2p/crypto/keys"; +import type {PrivateKey} from "@libp2p/interface"; +import {peerIdFromPrivateKey, peerIdFromString} from "@libp2p/peer-id"; +import { + privateKeyFromProtobuf, + privateKeyToProtobuf, + publicKeyFromProtobuf, + publicKeyToProtobuf, +} from "@libp2p/crypto/keys"; import {fromString as uint8ArrayFromString} from "uint8arrays/from-string"; import {toString as uint8ArrayToString} from "uint8arrays/to-string"; import {writeFile600Perm, readFile} from "../util/index.js"; @@ -9,45 +13,38 @@ import {writeFile600Perm, readFile} from "../util/index.js"; // Peer id to / from JSON taken from peer-id-factory // See https://github.com/libp2p/js-libp2p-peer-id/pull/9 for more details -async function createFromParts(multihash: Uint8Array, privKey?: Uint8Array, pubKey?: Uint8Array): Promise { - if (privKey != null) { - const key = await unmarshalPrivateKey(privKey); +// after libp2p 2.0, PeerId no longer contains a private key +// but we retain a semi-backwards-compatible on-disk format +// Note: all properties are required +export type PeerIdJSON = {id: string; pubKey: string; privKey: string}; - return createFromPrivKey(key); - } else if (pubKey != null) { - const key = unmarshalPublicKey(pubKey); - - return createFromPubKey(key); - } - - return peerIdFromBytes(multihash); -} - -export type PeerIdJSON = {id: string; pubKey?: string; privKey?: string}; - -export function exportToJSON(peerId: PeerId, excludePrivateKey?: boolean): PeerIdJSON { +export function exportToJSON(privateKey: PrivateKey): PeerIdJSON { + const publicKey = privateKey.publicKey; + const peerId = peerIdFromPrivateKey(privateKey); return { - id: uint8ArrayToString(peerId.toBytes(), "base58btc"), - pubKey: peerId.publicKey != null ? uint8ArrayToString(peerId.publicKey, "base64pad") : undefined, - privKey: - excludePrivateKey === true || peerId.privateKey == null - ? undefined - : uint8ArrayToString(peerId.privateKey, "base64pad"), + id: peerId.toString(), + pubKey: uint8ArrayToString(publicKeyToProtobuf(publicKey), "base64pad"), + privKey: uint8ArrayToString(privateKeyToProtobuf(privateKey), "base64pad"), }; } -export async function createFromJSON(obj: PeerIdJSON): Promise { - return createFromParts( - uint8ArrayFromString(obj.id, "base58btc"), - obj.privKey != null ? uint8ArrayFromString(obj.privKey, "base64pad") : undefined, - obj.pubKey != null ? uint8ArrayFromString(obj.pubKey, "base64pad") : undefined - ); +export function createFromJSON(obj: PeerIdJSON): PrivateKey { + const privateKey = privateKeyFromProtobuf(uint8ArrayFromString(obj.privKey, "base64pad")); + const publicKey = publicKeyFromProtobuf(uint8ArrayFromString(obj.pubKey, "base64pad")); + const peerId = peerIdFromString(obj.id); + if (!publicKey.equals(privateKey.publicKey)) { + throw new Error("Public key does not match private key"); + } + if (!peerId.equals(peerIdFromPrivateKey(privateKey))) { + throw new Error("Peer ID does not match private key"); + } + return privateKey; } -export function writePeerId(filepath: string, peerId: PeerId): void { - writeFile600Perm(filepath, exportToJSON(peerId)); +export function writePrivateKey(filepath: string, privateKey: PrivateKey): void { + writeFile600Perm(filepath, exportToJSON(privateKey)); } -export async function readPeerId(filepath: string): Promise { +export function readPrivateKey(filepath: string): PrivateKey { return createFromJSON(readFile(filepath)); } diff --git a/packages/cli/test/unit/cmds/beacon.test.ts b/packages/cli/test/unit/cmds/beacon.test.ts index 6e7b7f389a29..74cde026b1ad 100644 --- a/packages/cli/test/unit/cmds/beacon.test.ts +++ b/packages/cli/test/unit/cmds/beacon.test.ts @@ -1,15 +1,16 @@ import path from "node:path"; import fs from "node:fs"; import {describe, it, expect} from "vitest"; -import {createFromJSON, createSecp256k1PeerId} from "@libp2p/peer-id-factory"; import {multiaddr} from "@multiformats/multiaddr"; -import {createPrivateKeyFromPeerId, ENR, SignableENR} from "@chainsafe/enr"; +import {ENR, SignableENR} from "@chainsafe/enr"; +import {generateKeyPair} from "@libp2p/crypto/keys"; +import {peerIdFromPrivateKey} from "@libp2p/peer-id"; import {chainConfig} from "@lodestar/config/default"; import {chainConfigToJson} from "@lodestar/config"; import {LogLevel} from "@lodestar/utils"; -import {exportToJSON} from "../../../src/config/peerId.js"; +import {createFromJSON, exportToJSON} from "../../../src/config/peerId.js"; import {beaconHandlerInit} from "../../../src/cmds/beacon/handler.js"; -import {initPeerIdAndEnr, isLocalMultiAddr} from "../../../src/cmds/beacon/initPeerIdAndEnr.js"; +import {initPrivateKeyAndEnr, isLocalMultiAddr} from "../../../src/cmds/beacon/initPeerIdAndEnr.js"; import {BeaconArgs} from "../../../src/cmds/beacon/options.js"; import {GlobalArgs} from "../../../src/options/globalOptions.js"; import {testFilesDir, testLogger} from "../../utils.js"; @@ -55,26 +56,26 @@ describe("cmds / beacon / args handler", () => { }); it("Create different PeerId every run", async () => { - const {peerId: peerId1} = await runBeaconHandlerInit({}); - const {peerId: peerId2} = await runBeaconHandlerInit({}); + const {privateKey: pk1} = await runBeaconHandlerInit({}); + const {privateKey: pk2} = await runBeaconHandlerInit({}); - expect(peerId1.toString()).not.toBe(peerId2.toString()); + expect(pk1.equals(pk2)).toBe(false); }); it("Re-use existing peer", async () => { - const prevPeerId = await createSecp256k1PeerId(); + const prevPk = await generateKeyPair("secp256k1"); const peerIdFile = path.join(testFilesDir, "peer-id.json"); - fs.writeFileSync(peerIdFile, JSON.stringify(exportToJSON(prevPeerId))); - const enr = SignableENR.createV4(createPrivateKeyFromPeerId(prevPeerId).privateKey); + fs.writeFileSync(peerIdFile, JSON.stringify(exportToJSON(prevPk))); + const enr = SignableENR.createFromPrivateKey(prevPk); const enrFilePath = path.join(testFilesDir, "enr"); fs.writeFileSync(enrFilePath, enr.encodeTxt()); - const {peerId} = await runBeaconHandlerInit({ + const {privateKey} = await runBeaconHandlerInit({ persistNetworkIdentity: true, }); - expect(peerId.toString()).toBe(prevPeerId.toString()); + expect(privateKey.equals(prevPk)).toBe(true); }); it("Set known deposit contract", async () => { @@ -117,48 +118,48 @@ describe("Test isLocalMultiAddr", () => { describe("initPeerIdAndEnr", () => { it("should not reuse peer id, persistNetworkIdentity=false", async () => { - const {peerId: peerId1} = await initPeerIdAndEnr( + const {privateKey: pk1} = await initPrivateKeyAndEnr( {persistNetworkIdentity: false} as BeaconArgs, testFilesDir, testLogger() ); - const {peerId: peerId2} = await initPeerIdAndEnr( + const {privateKey: pk2} = await initPrivateKeyAndEnr( {persistNetworkIdentity: false} as BeaconArgs, testFilesDir, testLogger() ); - expect(peerId1.toString()).not.toBe(peerId2.toString()); + expect(pk1.equals(pk2)).toBe(false); }); it("should reuse peer id, persistNetworkIdentity=true", async () => { - const {peerId: peerId1} = await initPeerIdAndEnr( + const {privateKey: pk1} = await initPrivateKeyAndEnr( {persistNetworkIdentity: true} as BeaconArgs, testFilesDir, testLogger() ); - const {peerId: peerId2} = await initPeerIdAndEnr( + const {privateKey: pk2} = await initPrivateKeyAndEnr( {persistNetworkIdentity: true} as BeaconArgs, testFilesDir, testLogger() ); - expect(peerId1.toString()).toBe(peerId2.toString()); + expect(pk1.equals(pk2)).toBe(true); }); it("should overwrite invalid peer id", async () => { const peerIdFile = path.join(testFilesDir, "peer-id.json"); - const peerId1Str = "wrong peer id file content"; - fs.writeFileSync(peerIdFile, peerId1Str); - const {peerId: peerId2} = await initPeerIdAndEnr( + const pk1Str = "wrong peer id file content"; + fs.writeFileSync(peerIdFile, pk1Str); + const {privateKey: pk2} = await initPrivateKeyAndEnr( {persistNetworkIdentity: true} as BeaconArgs, testFilesDir, testLogger() ); - const filePeerId = await createFromJSON(JSON.parse(fs.readFileSync(peerIdFile, "utf-8"))); + const filePk = createFromJSON(JSON.parse(fs.readFileSync(peerIdFile, "utf-8"))); - expect(peerId1Str).not.toBe(peerId2.toString()); - expect(filePeerId.toString()).toBe(peerId2.toString()); + expect(pk1Str).not.toBe(peerIdFromPrivateKey(pk2).toString()); + expect(filePk.equals(pk2)).toBe(true); }); it("should overwrite invalid enr", async () => { @@ -166,7 +167,7 @@ describe("initPeerIdAndEnr", () => { const invalidEnr = "wrong enr file content"; fs.writeFileSync(enrFilePath, invalidEnr); - await initPeerIdAndEnr({persistNetworkIdentity: true} as BeaconArgs, testFilesDir, testLogger()); + await initPrivateKeyAndEnr({persistNetworkIdentity: true} as BeaconArgs, testFilesDir, testLogger()); const validEnr = fs.readFileSync(enrFilePath, "utf-8"); @@ -174,13 +175,13 @@ describe("initPeerIdAndEnr", () => { }); it("should overwrite enr that doesn't match peer id", async () => { - const otherPeerId = await createSecp256k1PeerId(); - const otherEnr = SignableENR.createFromPeerId(otherPeerId); + const otherPk = await generateKeyPair("secp256k1"); + const otherEnr = SignableENR.createFromPrivateKey(otherPk); const enrFilePath = path.join(testFilesDir, "enr"); const otherEnrStr = otherEnr.encodeTxt(); fs.writeFileSync(enrFilePath, otherEnrStr); - const {enr} = await initPeerIdAndEnr({persistNetworkIdentity: true} as BeaconArgs, testFilesDir, testLogger()); + const {enr} = await initPrivateKeyAndEnr({persistNetworkIdentity: true} as BeaconArgs, testFilesDir, testLogger()); expect(enr.nodeId).not.toBe(otherEnr); }); diff --git a/packages/cli/test/unit/cmds/initPeerIdAndEnr.test.ts b/packages/cli/test/unit/cmds/initPeerIdAndEnr.test.ts index a207e0c0f59d..3dd9b48c298d 100644 --- a/packages/cli/test/unit/cmds/initPeerIdAndEnr.test.ts +++ b/packages/cli/test/unit/cmds/initPeerIdAndEnr.test.ts @@ -1,7 +1,8 @@ import fs from "node:fs"; import {describe, it, expect, beforeEach, afterEach} from "vitest"; import tmp from "tmp"; -import {initPeerIdAndEnr} from "../../../src/cmds/beacon/initPeerIdAndEnr.js"; +import {peerIdFromPrivateKey} from "@libp2p/peer-id"; +import {initPrivateKeyAndEnr} from "../../../src/cmds/beacon/initPeerIdAndEnr.js"; import {BeaconArgs} from "../../../src/cmds/beacon/options.js"; import {testLogger} from "../../utils.js"; @@ -17,35 +18,35 @@ describe("initPeerIdAndEnr", () => { }); it("first time should create a new enr and peer id", async () => { - const {enr, peerId} = await initPeerIdAndEnr( + const {enr, privateKey} = await initPrivateKeyAndEnr( {persistNetworkIdentity: true} as unknown as BeaconArgs, tmpDir.name, testLogger(), true ); // "enr peer id doesn't equal the returned peer id" - expect((await enr.peerId()).toString()).toBe(peerId.toString()); + expect(enr.peerId.toString()).toBe(peerIdFromPrivateKey(privateKey).toString()); expect(enr.seq).toBe(BigInt(1)); expect(enr.tcp).toBeUndefined(); expect(enr.tcp6).toBeUndefined(); }); it("second time should use ths existing enr and peer id", async () => { - const run1 = await initPeerIdAndEnr( + const run1 = await initPrivateKeyAndEnr( {persistNetworkIdentity: true} as unknown as BeaconArgs, tmpDir.name, testLogger(), true ); - const run2 = await initPeerIdAndEnr( + const run2 = await initPrivateKeyAndEnr( {persistNetworkIdentity: true} as unknown as BeaconArgs, tmpDir.name, testLogger(), true ); - expect(run1.peerId.toString()).toBe(run2.peerId.toString()); + expect(run1.privateKey.equals(run2.privateKey)).toBe(true); expect(run1.enr.encodeTxt()).toBe(run2.enr.encodeTxt()); }); }); diff --git a/packages/cli/test/unit/config/peerId.test.ts b/packages/cli/test/unit/config/peerId.test.ts index c0cdc8cff1a9..120a5e931749 100644 --- a/packages/cli/test/unit/config/peerId.test.ts +++ b/packages/cli/test/unit/config/peerId.test.ts @@ -1,16 +1,16 @@ import {describe, it, expect} from "vitest"; -import {createSecp256k1PeerId} from "@libp2p/peer-id-factory"; +import {generateKeyPair} from "@libp2p/crypto/keys"; import {getTestdirPath} from "../../utils.js"; -import {writePeerId, readPeerId} from "../../../src/config/index.js"; +import {writePrivateKey, readPrivateKey} from "../../../src/config/index.js"; describe("config / peerId", () => { const peerIdFilepath = getTestdirPath("./test-peer-id.json"); it("create, write and read PeerId", async () => { - const peerId = await createSecp256k1PeerId(); - writePeerId(peerIdFilepath, peerId); - const peerIdRead = await readPeerId(peerIdFilepath); + const privateKey = await generateKeyPair("secp256k1"); + writePrivateKey(peerIdFilepath, privateKey); + const pkRead = readPrivateKey(peerIdFilepath); - expect(peerIdRead.toString()).toBe(peerId.toString()); + expect(pkRead.toString()).toBe(privateKey.toString()); }); }); diff --git a/packages/reqresp/package.json b/packages/reqresp/package.json index 9bd9775ba2c0..d6d4fbd2b5c2 100644 --- a/packages/reqresp/package.json +++ b/packages/reqresp/package.json @@ -53,7 +53,7 @@ }, "dependencies": { "@chainsafe/fast-crc32c": "^4.1.1", - "@libp2p/interface": "^1.3.0", + "@libp2p/interface": "^2.1.2", "@lodestar/config": "^1.22.0", "@lodestar/params": "^1.22.0", "@lodestar/utils": "^1.22.0", @@ -67,10 +67,10 @@ "devDependencies": { "@lodestar/logger": "^1.22.0", "@lodestar/types": "^1.22.0", - "libp2p": "1.4.3" + "libp2p": "2.1.7" }, "peerDependencies": { - "libp2p": "~1.4.3" + "libp2p": "~2.1.7" }, "keywords": [ "ethereum", diff --git a/packages/reqresp/test/utils/peer.ts b/packages/reqresp/test/utils/peer.ts index 43edaefbafdd..cbc21eca370f 100644 --- a/packages/reqresp/test/utils/peer.ts +++ b/packages/reqresp/test/utils/peer.ts @@ -1,5 +1,6 @@ import {PeerId} from "@libp2p/interface"; -import {peerIdFromBytes} from "@libp2p/peer-id"; +import {peerIdFromPublicKey} from "@libp2p/peer-id"; +import {publicKeyFromProtobuf} from "@libp2p/crypto/keys"; /** * Returns a valid PeerId with opts `bits: 256, keyType: "secp256k1"` @@ -7,5 +8,5 @@ import {peerIdFromBytes} from "@libp2p/peer-id"; */ export function getValidPeerId(): PeerId { const id = Buffer.from("002508021221039481269fe831799b1a0f1d521c1395b4831514859e4559c44d155eae46f03819", "hex"); - return peerIdFromBytes(id); + return peerIdFromPublicKey(publicKeyFromProtobuf(id)); } diff --git a/yarn.lock b/yarn.lock index 3907e9f4e441..32c923a514e9 100644 --- a/yarn.lock +++ b/yarn.lock @@ -456,14 +456,14 @@ "@chainsafe/blst-linux-x64-musl" "2.0.3" "@chainsafe/blst-win32-x64-msvc" "2.0.3" -"@chainsafe/discv5@^9.0.0": - version "9.0.0" - resolved "https://registry.yarnpkg.com/@chainsafe/discv5/-/discv5-9.0.0.tgz#05d4d9d671894b41f0fafa8f32c48ae3ed761bd1" - integrity sha512-7s23ziqsHG/KRgkX79qB/w8kuqPrY8aJaF2aRDy9cScJocJ6ZaOnXhEc8Ku1AcSyrvfGp+tY8R4rDABcxRY+Wg== +"@chainsafe/discv5@^10.0.1": + version "10.0.1" + resolved "https://registry.yarnpkg.com/@chainsafe/discv5/-/discv5-10.0.1.tgz#1aefe3826b19b1f66e76c737a7a49ae7c77d7664" + integrity sha512-YpvqOMOn/sQMHU97lonvRnbtLZQW1Vqjcwtofd0hOJ6ohtxn+Ne7Cos8qCOFkhRHirGG6irHej4akh/BlBscSA== dependencies: - "@chainsafe/enr" "^3.0.0" - "@libp2p/crypto" "^4.0.1" - "@libp2p/interface" "^1.1.1" + "@chainsafe/enr" "^4.0.1" + "@libp2p/crypto" "^5.0.1" + "@libp2p/interface" "^2.0.1" "@multiformats/multiaddr" "^12.1.10" bcrypto "^5.4.0" bigint-buffer "^1.1.5" @@ -472,17 +472,17 @@ rlp "^2.2.6" strict-event-emitter-types "^2.0.0" -"@chainsafe/enr@^3.0.0": - version "3.0.0" - resolved "https://registry.yarnpkg.com/@chainsafe/enr/-/enr-3.0.0.tgz#71c83d4381d703bbcd19245ce733eb7c779a30ed" - integrity sha512-D8M8sqnvOim0jWlTdr2IhLyVe0GSUgpk+QO6UaLY4pQVdW1myJP8REp7xdbv1193ULVEkJQFTJAZexTOtmu3jw== +"@chainsafe/enr@^4.0.1": + version "4.0.1" + resolved "https://registry.yarnpkg.com/@chainsafe/enr/-/enr-4.0.1.tgz#9c9ad8cd84aedc1242d7e7ac99d670c0f8ee3c0d" + integrity sha512-eYGZC6Wq9UNtD5AZLO21w9DctRkEAhMZ/kIa+eggT5lVRcVSI06O7PmSXOSRW6z+Td/9MQKGEDtuyYa1esWlSg== dependencies: - "@libp2p/crypto" "^4.0.1" - "@libp2p/interface" "^1.1.1" - "@libp2p/peer-id" "^4.0.4" + "@libp2p/crypto" "^5.0.1" + "@libp2p/interface" "^2.0.1" + "@libp2p/peer-id" "^5.0.1" "@multiformats/multiaddr" "^12.1.10" bigint-buffer "^1.1.5" - ethereum-cryptography "^2.1.3" + ethereum-cryptography "^2.2.0" rlp "^2.2.6" uint8-varint "^2.0.2" uint8arrays "^5.0.1" @@ -528,54 +528,37 @@ resolved "https://registry.yarnpkg.com/@chainsafe/is-ip/-/is-ip-2.0.2.tgz#7311e7403f11d8c5cfa48111f56fcecaac37c9f6" integrity sha512-ndGqEMG1W5WkGagaqOZHpPU172AGdxr+LD15sv3WIUvT5oCFUrG1Y0CW/v2Egwj4JXEvSibaIIIqImsm98y1nA== -"@chainsafe/libp2p-gossipsub@^13.0.0": - version "13.0.0" - resolved "https://registry.yarnpkg.com/@chainsafe/libp2p-gossipsub/-/libp2p-gossipsub-13.0.0.tgz#b1dfa5c2d455d77ab8dfc97f5eb8961861bb623e" - integrity sha512-2q+v429uZjMl6N3d+j9QCMj8YO0aiYvLSN1t0aTdpMXQHCHLJaaT9PtNn845B1Li7/uZjYESmikgVt8r7keH0w== +"@chainsafe/libp2p-gossipsub@^14.1.0": + version "14.1.0" + resolved "https://registry.yarnpkg.com/@chainsafe/libp2p-gossipsub/-/libp2p-gossipsub-14.1.0.tgz#0003a214c2a88b04ab7c256c70ec439717958f09" + integrity sha512-nzFBbHOoRFa/bXUSzmJaXOgHI+EttTldhLJ33yWcM0DxnWhLKychHkCDLoJO3THa1+dnzrDJoxj3N3/V0WoPVw== dependencies: - "@libp2p/crypto" "^4.0.1" - "@libp2p/interface" "^1.1.2" - "@libp2p/interface-internal" "^1.0.7" - "@libp2p/peer-id" "^4.0.5" - "@libp2p/pubsub" "^9.0.8" + "@libp2p/crypto" "^5.0.0" + "@libp2p/interface" "^2.0.0" + "@libp2p/interface-internal" "^2.0.0" + "@libp2p/peer-id" "^5.0.0" + "@libp2p/pubsub" "^10.0.0" "@multiformats/multiaddr" "^12.1.14" denque "^2.1.0" it-length-prefixed "^9.0.4" it-pipe "^3.0.1" it-pushable "^3.2.3" multiformats "^13.0.1" - protons-runtime "5.4.0" + protons-runtime "^5.5.0" uint8arraylist "^2.4.8" uint8arrays "^5.0.1" -"@chainsafe/libp2p-identify@^1.0.0": - version "1.0.0" - resolved "https://registry.yarnpkg.com/@chainsafe/libp2p-identify/-/libp2p-identify-1.0.0.tgz#28191e619715a87c140d8b516ee85cb7d39e41e0" - integrity sha512-X+VWUC0xeCFIulE4BU5M8FmTxZ/OKzku+9/1UaX2EG1LcqQkCDrPi6CCODbE0SraqImG4aVHRbiCFWxKEfE8wQ== - dependencies: - "@libp2p/interface" "^1.1.2" - "@libp2p/interface-internal" "^1.0.7" - "@libp2p/peer-id" "^4.0.5" - "@libp2p/peer-record" "^7.0.7" - "@multiformats/multiaddr" "^12.1.10" - "@multiformats/multiaddr-matcher" "^1.1.0" - it-protobuf-stream "^1.1.1" - protons-runtime "^5.0.0" - uint8arraylist "^2.4.7" - uint8arrays "^5.0.0" - wherearewe "^2.0.1" - -"@chainsafe/libp2p-noise@^15.0.0": - version "15.0.0" - resolved "https://registry.yarnpkg.com/@chainsafe/libp2p-noise/-/libp2p-noise-15.0.0.tgz#c3f38a31d03d96b475f7e35b592a22f5fe9269a0" - integrity sha512-O8Y/WVU4J/qrnG72jwVhbmdXiBzv1dT9B3PMClCRmZ9z/5vVPEGRVXE/SVYeGF3bNuBTLoh+F+GaKG/9UHlMhg== +"@chainsafe/libp2p-noise@^16.0.0": + version "16.0.0" + resolved "https://registry.yarnpkg.com/@chainsafe/libp2p-noise/-/libp2p-noise-16.0.0.tgz#52bb558490065439b0026950d7d99567da5c2c96" + integrity sha512-8rqr8V1RD2/lVbfL0Bb//N8iPOFof11cUe8v8z8xJT7fUhCAbtCCSM4jbwI4HCnw0MvHLmcpmAfDCFRwcWzoeA== dependencies: "@chainsafe/as-chacha20poly1305" "^0.1.0" "@chainsafe/as-sha256" "^0.4.1" - "@libp2p/crypto" "^4.0.0" - "@libp2p/interface" "^1.0.0" - "@libp2p/peer-id" "^4.0.0" - "@noble/ciphers" "^0.4.0" + "@libp2p/crypto" "^5.0.0" + "@libp2p/interface" "^2.0.0" + "@libp2p/peer-id" "^5.0.0" + "@noble/ciphers" "^0.6.0" "@noble/curves" "^1.1.0" "@noble/hashes" "^1.3.1" it-length-prefixed "^9.0.1" @@ -583,7 +566,7 @@ it-pair "^2.0.6" it-pipe "^3.0.1" it-stream-types "^2.0.1" - protons-runtime "^5.0.0" + protons-runtime "^5.5.0" uint8arraylist "^2.4.3" uint8arrays "^5.0.0" wherearewe "^2.0.1" @@ -1686,247 +1669,277 @@ yargs "16.2.0" yargs-parser "20.2.4" -"@libp2p/bootstrap@^10.0.21": - version "10.0.21" - resolved "https://registry.yarnpkg.com/@libp2p/bootstrap/-/bootstrap-10.0.21.tgz#be8b528604dc9634002f54d978ce6d5648d6a3ff" - integrity sha512-a9OGwyRM1ucq7ECUaxB4HdNoxCj21vXHcKce9khf44V5rUngF8Qzy07DI6/OaPyxJlXlDS19IJ7igaiYKx0TJw== +"@libp2p/bootstrap@^11.0.4": + version "11.0.7" + resolved "https://registry.yarnpkg.com/@libp2p/bootstrap/-/bootstrap-11.0.7.tgz#ecb14834fff03a184a3a7fd211d2ef85b3002fc6" + integrity sha512-PRDMVXf67+ASYTco6APqPy4HF03mQ8UX+BbBZcMAMpnlPsetYfWgQg3YiBe56J+PVQLs0FPsGpfLmAg7PUguQA== dependencies: - "@libp2p/interface" "^1.3.0" - "@libp2p/peer-id" "^4.1.0" + "@libp2p/interface" "^2.1.2" + "@libp2p/interface-internal" "^2.0.7" + "@libp2p/peer-id" "^5.0.4" "@multiformats/mafmt" "^12.1.6" - "@multiformats/multiaddr" "^12.2.1" + "@multiformats/multiaddr" "^12.2.3" -"@libp2p/crypto@^4.0.0", "@libp2p/crypto@^4.0.1", "@libp2p/crypto@^4.1.0": - version "4.1.0" - resolved "https://registry.yarnpkg.com/@libp2p/crypto/-/crypto-4.1.0.tgz#722060a77ced262dc89c7e42fc19ae67506b74ac" - integrity sha512-Gu4jkSdrVk1LOeyiOAuktmtN5pbSq6b9byzch2CfclFGZgXrHg3b46I0Fy63nZBc60Wq2KID3MQMVuRkVkDwAw== +"@libp2p/crypto@^5.0.0", "@libp2p/crypto@^5.0.1", "@libp2p/crypto@^5.0.4": + version "5.0.4" + resolved "https://registry.yarnpkg.com/@libp2p/crypto/-/crypto-5.0.4.tgz#26f24025f3dd2be959360c6b58c94ccadb04ed63" + integrity sha512-v5xsngOlDu8JP3GQDvK+2YYzTELl7/aPfXPbIzKEcy7ON2hu79t1BZMuavjPsr+WWIPNg5yKst6IJfRilzwXRQ== dependencies: - "@libp2p/interface" "^1.3.0" + "@libp2p/interface" "^2.1.2" "@noble/curves" "^1.4.0" "@noble/hashes" "^1.4.0" asn1js "^3.0.5" multiformats "^13.1.0" protons-runtime "^5.4.0" uint8arraylist "^2.4.8" - uint8arrays "^5.0.3" - -"@libp2p/identify@^1.0.20": - version "1.0.20" - resolved "https://registry.yarnpkg.com/@libp2p/identify/-/identify-1.0.20.tgz#cce6c4efad77afe6c0b26b0704a902f2fdbaeab2" - integrity sha512-bhn57ZI4MIMn0p3S6YNc8Sr5ReA8We8bVU25lNAefVUO3gMeQOMZ6FdTVJKbxoSumvZ+q8ciB2IOvu4rMU7o1g== - dependencies: - "@libp2p/interface" "^1.3.0" - "@libp2p/interface-internal" "^1.1.1" - "@libp2p/peer-id" "^4.1.0" - "@libp2p/peer-record" "^7.0.15" - "@multiformats/multiaddr" "^12.2.1" - "@multiformats/multiaddr-matcher" "^1.2.0" - it-protobuf-stream "^1.1.2" + uint8arrays "^5.1.0" + +"@libp2p/identify@^3.0.4": + version "3.0.7" + resolved "https://registry.yarnpkg.com/@libp2p/identify/-/identify-3.0.7.tgz#a7541d6775cf652314bf2209b281b402e8dedc35" + integrity sha512-4Ns/0HN9lvQAox8eaJruKXakOtikduk6kPlz+KYmFMgVE5/kRBRf7h0aK/8cyU9sQPbSZLCaJ3gBWoDrfMIu2w== + dependencies: + "@libp2p/crypto" "^5.0.4" + "@libp2p/interface" "^2.1.2" + "@libp2p/interface-internal" "^2.0.7" + "@libp2p/peer-id" "^5.0.4" + "@libp2p/peer-record" "^8.0.7" + "@libp2p/utils" "^6.1.0" + "@multiformats/multiaddr" "^12.2.3" + "@multiformats/multiaddr-matcher" "^1.2.1" + it-drain "^3.0.7" + it-parallel "^3.0.7" + it-protobuf-stream "^1.1.3" protons-runtime "^5.4.0" uint8arraylist "^2.4.8" - uint8arrays "^5.0.3" + uint8arrays "^5.1.0" wherearewe "^2.0.1" -"@libp2p/interface-internal@^1.0.7", "@libp2p/interface-internal@^1.1.1": - version "1.1.1" - resolved "https://registry.yarnpkg.com/@libp2p/interface-internal/-/interface-internal-1.1.1.tgz#ff16b4fee4a3d3e39121e26eeeab42e9257f5f49" - integrity sha512-lLPd7yysXqpb1oiPZAn57w3CQdD33C+mu6pfUuPYI5yWMgwWq8V3XE4IMG1IyHUGEYZAuGglghAH9YQNbtticw== +"@libp2p/interface-internal@^2.0.0", "@libp2p/interface-internal@^2.0.7": + version "2.0.7" + resolved "https://registry.yarnpkg.com/@libp2p/interface-internal/-/interface-internal-2.0.7.tgz#ceefa71553ce5aec9be793fcc646680f7d289806" + integrity sha512-numJBYHajL7W1BuURkQ4tlZ4sUGNGI3GWkhTmL2fS+LxYS2hUVTxcemHtUZGpcJQ17GiCqq+j4GE3bkBagOb0g== dependencies: - "@libp2p/interface" "^1.3.0" - "@libp2p/peer-collections" "^5.1.11" - "@multiformats/multiaddr" "^12.2.1" + "@libp2p/interface" "^2.1.2" + "@libp2p/peer-collections" "^6.0.7" + "@multiformats/multiaddr" "^12.2.3" + progress-events "^1.0.0" uint8arraylist "^2.4.8" -"@libp2p/interface@^1.0.0", "@libp2p/interface@^1.1.1", "@libp2p/interface@^1.1.2", "@libp2p/interface@^1.3.0": - version "1.3.0" - resolved "https://registry.yarnpkg.com/@libp2p/interface/-/interface-1.3.0.tgz#c4fcee2878aa8d37357974b6c7395cb2a645eb50" - integrity sha512-K72Km0Co1Z+pXpggWuoAvUUbvwZYvjCcywrHj2Ym3jt2anTE3hzL4rlZrrkzA0YhNTRFRiZ04dnu6WMXT5/4+A== +"@libp2p/interface@^1.7.0": + version "1.7.0" + resolved "https://registry.yarnpkg.com/@libp2p/interface/-/interface-1.7.0.tgz#b75b6032a6b0d0d5a13e551dcf4d481a8ca9a88f" + integrity sha512-/zFyaIaIGW0aihhsH7/93vQdpWInUzFocxF11RO/029Y6h0SVjs24HHbils+DqaFDTqN+L7oNlBx2rM2MnmTjA== dependencies: - "@multiformats/multiaddr" "^12.2.1" + "@multiformats/multiaddr" "^12.2.3" it-pushable "^3.2.3" it-stream-types "^2.0.1" multiformats "^13.1.0" progress-events "^1.0.0" uint8arraylist "^2.4.8" -"@libp2p/logger@^4.0.11", "@libp2p/logger@^4.0.6": - version "4.0.11" - resolved "https://registry.yarnpkg.com/@libp2p/logger/-/logger-4.0.11.tgz#671692a0cceee73a0c0bf9b5f05ea14fde05f5e5" - integrity sha512-WsZBup1Q+ec4C7i2YiCx0elFrejqJea3Fmkzy3t4fAek7Ofyh4GQonk3A4R7XsG5yq8+Hu1fpsGhIK8EVQsqZQ== +"@libp2p/interface@^2.0.0", "@libp2p/interface@^2.0.1", "@libp2p/interface@^2.1.2": + version "2.1.2" + resolved "https://registry.yarnpkg.com/@libp2p/interface/-/interface-2.1.2.tgz#7b38047a7d2d35a6a4e0f0f22fbdeeec98b85321" + integrity sha512-uD4NapC+1qGX7RmgC1aehQm3pMs1MpO1DwuhUlAo1M6CyNxfs1Ha9jhg2T+G4u4CAJM6wffZTyPGnKnrR+M8Fw== dependencies: - "@libp2p/interface" "^1.3.0" - "@multiformats/multiaddr" "^12.2.1" - debug "^4.3.4" + "@multiformats/multiaddr" "^12.2.3" + it-pushable "^3.2.3" + it-stream-types "^2.0.1" + multiformats "^13.1.0" + progress-events "^1.0.0" + uint8arraylist "^2.4.8" + +"@libp2p/logger@^4.0.6": + version "4.0.20" + resolved "https://registry.yarnpkg.com/@libp2p/logger/-/logger-4.0.20.tgz#bcb7fa83f3803d8ec37926747a18108728589c13" + integrity sha512-TTh2dhHsOTAlMPxSa9ncFPHa/0jTt+0AQxwHdlxg/OGLAgc9VRhnrhHUbJZp07Crcw4T/MOfS4KhjlxgqYgJRw== + dependencies: + "@libp2p/interface" "^1.7.0" + "@multiformats/multiaddr" "^12.2.3" interface-datastore "^8.2.11" multiformats "^13.1.0" + weald "^1.0.2" -"@libp2p/mdns@^10.0.21": - version "10.0.21" - resolved "https://registry.yarnpkg.com/@libp2p/mdns/-/mdns-10.0.21.tgz#028a388b73de703e4c762fd4937f217648c8128c" - integrity sha512-/lmjsZJvhfEXeSodqKECiRZk8mqApESc3OI6MhHxNvRBsfncY93IZM7lR6jwlmyQ2DOL5rCkm2rcr9geIsVzmQ== +"@libp2p/logger@^5.1.0": + version "5.1.0" + resolved "https://registry.yarnpkg.com/@libp2p/logger/-/logger-5.1.0.tgz#d580e2ee89e3f4224129cc12d727b45494aad6e5" + integrity sha512-hmkk1TONYRe+kKs5QTxkayIfj9qicp8hcrJ1Ac9QfTW/jdaUlnqd1uop4QcOD5GV6qNMq+v1qaMFWFYSN9RcPA== dependencies: - "@libp2p/interface" "^1.3.0" - "@libp2p/interface-internal" "^1.1.1" - "@libp2p/peer-id" "^4.1.0" - "@libp2p/utils" "^5.3.2" - "@multiformats/multiaddr" "^12.2.1" + "@libp2p/interface" "^2.1.2" + "@multiformats/multiaddr" "^12.2.3" + interface-datastore "^8.3.0" + multiformats "^13.1.0" + weald "^1.0.2" + +"@libp2p/mdns@^11.0.4": + version "11.0.7" + resolved "https://registry.yarnpkg.com/@libp2p/mdns/-/mdns-11.0.7.tgz#ab968f952085a59d3ea829727e79f631fa049376" + integrity sha512-CW0MbN2bQvSVsZmYT8Ul5a2TOiwhU3aBKyHyCuf5WA70Nu6Lc72YSc+vRT2EIw5Ihb+dbxC/mXrhY1xKdXaWCg== + dependencies: + "@libp2p/interface" "^2.1.2" + "@libp2p/interface-internal" "^2.0.7" + "@libp2p/peer-id" "^5.0.4" + "@libp2p/utils" "^6.1.0" + "@multiformats/multiaddr" "^12.2.3" "@types/multicast-dns" "^7.2.4" dns-packet "^5.6.1" multicast-dns "^7.2.5" -"@libp2p/mplex@^10.0.21": - version "10.0.21" - resolved "https://registry.yarnpkg.com/@libp2p/mplex/-/mplex-10.0.21.tgz#530de45f23dd36d5ac35e21a1c259767c5bfdab1" - integrity sha512-F7pK/xG9LNG3KhZBMb6SsiR7MI18na1x1e1qr8EvlyJcmdT0OiiHCnjDXWrmy+wh6uTD2qhRM+ea1vQEhKANXw== +"@libp2p/mplex@^11.0.4": + version "11.0.7" + resolved "https://registry.yarnpkg.com/@libp2p/mplex/-/mplex-11.0.7.tgz#18f5af4d59bbd9bdf64c9ddda30020c6b674010d" + integrity sha512-q13aTXf6+kEQk67bnlDnXBy8TAU19zxrNrxzwTTW3m9HEyPEKoA1YJuSqZuDjxfP31BbMshs3xxnlXgph5SpUw== dependencies: - "@libp2p/interface" "^1.3.0" - "@libp2p/utils" "^5.3.2" + "@libp2p/interface" "^2.1.2" + "@libp2p/utils" "^6.1.0" it-pipe "^3.0.1" it-pushable "^3.2.3" it-stream-types "^2.0.1" uint8-varint "^2.0.4" uint8arraylist "^2.4.8" - uint8arrays "^5.0.3" + uint8arrays "^5.1.0" -"@libp2p/multistream-select@^5.1.8": - version "5.1.8" - resolved "https://registry.yarnpkg.com/@libp2p/multistream-select/-/multistream-select-5.1.8.tgz#c484534496625da2a20873874b33e90d3ef2a95e" - integrity sha512-mYbYyjKhNOGIaS3kefs+koofGmiBvLukcnS+BVCZDGjYxAjhaes9PB++VyuX/D0lTZSk08P3cIBvw2sN+amOVQ== +"@libp2p/multistream-select@^6.0.5": + version "6.0.5" + resolved "https://registry.yarnpkg.com/@libp2p/multistream-select/-/multistream-select-6.0.5.tgz#919c923ac13573a44de6945695f1d1882ba35da4" + integrity sha512-iOMHcF/NzeShmnRLf9KI39bgfxptklbf6Tv9NvBbICfYO/IJB6KDI6bOif5eXXqUqZjHrQJ3jrRppOEwk2HV4g== dependencies: - "@libp2p/interface" "^1.3.0" + "@libp2p/interface" "^2.1.2" it-length-prefixed "^9.0.4" - it-length-prefixed-stream "^1.1.6" + it-length-prefixed-stream "^1.1.7" it-stream-types "^2.0.1" p-defer "^4.0.1" race-signal "^1.0.2" uint8-varint "^2.0.4" uint8arraylist "^2.4.8" - uint8arrays "^5.0.3" + uint8arrays "^5.1.0" -"@libp2p/peer-collections@^5.1.11": - version "5.1.11" - resolved "https://registry.yarnpkg.com/@libp2p/peer-collections/-/peer-collections-5.1.11.tgz#55589fccb4daf6a9f611f3e4126d2721d856aaca" - integrity sha512-w8ZeXfsAxBQiYgRnvpD3mxGORxwAXFsIhAOxFXl8scFhuE1j086PoTfRTuKYfp4DAyNHWkhUd+LQaXN0OG/Fgg== +"@libp2p/peer-collections@^6.0.7": + version "6.0.7" + resolved "https://registry.yarnpkg.com/@libp2p/peer-collections/-/peer-collections-6.0.7.tgz#8347e08aebbdf4a39962bb87e5ae86cc0aadfcb4" + integrity sha512-e3o994iEUvPR58x8Y5iE6lvrkv48oJXp/A1XIxMB4D/kA4OlY5BjDpHpR4nE4+EkzhIbslbMLAfip2FStyjtHg== dependencies: - "@libp2p/interface" "^1.3.0" - "@libp2p/peer-id" "^4.1.0" - -"@libp2p/peer-id-factory@^4.1.0": - version "4.1.0" - resolved "https://registry.yarnpkg.com/@libp2p/peer-id-factory/-/peer-id-factory-4.1.0.tgz#e134ff61c38d1a0fd210bf1fbdcd9116a74f2919" - integrity sha512-EMovpqtqj+5s+QpzSkVundoPQ88/GQMShB79Y6zLUkGZ73VtqWds/9e1WsrHBx6HhvmkmXFOrzcW8qfml3sE7A== - dependencies: - "@libp2p/crypto" "^4.1.0" - "@libp2p/interface" "^1.3.0" - "@libp2p/peer-id" "^4.1.0" - protons-runtime "^5.4.0" - uint8arraylist "^2.4.8" - uint8arrays "^5.0.3" + "@libp2p/interface" "^2.1.2" + "@libp2p/peer-id" "^5.0.4" + "@libp2p/utils" "^6.1.0" + multiformats "^13.2.2" -"@libp2p/peer-id@^4.0.0", "@libp2p/peer-id@^4.0.4", "@libp2p/peer-id@^4.0.5", "@libp2p/peer-id@^4.1.0": - version "4.1.0" - resolved "https://registry.yarnpkg.com/@libp2p/peer-id/-/peer-id-4.1.0.tgz#460e07d5b25339cf80afcb5e30c4f701423d1755" - integrity sha512-XmuqEfz3H+Cwq72V3opXg7wK2WnB08VEnG5nLILefLg+qo1KMlUP5pCP3ffyvYIvxMnsRla/xPYRDEBtL2JMpg== +"@libp2p/peer-id@^5.0.0", "@libp2p/peer-id@^5.0.1", "@libp2p/peer-id@^5.0.4": + version "5.0.4" + resolved "https://registry.yarnpkg.com/@libp2p/peer-id/-/peer-id-5.0.4.tgz#5a71f449b97098a5b12631b6be898a016a82c6bb" + integrity sha512-CHNbQ4Odlc+YDTtv6BzWdGSaJ1I3Wb6iHNV7YB59v0ivSsd0NzlR31qWpK/ByUAMT+hfzQzR1dK9s3e7zS4/zQ== dependencies: - "@libp2p/interface" "^1.3.0" + "@libp2p/crypto" "^5.0.4" + "@libp2p/interface" "^2.1.2" multiformats "^13.1.0" - uint8arrays "^5.0.3" - -"@libp2p/peer-record@^7.0.15", "@libp2p/peer-record@^7.0.7": - version "7.0.15" - resolved "https://registry.yarnpkg.com/@libp2p/peer-record/-/peer-record-7.0.15.tgz#063f302fb52ebe6c548a4533e3fa3b910efdfc84" - integrity sha512-VNDjLAuDF+CHf50+50CZQeT341kJm0GuWhuOqlzonOlJihpm5314Xe1BV3oeLgrtdp1ikLvQ099JqZN/l4KIQQ== - dependencies: - "@libp2p/crypto" "^4.1.0" - "@libp2p/interface" "^1.3.0" - "@libp2p/peer-id" "^4.1.0" - "@libp2p/utils" "^5.3.2" - "@multiformats/multiaddr" "^12.2.1" + uint8arrays "^5.1.0" + +"@libp2p/peer-record@^8.0.7": + version "8.0.7" + resolved "https://registry.yarnpkg.com/@libp2p/peer-record/-/peer-record-8.0.7.tgz#a092b2405e1130b8211f8ef15748b453096029d8" + integrity sha512-YsN8R+5O0MQwYQ0UGqERJJVRx7hAU4/nxiby91wzbgdfuL4qVPXHG4k0OAAtxVGLYa0q7KeXBpBG8qoaKhOXMQ== + dependencies: + "@libp2p/crypto" "^5.0.4" + "@libp2p/interface" "^2.1.2" + "@libp2p/peer-id" "^5.0.4" + "@libp2p/utils" "^6.1.0" + "@multiformats/multiaddr" "^12.2.3" + multiformats "^13.2.2" protons-runtime "^5.4.0" uint8-varint "^2.0.4" uint8arraylist "^2.4.8" - uint8arrays "^5.0.3" - -"@libp2p/peer-store@^10.0.16": - version "10.0.16" - resolved "https://registry.yarnpkg.com/@libp2p/peer-store/-/peer-store-10.0.16.tgz#0bde6e2185e416a137d8adb7b2c381bfe4acf535" - integrity sha512-xzitLNXnCG8eAs3KT5j0sBkK0ooChv4QDqjEzCNr+Gzwryi2fn386KlPoCGNkbeAUsIHS81TY/ldK8o8NBac7Q== - dependencies: - "@libp2p/interface" "^1.3.0" - "@libp2p/peer-collections" "^5.1.11" - "@libp2p/peer-id" "^4.1.0" - "@libp2p/peer-record" "^7.0.15" - "@multiformats/multiaddr" "^12.2.1" - interface-datastore "^8.2.11" - it-all "^3.0.4" + uint8arrays "^5.1.0" + +"@libp2p/peer-store@^11.0.7": + version "11.0.7" + resolved "https://registry.yarnpkg.com/@libp2p/peer-store/-/peer-store-11.0.7.tgz#e9a57d8a0ce1b3d0559a11b7e6633620f4297276" + integrity sha512-h8W/XVYfKTmJhhnh2Mdub23CzPv24l5g1RRwFsEKCkWAe95M/fvDMPTM2ahRUB64qfnFT5X4XNFFyJFMsVtjLA== + dependencies: + "@libp2p/crypto" "^5.0.4" + "@libp2p/interface" "^2.1.2" + "@libp2p/peer-collections" "^6.0.7" + "@libp2p/peer-id" "^5.0.4" + "@libp2p/peer-record" "^8.0.7" + "@multiformats/multiaddr" "^12.2.3" + interface-datastore "^8.3.0" + it-all "^3.0.6" mortice "^3.0.4" multiformats "^13.1.0" protons-runtime "^5.4.0" uint8arraylist "^2.4.8" - uint8arrays "^5.0.3" + uint8arrays "^5.1.0" -"@libp2p/prometheus-metrics@^3.0.21": - version "3.0.21" - resolved "https://registry.yarnpkg.com/@libp2p/prometheus-metrics/-/prometheus-metrics-3.0.21.tgz#78b3327a614aacc62886597d6c6eb67c5597b8db" - integrity sha512-sqU8pI9CG/b86YUEt3IaE3ZSbauBfKbxFRdSiYVRN8EbliGxQC9blgwUcGDfWW2qcXZEgM4m2FTDLZrujFDbzA== +"@libp2p/prometheus-metrics@^4.1.2": + version "4.2.1" + resolved "https://registry.yarnpkg.com/@libp2p/prometheus-metrics/-/prometheus-metrics-4.2.1.tgz#a563e05cac1f67a161824301cacdfd659bc3052c" + integrity sha512-Mt93FWjP1Jz5G/FsG7cf0J4Y1nYs4eQvx1RjtuEghoQcSzD8nSupeMt67YRQG87R/qrs0jdiGtYxmoCoagsIDw== dependencies: - "@libp2p/interface" "^1.3.0" - it-foreach "^2.0.6" + "@libp2p/interface" "^2.1.2" + it-foreach "^2.1.0" it-stream-types "^2.0.1" - prom-client "^15.1.1" + prom-client "^15.1.2" uint8arraylist "^2.4.8" -"@libp2p/pubsub@^9.0.8": - version "9.0.16" - resolved "https://registry.yarnpkg.com/@libp2p/pubsub/-/pubsub-9.0.16.tgz#90857f494213f7a596df15081956514728e14aa2" - integrity sha512-SCV0eZuYMyhHhBFzUBslHjvfwKfL2UMZSSr08c7MsTrqvQQSVdiCEeGKfoR70h7BUvBBQkPLcCqTFZGRoYX8dA== - dependencies: - "@libp2p/crypto" "^4.1.0" - "@libp2p/interface" "^1.3.0" - "@libp2p/interface-internal" "^1.1.1" - "@libp2p/peer-collections" "^5.1.11" - "@libp2p/peer-id" "^4.1.0" - "@libp2p/utils" "^5.3.2" +"@libp2p/pubsub@^10.0.0": + version "10.0.7" + resolved "https://registry.yarnpkg.com/@libp2p/pubsub/-/pubsub-10.0.7.tgz#1b7e0b7e96b75a8a1f557171ef4d72c17879e5c0" + integrity sha512-XYAYaASilesqxonjhiEENF/jXoT3jcftNYySkiyajrw3rZnLVkfJMRese3lkFqkIZqy7K/7aAtYEDJLeSrJDiQ== + dependencies: + "@libp2p/crypto" "^5.0.4" + "@libp2p/interface" "^2.1.2" + "@libp2p/interface-internal" "^2.0.7" + "@libp2p/peer-collections" "^6.0.7" + "@libp2p/peer-id" "^5.0.4" + "@libp2p/utils" "^6.1.0" it-length-prefixed "^9.0.4" it-pipe "^3.0.1" it-pushable "^3.2.3" multiformats "^13.1.0" p-queue "^8.0.1" uint8arraylist "^2.4.8" - uint8arrays "^5.0.3" + uint8arrays "^5.1.0" -"@libp2p/tcp@9.0.23": - version "9.0.23" - resolved "https://registry.yarnpkg.com/@libp2p/tcp/-/tcp-9.0.23.tgz#44eed016fdbe4725726d451a67af548507f5591b" - integrity sha512-ERX7b//PEmy4AwhjkjLx83ZpfwTlrbDt12TEn4+ZDqtsx1lzgCjuNVUy3joSWMu9ySIvMjnzxm7mxlkAJd8buw== +"@libp2p/tcp@10.0.4": + version "10.0.4" + resolved "https://registry.yarnpkg.com/@libp2p/tcp/-/tcp-10.0.4.tgz#9fdcd4ef5940816d366ee29e7e8150a5a4bd2f11" + integrity sha512-53WIxkKNMHJphTK/VUJvL5jPrkEitZpZqUSA8zN7e02OXwwOC/X3U03xvVFdrjGL32rW524+7I+SrvS+hVdNCw== dependencies: - "@libp2p/interface" "^1.3.0" - "@libp2p/utils" "^5.3.2" + "@libp2p/interface" "^2.1.2" + "@libp2p/utils" "^6.0.4" "@multiformats/mafmt" "^12.1.6" - "@multiformats/multiaddr" "^12.2.1" + "@multiformats/multiaddr" "^12.2.3" "@types/sinon" "^17.0.3" - stream-to-it "^1.0.0" + progress-events "^1.0.0" + stream-to-it "^1.0.1" -"@libp2p/utils@^5.3.2": - version "5.3.2" - resolved "https://registry.yarnpkg.com/@libp2p/utils/-/utils-5.3.2.tgz#044881910350fb22ed0f9db35e6f68f7e8948801" - integrity sha512-3HVixx17xT7JCEY931Gd2E2WmtY0RQirDeb6OZ1YD0T3VdWUMxH7pdf1gZpCHjQTg18ISIItZnFCGy+NyoYv6Q== +"@libp2p/utils@^6.0.4", "@libp2p/utils@^6.1.0": + version "6.1.0" + resolved "https://registry.yarnpkg.com/@libp2p/utils/-/utils-6.1.0.tgz#5ccece78a38bec2c2d759136ccc78494838c2b87" + integrity sha512-pxuUI8QgeS06bMZRpy0JnACPhrrCJS5/rVNTcnQK8lV1ag2bjwkGG/359AwjeEolzYQeLrmmqnZyawd1Y74wpw== dependencies: "@chainsafe/is-ip" "^2.0.2" - "@libp2p/interface" "^1.3.0" - "@libp2p/logger" "^4.0.11" - "@multiformats/multiaddr" "^12.2.1" - "@multiformats/multiaddr-matcher" "^1.2.0" + "@libp2p/crypto" "^5.0.4" + "@libp2p/interface" "^2.1.2" + "@libp2p/logger" "^5.1.0" + "@multiformats/multiaddr" "^12.2.3" + "@sindresorhus/fnv1a" "^3.1.0" + "@types/murmurhash3js-revisited" "^3.0.3" + any-signal "^4.1.1" delay "^6.0.0" get-iterator "^2.0.1" is-loopback-addr "^2.0.2" + it-foreach "^2.1.1" + it-pipe "^3.0.1" it-pushable "^3.2.3" it-stream-types "^2.0.1" + murmurhash3js-revisited "^3.0.0" netmask "^2.0.2" p-defer "^4.0.1" - race-event "^1.2.0" + race-event "^1.3.0" race-signal "^1.0.2" uint8arraylist "^2.4.8" + uint8arrays "^5.1.0" "@lukeed/ms@^2.0.2": version "2.0.2" @@ -1993,7 +2006,7 @@ outvariant "^1.2.1" strict-event-emitter "^0.5.1" -"@multiformats/dns@^1.0.3", "@multiformats/dns@^1.0.5": +"@multiformats/dns@^1.0.3", "@multiformats/dns@^1.0.6": version "1.0.6" resolved "https://registry.yarnpkg.com/@multiformats/dns/-/dns-1.0.6.tgz#b8c7de11459a02a5f4e609d35d3cdb95cb6ad152" integrity sha512-nt/5UqjMPtyvkG9BQYdJ4GfLK3nMqGpFZOzf4hAmIa0sJh2LlS9YKXZ4FgwBDsaHvzZqR/rUFIywIc7pkHNNuw== @@ -2013,23 +2026,22 @@ dependencies: "@multiformats/multiaddr" "^12.0.0" -"@multiformats/multiaddr-matcher@^1.1.0", "@multiformats/multiaddr-matcher@^1.2.0": - version "1.2.0" - resolved "https://registry.yarnpkg.com/@multiformats/multiaddr-matcher/-/multiaddr-matcher-1.2.0.tgz#8a2beae9eff394861668e6a2776fb1e7bf719c81" - integrity sha512-LH6yR7h3HSNKcxuvvi2UpLuowuVkYC6H9Y3jqmKuTai8XtKnXtW6NcDZFD/ooTBY+H4yX/scoJpjOalHrk5qdQ== +"@multiformats/multiaddr-matcher@^1.2.1": + version "1.2.4" + resolved "https://registry.yarnpkg.com/@multiformats/multiaddr-matcher/-/multiaddr-matcher-1.2.4.tgz#affb3c63b5cd83b44156be19583981651373ec2e" + integrity sha512-GgpqzQFL4Mj8t7cLNHC5nuYUuSm0kTtSUyYswiyWwTSUY3XwRAMx0UiFWQg+ETk0u+/IvFaHxfnyEoH3tasvwg== dependencies: "@chainsafe/is-ip" "^2.0.1" "@multiformats/multiaddr" "^12.0.0" multiformats "^13.0.0" -"@multiformats/multiaddr@^12.0.0", "@multiformats/multiaddr@^12.1.10", "@multiformats/multiaddr@^12.1.14", "@multiformats/multiaddr@^12.1.3", "@multiformats/multiaddr@^12.2.1": - version "12.2.1" - resolved "https://registry.yarnpkg.com/@multiformats/multiaddr/-/multiaddr-12.2.1.tgz#d95d1590b17dbe39dcefbb4d832d14434d3fe075" - integrity sha512-UwjoArBbv64FlaetV4DDwh+PUMfzXUBltxQwdh+uTYnGFzVa8ZfJsn1vt1RJlJ6+Xtrm3RMekF/B+K338i2L5Q== +"@multiformats/multiaddr@^12.0.0", "@multiformats/multiaddr@^12.1.10", "@multiformats/multiaddr@^12.1.14", "@multiformats/multiaddr@^12.1.3", "@multiformats/multiaddr@^12.2.3": + version "12.3.1" + resolved "https://registry.yarnpkg.com/@multiformats/multiaddr/-/multiaddr-12.3.1.tgz#953ceb4ae3b39125b7b2c721230ea7b398cf49fe" + integrity sha512-yoGODQY4nIj41ENJClucS8FtBoe8w682bzbKldEQr9lSlfdHqAsRC+vpJAOBpiMwPps1tHua4kxrDmvprdhoDQ== dependencies: "@chainsafe/is-ip" "^2.0.1" "@chainsafe/netmask" "^2.0.0" - "@libp2p/interface" "^1.0.0" "@multiformats/dns" "^1.0.3" multiformats "^13.0.0" uint8-varint "^2.0.1" @@ -2100,12 +2112,19 @@ resolved "https://registry.yarnpkg.com/@napi-rs/snappy-win32-x64-msvc/-/snappy-win32-x64-msvc-7.2.2.tgz#4f598d3a5d50904d9f72433819f68b21eaec4f7d" integrity sha512-a43cyx1nK0daw6BZxVcvDEXxKMFLSBSDTAhsFD0VqSKcC7MGUBMaqyoWUcMiI7LBSz4bxUmxDWKfCYzpEmeb3w== -"@noble/ciphers@^0.4.0": - version "0.4.0" - resolved "https://registry.yarnpkg.com/@noble/ciphers/-/ciphers-0.4.0.tgz#e3f69e3ce935683dd8dadb636652a5cb5cd5958c" - integrity sha512-xaUaUUDWbHIFSxaQ/pIe+33VG2mfJp6N/KxKLmZr5biWdNznCAmfu24QRhX10BbVAuqOahAoyp0S4M9md6GPDw== +"@noble/ciphers@^0.6.0": + version "0.6.0" + resolved "https://registry.yarnpkg.com/@noble/ciphers/-/ciphers-0.6.0.tgz#a3d82c72ce71ba43128e7eb71757b5ecb75b1273" + integrity sha512-mIbq/R9QXk5/cTfESb1OKtyFnk7oc1Om/8onA1158K9/OZUQFDEVy55jVTato+xmp3XX6F6Qh0zz0Nc1AxAlRQ== -"@noble/curves@1.3.0", "@noble/curves@^1.1.0", "@noble/curves@~1.3.0": +"@noble/curves@1.4.2", "@noble/curves@~1.4.0": + version "1.4.2" + resolved "https://registry.yarnpkg.com/@noble/curves/-/curves-1.4.2.tgz#40309198c76ed71bc6dbf7ba24e81ceb4d0d1fe9" + integrity sha512-TavHr8qycMChk8UwMld0ZDRvatedkzWfH8IiaeGCfymOP5i0hSCozz9vHOL0nkwk7HRMlFnAiKpS2jrUmSybcw== + dependencies: + "@noble/hashes" "1.4.0" + +"@noble/curves@^1.1.0": version "1.3.0" resolved "https://registry.yarnpkg.com/@noble/curves/-/curves-1.3.0.tgz#01be46da4fd195822dab821e72f71bf4aeec635e" integrity sha512-t01iSXPuN+Eqzb4eBX0S5oubSqXbK/xXa1Ne18Hj8f9pStxztHCE2gfboSp/dZRLSqfuLpRK2nDXDK+W9puocA== @@ -2124,12 +2143,12 @@ resolved "https://registry.yarnpkg.com/@noble/hashes/-/hashes-1.1.2.tgz#e9e035b9b166ca0af657a7848eb2718f0f22f183" integrity sha512-KYRCASVTv6aeUi1tsF8/vpyR7zpfs3FUzy2Jqm+MU+LmUKhQ0y2FpfwqkCcxSg2ua4GALJd8k2R76WxwZGbQpA== -"@noble/hashes@1.3.3", "@noble/hashes@^1.0.0", "@noble/hashes@^1.3.0", "@noble/hashes@^1.3.1", "@noble/hashes@~1.3.2": +"@noble/hashes@1.3.3", "@noble/hashes@^1.0.0", "@noble/hashes@^1.3.0", "@noble/hashes@^1.3.1": version "1.3.3" resolved "https://registry.yarnpkg.com/@noble/hashes/-/hashes-1.3.3.tgz#39908da56a4adc270147bb07968bf3b16cfe1699" integrity sha512-V7/fPHgl+jsVPXqqeOzT8egNj2iBIVt+ECeMMG8TdcnTikP3oaBtUVqpT/gYCR68aEBJSF+XbYUxStjbFMqIIA== -"@noble/hashes@1.4.0", "@noble/hashes@^1.4.0": +"@noble/hashes@1.4.0", "@noble/hashes@^1.4.0", "@noble/hashes@~1.4.0": version "1.4.0" resolved "https://registry.yarnpkg.com/@noble/hashes/-/hashes-1.4.0.tgz#45814aa329f30e4fe0ba49426f49dfccdd066426" integrity sha512-V1JJ1WTRUqHHrOSh597hURcMqVKVGL/ea3kv0gSnEdsEZ0/+VyPghM1lMNGc00z7CIQorSvbKpuJkxvuHbvdbg== @@ -2702,11 +2721,11 @@ integrity sha512-2LuNTFBIO0m7kKIQvvPHN6UE63VjpmL9rnEEaOOaiSPbZK+zUOYIzBAWcED+3XYzhYsd/0mD57VdxAEqqV52CQ== "@puppeteer/browsers@1.4.6", "@puppeteer/browsers@^1.6.0", "@puppeteer/browsers@^2.1.0": - version "2.3.0" - resolved "https://registry.yarnpkg.com/@puppeteer/browsers/-/browsers-2.3.0.tgz#791ea7d80450fea24eb19fb1d70c367ad4e08cae" - integrity sha512-ioXoq9gPxkss4MYhD+SFaU9p1IHFUX0ILAWFPyjGaBdjLsYAlZw6j1iLA0N/m12uVHLFDfSYNF7EQccjinIMDA== + version "2.4.0" + resolved "https://registry.yarnpkg.com/@puppeteer/browsers/-/browsers-2.4.0.tgz#a0dd0f4e381e53f509109ae83b891db5972750f5" + integrity sha512-x8J1csfIygOwf6D6qUAZ0ASk3z63zPb7wkNeHRerCMh82qWKUrOgkuP005AJC8lDL6/evtXETGEJVcwykKT4/g== dependencies: - debug "^4.3.5" + debug "^4.3.6" extract-zip "^2.0.1" progress "^2.0.3" proxy-agent "^6.4.0" @@ -2870,27 +2889,27 @@ resolved "https://registry.yarnpkg.com/@scure/base/-/base-1.0.0.tgz#109fb595021de285f05a7db6806f2f48296fcee7" integrity sha512-gIVaYhUsy+9s58m/ETjSJVKHhKTBMmcRb9cEV5/5dwvfDlfORjKrFsDeDHWRrm6RjcPvCLZFwGJjAjLj1gg4HA== -"@scure/base@~1.1.4": - version "1.1.5" - resolved "https://registry.yarnpkg.com/@scure/base/-/base-1.1.5.tgz#1d85d17269fe97694b9c592552dd9e5e33552157" - integrity sha512-Brj9FiG2W1MRQSTB212YVPRrcbjkv48FoZi/u4l/zds/ieRrqsh7aUf6CLwkAq61oKXr/ZlTzlY66gLIj3TFTQ== +"@scure/base@~1.1.6": + version "1.1.8" + resolved "https://registry.yarnpkg.com/@scure/base/-/base-1.1.8.tgz#8f23646c352f020c83bca750a82789e246d42b50" + integrity sha512-6CyAclxj3Nb0XT7GHK6K4zK6k2xJm6E4Ft0Ohjt4WgegiFUHEtFb2CGzmPmGBwoIhrLsqNLYfLr04Y1GePrzZg== -"@scure/bip32@1.3.3": - version "1.3.3" - resolved "https://registry.yarnpkg.com/@scure/bip32/-/bip32-1.3.3.tgz#a9624991dc8767087c57999a5d79488f48eae6c8" - integrity sha512-LJaN3HwRbfQK0X1xFSi0Q9amqOgzQnnDngIt+ZlsBC3Bm7/nE7K0kwshZHyaru79yIVRv/e1mQAjZyuZG6jOFQ== +"@scure/bip32@1.4.0": + version "1.4.0" + resolved "https://registry.yarnpkg.com/@scure/bip32/-/bip32-1.4.0.tgz#4e1f1e196abedcef395b33b9674a042524e20d67" + integrity sha512-sVUpc0Vq3tXCkDGYVWGIZTRfnvu8LoTDaev7vbwh0omSvVORONr960MQWdKqJDCReIEmTj3PAr73O3aoxz7OPg== dependencies: - "@noble/curves" "~1.3.0" - "@noble/hashes" "~1.3.2" - "@scure/base" "~1.1.4" + "@noble/curves" "~1.4.0" + "@noble/hashes" "~1.4.0" + "@scure/base" "~1.1.6" -"@scure/bip39@1.2.2": - version "1.2.2" - resolved "https://registry.yarnpkg.com/@scure/bip39/-/bip39-1.2.2.tgz#f3426813f4ced11a47489cbcf7294aa963966527" - integrity sha512-HYf9TUXG80beW+hGAt3TRM8wU6pQoYur9iNypTROm42dorCGmLnFe3eWjz3gOq6G62H2WRh0FCzAR1PI+29zIA== +"@scure/bip39@1.3.0": + version "1.3.0" + resolved "https://registry.yarnpkg.com/@scure/bip39/-/bip39-1.3.0.tgz#0f258c16823ddd00739461ac31398b4e7d6a18c3" + integrity sha512-disdg7gHuTDZtY+ZdkmLpPCk7fxZSu3gBiEGuoC1XYxv9cGx3Z6cpTggCgW6odSOOIXCiDjuGejW+aJKCY/pIQ== dependencies: - "@noble/hashes" "~1.3.2" - "@scure/base" "~1.1.4" + "@noble/hashes" "~1.4.0" + "@scure/base" "~1.1.6" "@scure/bip39@^1.0.0": version "1.0.0" @@ -2934,6 +2953,11 @@ resolved "https://registry.yarnpkg.com/@sinclair/typebox/-/typebox-0.27.8.tgz#6667fac16c436b5434a387a34dedb013198f6e6e" integrity sha512-+Fj43pSMwJs4KRrH/938Uf+uAELIgVBmQzg/q1YG10djyfA3TnrU8N8XzqCh/okZdszqBQTZf96idMfE5lnwTA== +"@sindresorhus/fnv1a@^3.1.0": + version "3.1.0" + resolved "https://registry.yarnpkg.com/@sindresorhus/fnv1a/-/fnv1a-3.1.0.tgz#f8e46597298f6fd4c12dc901cdd4e73beb4d24fa" + integrity sha512-KV321z5m/0nuAg83W1dPLy85HpHDk7Sdi4fJbwvacWsEhAh+rZUW4ZfGcXmUIvjZg4ss2bcwNlRhJ7GBEUG08w== + "@sindresorhus/is@^4.0.0": version "4.6.0" resolved "https://registry.yarnpkg.com/@sindresorhus/is/-/is-4.6.0.tgz#3c7c9c46e678feefe7a2e5bb609d3dbd665ffb3f" @@ -3248,6 +3272,11 @@ "@types/dns-packet" "*" "@types/node" "*" +"@types/murmurhash3js-revisited@^3.0.3": + version "3.0.3" + resolved "https://registry.yarnpkg.com/@types/murmurhash3js-revisited/-/murmurhash3js-revisited-3.0.3.tgz#94e247168a18342477639126da8f01353437e8d0" + integrity sha512-QvlqvYtGBYIDeO8dFdY4djkRubcrc+yTJtBc7n8VZPlJDUS/00A+PssbvERM8f9bYRmcaSEHPZgZojeQj7kzAA== + "@types/mute-stream@^0.0.4": version "0.0.4" resolved "https://registry.yarnpkg.com/@types/mute-stream/-/mute-stream-0.0.4.tgz#77208e56a08767af6c5e1237be8888e2f255c478" @@ -3336,6 +3365,11 @@ resolved "https://registry.npmjs.org/@types/retry/-/retry-0.12.1.tgz" integrity sha512-xoDlM2S4ortawSWORYqsdU+2rxdh4LRW9ytc3zmT37RIKQh6IHyKwwtKhKis9ah8ol07DCkZxPt8BBvPjC6v4g== +"@types/retry@0.12.2": + version "0.12.2" + resolved "https://registry.yarnpkg.com/@types/retry/-/retry-0.12.2.tgz#ed279a64fa438bb69f2480eda44937912bb7480a" + integrity sha512-XISRgDJ2Tc5q4TRqvgJtzsRkFYNJzZrhTdtMoGVBttwzzQJkPnS3WWTFc7kuDRoPtPakl+T+OfdEUjYJj7Jbow== + "@types/sinon@^17.0.3": version "17.0.3" resolved "https://registry.yarnpkg.com/@types/sinon/-/sinon-17.0.3.tgz#9aa7e62f0a323b9ead177ed23a36ea757141a5fa" @@ -3718,6 +3752,19 @@ abstract-level@^1.0.0, abstract-level@^1.0.2, abstract-level@^1.0.3: module-error "^1.0.1" queue-microtask "^1.2.3" +abstract-level@^1.0.4: + version "1.0.4" + resolved "https://registry.yarnpkg.com/abstract-level/-/abstract-level-1.0.4.tgz#3ad8d684c51cc9cbc9cf9612a7100b716c414b57" + integrity sha512-eUP/6pbXBkMbXFdx4IH2fVgvB7M0JvR7/lIL33zcs0IBcwjdzSSl31TOJsaCzmKSSDF9h8QYSOJux4Nd4YJqFg== + dependencies: + buffer "^6.0.3" + catering "^2.1.0" + is-buffer "^2.0.5" + level-supports "^4.0.0" + level-transcoder "^1.0.1" + module-error "^1.0.1" + queue-microtask "^1.2.3" + abstract-logging@^2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/abstract-logging/-/abstract-logging-2.0.1.tgz#6b0c371df212db7129b57d2e7fcf282b8bf1c839" @@ -5349,15 +5396,14 @@ data-urls@^5.0.0: whatwg-mimetype "^4.0.0" whatwg-url "^14.0.0" -datastore-core@^9.0.0, datastore-core@^9.1.1, datastore-core@^9.2.9: - version "9.2.9" - resolved "https://registry.yarnpkg.com/datastore-core/-/datastore-core-9.2.9.tgz#74b4dd53d4597b59038488ba5f92a7f81769f8df" - integrity sha512-wraWTPsbtdE7FFaVo3pwPuTB/zXsgwGGAm8BgBYwYAuzZCTS0MfXmd/HH1vR9s0/NFFjOVmBkGiWCvKxZ+QjVw== +datastore-core@10.0.0, datastore-core@^10.0.0: + version "10.0.0" + resolved "https://registry.yarnpkg.com/datastore-core/-/datastore-core-10.0.0.tgz#86abe346338e88c3326fb7aeb90eff3613cf542f" + integrity sha512-/b5KDmSAIFizS/ZzTTU+ZdfOcQc6mRmbc4/EK/WOzbEO5c0KWyjRLsZ3DWwh9wiPu93V7pX1oC+Or61k8UPPsg== dependencies: "@libp2p/logger" "^4.0.6" - err-code "^3.0.1" interface-datastore "^8.0.0" - interface-store "^5.0.0" + interface-store "6.0.0" it-drain "^3.0.5" it-filter "^3.0.4" it-map "^3.0.5" @@ -5367,18 +5413,19 @@ datastore-core@^9.0.0, datastore-core@^9.1.1, datastore-core@^9.2.9: it-sort "^3.0.4" it-take "^3.0.4" -datastore-level@*, datastore-level@^10.1.1: - version "10.1.1" - resolved "https://registry.yarnpkg.com/datastore-level/-/datastore-level-10.1.1.tgz#390dc6ca17dc691947a3e81c984b4b6064812e81" - integrity sha512-4fQPf/6fIXdcC0XZPGMiNuoOmF82Vhdz+LPTmbzR+CbbnCri6eOcFdzBPnDsAAuPOCV6Zld1EhgM2cRArw1+sQ== +datastore-level@*, datastore-level@^11.0.0: + version "11.0.0" + resolved "https://registry.yarnpkg.com/datastore-level/-/datastore-level-11.0.0.tgz#c0f7324bd74e15bec01f2911f5740fbf59c344f7" + integrity sha512-ATSEfGoWTAHgDeZaYukeHu0FgyhjW3FKUw3XtcIpfBl4UF2kLNnYRBfzCeH+3RA0QaZvbSWpgYk6Gwf7m1oCtg== dependencies: - datastore-core "^9.0.0" + datastore-core "10.0.0" interface-datastore "^8.0.0" - it-filter "^3.0.0" - it-map "^3.0.1" - it-sort "^3.0.1" - it-take "^3.0.1" - level "^8.0.0" + interface-store "6.0.0" + it-filter "^3.0.4" + it-map "^3.0.5" + it-sort "^3.0.4" + it-take "^3.0.4" + level "^8.0.1" dateformat@^3.0.3: version "3.0.3" @@ -5404,6 +5451,13 @@ debug@^4.3.5: dependencies: ms "2.1.2" +debug@^4.3.6: + version "4.3.7" + resolved "https://registry.yarnpkg.com/debug/-/debug-4.3.7.tgz#87945b4151a011d76d95a198d7111c865c360a52" + integrity sha512-Er2nc/H7RrMXZBFCEim6TCmMk02Z8vLC2Rbi1KEBggpo0fS6l0S1nnapwmIi3yW/+GOJap1Krg4w0Hg80oCqgQ== + dependencies: + ms "^2.1.3" + decamelize-keys@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/decamelize-keys/-/decamelize-keys-1.1.0.tgz#d171a87933252807eb3cb61dc1c1445d078df2d9" @@ -6001,15 +6055,15 @@ esutils@^2.0.2: resolved "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz" integrity sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g== -ethereum-cryptography@^2.0.0, ethereum-cryptography@^2.1.3: - version "2.1.3" - resolved "https://registry.yarnpkg.com/ethereum-cryptography/-/ethereum-cryptography-2.1.3.tgz#1352270ed3b339fe25af5ceeadcf1b9c8e30768a" - integrity sha512-BlwbIL7/P45W8FGW2r7LGuvoEZ+7PWsniMvQ4p5s2xCyw9tmaDlpfsN9HjAucbF+t/qpVHwZUisgfK24TCW8aA== +ethereum-cryptography@^2.0.0, ethereum-cryptography@^2.2.0: + version "2.2.1" + resolved "https://registry.yarnpkg.com/ethereum-cryptography/-/ethereum-cryptography-2.2.1.tgz#58f2810f8e020aecb97de8c8c76147600b0b8ccf" + integrity sha512-r/W8lkHSiTLxUxW8Rf3u4HGB0xQweG2RyETjywylKZSzLWoWAijRz8WCuOtJ6wah+avllXBqZuk29HCCvhEIRg== dependencies: - "@noble/curves" "1.3.0" - "@noble/hashes" "1.3.3" - "@scure/bip32" "1.3.3" - "@scure/bip39" "1.2.2" + "@noble/curves" "1.4.2" + "@noble/hashes" "1.4.0" + "@scure/bip32" "1.4.0" + "@scure/bip39" "1.3.0" ethers@^5.7.1: version "5.7.2" @@ -7396,18 +7450,18 @@ inquirer@^9.1.5: through "^2.3.6" wrap-ansi "^8.1.0" -interface-datastore@^8.0.0, interface-datastore@^8.2.11, interface-datastore@^8.2.7: - version "8.2.11" - resolved "https://registry.yarnpkg.com/interface-datastore/-/interface-datastore-8.2.11.tgz#1d555ce6218ab6cba6291fc361debe9713590207" - integrity sha512-9E0iXehfp/j0UbZ2mvlYB4K9pP7uQBCppfuy8WHs1EHF6wLQrM9+zwyX+8Qt6HnH4GKZRyXX/CNXm6oD4+QYgA== +interface-datastore@^8.0.0, interface-datastore@^8.2.11, interface-datastore@^8.3.0: + version "8.3.0" + resolved "https://registry.yarnpkg.com/interface-datastore/-/interface-datastore-8.3.0.tgz#0ce9a2f0f61f9fbe1c1734c6d10a0265193689f7" + integrity sha512-RM/rTSmRcnoCwGZIHrPm+nlGYVoT4R0lcFvNnDyhdFT4R6BuHHhfFP47UldVEjs98SfxLuMhaNMsyjI918saHw== dependencies: - interface-store "^5.0.0" + interface-store "6.0.0" uint8arrays "^5.0.2" -interface-store@^5.0.0: - version "5.1.0" - resolved "https://registry.yarnpkg.com/interface-store/-/interface-store-5.1.0.tgz#1735cead844fe452d62c307fafbaaa1d261e6ff3" - integrity sha512-mjUwX3XSoreoxCS3sXS3pSRsGnUjl9T06KBqt/T7AgE9Sgp4diH64ZyURJKnj2T5WmCvTbC0Dm+mwQV5hfLSBQ== +interface-store@6.0.0: + version "6.0.0" + resolved "https://registry.yarnpkg.com/interface-store/-/interface-store-6.0.0.tgz#8d8277a582f69d819134e125b686e147099a4728" + integrity sha512-HkjsDPsjA7SKkCr+TH1elUQApAAM3X3JPwrz3vFzaf614wI+ZD6GVvwKGZCHYcbSRqeZP/uzVPqezzeISeo5kA== internal-slot@^1.0.5: version "1.0.5" @@ -7593,6 +7647,11 @@ is-negative-zero@^2.0.2: resolved "https://registry.yarnpkg.com/is-negative-zero/-/is-negative-zero-2.0.2.tgz#7bf6f03a28003b8b3965de3ac26f664d765f3150" integrity sha512-dqJvarLawXsFbNDeJW7zAz8ItJ9cd28YufuuFzh0G8pNHjJMnY08Dv7sYX2uF5UpQOwieAeOExEYAWWfu7ZZUA== +is-network-error@^1.0.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/is-network-error/-/is-network-error-1.1.0.tgz#d26a760e3770226d11c169052f266a4803d9c997" + integrity sha512-tUdRRAnhT+OtCZR/LxZelH/C7QtjtFrTu5tXCA8pl55eTUElUHT+GPYV8MBMBvea/j+NxQqVt3LbWMRir7Gx9g== + is-node-process@^1.2.0: version "1.2.0" resolved "https://registry.yarnpkg.com/is-node-process/-/is-node-process-1.2.0.tgz#ea02a1b90ddb3934a19aea414e88edef7e11d134" @@ -7817,6 +7876,11 @@ it-all@^3.0.0, it-all@^3.0.4: resolved "https://registry.yarnpkg.com/it-all/-/it-all-3.0.4.tgz#08f2e3eb3df04fa4525a343dcacfbdf91ffee162" integrity sha512-UMiy0i9DqCHBdWvMbzdYvVGa5/w4t1cc4nchpbnjdLhklglv8mQeEYnii0gvKESJuL1zV32Cqdb33R6/GPfxpQ== +it-all@^3.0.6: + version "3.0.6" + resolved "https://registry.yarnpkg.com/it-all/-/it-all-3.0.6.tgz#30a4f922ae9ca0945b0f720d3478ae6f5b6707ab" + integrity sha512-HXZWbxCgQZJfrv5rXvaVeaayXED8nTKx9tj9fpBhmcUJcedVZshMMMqTj0RG2+scGypb9Ut1zd1ifbf3lA8L+Q== + it-byte-stream@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/it-byte-stream/-/it-byte-stream-1.0.0.tgz#07645e1c94444760bc7abecebf187b83777b0351" @@ -7826,29 +7890,38 @@ it-byte-stream@^1.0.0: it-stream-types "^2.0.1" uint8arraylist "^2.4.1" -it-drain@^3.0.3, it-drain@^3.0.5: +it-byte-stream@^1.0.12: + version "1.1.0" + resolved "https://registry.yarnpkg.com/it-byte-stream/-/it-byte-stream-1.1.0.tgz#f5b80b713fb71a34cbff2390b7232b103cf625bb" + integrity sha512-WWponBWdKEa6o2U3NX+wGMY8X1EkWXcQvpC+3CUqKb4ZzK30q3EPqiTjFxLf9tNVgdF/MNAtx/XclpVfgaz9KQ== + dependencies: + it-queueless-pushable "^1.0.0" + it-stream-types "^2.0.1" + uint8arraylist "^2.4.8" + +it-drain@^3.0.3, it-drain@^3.0.5, it-drain@^3.0.7: version "3.0.7" resolved "https://registry.yarnpkg.com/it-drain/-/it-drain-3.0.7.tgz#671a5d0220802c5bce9e68fc2b07088540fbc674" integrity sha512-vy6S1JKjjHSIFHgBpLpD1zhkCRl3z1zYWUxE14+kAYf+BL9ssWSFImJfhl361IIcwr0ofw8etzg11VqqB+ntUA== -it-filter@^3.0.0, it-filter@^3.0.4: +it-filter@^3.0.4: version "3.1.0" resolved "https://registry.yarnpkg.com/it-filter/-/it-filter-3.1.0.tgz#16e2914f7f54de44a19c03eb8289027643f33a1b" integrity sha512-FiYuzdsUhmMZJTJQ8YLdgX3ArjQmAtCG1lyrtZd+92/2eC6YO9UoybdrwVj/yyZkuXAPykrSipLuZ+KSKpt29A== dependencies: it-peekable "^3.0.0" -it-foreach@^2.0.6: - version "2.1.0" - resolved "https://registry.yarnpkg.com/it-foreach/-/it-foreach-2.1.0.tgz#37dd606d92d93ac82ee3fdeffeec7f9f8dd76cf8" - integrity sha512-nobWUecq9E2ED1kcXz2o27yN6KePauSdmxJNMwCduWByrF4WNB2UgBHjr9QV2jPXpEWPDuzxZas9fVhQj1Vovg== +it-foreach@^2.1.0, it-foreach@^2.1.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/it-foreach/-/it-foreach-2.1.1.tgz#93e311a1057dd0ff7631f914dc9c2c963f27a4b8" + integrity sha512-ID4Gxnavk/LVQLQESAQ9hR6dR63Ih6X+8VdxEktX8rpz2dCGAbZpey/eljTNbMfV2UKXHiu6UsneoNBZuac97g== dependencies: it-peekable "^3.0.0" -it-length-prefixed-stream@^1.0.0, it-length-prefixed-stream@^1.1.6: - version "1.1.7" - resolved "https://registry.yarnpkg.com/it-length-prefixed-stream/-/it-length-prefixed-stream-1.1.7.tgz#de4fec7da005f9a593e3eccd901c183154be09f9" - integrity sha512-tH38h/wChpR6As/PD6yWZlpoMuB4wDW2Rxf3QbSt4+O1HTsLYbyZasNhTyIuvQqhebQ30OYrdM0yr9ig5qUvYQ== +it-length-prefixed-stream@^1.0.0, it-length-prefixed-stream@^1.1.7: + version "1.2.0" + resolved "https://registry.yarnpkg.com/it-length-prefixed-stream/-/it-length-prefixed-stream-1.2.0.tgz#1f6ad78c60dea3b16364f86a0b78058f4d66a04e" + integrity sha512-vX7dzSl/2UMYYsAr0FQdPNVR5xYEETaeboZ+eXxNBjgARuvxnWA6OedW8lC5/J3ebMTC98JhA3eH76eTijUOsA== dependencies: it-byte-stream "^1.0.0" it-stream-types "^2.0.1" @@ -7867,14 +7940,14 @@ it-length-prefixed@^9.0.1, it-length-prefixed@^9.0.4: uint8arraylist "^2.0.0" uint8arrays "^5.0.1" -it-map@^3.0.1, it-map@^3.0.5: +it-map@^3.0.5: version "3.1.0" resolved "https://registry.yarnpkg.com/it-map/-/it-map-3.1.0.tgz#a66e5447d2ed8167ff90d19b183f6a3f8ae6e1b9" integrity sha512-B7zNmHYRE0qes8oTiNYU7jXEF5WvKZNAUosskCks1JT9Z4DNwRClrQyd+C/hgITG8ewDbVZMGx9VXAx3KMY2kA== dependencies: it-peekable "^3.0.0" -it-merge@^3.0.0, it-merge@^3.0.3: +it-merge@^3.0.0, it-merge@^3.0.3, it-merge@^3.0.5: version "3.0.5" resolved "https://registry.yarnpkg.com/it-merge/-/it-merge-3.0.5.tgz#2b0d1d07c825b9d20c4c2889aab8e07322fd803e" integrity sha512-2l7+mPf85pyRF5pqi0dKcA54E5Jm/2FyY5GsOaN51Ta0ipC7YZ3szuAsH8wOoB6eKY4XsU4k2X+mzPmFBMayEA== @@ -7889,12 +7962,12 @@ it-pair@^2.0.6: it-stream-types "^2.0.1" p-defer "^4.0.0" -it-parallel@^3.0.6: - version "3.0.6" - resolved "https://registry.yarnpkg.com/it-parallel/-/it-parallel-3.0.6.tgz#d8f9efa56dac5f960545b3a148d2ca171694d228" - integrity sha512-i7UM7I9LTkDJw3YIqXHFAPZX6CWYzGc+X3irdNrVExI4vPazrJdI7t5OqrSVN8CONXLAunCiqaSV/zZRbQR56A== +it-parallel@^3.0.7: + version "3.0.8" + resolved "https://registry.yarnpkg.com/it-parallel/-/it-parallel-3.0.8.tgz#fb4a5344732ddae9eff7c7b21908aa1f223638d4" + integrity sha512-URLhs6eG4Hdr4OdvgBBPDzOjBeSSmI+Kqex2rv/aAyYClME26RYHirLVhZsZP5M+ZP6M34iRlXk8Wlqtezuqpg== dependencies: - p-defer "^4.0.0" + p-defer "^4.0.1" it-peekable@^3.0.0: version "3.0.1" @@ -7910,10 +7983,10 @@ it-pipe@^3.0.1: it-pushable "^3.1.2" it-stream-types "^2.0.1" -it-protobuf-stream@^1.1.1, it-protobuf-stream@^1.1.2: - version "1.1.3" - resolved "https://registry.yarnpkg.com/it-protobuf-stream/-/it-protobuf-stream-1.1.3.tgz#66d95ad55b66827fbd057e45bd411917437bc116" - integrity sha512-96n+e6X8CXL0JerxTJuEnfivmfLzGKpIGAlJLoH7HEGo2nPRrMe+HxeWGwDF4Un3FphI/Z62JNxSvq/5DxfiQw== +it-protobuf-stream@^1.1.3: + version "1.1.5" + resolved "https://registry.yarnpkg.com/it-protobuf-stream/-/it-protobuf-stream-1.1.5.tgz#70da43abfb6beaaf7c53262d8cfd176d463b08f0" + integrity sha512-H70idW45As3cEbU4uSoZ9IYHUIV3YM69/2mmXYR7gOlPabWjuyNi3/abK11geiiq3la27Sos/mXr68JljjKtEQ== dependencies: it-length-prefixed-stream "^1.0.0" it-stream-types "^2.0.1" @@ -7926,6 +7999,14 @@ it-pushable@^3.1.2, it-pushable@^3.2.0, it-pushable@^3.2.3: dependencies: p-defer "^4.0.0" +it-queueless-pushable@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/it-queueless-pushable/-/it-queueless-pushable-1.0.0.tgz#917b52964cd6465d6436f923552c407c5ee3d11c" + integrity sha512-HbcAbcuQj7a9EBxiRCZ+77FxWutgs/pY5ZvEyQnylWPGNFojCLAUwhcZjf5OuEQ9+y+vSa7w1GQBe8xJdmIn5A== + dependencies: + p-defer "^4.0.1" + race-signal "^1.0.2" + it-reader@^6.0.1: version "6.0.4" resolved "https://registry.yarnpkg.com/it-reader/-/it-reader-6.0.4.tgz#439cb88225dcd15116be0ffde9e846a928c3871a" @@ -7934,7 +8015,7 @@ it-reader@^6.0.1: it-stream-types "^2.0.1" uint8arraylist "^2.0.0" -it-sort@^3.0.1, it-sort@^3.0.4: +it-sort@^3.0.4: version "3.0.5" resolved "https://registry.yarnpkg.com/it-sort/-/it-sort-3.0.5.tgz#7209710c64e83e130659e00b2e42df4b36643f7e" integrity sha512-vFo3wYR+aRDwklp8iH8LKeePmWqXGQrS8JqEdZmbJ58DIGj67n0RT/t5BR8iYps/C/v5IdWsbow1bOCEUfY+hA== @@ -7946,7 +8027,7 @@ it-stream-types@^2.0.1: resolved "https://registry.yarnpkg.com/it-stream-types/-/it-stream-types-2.0.1.tgz#69cb4d7e79e707b8257a8997e02751ccb6c3af32" integrity sha512-6DmOs5r7ERDbvS4q8yLKENcj6Yecr7QQTqWApbZdfAUTEC947d+PEha7PCqhm//9oxaLYL7TWRekwhoXl2s6fg== -it-take@^3.0.1, it-take@^3.0.4: +it-take@^3.0.4: version "3.0.5" resolved "https://registry.yarnpkg.com/it-take/-/it-take-3.0.5.tgz#c5a82cb160d5d7767954d84c6ce30d680f884b77" integrity sha512-4CzqXzx7FAeXsRYBTH0GhkxerH8Sv0nEGIXrO0ZIpECHth59Dm9ZYZ161VPrCQccWIL/Vu6M9YptlbMiEpCIlQ== @@ -8307,6 +8388,15 @@ level@^8.0.0: browser-level "^1.0.1" classic-level "^1.2.0" +level@^8.0.1: + version "8.0.1" + resolved "https://registry.yarnpkg.com/level/-/level-8.0.1.tgz#737161db1bc317193aca4e7b6f436e7e1df64379" + integrity sha512-oPBGkheysuw7DmzFQYyFe8NAia5jFLAgEnkgWnK3OXAuJr8qFT+xBQIwokAZPME2bhPFzS8hlYcL16m8UZrtwQ== + dependencies: + abstract-level "^1.0.4" + browser-level "^1.0.1" + classic-level "^1.2.0" + libnpmaccess@7.0.2: version "7.0.2" resolved "https://registry.yarnpkg.com/libnpmaccess/-/libnpmaccess-7.0.2.tgz#7f056c8c933dd9c8ba771fa6493556b53c5aac52" @@ -8329,32 +8419,37 @@ libnpmpublish@7.3.0: sigstore "^1.4.0" ssri "^10.0.1" -libp2p@1.4.3: - version "1.4.3" - resolved "https://registry.yarnpkg.com/libp2p/-/libp2p-1.4.3.tgz#830453eec2982e5c0faf79558a0aaa87d1e5b150" - integrity sha512-/J+bqE+bYw6iiyPBlBZk1PrZo182f9W1zSzWcMrNy+CQCG/WdJllft/WxvhNKHK1KuIS/JsL9gvhuRhtpqmMKg== - dependencies: - "@libp2p/crypto" "^4.1.0" - "@libp2p/interface" "^1.3.0" - "@libp2p/interface-internal" "^1.1.1" - "@libp2p/logger" "^4.0.11" - "@libp2p/multistream-select" "^5.1.8" - "@libp2p/peer-collections" "^5.1.11" - "@libp2p/peer-id" "^4.1.0" - "@libp2p/peer-id-factory" "^4.1.0" - "@libp2p/peer-store" "^10.0.16" - "@libp2p/utils" "^5.3.2" - "@multiformats/dns" "^1.0.5" - "@multiformats/multiaddr" "^12.2.1" - "@multiformats/multiaddr-matcher" "^1.2.0" +libp2p@2.1.7: + version "2.1.7" + resolved "https://registry.yarnpkg.com/libp2p/-/libp2p-2.1.7.tgz#e0d921cba459c78c63d783aafea6ead98a75e57f" + integrity sha512-nUxws8eHeI4jREZJFNdif20c8jYnqPkmvioI3y/hICgXchkhcKzgT1E3jEd2CVT+isskr5LnJ1n70aw6bt0m6w== + dependencies: + "@libp2p/crypto" "^5.0.4" + "@libp2p/interface" "^2.1.2" + "@libp2p/interface-internal" "^2.0.7" + "@libp2p/logger" "^5.1.0" + "@libp2p/multistream-select" "^6.0.5" + "@libp2p/peer-collections" "^6.0.7" + "@libp2p/peer-id" "^5.0.4" + "@libp2p/peer-store" "^11.0.7" + "@libp2p/utils" "^6.1.0" + "@multiformats/dns" "^1.0.6" + "@multiformats/multiaddr" "^12.2.3" + "@multiformats/multiaddr-matcher" "^1.2.1" any-signal "^4.1.1" - datastore-core "^9.2.9" - interface-datastore "^8.2.11" - it-merge "^3.0.3" - it-parallel "^3.0.6" + datastore-core "^10.0.0" + interface-datastore "^8.3.0" + it-byte-stream "^1.0.12" + it-merge "^3.0.5" + it-parallel "^3.0.7" merge-options "^3.0.4" multiformats "^13.1.0" - uint8arrays "^5.0.3" + p-defer "^4.0.1" + p-retry "^6.2.0" + progress-events "^1.0.0" + race-event "^1.3.0" + race-signal "^1.0.2" + uint8arrays "^5.1.0" light-my-request@^6.0.0: version "6.0.0" @@ -9177,11 +9272,16 @@ ms@2.1.2: resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.2.tgz#d09d1f357b443f493382a8eb3ccd183872ae6009" integrity sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w== -ms@2.1.3, ms@^2.0.0, ms@^2.1.1: +ms@2.1.3, ms@^2.0.0, ms@^2.1.1, ms@^2.1.3: version "2.1.3" resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.3.tgz#574c8138ce1d2b5861f0b44579dbadd60c6615b2" integrity sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA== +ms@^3.0.0-canary.1: + version "3.0.0-canary.1" + resolved "https://registry.yarnpkg.com/ms/-/ms-3.0.0-canary.1.tgz#c7b34fbce381492fd0b345d1cf56e14d67b77b80" + integrity sha512-kh8ARjh8rMN7Du2igDRO9QJnqCb2xYTJxyQYK7vJJS4TvLLmsbyhiKpSW+t+y26gyOyMd0riphX0GeWKU3ky5g== + msw@^2.3.1: version "2.3.2" resolved "https://registry.yarnpkg.com/msw/-/msw-2.3.2.tgz#ea4f45b51f833fa3b2215c4093bcda28dbe25a83" @@ -9223,10 +9323,10 @@ multiformats@^11.0.1: resolved "https://registry.yarnpkg.com/multiformats/-/multiformats-11.0.2.tgz#b14735efc42cd8581e73895e66bebb9752151b60" integrity sha512-b5mYMkOkARIuVZCpvijFj9a6m5wMVLC7cf/jIPd5D/ARDOfLC5+IFkbgDXQgcU2goIsTD/O9NY4DI/Mt4OGvlg== -multiformats@^13.0.0, multiformats@^13.0.1, multiformats@^13.1.0: - version "13.1.0" - resolved "https://registry.yarnpkg.com/multiformats/-/multiformats-13.1.0.tgz#5aa9d2175108a448fc3bdb54ba8a3d0b6cab3ac3" - integrity sha512-HzdtdBwxsIkzpeXzhQ5mAhhuxcHbjEHH+JQoxt7hG/2HGFjjwyolLo7hbaexcnhoEuV4e0TNJ8kkpMjiEYY4VQ== +multiformats@^13.0.0, multiformats@^13.0.1, multiformats@^13.1.0, multiformats@^13.2.2: + version "13.2.2" + resolved "https://registry.yarnpkg.com/multiformats/-/multiformats-13.2.2.tgz#16da153ee8b68d8c9da31b52176e90b3cd8b43ef" + integrity sha512-RWI+nyf0q64vyOxL8LbKtjJMki0sogRL/8axvklNtiTM0iFCVtHwME9w6+0P1/v4dQvsIg8A45oT3ka1t/M/+A== multimatch@5.0.0: version "5.0.0" @@ -9239,6 +9339,11 @@ multimatch@5.0.0: arrify "^2.0.1" minimatch "^3.0.4" +murmurhash3js-revisited@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/murmurhash3js-revisited/-/murmurhash3js-revisited-3.0.0.tgz#6bd36e25de8f73394222adc6e41fa3fac08a5869" + integrity sha512-/sF3ee6zvScXMb1XFJ8gDsSnY+X8PbOyjIuBhtgis10W2Jx4ZjIhikUCIF9c4gpJxVnQIsPAFrSwTCuAjicP6g== + mute-stream@0.0.8: version "0.0.8" resolved "https://registry.yarnpkg.com/mute-stream/-/mute-stream-0.0.8.tgz#1630c42b2251ff81e2a283de96a5497ea92e5e0d" @@ -9947,6 +10052,15 @@ p-reduce@2.1.0, p-reduce@^2.0.0, p-reduce@^2.1.0: resolved "https://registry.yarnpkg.com/p-reduce/-/p-reduce-2.1.0.tgz#09408da49507c6c274faa31f28df334bc712b64a" integrity sha512-2USApvnsutq8uoxZBGbbWM0JIYLiEMJ9RlaN7fAzVNb9OZN0SHjjTTfIcb667XynS5Y1VhwDJVDa72TnPzAYWw== +p-retry@^6.2.0: + version "6.2.0" + resolved "https://registry.yarnpkg.com/p-retry/-/p-retry-6.2.0.tgz#8d6df01af298750009691ce2f9b3ad2d5968f3bd" + integrity sha512-JA6nkq6hKyWLLasXQXUrO4z8BUZGUt/LjlJxx8Gb2+2ntodU/SS63YZ8b0LUTbQ8ZB9iwOfhEPhg4ykKnn2KsA== + dependencies: + "@types/retry" "0.12.2" + is-network-error "^1.0.0" + retry "^0.13.1" + p-timeout@^3.2.0: version "3.2.0" resolved "https://registry.yarnpkg.com/p-timeout/-/p-timeout-3.2.0.tgz#c7e17abc971d2a7962ef83626b35d635acf23dfe" @@ -10357,10 +10471,10 @@ progress@^2.0.3: resolved "https://registry.npmjs.org/progress/-/progress-2.0.3.tgz" integrity sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA== -prom-client@^15.1.0, prom-client@^15.1.1: - version "15.1.2" - resolved "https://registry.yarnpkg.com/prom-client/-/prom-client-15.1.2.tgz#78d79f12c35d395ca97edf7111c18210cf07f815" - integrity sha512-on3h1iXb04QFLLThrmVYg1SChBQ9N1c+nKAjebBjokBqipddH3uxmOUcEkTnzmJ8Jh/5TSUnUqS40i2QB2dJHQ== +prom-client@^15.1.0, prom-client@^15.1.2: + version "15.1.3" + resolved "https://registry.yarnpkg.com/prom-client/-/prom-client-15.1.3.tgz#69fa8de93a88bc9783173db5f758dc1c69fa8fc2" + integrity sha512-6ZiOBfCywsD4k1BN9IX0uZhF+tJkV8q8llP64G5Hajs4JOeVLPCwpPVcpXy3BwYiUGgyJzsJJQeOIv7+hDSq8g== dependencies: "@opentelemetry/api" "^1.4.0" tdigest "^0.1.1" @@ -10406,10 +10520,10 @@ protocols@^2.0.0, protocols@^2.0.1: resolved "https://registry.yarnpkg.com/protocols/-/protocols-2.0.1.tgz#8f155da3fc0f32644e83c5782c8e8212ccf70a86" integrity sha512-/XJ368cyBJ7fzLMwLKv1e4vLxOju2MNAIokcr7meSaNcVbWz/CPcW22cP04mwxOErdA5mwjA8Q6w/cdAQxVn7Q== -protons-runtime@5.4.0, protons-runtime@^5.0.0, protons-runtime@^5.4.0: - version "5.4.0" - resolved "https://registry.yarnpkg.com/protons-runtime/-/protons-runtime-5.4.0.tgz#2751ce22cae6c35eebba89acfd9d783419ae3726" - integrity sha512-XfA++W/WlQOSyjUyuF5lgYBfXZUEMP01Oh1C2dSwZAlF2e/ZrMRPfWonXj6BGM+o8Xciv7w0tsRMKYwYEuQvaw== +protons-runtime@^5.4.0, protons-runtime@^5.5.0: + version "5.5.0" + resolved "https://registry.yarnpkg.com/protons-runtime/-/protons-runtime-5.5.0.tgz#ea06d9ef843aad77ea5de3e1ebafa81b58c24570" + integrity sha512-EsALjF9QsrEk6gbCx3lmfHxVN0ah7nG3cY7GySD4xf4g8cr7g543zB88Foh897Sr1RQJ9yDCUsoT1i1H/cVUFA== dependencies: uint8-varint "^2.0.2" uint8arraylist "^2.4.3" @@ -10558,7 +10672,7 @@ quick-lru@^5.1.1: resolved "https://registry.npmjs.org/quick-lru/-/quick-lru-5.1.1.tgz" integrity sha512-WuyALRjWPDGtt/wzJiadO5AXY+8hZ80hVpe6MyivgraREW751X3SbhRvG3eLKOYN+8VEvqLcf3wdnt44Z4S4SA== -race-event@^1.2.0: +race-event@^1.3.0: version "1.3.0" resolved "https://registry.yarnpkg.com/race-event/-/race-event-1.3.0.tgz#854f34118c31addf877898bd9f8e4dcfac9de7a2" integrity sha512-kaLm7axfOnahIqD3jQ4l1e471FIFcEGebXEnhxyLscuUzV8C94xVHtWEqDDXxll7+yu/6lW0w1Ff4HbtvHvOHg== @@ -10854,6 +10968,11 @@ retry@^0.12.0: resolved "https://registry.yarnpkg.com/retry/-/retry-0.12.0.tgz#1b42a6266a21f07421d1b0b54b7dc167b01c013b" integrity sha512-9LkiTwjUh6rT555DtE9rTX+BKByPfrMzEAtnlEtdEwr3Nkffwiihqe2bWADg+OQRjt9gl6ICdmB/ZFDCGAtSow== +retry@^0.13.1: + version "0.13.1" + resolved "https://registry.yarnpkg.com/retry/-/retry-0.13.1.tgz#185b1587acf67919d63b357349e03537b2484658" + integrity sha512-XQBQ3I8W1Cge0Seh+6gjj03LbmRFWuoszgK9ooCpwYIrhhoO80pfq4cUkU5DkknwfOfFteRwlZ56PYOGYyFWdg== + reusify@^1.0.4: version "1.0.4" resolved "https://registry.yarnpkg.com/reusify/-/reusify-1.0.4.tgz#90da382b1e126efc02146e90845a88db12925d76" @@ -11540,7 +11659,7 @@ stream-http@^3.2.0: readable-stream "^3.6.0" xtend "^4.0.2" -stream-to-it@^1.0.0: +stream-to-it@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/stream-to-it/-/stream-to-it-1.0.1.tgz#7d5e1b04bab70facd48273279bfa49f0d0165950" integrity sha512-AqHYAYPHcmvMrcLNgncE/q0Aj/ajP6A4qGhxP6EVn7K3YTNs0bJpJyk57wc2Heb7MUL64jurvmnmui8D9kjZgA== @@ -11776,6 +11895,11 @@ supports-color@^7.1.0: dependencies: has-flag "^4.0.0" +supports-color@^9.4.0: + version "9.4.0" + resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-9.4.0.tgz#17bfcf686288f531db3dea3215510621ccb55954" + integrity sha512-VL+lNrEoIXww1coLPOmiEmK/0sGigko5COxI09KzHc2VJXJsQ37UaQ+8quuxjDeA7+KnLGTWRyOXSLLR2Wb4jw== + supports-preserve-symlinks-flag@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz#6eda4bd344a3c94aea376d4cc31bc77311039e09" @@ -12307,10 +12431,10 @@ uint8arraylist@^2.0.0, uint8arraylist@^2.4.1, uint8arraylist@^2.4.3, uint8arrayl dependencies: uint8arrays "^5.0.1" -uint8arrays@^5.0.0, uint8arrays@^5.0.1, uint8arrays@^5.0.2, uint8arrays@^5.0.3: - version "5.0.3" - resolved "https://registry.yarnpkg.com/uint8arrays/-/uint8arrays-5.0.3.tgz#92b894d9c4269ba97c51544d6e1f279fe6f80d1f" - integrity sha512-6LBuKji28kHjgPJMkQ6GDaBb1lRwIhyOYq6pDGwYMoDPfImE9SkuYENVmR0yu9yGgs2clHUSY9fKDukR+AXfqQ== +uint8arrays@^5.0.0, uint8arrays@^5.0.1, uint8arrays@^5.0.2, uint8arrays@^5.1.0: + version "5.1.0" + resolved "https://registry.yarnpkg.com/uint8arrays/-/uint8arrays-5.1.0.tgz#14047c9bdf825d025b7391299436e5e50e7270f1" + integrity sha512-vA6nFepEmlSKkMBnLBaUMVvAC4G3CTmO58C12y4sq6WPDOR7mOFYOi7GlrQ4djeSbP6JG9Pv9tJDM97PedRSww== dependencies: multiformats "^13.0.0" @@ -12675,6 +12799,14 @@ wcwidth@^1.0.0, wcwidth@^1.0.1: dependencies: defaults "^1.0.3" +weald@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/weald/-/weald-1.0.2.tgz#a51fb3a8dbf5fa2b71ef09f9a267c86a46742238" + integrity sha512-iG5cIuBwsPe1ZcoGGd4X6QYlepU1vLr4l4oWpzQWqeJPSo9B8bxxyE6xlnj3TCmThtha7gyVL+uuZgUFkPyfDg== + dependencies: + ms "^3.0.0-canary.1" + supports-color "^9.4.0" + web-streams-polyfill@^3.0.3: version "3.2.1" resolved "https://registry.yarnpkg.com/web-streams-polyfill/-/web-streams-polyfill-3.2.1.tgz#71c2718c52b45fd49dbeee88634b3a60ceab42a6"