@aztec/p2p 2.1.0-rc.21 → 2.1.0-rc.22
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.
package/dest/client/factory.js
CHANGED
|
@@ -18,7 +18,7 @@ export const P2P_ATTESTATION_STORE_NAME = 'p2p-attestation';
|
|
|
18
18
|
export async function createP2PClient(clientType, inputConfig, archiver, proofVerifier, worldStateSynchronizer, epochCache, packageVersion, dateProvider = new DateProvider(), telemetry = getTelemetryClient(), deps = {}) {
|
|
19
19
|
const config = await configureP2PClientAddresses({
|
|
20
20
|
...inputConfig,
|
|
21
|
-
|
|
21
|
+
dataStoreMapSizeKb: inputConfig.p2pStoreMapSizeKb ?? inputConfig.dataStoreMapSizeKb
|
|
22
22
|
});
|
|
23
23
|
const logger = deps.logger ?? createLogger('p2p');
|
|
24
24
|
if (config.bootstrapNodes.length === 0) {
|
package/dest/config.d.ts
CHANGED
|
@@ -77,7 +77,7 @@ export interface P2PConfig extends P2PReqRespConfig, ChainConfig, TxCollectionCo
|
|
|
77
77
|
privatePeers: string[];
|
|
78
78
|
/** A list of preferred peers. */
|
|
79
79
|
preferredPeers: string[];
|
|
80
|
-
/** The maximum possible size of the P2P DB in KB. Overwrites the general
|
|
80
|
+
/** The maximum possible size of the P2P DB in KB. Overwrites the general dataStoreMapSizeKb. */
|
|
81
81
|
p2pStoreMapSizeKb?: number;
|
|
82
82
|
/** Which calls are allowed in the public setup phase of a tx. */
|
|
83
83
|
txPublicSetupAllowList: AllowedElement[];
|
|
@@ -115,13 +115,13 @@ export declare function getP2PDefaultConfig(): P2PConfig;
|
|
|
115
115
|
/**
|
|
116
116
|
* Required P2P config values for a bootstrap node.
|
|
117
117
|
*/
|
|
118
|
-
export type BootnodeConfig = Pick<P2PConfig, 'p2pIp' | 'p2pPort' | 'p2pBroadcastPort' | 'peerIdPrivateKey' | 'peerIdPrivateKeyPath' | 'bootstrapNodes' | 'listenAddress' | 'queryForIp'> & Required<Pick<P2PConfig, 'p2pIp' | 'p2pPort'>> & Pick<DataStoreConfig, 'dataDirectory' | '
|
|
118
|
+
export type BootnodeConfig = Pick<P2PConfig, 'p2pIp' | 'p2pPort' | 'p2pBroadcastPort' | 'peerIdPrivateKey' | 'peerIdPrivateKeyPath' | 'bootstrapNodes' | 'listenAddress' | 'queryForIp'> & Required<Pick<P2PConfig, 'p2pIp' | 'p2pPort'>> & Pick<DataStoreConfig, 'dataDirectory' | 'dataStoreMapSizeKb'> & Pick<ChainConfig, 'l1ChainId'>;
|
|
119
119
|
export declare const bootnodeConfigMappings: ConfigMappingsType<Pick<{
|
|
120
120
|
l1ChainId: unknown;
|
|
121
121
|
rollupVersion: unknown;
|
|
122
122
|
l1Contracts: unknown;
|
|
123
123
|
dataDirectory: unknown;
|
|
124
|
-
|
|
124
|
+
dataStoreMapSizeKb: unknown;
|
|
125
125
|
overallRequestTimeoutMs: unknown;
|
|
126
126
|
individualRequestTimeoutMs: unknown;
|
|
127
127
|
p2pOptimisticNegotiation: unknown;
|
|
@@ -184,7 +184,7 @@ export declare const bootnodeConfigMappings: ConfigMappingsType<Pick<{
|
|
|
184
184
|
dropTransactions: unknown;
|
|
185
185
|
dropTransactionsProbability: unknown;
|
|
186
186
|
txPoolDeleteTxsAfterReorg: unknown;
|
|
187
|
-
}, "p2pPort" | "p2pBroadcastPort" | "p2pIp" | "listenAddress" | "peerIdPrivateKey" | "peerIdPrivateKeyPath" | "bootstrapNodes" | "queryForIp" | "l1ChainId" | "dataDirectory" | "
|
|
187
|
+
}, "p2pPort" | "p2pBroadcastPort" | "p2pIp" | "listenAddress" | "peerIdPrivateKey" | "peerIdPrivateKeyPath" | "bootstrapNodes" | "queryForIp" | "l1ChainId" | "dataDirectory" | "dataStoreMapSizeKb">>;
|
|
188
188
|
/**
|
|
189
189
|
* Parses a string to a list of allowed elements.
|
|
190
190
|
* Each encoded is expected to be of one of the following formats
|
package/dest/config.js
CHANGED
|
@@ -197,7 +197,7 @@ export const p2pConfigMappings = {
|
|
|
197
197
|
p2pStoreMapSizeKb: {
|
|
198
198
|
env: 'P2P_STORE_MAP_SIZE_KB',
|
|
199
199
|
parseEnv: (val)=>val ? +val : undefined,
|
|
200
|
-
description: 'The maximum possible size of the P2P DB in KB. Overwrites the general
|
|
200
|
+
description: 'The maximum possible size of the P2P DB in KB. Overwrites the general dataStoreMapSizeKb.'
|
|
201
201
|
},
|
|
202
202
|
txPublicSetupAllowList: {
|
|
203
203
|
env: 'TX_PUBLIC_SETUP_ALLOWLIST',
|
|
@@ -276,7 +276,7 @@ const bootnodeConfigKeys = [
|
|
|
276
276
|
'peerIdPrivateKey',
|
|
277
277
|
'peerIdPrivateKeyPath',
|
|
278
278
|
'dataDirectory',
|
|
279
|
-
'
|
|
279
|
+
'dataStoreMapSizeKb',
|
|
280
280
|
'bootstrapNodes',
|
|
281
281
|
'l1ChainId',
|
|
282
282
|
'queryForIp'
|
|
@@ -205,7 +205,7 @@ export function createBootstrapNodeConfig(privateKey, port, chainConfig) {
|
|
|
205
205
|
p2pPort: port,
|
|
206
206
|
peerIdPrivateKey: new SecretValue(privateKey),
|
|
207
207
|
dataDirectory: undefined,
|
|
208
|
-
|
|
208
|
+
dataStoreMapSizeKb: 0,
|
|
209
209
|
bootstrapNodes: [],
|
|
210
210
|
listenAddress: '127.0.0.1',
|
|
211
211
|
queryForIp: false
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aztec/p2p",
|
|
3
|
-
"version": "2.1.0-rc.
|
|
3
|
+
"version": "2.1.0-rc.22",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"exports": {
|
|
6
6
|
".": "./dest/index.js",
|
|
@@ -67,17 +67,17 @@
|
|
|
67
67
|
]
|
|
68
68
|
},
|
|
69
69
|
"dependencies": {
|
|
70
|
-
"@aztec/constants": "2.1.0-rc.
|
|
71
|
-
"@aztec/epoch-cache": "2.1.0-rc.
|
|
72
|
-
"@aztec/ethereum": "2.1.0-rc.
|
|
73
|
-
"@aztec/foundation": "2.1.0-rc.
|
|
74
|
-
"@aztec/kv-store": "2.1.0-rc.
|
|
75
|
-
"@aztec/noir-contracts.js": "2.1.0-rc.
|
|
76
|
-
"@aztec/noir-protocol-circuits-types": "2.1.0-rc.
|
|
77
|
-
"@aztec/protocol-contracts": "2.1.0-rc.
|
|
78
|
-
"@aztec/simulator": "2.1.0-rc.
|
|
79
|
-
"@aztec/stdlib": "2.1.0-rc.
|
|
80
|
-
"@aztec/telemetry-client": "2.1.0-rc.
|
|
70
|
+
"@aztec/constants": "2.1.0-rc.22",
|
|
71
|
+
"@aztec/epoch-cache": "2.1.0-rc.22",
|
|
72
|
+
"@aztec/ethereum": "2.1.0-rc.22",
|
|
73
|
+
"@aztec/foundation": "2.1.0-rc.22",
|
|
74
|
+
"@aztec/kv-store": "2.1.0-rc.22",
|
|
75
|
+
"@aztec/noir-contracts.js": "2.1.0-rc.22",
|
|
76
|
+
"@aztec/noir-protocol-circuits-types": "2.1.0-rc.22",
|
|
77
|
+
"@aztec/protocol-contracts": "2.1.0-rc.22",
|
|
78
|
+
"@aztec/simulator": "2.1.0-rc.22",
|
|
79
|
+
"@aztec/stdlib": "2.1.0-rc.22",
|
|
80
|
+
"@aztec/telemetry-client": "2.1.0-rc.22",
|
|
81
81
|
"@chainsafe/libp2p-gossipsub": "13.0.0",
|
|
82
82
|
"@chainsafe/libp2p-noise": "^15.0.0",
|
|
83
83
|
"@chainsafe/libp2p-yamux": "^6.0.2",
|
|
@@ -104,8 +104,8 @@
|
|
|
104
104
|
"xxhash-wasm": "^1.1.0"
|
|
105
105
|
},
|
|
106
106
|
"devDependencies": {
|
|
107
|
-
"@aztec/archiver": "2.1.0-rc.
|
|
108
|
-
"@aztec/world-state": "2.1.0-rc.
|
|
107
|
+
"@aztec/archiver": "2.1.0-rc.22",
|
|
108
|
+
"@aztec/world-state": "2.1.0-rc.22",
|
|
109
109
|
"@jest/globals": "^30.0.0",
|
|
110
110
|
"@types/jest": "^30.0.0",
|
|
111
111
|
"@types/node": "^22.15.17",
|
package/src/client/factory.ts
CHANGED
|
@@ -51,7 +51,7 @@ export async function createP2PClient<T extends P2PClientType>(
|
|
|
51
51
|
) {
|
|
52
52
|
const config = await configureP2PClientAddresses({
|
|
53
53
|
...inputConfig,
|
|
54
|
-
|
|
54
|
+
dataStoreMapSizeKb: inputConfig.p2pStoreMapSizeKb ?? inputConfig.dataStoreMapSizeKb,
|
|
55
55
|
});
|
|
56
56
|
|
|
57
57
|
const logger = deps.logger ?? createLogger('p2p');
|
package/src/config.ts
CHANGED
|
@@ -127,7 +127,7 @@ export interface P2PConfig extends P2PReqRespConfig, ChainConfig, TxCollectionCo
|
|
|
127
127
|
/** A list of preferred peers. */
|
|
128
128
|
preferredPeers: string[];
|
|
129
129
|
|
|
130
|
-
/** The maximum possible size of the P2P DB in KB. Overwrites the general
|
|
130
|
+
/** The maximum possible size of the P2P DB in KB. Overwrites the general dataStoreMapSizeKb. */
|
|
131
131
|
p2pStoreMapSizeKb?: number;
|
|
132
132
|
|
|
133
133
|
/** Which calls are allowed in the public setup phase of a tx. */
|
|
@@ -360,7 +360,7 @@ export const p2pConfigMappings: ConfigMappingsType<P2PConfig> = {
|
|
|
360
360
|
p2pStoreMapSizeKb: {
|
|
361
361
|
env: 'P2P_STORE_MAP_SIZE_KB',
|
|
362
362
|
parseEnv: (val: string | undefined) => (val ? +val : undefined),
|
|
363
|
-
description: 'The maximum possible size of the P2P DB in KB. Overwrites the general
|
|
363
|
+
description: 'The maximum possible size of the P2P DB in KB. Overwrites the general dataStoreMapSizeKb.',
|
|
364
364
|
},
|
|
365
365
|
txPublicSetupAllowList: {
|
|
366
366
|
env: 'TX_PUBLIC_SETUP_ALLOWLIST',
|
|
@@ -452,7 +452,7 @@ export type BootnodeConfig = Pick<
|
|
|
452
452
|
| 'queryForIp'
|
|
453
453
|
> &
|
|
454
454
|
Required<Pick<P2PConfig, 'p2pIp' | 'p2pPort'>> &
|
|
455
|
-
Pick<DataStoreConfig, 'dataDirectory' | '
|
|
455
|
+
Pick<DataStoreConfig, 'dataDirectory' | 'dataStoreMapSizeKb'> &
|
|
456
456
|
Pick<ChainConfig, 'l1ChainId'>;
|
|
457
457
|
|
|
458
458
|
const bootnodeConfigKeys: (keyof BootnodeConfig)[] = [
|
|
@@ -463,7 +463,7 @@ const bootnodeConfigKeys: (keyof BootnodeConfig)[] = [
|
|
|
463
463
|
'peerIdPrivateKey',
|
|
464
464
|
'peerIdPrivateKeyPath',
|
|
465
465
|
'dataDirectory',
|
|
466
|
-
'
|
|
466
|
+
'dataStoreMapSizeKb',
|
|
467
467
|
'bootstrapNodes',
|
|
468
468
|
'l1ChainId',
|
|
469
469
|
'queryForIp',
|
|
@@ -288,7 +288,7 @@ export function createBootstrapNodeConfig(privateKey: string, port: number, chai
|
|
|
288
288
|
p2pPort: port,
|
|
289
289
|
peerIdPrivateKey: new SecretValue(privateKey),
|
|
290
290
|
dataDirectory: undefined,
|
|
291
|
-
|
|
291
|
+
dataStoreMapSizeKb: 0,
|
|
292
292
|
bootstrapNodes: [],
|
|
293
293
|
listenAddress: '127.0.0.1',
|
|
294
294
|
queryForIp: false,
|