@aztec/p2p 0.77.0-testnet-ignition.26 → 0.77.0-testnet-ignition.27

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (155) hide show
  1. package/dest/services/discv5/discV5_service.js +1 -1
  2. package/package.json +10 -10
  3. package/src/services/discv5/discV5_service.ts +1 -1
  4. package/dest/bootstrap/bootstrap.d.ts +0 -38
  5. package/dest/bootstrap/bootstrap.d.ts.map +0 -1
  6. package/dest/client/factory.d.ts +0 -21
  7. package/dest/client/factory.d.ts.map +0 -1
  8. package/dest/client/index.d.ts +0 -3
  9. package/dest/client/index.d.ts.map +0 -1
  10. package/dest/client/p2p_client.d.ts +0 -314
  11. package/dest/client/p2p_client.d.ts.map +0 -1
  12. package/dest/config.d.ts +0 -185
  13. package/dest/config.d.ts.map +0 -1
  14. package/dest/enr/generate-enr.d.ts +0 -9
  15. package/dest/enr/generate-enr.d.ts.map +0 -1
  16. package/dest/enr/index.d.ts +0 -2
  17. package/dest/enr/index.d.ts.map +0 -1
  18. package/dest/errors/reqresp.error.d.ts +0 -28
  19. package/dest/errors/reqresp.error.d.ts.map +0 -1
  20. package/dest/index.d.ts +0 -8
  21. package/dest/index.d.ts.map +0 -1
  22. package/dest/mem_pools/attestation_pool/attestation_pool.d.ts +0 -57
  23. package/dest/mem_pools/attestation_pool/attestation_pool.d.ts.map +0 -1
  24. package/dest/mem_pools/attestation_pool/attestation_pool_test_suite.d.ts +0 -3
  25. package/dest/mem_pools/attestation_pool/attestation_pool_test_suite.d.ts.map +0 -1
  26. package/dest/mem_pools/attestation_pool/index.d.ts +0 -3
  27. package/dest/mem_pools/attestation_pool/index.d.ts.map +0 -1
  28. package/dest/mem_pools/attestation_pool/kv_attestation_pool.d.ts +0 -22
  29. package/dest/mem_pools/attestation_pool/kv_attestation_pool.d.ts.map +0 -1
  30. package/dest/mem_pools/attestation_pool/memory_attestation_pool.d.ts +0 -17
  31. package/dest/mem_pools/attestation_pool/memory_attestation_pool.d.ts.map +0 -1
  32. package/dest/mem_pools/attestation_pool/mocks.d.ts +0 -19
  33. package/dest/mem_pools/attestation_pool/mocks.d.ts.map +0 -1
  34. package/dest/mem_pools/index.d.ts +0 -4
  35. package/dest/mem_pools/index.d.ts.map +0 -1
  36. package/dest/mem_pools/instrumentation.d.ts +0 -30
  37. package/dest/mem_pools/instrumentation.d.ts.map +0 -1
  38. package/dest/mem_pools/interface.d.ts +0 -11
  39. package/dest/mem_pools/interface.d.ts.map +0 -1
  40. package/dest/mem_pools/tx_pool/aztec_kv_tx_pool.d.ts +0 -66
  41. package/dest/mem_pools/tx_pool/aztec_kv_tx_pool.d.ts.map +0 -1
  42. package/dest/mem_pools/tx_pool/index.d.ts +0 -4
  43. package/dest/mem_pools/tx_pool/index.d.ts.map +0 -1
  44. package/dest/mem_pools/tx_pool/memory_tx_pool.d.ts +0 -56
  45. package/dest/mem_pools/tx_pool/memory_tx_pool.d.ts.map +0 -1
  46. package/dest/mem_pools/tx_pool/priority.d.ts +0 -8
  47. package/dest/mem_pools/tx_pool/priority.d.ts.map +0 -1
  48. package/dest/mem_pools/tx_pool/tx_pool.d.ts +0 -66
  49. package/dest/mem_pools/tx_pool/tx_pool.d.ts.map +0 -1
  50. package/dest/mem_pools/tx_pool/tx_pool_test_suite.d.ts +0 -7
  51. package/dest/mem_pools/tx_pool/tx_pool_test_suite.d.ts.map +0 -1
  52. package/dest/msg_validators/attestation_validator/attestation_validator.d.ts +0 -8
  53. package/dest/msg_validators/attestation_validator/attestation_validator.d.ts.map +0 -1
  54. package/dest/msg_validators/attestation_validator/index.d.ts +0 -2
  55. package/dest/msg_validators/attestation_validator/index.d.ts.map +0 -1
  56. package/dest/msg_validators/block_proposal_validator/block_proposal_validator.d.ts +0 -8
  57. package/dest/msg_validators/block_proposal_validator/block_proposal_validator.d.ts.map +0 -1
  58. package/dest/msg_validators/block_proposal_validator/index.d.ts +0 -2
  59. package/dest/msg_validators/block_proposal_validator/index.d.ts.map +0 -1
  60. package/dest/msg_validators/index.d.ts +0 -4
  61. package/dest/msg_validators/index.d.ts.map +0 -1
  62. package/dest/msg_validators/tx_validator/aggregate_tx_validator.d.ts +0 -7
  63. package/dest/msg_validators/tx_validator/aggregate_tx_validator.d.ts.map +0 -1
  64. package/dest/msg_validators/tx_validator/block_header_validator.d.ts +0 -11
  65. package/dest/msg_validators/tx_validator/block_header_validator.d.ts.map +0 -1
  66. package/dest/msg_validators/tx_validator/data_validator.d.ts +0 -6
  67. package/dest/msg_validators/tx_validator/data_validator.d.ts.map +0 -1
  68. package/dest/msg_validators/tx_validator/double_spend_validator.d.ts +0 -12
  69. package/dest/msg_validators/tx_validator/double_spend_validator.d.ts.map +0 -1
  70. package/dest/msg_validators/tx_validator/index.d.ts +0 -7
  71. package/dest/msg_validators/tx_validator/index.d.ts.map +0 -1
  72. package/dest/msg_validators/tx_validator/metadata_validator.d.ts +0 -10
  73. package/dest/msg_validators/tx_validator/metadata_validator.d.ts.map +0 -1
  74. package/dest/msg_validators/tx_validator/tx_proof_validator.d.ts +0 -9
  75. package/dest/msg_validators/tx_validator/tx_proof_validator.d.ts.map +0 -1
  76. package/dest/services/data_store.d.ts +0 -27
  77. package/dest/services/data_store.d.ts.map +0 -1
  78. package/dest/services/discv5/discV5_service.d.ts +0 -42
  79. package/dest/services/discv5/discV5_service.d.ts.map +0 -1
  80. package/dest/services/dummy_service.d.ts +0 -85
  81. package/dest/services/dummy_service.d.ts.map +0 -1
  82. package/dest/services/encoding.d.ts +0 -31
  83. package/dest/services/encoding.d.ts.map +0 -1
  84. package/dest/services/gossipsub/scoring.d.ts +0 -7
  85. package/dest/services/gossipsub/scoring.d.ts.map +0 -1
  86. package/dest/services/index.d.ts +0 -3
  87. package/dest/services/index.d.ts.map +0 -1
  88. package/dest/services/libp2p/libp2p_service.d.ts +0 -186
  89. package/dest/services/libp2p/libp2p_service.d.ts.map +0 -1
  90. package/dest/services/peer-manager/metrics.d.ts +0 -12
  91. package/dest/services/peer-manager/metrics.d.ts.map +0 -1
  92. package/dest/services/peer-manager/peer_manager.d.ts +0 -94
  93. package/dest/services/peer-manager/peer_manager.d.ts.map +0 -1
  94. package/dest/services/peer-manager/peer_scoring.d.ts +0 -28
  95. package/dest/services/peer-manager/peer_scoring.d.ts.map +0 -1
  96. package/dest/services/reqresp/config.d.ts +0 -16
  97. package/dest/services/reqresp/config.d.ts.map +0 -1
  98. package/dest/services/reqresp/connection-sampler/batch_connection_sampler.d.ts +0 -45
  99. package/dest/services/reqresp/connection-sampler/batch_connection_sampler.d.ts.map +0 -1
  100. package/dest/services/reqresp/connection-sampler/connection_sampler.d.ts +0 -61
  101. package/dest/services/reqresp/connection-sampler/connection_sampler.d.ts.map +0 -1
  102. package/dest/services/reqresp/index.d.ts +0 -6
  103. package/dest/services/reqresp/index.d.ts.map +0 -1
  104. package/dest/services/reqresp/interface.d.ts +0 -116
  105. package/dest/services/reqresp/interface.d.ts.map +0 -1
  106. package/dest/services/reqresp/metrics.d.ts +0 -15
  107. package/dest/services/reqresp/metrics.d.ts.map +0 -1
  108. package/dest/services/reqresp/protocols/block.d.ts +0 -4
  109. package/dest/services/reqresp/protocols/block.d.ts.map +0 -1
  110. package/dest/services/reqresp/protocols/goodbye.d.ts +0 -51
  111. package/dest/services/reqresp/protocols/goodbye.d.ts.map +0 -1
  112. package/dest/services/reqresp/protocols/index.d.ts +0 -9
  113. package/dest/services/reqresp/protocols/index.d.ts.map +0 -1
  114. package/dest/services/reqresp/protocols/ping.d.ts +0 -9
  115. package/dest/services/reqresp/protocols/ping.d.ts.map +0 -1
  116. package/dest/services/reqresp/protocols/status.d.ts +0 -9
  117. package/dest/services/reqresp/protocols/status.d.ts.map +0 -1
  118. package/dest/services/reqresp/protocols/tx.d.ts +0 -13
  119. package/dest/services/reqresp/protocols/tx.d.ts.map +0 -1
  120. package/dest/services/reqresp/rate-limiter/index.d.ts +0 -2
  121. package/dest/services/reqresp/rate-limiter/index.d.ts.map +0 -1
  122. package/dest/services/reqresp/rate-limiter/rate_limiter.d.ts +0 -102
  123. package/dest/services/reqresp/rate-limiter/rate_limiter.d.ts.map +0 -1
  124. package/dest/services/reqresp/rate-limiter/rate_limits.d.ts +0 -3
  125. package/dest/services/reqresp/rate-limiter/rate_limits.d.ts.map +0 -1
  126. package/dest/services/reqresp/reqresp.d.ts +0 -166
  127. package/dest/services/reqresp/reqresp.d.ts.map +0 -1
  128. package/dest/services/reqresp/status.d.ts +0 -31
  129. package/dest/services/reqresp/status.d.ts.map +0 -1
  130. package/dest/services/service.d.ts +0 -87
  131. package/dest/services/service.d.ts.map +0 -1
  132. package/dest/test-helpers/generate-peer-id-private-keys.d.ts +0 -7
  133. package/dest/test-helpers/generate-peer-id-private-keys.d.ts.map +0 -1
  134. package/dest/test-helpers/get-ports.d.ts +0 -7
  135. package/dest/test-helpers/get-ports.d.ts.map +0 -1
  136. package/dest/test-helpers/index.d.ts +0 -6
  137. package/dest/test-helpers/index.d.ts.map +0 -1
  138. package/dest/test-helpers/make-enrs.d.ts +0 -16
  139. package/dest/test-helpers/make-enrs.d.ts.map +0 -1
  140. package/dest/test-helpers/make-test-p2p-clients.d.ts +0 -36
  141. package/dest/test-helpers/make-test-p2p-clients.d.ts.map +0 -1
  142. package/dest/test-helpers/reqresp-nodes.d.ts +0 -66
  143. package/dest/test-helpers/reqresp-nodes.d.ts.map +0 -1
  144. package/dest/testbench/p2p_client_testbench_worker.d.ts +0 -2
  145. package/dest/testbench/p2p_client_testbench_worker.d.ts.map +0 -1
  146. package/dest/testbench/parse_log_file.d.ts +0 -2
  147. package/dest/testbench/parse_log_file.d.ts.map +0 -1
  148. package/dest/testbench/testbench.d.ts +0 -2
  149. package/dest/testbench/testbench.d.ts.map +0 -1
  150. package/dest/types/index.d.ts +0 -32
  151. package/dest/types/index.d.ts.map +0 -1
  152. package/dest/util.d.ts +0 -53
  153. package/dest/util.d.ts.map +0 -1
  154. package/dest/versioning.d.ts +0 -12
  155. package/dest/versioning.d.ts.map +0 -1
@@ -201,7 +201,7 @@ const delayBeforeStart = 2000; // 2sec
201
201
  return true;
202
202
  } catch (err) {
203
203
  if (err.name === 'ComponentsVersionsError') {
204
- this.logger.warn(`Peer node ${enr.nodeId} has incorrect version: ${err.message}`, {
204
+ this.logger.debug(`Peer node ${enr.nodeId} has incorrect version: ${err.message}`, {
205
205
  compressedVersion,
206
206
  expected: this.versions
207
207
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aztec/p2p",
3
- "version": "0.77.0-testnet-ignition.26",
3
+ "version": "0.77.0-testnet-ignition.27",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": "./dest/index.js",
@@ -65,14 +65,14 @@
65
65
  ]
66
66
  },
67
67
  "dependencies": {
68
- "@aztec/constants": "0.77.0-testnet-ignition.26",
69
- "@aztec/epoch-cache": "0.77.0-testnet-ignition.26",
70
- "@aztec/foundation": "0.77.0-testnet-ignition.26",
71
- "@aztec/kv-store": "0.77.0-testnet-ignition.26",
72
- "@aztec/noir-protocol-circuits-types": "0.77.0-testnet-ignition.26",
73
- "@aztec/protocol-contracts": "0.77.0-testnet-ignition.26",
74
- "@aztec/stdlib": "0.77.0-testnet-ignition.26",
75
- "@aztec/telemetry-client": "0.77.0-testnet-ignition.26",
68
+ "@aztec/constants": "0.77.0-testnet-ignition.27",
69
+ "@aztec/epoch-cache": "0.77.0-testnet-ignition.27",
70
+ "@aztec/foundation": "0.77.0-testnet-ignition.27",
71
+ "@aztec/kv-store": "0.77.0-testnet-ignition.27",
72
+ "@aztec/noir-protocol-circuits-types": "0.77.0-testnet-ignition.27",
73
+ "@aztec/protocol-contracts": "0.77.0-testnet-ignition.27",
74
+ "@aztec/stdlib": "0.77.0-testnet-ignition.27",
75
+ "@aztec/telemetry-client": "0.77.0-testnet-ignition.27",
76
76
  "@chainsafe/discv5": "9.0.0",
77
77
  "@chainsafe/enr": "3.0.0",
78
78
  "@chainsafe/libp2p-gossipsub": "13.0.0",
@@ -101,7 +101,7 @@
101
101
  "xxhash-wasm": "^1.1.0"
102
102
  },
103
103
  "devDependencies": {
104
- "@aztec/archiver": "0.77.0-testnet-ignition.26",
104
+ "@aztec/archiver": "0.77.0-testnet-ignition.27",
105
105
  "@jest/globals": "^29.5.0",
106
106
  "@types/jest": "^29.5.0",
107
107
  "@types/node": "^18.14.6",
@@ -243,7 +243,7 @@ export class DiscV5Service extends EventEmitter implements PeerDiscoveryService
243
243
  return true;
244
244
  } catch (err: any) {
245
245
  if (err.name === 'ComponentsVersionsError') {
246
- this.logger.warn(`Peer node ${enr.nodeId} has incorrect version: ${err.message}`, {
246
+ this.logger.debug(`Peer node ${enr.nodeId} has incorrect version: ${err.message}`, {
247
247
  compressedVersion,
248
248
  expected: this.versions,
249
249
  });
@@ -1,38 +0,0 @@
1
- import type { AztecAsyncKVStore } from '@aztec/kv-store';
2
- import type { P2PBootstrapApi } from '@aztec/stdlib/interfaces/server';
3
- import { type TelemetryClient } from '@aztec/telemetry-client';
4
- import type { PeerId } from '@libp2p/interface';
5
- import type { BootnodeConfig } from '../config.js';
6
- /**
7
- * Encapsulates a 'Bootstrap' node, used for the purpose of assisting new joiners in acquiring peers.
8
- */
9
- export declare class BootstrapNode implements P2PBootstrapApi {
10
- private store;
11
- private telemetry;
12
- private logger;
13
- private node?;
14
- private peerId?;
15
- constructor(store: AztecAsyncKVStore, telemetry: TelemetryClient, logger?: import("@aztec/foundation/log").Logger);
16
- /**
17
- * Starts the bootstrap node.
18
- * @param config - A partial P2P configuration. No need for TCP values as well as aztec node specific values.
19
- * @returns An empty promise.
20
- */
21
- start(config: BootnodeConfig): Promise<void>;
22
- /**
23
- * Stops the bootstrap node.
24
- * @returns And empty promise.
25
- */
26
- stop(): Promise<void>;
27
- private assertNodeStarted;
28
- private assertPeerId;
29
- /**
30
- * Returns the peerId of this node.
31
- * @returns The node's peer Id
32
- */
33
- getPeerId(): PeerId;
34
- getENR(): any;
35
- getEncodedEnr(): Promise<any>;
36
- getRoutingTable(): Promise<any>;
37
- }
38
- //# sourceMappingURL=bootstrap.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"bootstrap.d.ts","sourceRoot":"","sources":["../../src/bootstrap/bootstrap.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AACzD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,iCAAiC,CAAC;AACvE,OAAO,EAAsB,KAAK,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAInF,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAGhD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAInD;;GAEG;AACH,qBAAa,aAAc,YAAW,eAAe;IAKjD,OAAO,CAAC,KAAK;IACb,OAAO,CAAC,SAAS;IACjB,OAAO,CAAC,MAAM;IANhB,OAAO,CAAC,IAAI,CAAC,CAA0C;IACvD,OAAO,CAAC,MAAM,CAAC,CAAS;gBAGd,KAAK,EAAE,iBAAiB,EACxB,SAAS,EAAE,eAAe,EAC1B,MAAM,yCAAgC;IAGhD;;;;OAIG;IACU,KAAK,CAAC,MAAM,EAAE,cAAc;IAmEzC;;;OAGG;IACU,IAAI;IAOjB,OAAO,CAAC,iBAAiB;IAMzB,OAAO,CAAC,YAAY;IAMpB;;;OAGG;IACI,SAAS;IAKT,MAAM;IAKN,aAAa;IAKb,eAAe;CAIvB"}
@@ -1,21 +0,0 @@
1
- import type { EpochCacheInterface } from '@aztec/epoch-cache';
2
- import { type Logger } from '@aztec/foundation/log';
3
- import type { AztecAsyncKVStore } from '@aztec/kv-store';
4
- import type { DataStoreConfig } from '@aztec/kv-store/config';
5
- import type { L2BlockSource } from '@aztec/stdlib/block';
6
- import type { ClientProtocolCircuitVerifier, WorldStateSynchronizer } from '@aztec/stdlib/interfaces/server';
7
- import { P2PClientType } from '@aztec/stdlib/p2p';
8
- import { type TelemetryClient } from '@aztec/telemetry-client';
9
- import { P2PClient } from '../client/p2p_client.js';
10
- import type { P2PConfig } from '../config.js';
11
- import type { AttestationPool } from '../mem_pools/attestation_pool/attestation_pool.js';
12
- import { type TxPool } from '../mem_pools/tx_pool/index.js';
13
- type P2PClientDeps<T extends P2PClientType> = {
14
- txPool?: TxPool;
15
- store?: AztecAsyncKVStore;
16
- attestationPool?: T extends P2PClientType.Full ? AttestationPool : undefined;
17
- logger?: Logger;
18
- };
19
- export declare const createP2PClient: <T extends P2PClientType>(clientType: T, _config: P2PConfig & DataStoreConfig, l2BlockSource: L2BlockSource, proofVerifier: ClientProtocolCircuitVerifier, worldStateSynchronizer: WorldStateSynchronizer, epochCache: EpochCacheInterface, telemetry?: TelemetryClient, deps?: P2PClientDeps<T>) => Promise<P2PClient<T>>;
20
- export {};
21
- //# sourceMappingURL=factory.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"factory.d.ts","sourceRoot":"","sources":["../../src/client/factory.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AAC9D,OAAO,EAAE,KAAK,MAAM,EAAgB,MAAM,uBAAuB,CAAC;AAClE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AACzD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAE9D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACzD,OAAO,KAAK,EAAE,6BAA6B,EAAE,sBAAsB,EAAE,MAAM,iCAAiC,CAAC;AAC7G,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAClD,OAAO,EAAE,KAAK,eAAe,EAAsB,MAAM,yBAAyB,CAAC;AAEnF,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AACpD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAC9C,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,mDAAmD,CAAC;AAGzF,OAAO,EAAiB,KAAK,MAAM,EAAE,MAAM,+BAA+B,CAAC;AAM3E,KAAK,aAAa,CAAC,CAAC,SAAS,aAAa,IAAI;IAC5C,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,iBAAiB,CAAC;IAC1B,eAAe,CAAC,EAAE,CAAC,SAAS,aAAa,CAAC,IAAI,GAAG,eAAe,GAAG,SAAS,CAAC;IAC7E,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF,eAAO,MAAM,eAAe,wCACd,CAAC,WACJ,SAAS,GAAG,eAAe,iBACrB,aAAa,iBACb,6BAA6B,0BACpB,sBAAsB,cAClC,mBAAmB,cACpB,eAAe,SACpB,cAAc,CAAC,CAAC,0BAoDvB,CAAC"}
@@ -1,3 +0,0 @@
1
- export * from './p2p_client.js';
2
- export * from './factory.js';
3
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/client/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAC;AAChC,cAAc,cAAc,CAAC"}
@@ -1,314 +0,0 @@
1
- import type { AztecAsyncKVStore } from '@aztec/kv-store';
2
- import type { L2BlockId, L2BlockSource, L2BlockStreamEvent, L2Tips } from '@aztec/stdlib/block';
3
- import type { P2PApi, PeerInfo, ProverCoordination } from '@aztec/stdlib/interfaces/server';
4
- import type { BlockAttestation, BlockProposal, P2PClientType } from '@aztec/stdlib/p2p';
5
- import type { Tx, TxHash } from '@aztec/stdlib/tx';
6
- import { type TelemetryClient, WithTracer } from '@aztec/telemetry-client';
7
- import type { ENR } from '@chainsafe/enr';
8
- import { type P2PConfig } from '../config.js';
9
- import type { MemPools } from '../mem_pools/interface.js';
10
- import type { P2PService } from '../services/service.js';
11
- /**
12
- * Enum defining the possible states of the p2p client.
13
- */
14
- export declare enum P2PClientState {
15
- IDLE = 0,
16
- SYNCHING = 1,
17
- RUNNING = 2,
18
- STOPPED = 3
19
- }
20
- /**
21
- * The synchronization status of the P2P client.
22
- */
23
- export interface P2PSyncState {
24
- /**
25
- * The current state of the p2p client.
26
- */
27
- state: P2PClientState;
28
- /**
29
- * The block number that the p2p client is synced to.
30
- */
31
- syncedToL2Block: L2BlockId;
32
- }
33
- /**
34
- * Interface of a P2P client.
35
- **/
36
- export type P2P<T extends P2PClientType = P2PClientType.Full> = ProverCoordination & P2PApi<T> & {
37
- /**
38
- * Broadcasts a block proposal to other peers.
39
- *
40
- * @param proposal - the block proposal
41
- */
42
- broadcastProposal(proposal: BlockProposal): void;
43
- /**
44
- * Registers a callback from the validator client that determines how to behave when
45
- * foreign block proposals are received
46
- *
47
- * @param handler - A function taking a received block proposal and producing an attestation
48
- */
49
- registerBlockProposalHandler(handler: (block: BlockProposal) => Promise<BlockAttestation | undefined>): void;
50
- /**
51
- * Request a list of transactions from another peer by their tx hashes.
52
- * @param txHashes - Hashes of the txs to query.
53
- * @returns A list of transactions or undefined if the transactions are not found.
54
- */
55
- requestTxs(txHashes: TxHash[]): Promise<(Tx | undefined)[]>;
56
- /**
57
- * Request a transaction from another peer by its tx hash.
58
- * @param txHash - Hash of the tx to query.
59
- */
60
- requestTxByHash(txHash: TxHash): Promise<Tx | undefined>;
61
- /**
62
- * Verifies the 'tx' and, if valid, adds it to local tx pool and forwards it to other peers.
63
- * @param tx - The transaction.
64
- **/
65
- sendTx(tx: Tx): Promise<void>;
66
- /**
67
- * Deletes 'txs' from the pool, given hashes.
68
- * NOT used if we use sendTx as reconcileTxPool will handle this.
69
- * @param txHashes - Hashes to check.
70
- **/
71
- deleteTxs(txHashes: TxHash[]): Promise<void>;
72
- /**
73
- * Returns a transaction in the transaction pool by its hash.
74
- * @param txHash - Hash of tx to return.
75
- * @returns A single tx or undefined.
76
- */
77
- getTxByHashFromPool(txHash: TxHash): Promise<Tx | undefined>;
78
- /**
79
- * Returns a transaction in the transaction pool by its hash, requesting it from the network if it is not found.
80
- * @param txHash - Hash of tx to return.
81
- * @returns A single tx or undefined.
82
- */
83
- getTxByHash(txHash: TxHash): Promise<Tx | undefined>;
84
- /**
85
- * Returns an archived transaction from the transaction pool by its hash.
86
- * @param txHash - Hash of tx to return.
87
- * @returns A single tx or undefined.
88
- */
89
- getArchivedTxByHash(txHash: TxHash): Promise<Tx | undefined>;
90
- /**
91
- * Returns whether the given tx hash is flagged as pending or mined.
92
- * @param txHash - Hash of the tx to query.
93
- * @returns Pending or mined depending on its status, or undefined if not found.
94
- */
95
- getTxStatus(txHash: TxHash): Promise<'pending' | 'mined' | undefined>;
96
- /** Returns an iterator over pending txs on the mempool. */
97
- iteratePendingTxs(): AsyncIterableIterator<Tx>;
98
- /** Returns the number of pending txs in the mempool. */
99
- getPendingTxCount(): Promise<number>;
100
- /**
101
- * Starts the p2p client.
102
- * @returns A promise signalling the completion of the block sync.
103
- */
104
- start(): Promise<void>;
105
- /**
106
- * Stops the p2p client.
107
- * @returns A promise signalling the completion of the stop process.
108
- */
109
- stop(): Promise<void>;
110
- /**
111
- * Indicates if the p2p client is ready for transaction submission.
112
- * @returns A boolean flag indicating readiness.
113
- */
114
- isReady(): boolean;
115
- /**
116
- * Returns the current status of the p2p client.
117
- */
118
- getStatus(): Promise<P2PSyncState>;
119
- /**
120
- * Returns the ENR of this node, if any.
121
- */
122
- getEnr(): ENR | undefined;
123
- /** Identifies a p2p client. */
124
- isP2PClient(): true;
125
- };
126
- /**
127
- * The P2P client implementation.
128
- */
129
- export declare class P2PClient<T extends P2PClientType = P2PClientType.Full> extends WithTracer implements P2P, P2P<P2PClientType.Prover> {
130
- #private;
131
- private l2BlockSource;
132
- private p2pService;
133
- private log;
134
- /** The JS promise that will be running to keep the client's data in sync. Can be interrupted if the client is stopped. */
135
- private runningPromise;
136
- private currentState;
137
- private syncPromise;
138
- private syncResolve?;
139
- private latestBlockNumberAtStart;
140
- private provenBlockNumberAtStart;
141
- private synchedBlockHashes;
142
- private synchedLatestBlockNumber;
143
- private synchedProvenBlockNumber;
144
- private txPool;
145
- private attestationPool;
146
- /** How many slots to keep attestations for. */
147
- private keepAttestationsInPoolFor;
148
- /** How many slots to keep proven txs for. */
149
- private keepProvenTxsFor;
150
- private blockStream;
151
- /**
152
- * In-memory P2P client constructor.
153
- * @param store - The client's instance of the KV store.
154
- * @param l2BlockSource - P2P client's source for fetching existing blocks.
155
- * @param txPool - The client's instance of a transaction pool. Defaults to in-memory implementation.
156
- * @param p2pService - The concrete instance of p2p networking to use.
157
- * @param keepProvenTxsFor - How many blocks have to pass after a block is proven before its txs are deleted (zero to delete immediately once proven).
158
- * @param log - A logger.
159
- */
160
- constructor(_clientType: T, store: AztecAsyncKVStore, l2BlockSource: L2BlockSource, mempools: MemPools<T>, p2pService: P2PService, config?: Partial<P2PConfig>, telemetry?: TelemetryClient, log?: import("@aztec/foundation/log").Logger);
161
- isP2PClient(): true;
162
- getPeers(includePending?: boolean): Promise<PeerInfo[]>;
163
- getL2BlockHash(number: number): Promise<string | undefined>;
164
- getL2Tips(): Promise<L2Tips>;
165
- handleBlockStreamEvent(event: L2BlockStreamEvent): Promise<void>;
166
- /**
167
- * Starts the P2P client.
168
- * @returns An empty promise signalling the synching process.
169
- */
170
- start(): Promise<void>;
171
- /**
172
- * Allows consumers to stop the instance of the P2P client.
173
- * 'ready' will now return 'false' and the running promise that keeps the client synced is interrupted.
174
- */
175
- stop(): Promise<void>;
176
- broadcastProposal(proposal: BlockProposal): void;
177
- getAttestationsForSlot(slot: bigint, proposalId: string): Promise<BlockAttestation[]>;
178
- registerBlockProposalHandler(handler: (block: BlockProposal) => Promise<BlockAttestation | undefined>): void;
179
- /**
180
- * Requests the transactions with the given hashes from the network.
181
- *
182
- * If a transaction can be retrieved, it will be returned, if not an undefined
183
- * will be returned. In place.
184
- *
185
- * @param txHashes - The hashes of the transactions to request.
186
- * @returns A promise that resolves to an array of transactions or undefined.
187
- */
188
- requestTxs(txHashes: TxHash[]): Promise<(Tx | undefined)[]>;
189
- /**
190
- * Uses the Request Response protocol to request a transaction from the network.
191
- *
192
- * If the underlying request response protocol fails, then we return undefined.
193
- * If it succeeds then we add the transaction to our transaction pool and return.
194
- *
195
- * @param txHash - The hash of the transaction to request.
196
- * @returns A promise that resolves to a transaction or undefined.
197
- */
198
- requestTxByHash(txHash: TxHash): Promise<Tx | undefined>;
199
- /**
200
- * Uses the batched Request Response protocol to request a set of transactions from the network.
201
- */
202
- requestTxsByHash(txHashes: TxHash[]): Promise<Tx[]>;
203
- getPendingTxs(): Promise<Tx[]>;
204
- getPendingTxCount(): Promise<number>;
205
- iteratePendingTxs(): AsyncIterableIterator<Tx>;
206
- /**
207
- * Returns all transactions in the transaction pool.
208
- * @returns An array of Txs.
209
- */
210
- getTxs(filter: 'all' | 'pending' | 'mined'): Promise<Tx[]>;
211
- /**
212
- * Returns a transaction in the transaction pool by its hash.
213
- * @param txHash - Hash of the transaction to look for in the pool.
214
- * @returns A single tx or undefined.
215
- */
216
- getTxByHashFromPool(txHash: TxHash): Promise<Tx | undefined>;
217
- /**
218
- * Returns a transaction in the transaction pool by its hash.
219
- * If the transaction is not in the pool, it will be requested from the network.
220
- * @param txHash - Hash of the transaction to look for in the pool.
221
- * @returns A single tx or undefined.
222
- */
223
- getTxByHash(txHash: TxHash): Promise<Tx | undefined>;
224
- /**
225
- * Returns transactions in the transaction pool by hash.
226
- * If a transaction is not in the pool, it will be requested from the network.
227
- * @param txHashes - Hashes of the transactions to look for.
228
- * @returns The txs found, not necessarily on the same order as the hashes.
229
- */
230
- getTxsByHash(txHashes: TxHash[]): Promise<Tx[]>;
231
- /**
232
- * Returns an archived transaction in the transaction pool by its hash.
233
- * @param txHash - Hash of the archived transaction to look for.
234
- * @returns A single tx or undefined.
235
- */
236
- getArchivedTxByHash(txHash: TxHash): Promise<Tx | undefined>;
237
- /**
238
- * Verifies the 'tx' and, if valid, adds it to local tx pool and forwards it to other peers.
239
- * @param tx - The tx to verify.
240
- * @returns Empty promise.
241
- **/
242
- sendTx(tx: Tx): Promise<void>;
243
- /**
244
- * Returns whether the given tx hash is flagged as pending or mined.
245
- * @param txHash - Hash of the tx to query.
246
- * @returns Pending or mined depending on its status, or undefined if not found.
247
- */
248
- getTxStatus(txHash: TxHash): Promise<'pending' | 'mined' | undefined>;
249
- getEnr(): ENR | undefined;
250
- getEncodedEnr(): Promise<string | undefined>;
251
- /**
252
- * Deletes the 'txs' from the pool.
253
- * NOT used if we use sendTx as reconcileTxPool will handle this.
254
- * @param txHashes - Hashes of the transactions to delete.
255
- * @returns Empty promise.
256
- **/
257
- deleteTxs(txHashes: TxHash[]): Promise<void>;
258
- /**
259
- * Public function to check if the p2p client is fully synced and ready to receive txs.
260
- * @returns True if the P2P client is ready to receive txs.
261
- */
262
- isReady(): boolean;
263
- /**
264
- * Public function to check the latest block number that the P2P client is synced to.
265
- * @returns Block number of latest L2 Block we've synced with.
266
- */
267
- getSyncedLatestBlockNum(): Promise<number>;
268
- /**
269
- * Public function to check the latest proven block number that the P2P client is synced to.
270
- * @returns Block number of latest proven L2 Block we've synced with.
271
- */
272
- getSyncedProvenBlockNum(): Promise<number>;
273
- /**
274
- * Method to check the status the p2p client.
275
- * @returns Information about p2p client status: state & syncedToBlockNum.
276
- */
277
- getStatus(): Promise<P2PSyncState>;
278
- /**
279
- * Mark all txs from these blocks as mined.
280
- * @param blocks - A list of existing blocks with txs that the P2P client needs to ensure the tx pool is reconciled with.
281
- * @returns Empty promise.
282
- */
283
- private markTxsAsMinedFromBlocks;
284
- /**
285
- * Deletes txs from these blocks.
286
- * @param blocks - A list of existing blocks with txs that the P2P client needs to ensure the tx pool is reconciled with.
287
- * @returns Empty promise.
288
- */
289
- private deleteTxsFromBlocks;
290
- /**
291
- * Handles new mined blocks by marking the txs in them as mined.
292
- * @param blocks - A list of existing blocks with txs that the P2P client needs to ensure the tx pool is reconciled with.
293
- * @returns Empty promise.
294
- */
295
- private handleLatestL2Blocks;
296
- /**
297
- * Handles new proven blocks by deleting the txs in them, or by deleting the txs in blocks `keepProvenTxsFor` ago.
298
- * @param blocks - A list of proven L2 blocks.
299
- * @returns Empty promise.
300
- */
301
- private handleProvenL2Blocks;
302
- /**
303
- * Updates the tx pool after a chain prune.
304
- * @param latestBlock - The block number the chain was pruned to.
305
- */
306
- private handlePruneL2Blocks;
307
- private startServiceIfSynched;
308
- /**
309
- * Method to set the value of the current state.
310
- * @param newState - New state value.
311
- */
312
- private setCurrentState;
313
- }
314
- //# sourceMappingURL=p2p_client.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"p2p_client.d.ts","sourceRoot":"","sources":["../../src/client/p2p_client.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,iBAAiB,EAAsC,MAAM,iBAAiB,CAAC;AAC7F,OAAO,KAAK,EAAW,SAAS,EAAE,aAAa,EAAE,kBAAkB,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AACzG,OAAO,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,kBAAkB,EAAE,MAAM,iCAAiC,CAAC;AAC5F,OAAO,KAAK,EAAE,gBAAgB,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AACxF,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AACnD,OAAO,EAEL,KAAK,eAAe,EAEpB,UAAU,EAGX,MAAM,yBAAyB,CAAC;AAEjC,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,gBAAgB,CAAC;AAE1C,OAAO,EAAE,KAAK,SAAS,EAAuB,MAAM,cAAc,CAAC;AAEnE,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,2BAA2B,CAAC;AAG1D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AAEzD;;GAEG;AACH,oBAAY,cAAc;IACxB,IAAI,IAAA;IACJ,QAAQ,IAAA;IACR,OAAO,IAAA;IACP,OAAO,IAAA;CACR;AAED;;GAEG;AACH,MAAM,WAAW,YAAY;IA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ACW,mBAAmB;IAQjC;;;;OAIG;YACW,oBAAoB;IAelC;;;;OAIG;YACW,oBAAoB;IAgClC;;;OAGG;YACW,mBAAmB;YAoCnB,qBAAqB;IAenC;;;OAGG;IACH,OAAO,CAAC,eAAe;CAKxB"}
package/dest/config.d.ts DELETED
@@ -1,185 +0,0 @@
1
- import { type ConfigMappingsType } from '@aztec/foundation/config';
2
- import { type DataStoreConfig } from '@aztec/kv-store/config';
3
- import { type ChainConfig } from '@aztec/stdlib/config';
4
- import { type P2PReqRespConfig } from './services/reqresp/config.js';
5
- /**
6
- * P2P client configuration values.
7
- */
8
- export interface P2PConfig extends P2PReqRespConfig, ChainConfig {
9
- /**
10
- * A flag dictating whether the P2P subsystem should be enabled.
11
- */
12
- p2pEnabled: boolean;
13
- /**
14
- * The frequency in which to check for new L2 blocks.
15
- */
16
- blockCheckIntervalMS: number;
17
- /**
18
- * The number of blocks to fetch in a single batch.
19
- */
20
- blockRequestBatchSize: number;
21
- /**
22
- * DEBUG: Disable colocation penalty - for testing purposes only
23
- */
24
- debugDisableColocationPenalty: boolean;
25
- /**
26
- * The frequency in which to check for new peers.
27
- */
28
- peerCheckIntervalMS: number;
29
- /**
30
- * Size of queue of L2 blocks to store.
31
- */
32
- l2QueueSize: number;
33
- /**
34
- * The announce address for TCP.
35
- */
36
- tcpAnnounceAddress?: string;
37
- /**
38
- * The announce address for UDP.
39
- */
40
- udpAnnounceAddress?: string;
41
- /**
42
- * The listen address for TCP.
43
- */
44
- tcpListenAddress: string;
45
- /**
46
- * The listen address for UDP.
47
- */
48
- udpListenAddress: string;
49
- /**
50
- * An optional peer id private key. If blank, will generate a random key.
51
- */
52
- peerIdPrivateKey?: string;
53
- /**
54
- * A list of bootstrap peers to connect to.
55
- */
56
- bootstrapNodes: string[];
57
- /** Whether to execute the version check in the bootstrap node ENR. */
58
- bootstrapNodeEnrVersionCheck: boolean;
59
- /** Whether to consider any configured bootnodes as full peers, e.g. for transaction gossiping */
60
- bootstrapNodesAsFullPeers: boolean;
61
- /**
62
- * Protocol identifier for transaction gossiping.
63
- */
64
- transactionProtocol: string;
65
- /**
66
- * The maximum number of peers (a peer count above this will cause the node to refuse connection attempts)
67
- */
68
- maxPeerCount: number;
69
- /**
70
- * If announceUdpAddress or announceTcpAddress are not provided, query for the IP address of the machine. Default is false.
71
- */
72
- queryForIp: boolean;
73
- /** How many blocks have to pass after a block is proven before its txs are deleted (zero to delete immediately once proven) */
74
- keepProvenTxsInPoolFor: number;
75
- /** How many slots to keep attestations for. */
76
- keepAttestationsInPoolFor: number;
77
- /**
78
- * The interval of the gossipsub heartbeat to perform maintenance tasks.
79
- */
80
- gossipsubInterval: number;
81
- /**
82
- * The D parameter for the gossipsub protocol.
83
- */
84
- gossipsubD: number;
85
- /**
86
- * The Dlo parameter for the gossipsub protocol.
87
- */
88
- gossipsubDlo: number;
89
- /**
90
- * The Dhi parameter for the gossipsub protocol.
91
- */
92
- gossipsubDhi: number;
93
- /**
94
- * The Dlazy parameter for the gossipsub protocol.
95
- */
96
- gossipsubDLazy: number;
97
- /**
98
- * Whether to flood publish messages. - For testing purposes only
99
- */
100
- gossipsubFloodPublish: boolean;
101
- /**
102
- * The number of gossipsub interval message cache windows to keep.
103
- */
104
- gossipsubMcacheLength: number;
105
- /**
106
- * How many message cache windows to include when gossiping with other pears.
107
- */
108
- gossipsubMcacheGossip: number;
109
- /**
110
- * The 'age' (in # of L2 blocks) of a processed tx after which we heavily penalize a peer for re-sending it.
111
- */
112
- severePeerPenaltyBlockLength: number;
113
- /**
114
- * The weight of the tx topic for the gossipsub protocol. This determines how much the score for this specific topic contributes to the overall peer score.
115
- */
116
- gossipsubTxTopicWeight: number;
117
- /**
118
- * This is the weight applied to the penalty for delivering invalid messages.
119
- */
120
- gossipsubTxInvalidMessageDeliveriesWeight: number;
121
- /**
122
- * determines how quickly the penalty for invalid message deliveries decays over time. Between 0 and 1.
123
- */
124
- gossipsubTxInvalidMessageDeliveriesDecay: number;
125
- /**
126
- * The values for the peer scoring system. Passed as a comma separated list of values in order: low, mid, high tolerance errors.
127
- */
128
- peerPenaltyValues: number[];
129
- /** Limit of transactions to archive in the tx pool. Once the archived tx limit is reached, the oldest archived txs will be purged. */
130
- archivedTxLimit: number;
131
- }
132
- export declare const p2pConfigMappings: ConfigMappingsType<P2PConfig>;
133
- /**
134
- * Gets the config values for p2p client from environment variables.
135
- * @returns The config values for p2p client.
136
- */
137
- export declare function getP2PConfigFromEnv(): P2PConfig;
138
- export declare function getP2PDefaultConfig(): P2PConfig;
139
- /**
140
- * Required P2P config values for a bootstrap node.
141
- */
142
- export type BootnodeConfig = Pick<P2PConfig, 'udpAnnounceAddress' | 'peerIdPrivateKey' | 'bootstrapNodes'> & Required<Pick<P2PConfig, 'udpListenAddress'>> & Pick<DataStoreConfig, 'dataDirectory' | 'dataStoreMapSizeKB'> & Pick<ChainConfig, 'l1ChainId'>;
143
- export declare const bootnodeConfigMappings: ConfigMappingsType<Pick<{
144
- l1ChainId: unknown;
145
- version: unknown;
146
- l1Contracts: unknown;
147
- dataDirectory: unknown;
148
- dataStoreMapSizeKB: unknown;
149
- overallRequestTimeoutMs: unknown;
150
- individualRequestTimeoutMs: unknown;
151
- p2pEnabled: unknown;
152
- blockCheckIntervalMS: unknown;
153
- blockRequestBatchSize: unknown;
154
- debugDisableColocationPenalty: unknown;
155
- peerCheckIntervalMS: unknown;
156
- l2QueueSize: unknown;
157
- tcpAnnounceAddress: unknown;
158
- udpAnnounceAddress: unknown;
159
- tcpListenAddress: unknown;
160
- udpListenAddress: unknown;
161
- peerIdPrivateKey: unknown;
162
- bootstrapNodes: unknown;
163
- bootstrapNodeEnrVersionCheck: unknown;
164
- bootstrapNodesAsFullPeers: unknown;
165
- transactionProtocol: unknown;
166
- maxPeerCount: unknown;
167
- queryForIp: unknown;
168
- keepProvenTxsInPoolFor: unknown;
169
- keepAttestationsInPoolFor: unknown;
170
- gossipsubInterval: unknown;
171
- gossipsubD: unknown;
172
- gossipsubDlo: unknown;
173
- gossipsubDhi: unknown;
174
- gossipsubDLazy: unknown;
175
- gossipsubFloodPublish: unknown;
176
- gossipsubMcacheLength: unknown;
177
- gossipsubMcacheGossip: unknown;
178
- severePeerPenaltyBlockLength: unknown;
179
- gossipsubTxTopicWeight: unknown;
180
- gossipsubTxInvalidMessageDeliveriesWeight: unknown;
181
- gossipsubTxInvalidMessageDeliveriesDecay: unknown;
182
- peerPenaltyValues: unknown;
183
- archivedTxLimit: unknown;
184
- }, "udpAnnounceAddress" | "udpListenAddress" | "peerIdPrivateKey" | "bootstrapNodes" | "l1ChainId" | "dataDirectory" | "dataStoreMapSizeKB">>;
185
- //# sourceMappingURL=config.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,kBAAkB,EAMxB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,KAAK,eAAe,EAAsB,MAAM,wBAAwB,CAAC;AAClF,OAAO,EAAE,KAAK,WAAW,EAAuB,MAAM,sBAAsB,CAAC;AAE7E,OAAO,EAAE,KAAK,gBAAgB,EAA4B,MAAM,8BAA8B,CAAC;AAE/F;;GAEG;AACH,MAAM,WAAW,SAAU,SAAQ,gBAAgB,EAAE,WAAW;IAC9D;;OAEG;IACH,UAAU,EAAE,OAAO,CAAC;IAEpB;;OAEG;IACH,oBAAoB,EAAE,MAAM,CAAC;IAE7B;;OAEG;IACH,qBAAqB,EAAE,MAAM,CAAC;IAE9B;;OAEG;IACH,6BAA6B,EAAE,OAAO,CAAC;IAEvC;;OAEG;IACH,mBAAmB,EAAE,MAAM,CAAC;IAE5B;;OAEG;IACH,WAAW,EAAE,MAAM,CAAC;IAEpB;;OAEG;IACH,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAE5B;;OAEG;IACH,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAE5B;;OAEG;IACH,gBAAgB,EAAE,MAAM,CAAC;IAEzB;;OAEG;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AAmB,IAAI,SAAS,CAE/C;AAED;;GAEG;AACH,MAAM,MAAM,cAAc,GAAG,IAAI,CAAC,SAAS,EAAE,oBAAoB,GAAG,kBAAkB,GAAG,gBAAgB,CAAC,GACxG,QAAQ,CAAC,IAAI,CAAC,SAAS,EAAE,kBAAkB,CAAC,CAAC,GAC7C,IAAI,CAAC,eAAe,EAAE,eAAe,GAAG,oBAAoB,CAAC,GAC7D,IAAI,CAAC,WAAW,EAAE,WAAW,CAAC,CAAC;AAYjC,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;6IAGlC,CAAC"}
@@ -1,9 +0,0 @@
1
- import type { LogFn } from '@aztec/foundation/log';
2
- import { SignableENR } from '@chainsafe/enr';
3
- import type { PeerId } from '@libp2p/interface';
4
- export declare function createBootnodeENRandPeerId(privateKey: string, udpAnnounceAddress: string, l1ChainId: number): Promise<{
5
- enr: SignableENR;
6
- peerId: PeerId;
7
- }>;
8
- export declare function printENR(enr: string, log: LogFn): Promise<void>;
9
- //# sourceMappingURL=generate-enr.d.ts.map