@aztec/aztec 1.0.0-staging.2 → 1.0.0
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/cli/chain_l2_config.d.ts +0 -3
- package/dest/cli/chain_l2_config.d.ts.map +1 -1
- package/dest/cli/chain_l2_config.js +1 -18
- package/dest/cli/util.d.ts +1 -12
- package/dest/cli/util.d.ts.map +1 -1
- package/dest/cli/util.js +15 -71
- package/package.json +30 -30
- package/src/cli/chain_l2_config.ts +1 -21
- package/src/cli/util.ts +16 -64
|
@@ -20,9 +20,6 @@ export type L2ChainConfig = {
|
|
|
20
20
|
autoUpdate: SharedNodeConfig['autoUpdate'];
|
|
21
21
|
autoUpdateUrl?: string;
|
|
22
22
|
maxTxPoolSize: number;
|
|
23
|
-
publicIncludeMetrics?: string[];
|
|
24
|
-
publicMetricsCollectorUrl?: string;
|
|
25
|
-
publicMetricsCollectFrom?: string[];
|
|
26
23
|
};
|
|
27
24
|
export declare const testnetIgnitionL2ChainConfig: L2ChainConfig;
|
|
28
25
|
export declare const alphaTestnetL2ChainConfig: L2ChainConfig;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chain_l2_config.d.ts","sourceRoot":"","sources":["../../src/cli/chain_l2_config.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;
|
|
1
|
+
{"version":3,"file":"chain_l2_config.d.ts","sourceRoot":"","sources":["../../src/cli/chain_l2_config.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAI/D,MAAM,MAAM,YAAY,GAAG,kBAAkB,GAAG,eAAe,CAAC;AAEhE,MAAM,MAAM,aAAa,GAAG;IAC1B,SAAS,EAAE,MAAM,CAAC;IAClB,oBAAoB,EAAE,MAAM,CAAC;IAC7B,iBAAiB,EAAE,MAAM,CAAC;IAC1B,kBAAkB,EAAE,MAAM,CAAC;IAC3B,0BAA0B,EAAE,MAAM,CAAC;IACnC,YAAY,EAAE,OAAO,CAAC;IACtB,YAAY,EAAE,OAAO,CAAC;IACtB,UAAU,EAAE,OAAO,CAAC;IACpB,iBAAiB,EAAE,MAAM,EAAE,CAAC;IAC5B,eAAe,EAAE,MAAM,CAAC;IACxB,mBAAmB,EAAE,MAAM,CAAC;IAC5B,sBAAsB,EAAE,MAAM,CAAC;IAC/B,iBAAiB,EAAE,MAAM,CAAC;IAC1B,iBAAiB,EAAE,MAAM,CAAC;IAC1B,UAAU,EAAE,OAAO,CAAC;IACpB,YAAY,EAAE,MAAM,CAAC;IACrB,UAAU,EAAE,gBAAgB,CAAC,YAAY,CAAC,CAAC;IAC3C,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,aAAa,EAAE,MAAM,CAAC;CACvB,CAAC;AAEF,eAAO,MAAM,4BAA4B,EAAE,aAoB1C,CAAC;AAEF,eAAO,MAAM,yBAAyB,EAAE,aAoBvC,CAAC;AAEF,wBAAsB,YAAY,CAAC,WAAW,EAAE,YAAY,gBAW3D;AAED,wBAAsB,gBAAgB,CAAC,WAAW,EAAE,YAAY,GAAG,OAAO,CAAC,aAAa,GAAG,SAAS,CAAC,CAWpG;AAmBD,wBAAsB,gCAAgC,CAAC,WAAW,EAAE,YAAY,iBAiC/E"}
|
|
@@ -1,8 +1,5 @@
|
|
|
1
1
|
import { EthAddress } from '@aztec/aztec.js';
|
|
2
2
|
import path from 'path';
|
|
3
|
-
import publicIncludeMetrics from '../../public_include_metric_prefixes.json' with {
|
|
4
|
-
type: 'json'
|
|
5
|
-
};
|
|
6
3
|
export const testnetIgnitionL2ChainConfig = {
|
|
7
4
|
l1ChainId: 11155111,
|
|
8
5
|
ethereumSlotDuration: 12,
|
|
@@ -43,12 +40,7 @@ export const alphaTestnetL2ChainConfig = {
|
|
|
43
40
|
snapshotsUrl: 'https://storage.googleapis.com/aztec-testnet/snapshots/',
|
|
44
41
|
autoUpdate: 'config-and-version',
|
|
45
42
|
autoUpdateUrl: 'https://storage.googleapis.com/aztec-testnet/auto-update/alpha-testnet.json',
|
|
46
|
-
maxTxPoolSize:
|
|
47
|
-
publicIncludeMetrics,
|
|
48
|
-
publicMetricsCollectorUrl: 'https://telemetry.alpha-testnet.aztec.network',
|
|
49
|
-
publicMetricsCollectFrom: [
|
|
50
|
-
'sequencer'
|
|
51
|
-
]
|
|
43
|
+
maxTxPoolSize: 2 * 1024 * 1024 * 1024
|
|
52
44
|
};
|
|
53
45
|
export async function getBootnodes(networkName) {
|
|
54
46
|
const url = `http://static.aztec.network/${networkName}/bootnodes.json`;
|
|
@@ -117,15 +109,6 @@ export async function enrichEnvironmentWithChainConfig(networkName) {
|
|
|
117
109
|
if (config.autoUpdateUrl) {
|
|
118
110
|
enrichVar('AUTO_UPDATE_URL', config.autoUpdateUrl);
|
|
119
111
|
}
|
|
120
|
-
if (config.publicIncludeMetrics) {
|
|
121
|
-
enrichVar('PUBLIC_OTEL_INCLUDE_METRICS', config.publicIncludeMetrics.join(','));
|
|
122
|
-
}
|
|
123
|
-
if (config.publicMetricsCollectorUrl) {
|
|
124
|
-
enrichVar('PUBLIC_OTEL_EXPORTER_OTLP_METRICS_ENDPOINT', config.publicMetricsCollectorUrl);
|
|
125
|
-
}
|
|
126
|
-
if (config.publicMetricsCollectFrom) {
|
|
127
|
-
enrichVar('PUBLIC_OTEL_COLLECT_FROM', config.publicMetricsCollectFrom.join(','));
|
|
128
|
-
}
|
|
129
112
|
enrichEthAddressVar('REGISTRY_CONTRACT_ADDRESS', config.registryAddress);
|
|
130
113
|
enrichEthAddressVar('SLASH_FACTORY_CONTRACT_ADDRESS', config.slashFactoryAddress);
|
|
131
114
|
enrichEthAddressVar('FEE_ASSET_HANDLER_CONTRACT_ADDRESS', config.feeAssetHandlerAddress);
|
package/dest/cli/util.d.ts
CHANGED
|
@@ -8,18 +8,6 @@ import type { PXEService } from '@aztec/pxe/server';
|
|
|
8
8
|
import type { ProverConfig } from '@aztec/stdlib/interfaces/server';
|
|
9
9
|
import type { Command } from 'commander';
|
|
10
10
|
import { type AztecStartOption } from './aztec_start_options.js';
|
|
11
|
-
export declare const enum ExitCode {
|
|
12
|
-
SUCCESS = 0,
|
|
13
|
-
ERROR = 1,
|
|
14
|
-
ROLLUP_UPGRADE = 78,// EX_CONFIG from FreeBSD (https://man.freebsd.org/cgi/man.cgi?query=sysexits)
|
|
15
|
-
VERSION_UPGRADE = 79,// prev + 1 because there's nothing better
|
|
16
|
-
SIGHUP = 129,
|
|
17
|
-
SIGINT = 130,
|
|
18
|
-
SIGQUIT = 131,
|
|
19
|
-
SIGTERM = 143
|
|
20
|
-
}
|
|
21
|
-
export declare function shutdown(logFn: LogFn, exitCode: ExitCode, cb?: Array<() => Promise<void>>): Promise<never>;
|
|
22
|
-
export declare function isShuttingDown(): boolean;
|
|
23
11
|
export declare const installSignalHandlers: (logFn: LogFn, cb?: Array<() => Promise<void>>) => void;
|
|
24
12
|
/**
|
|
25
13
|
* Creates logs for the initial accounts
|
|
@@ -72,4 +60,5 @@ export declare function preloadCrsDataForVerifying({ realProofs }: Pick<AztecNod
|
|
|
72
60
|
*/
|
|
73
61
|
export declare function preloadCrsDataForServerSideProving({ realProofs }: Pick<ProverConfig, 'realProofs'>, log: LogFn): Promise<void>;
|
|
74
62
|
export declare function setupUpdateMonitor(autoUpdateMode: SharedNodeConfig['autoUpdate'], updatesLocation: URL, followsCanonicalRollup: boolean, publicClient: ViemClient, registryContractAddress: EthAddress, signalHandlers: Array<() => Promise<void>>, updateNodeConfig?: (config: object) => Promise<void>): Promise<void>;
|
|
63
|
+
export declare function shutdown(logFn: LogFn, cb?: Array<() => Promise<void>>): Promise<void>;
|
|
75
64
|
//# sourceMappingURL=util.d.ts.map
|
package/dest/cli/util.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"util.d.ts","sourceRoot":"","sources":["../../src/cli/util.ts"],"names":[],"mappings":"AAAA,OAAO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CAAC,CAKf;AAED;;;;GAIG;AACH,wBAAsB,kCAAkC,CACtD,EAAE,UAAU,EAAE,EAAE,IAAI,CAAC,YAAY,EAAE,YAAY,CAAC,EAChD,GAAG,EAAE,KAAK,GACT,OAAO,CAAC,IAAI,CAAC,CAKf;AAED,wBAAsB,kBAAkB,CACtC,cAAc,EAAE,gBAAgB,CAAC,YAAY,CAAC,EAC9C,eAAe,EAAE,GAAG,EACpB,sBAAsB,EAAE,OAAO,EAC/B,YAAY,EAAE,UAAU,EACxB,uBAAuB,EAAE,UAAU,EACnC,cAAc,EAAE,KAAK,CAAC,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC,EAC1C,gBAAgB,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,iBA+DrD;AAED,wBAAsB,QAAQ,CAAC,KAAK,EAAE,KAAK,EAAE,EAAE,CAAC,EAAE,KAAK,CAAC,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC,iBAM3E"}
|
package/dest/cli/util.js
CHANGED
|
@@ -3,63 +3,13 @@ import { UpdateChecker } from '@aztec/stdlib/update-checker';
|
|
|
3
3
|
import { getTelemetryClient } from '@aztec/telemetry-client';
|
|
4
4
|
import chalk from 'chalk';
|
|
5
5
|
import { aztecStartOptions } from './aztec_start_options.js';
|
|
6
|
-
export var ExitCode = /*#__PURE__*/ function(ExitCode) {
|
|
7
|
-
ExitCode[ExitCode["SUCCESS"] = 0] = "SUCCESS";
|
|
8
|
-
ExitCode[ExitCode["ERROR"] = 1] = "ERROR";
|
|
9
|
-
ExitCode[ExitCode["ROLLUP_UPGRADE"] = 78] = "ROLLUP_UPGRADE";
|
|
10
|
-
ExitCode[ExitCode["VERSION_UPGRADE"] = 79] = "VERSION_UPGRADE";
|
|
11
|
-
// 128 + int(SIGNAL)
|
|
12
|
-
ExitCode[ExitCode["SIGHUP"] = 129] = "SIGHUP";
|
|
13
|
-
ExitCode[ExitCode["SIGINT"] = 130] = "SIGINT";
|
|
14
|
-
ExitCode[ExitCode["SIGQUIT"] = 131] = "SIGQUIT";
|
|
15
|
-
ExitCode[ExitCode["SIGTERM"] = 143] = "SIGTERM";
|
|
16
|
-
return ExitCode;
|
|
17
|
-
}({});
|
|
18
|
-
let shutdownPromise;
|
|
19
|
-
export function shutdown(logFn, exitCode, cb) {
|
|
20
|
-
if (shutdownPromise) {
|
|
21
|
-
logFn('Already shutting down.');
|
|
22
|
-
return shutdownPromise;
|
|
23
|
-
}
|
|
24
|
-
logFn('Shutting down...', {
|
|
25
|
-
exitCode
|
|
26
|
-
});
|
|
27
|
-
if (cb) {
|
|
28
|
-
shutdownPromise = Promise.allSettled(cb).then(()=>process.exit(exitCode));
|
|
29
|
-
} else {
|
|
30
|
-
// synchronously shuts down the process
|
|
31
|
-
// no need to set shutdownPromise on this branch of the if statement because no more code will be executed
|
|
32
|
-
process.exit(exitCode);
|
|
33
|
-
}
|
|
34
|
-
return shutdownPromise;
|
|
35
|
-
}
|
|
36
|
-
export function isShuttingDown() {
|
|
37
|
-
return shutdownPromise !== undefined;
|
|
38
|
-
}
|
|
39
6
|
export const installSignalHandlers = (logFn, cb)=>{
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
'SIGTERM',
|
|
47
|
-
143
|
|
48
|
-
],
|
|
49
|
-
[
|
|
50
|
-
'SIGHUP',
|
|
51
|
-
129
|
|
52
|
-
],
|
|
53
|
-
[
|
|
54
|
-
'SIQUIT',
|
|
55
|
-
131
|
|
56
|
-
]
|
|
57
|
-
];
|
|
58
|
-
for (const [signal, exitCode] of signals){
|
|
59
|
-
process.removeAllListeners(signal);
|
|
60
|
-
// eslint-disable-next-line @typescript-eslint/no-misused-promises
|
|
61
|
-
process.once(signal, ()=>shutdown(logFn, exitCode, cb));
|
|
62
|
-
}
|
|
7
|
+
process.removeAllListeners('SIGINT');
|
|
8
|
+
process.removeAllListeners('SIGTERM');
|
|
9
|
+
// eslint-disable-next-line @typescript-eslint/no-misused-promises
|
|
10
|
+
process.once('SIGINT', ()=>shutdown(logFn, cb));
|
|
11
|
+
// eslint-disable-next-line @typescript-eslint/no-misused-promises
|
|
12
|
+
process.once('SIGTERM', ()=>shutdown(logFn, cb));
|
|
63
13
|
};
|
|
64
14
|
/**
|
|
65
15
|
* Creates logs for the initial accounts
|
|
@@ -233,9 +183,6 @@ export async function setupUpdateMonitor(autoUpdateMode, updatesLocation, follow
|
|
|
233
183
|
});
|
|
234
184
|
// eslint-disable-next-line @typescript-eslint/no-misused-promises
|
|
235
185
|
checker.on('newRollupVersion', async ({ latestVersion, currentVersion })=>{
|
|
236
|
-
if (isShuttingDown()) {
|
|
237
|
-
return;
|
|
238
|
-
}
|
|
239
186
|
// if node follows canonical rollup then this is equivalent to a config update
|
|
240
187
|
if (!followsCanonicalRollup) {
|
|
241
188
|
return;
|
|
@@ -245,7 +192,7 @@ export async function setupUpdateMonitor(autoUpdateMode, updatesLocation, follow
|
|
|
245
192
|
latestVersion,
|
|
246
193
|
currentVersion
|
|
247
194
|
});
|
|
248
|
-
await shutdown(logger.info,
|
|
195
|
+
await shutdown(logger.info, signalHandlers);
|
|
249
196
|
} else if (autoUpdateMode === 'notify') {
|
|
250
197
|
logger.warn(`New rollup detected. Please restart the node`, {
|
|
251
198
|
latestVersion,
|
|
@@ -255,15 +202,12 @@ export async function setupUpdateMonitor(autoUpdateMode, updatesLocation, follow
|
|
|
255
202
|
});
|
|
256
203
|
// eslint-disable-next-line @typescript-eslint/no-misused-promises
|
|
257
204
|
checker.on('newNodeVersion', async ({ latestVersion, currentVersion })=>{
|
|
258
|
-
if (isShuttingDown()) {
|
|
259
|
-
return;
|
|
260
|
-
}
|
|
261
205
|
if (autoUpdateMode === 'config-and-version') {
|
|
262
206
|
logger.info(`New node version detected. Please update and restart the node`, {
|
|
263
207
|
latestVersion,
|
|
264
208
|
currentVersion
|
|
265
209
|
});
|
|
266
|
-
await shutdown(logger.info,
|
|
210
|
+
await shutdown(logger.info, signalHandlers);
|
|
267
211
|
} else if (autoUpdateMode === 'notify') {
|
|
268
212
|
logger.info(`New node version detected. Please update and restart the node`, {
|
|
269
213
|
latestVersion,
|
|
@@ -273,9 +217,6 @@ export async function setupUpdateMonitor(autoUpdateMode, updatesLocation, follow
|
|
|
273
217
|
});
|
|
274
218
|
// eslint-disable-next-line @typescript-eslint/no-misused-promises
|
|
275
219
|
checker.on('updateNodeConfig', async (config)=>{
|
|
276
|
-
if (isShuttingDown()) {
|
|
277
|
-
return;
|
|
278
|
-
}
|
|
279
220
|
if ((autoUpdateMode === 'config' || autoUpdateMode === 'config-and-version') && updateNodeConfig) {
|
|
280
221
|
logger.warn(`Config change detected. Updating node`, config);
|
|
281
222
|
try {
|
|
@@ -296,10 +237,6 @@ export async function setupUpdateMonitor(autoUpdateMode, updatesLocation, follow
|
|
|
296
237
|
if (Array.isArray(publicIncludeMetrics) && publicIncludeMetrics.every((m)=>typeof m === 'string')) {
|
|
297
238
|
getTelemetryClient().setExportedPublicTelemetry(publicIncludeMetrics);
|
|
298
239
|
}
|
|
299
|
-
const publicMetricsCollectFrom = config.publicMetricsCollectFrom;
|
|
300
|
-
if (Array.isArray(publicMetricsCollectFrom) && publicMetricsCollectFrom.every((m)=>typeof m === 'string')) {
|
|
301
|
-
getTelemetryClient().setPublicTelemetryCollectFrom(publicMetricsCollectFrom);
|
|
302
|
-
}
|
|
303
240
|
} catch (err) {
|
|
304
241
|
logger.warn('Failed to update config', {
|
|
305
242
|
err
|
|
@@ -310,3 +247,10 @@ export async function setupUpdateMonitor(autoUpdateMode, updatesLocation, follow
|
|
|
310
247
|
});
|
|
311
248
|
checker.start();
|
|
312
249
|
}
|
|
250
|
+
export async function shutdown(logFn, cb) {
|
|
251
|
+
logFn('Shutting down...');
|
|
252
|
+
if (cb) {
|
|
253
|
+
await Promise.all(cb);
|
|
254
|
+
}
|
|
255
|
+
process.exit(0);
|
|
256
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aztec/aztec",
|
|
3
|
-
"version": "1.0.0
|
|
3
|
+
"version": "1.0.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"exports": {
|
|
6
6
|
".": "./dest/index.js"
|
|
@@ -27,35 +27,35 @@
|
|
|
27
27
|
"../package.common.json"
|
|
28
28
|
],
|
|
29
29
|
"dependencies": {
|
|
30
|
-
"@aztec/accounts": "1.0.0
|
|
31
|
-
"@aztec/archiver": "1.0.0
|
|
32
|
-
"@aztec/aztec-faucet": "1.0.0
|
|
33
|
-
"@aztec/aztec-node": "1.0.0
|
|
34
|
-
"@aztec/aztec.js": "1.0.0
|
|
35
|
-
"@aztec/bb-prover": "1.0.0
|
|
36
|
-
"@aztec/bb.js": "1.0.0
|
|
37
|
-
"@aztec/blob-sink": "1.0.0
|
|
38
|
-
"@aztec/bot": "1.0.0
|
|
39
|
-
"@aztec/builder": "1.0.0
|
|
40
|
-
"@aztec/cli": "1.0.0
|
|
41
|
-
"@aztec/cli-wallet": "1.0.0
|
|
42
|
-
"@aztec/constants": "1.0.0
|
|
43
|
-
"@aztec/entrypoints": "1.0.0
|
|
44
|
-
"@aztec/ethereum": "1.0.0
|
|
45
|
-
"@aztec/foundation": "1.0.0
|
|
46
|
-
"@aztec/kv-store": "1.0.0
|
|
47
|
-
"@aztec/noir-contracts.js": "1.0.0
|
|
48
|
-
"@aztec/noir-protocol-circuits-types": "1.0.0
|
|
49
|
-
"@aztec/p2p": "1.0.0
|
|
50
|
-
"@aztec/p2p-bootstrap": "1.0.0
|
|
51
|
-
"@aztec/protocol-contracts": "1.0.0
|
|
52
|
-
"@aztec/prover-client": "1.0.0
|
|
53
|
-
"@aztec/prover-node": "1.0.0
|
|
54
|
-
"@aztec/pxe": "1.0.0
|
|
55
|
-
"@aztec/stdlib": "1.0.0
|
|
56
|
-
"@aztec/telemetry-client": "1.0.0
|
|
57
|
-
"@aztec/txe": "1.0.0
|
|
58
|
-
"@aztec/world-state": "1.0.0
|
|
30
|
+
"@aztec/accounts": "1.0.0",
|
|
31
|
+
"@aztec/archiver": "1.0.0",
|
|
32
|
+
"@aztec/aztec-faucet": "1.0.0",
|
|
33
|
+
"@aztec/aztec-node": "1.0.0",
|
|
34
|
+
"@aztec/aztec.js": "1.0.0",
|
|
35
|
+
"@aztec/bb-prover": "1.0.0",
|
|
36
|
+
"@aztec/bb.js": "1.0.0",
|
|
37
|
+
"@aztec/blob-sink": "1.0.0",
|
|
38
|
+
"@aztec/bot": "1.0.0",
|
|
39
|
+
"@aztec/builder": "1.0.0",
|
|
40
|
+
"@aztec/cli": "1.0.0",
|
|
41
|
+
"@aztec/cli-wallet": "1.0.0",
|
|
42
|
+
"@aztec/constants": "1.0.0",
|
|
43
|
+
"@aztec/entrypoints": "1.0.0",
|
|
44
|
+
"@aztec/ethereum": "1.0.0",
|
|
45
|
+
"@aztec/foundation": "1.0.0",
|
|
46
|
+
"@aztec/kv-store": "1.0.0",
|
|
47
|
+
"@aztec/noir-contracts.js": "1.0.0",
|
|
48
|
+
"@aztec/noir-protocol-circuits-types": "1.0.0",
|
|
49
|
+
"@aztec/p2p": "1.0.0",
|
|
50
|
+
"@aztec/p2p-bootstrap": "1.0.0",
|
|
51
|
+
"@aztec/protocol-contracts": "1.0.0",
|
|
52
|
+
"@aztec/prover-client": "1.0.0",
|
|
53
|
+
"@aztec/prover-node": "1.0.0",
|
|
54
|
+
"@aztec/pxe": "1.0.0",
|
|
55
|
+
"@aztec/stdlib": "1.0.0",
|
|
56
|
+
"@aztec/telemetry-client": "1.0.0",
|
|
57
|
+
"@aztec/txe": "1.0.0",
|
|
58
|
+
"@aztec/world-state": "1.0.0",
|
|
59
59
|
"@types/chalk": "^2.2.0",
|
|
60
60
|
"abitype": "^0.8.11",
|
|
61
61
|
"chalk": "^5.3.0",
|
|
@@ -4,8 +4,6 @@ import type { SharedNodeConfig } from '@aztec/node-lib/config';
|
|
|
4
4
|
|
|
5
5
|
import path from 'path';
|
|
6
6
|
|
|
7
|
-
import publicIncludeMetrics from '../../public_include_metric_prefixes.json' with { type: 'json' };
|
|
8
|
-
|
|
9
7
|
export type NetworkNames = 'testnet-ignition' | 'alpha-testnet';
|
|
10
8
|
|
|
11
9
|
export type L2ChainConfig = {
|
|
@@ -28,9 +26,6 @@ export type L2ChainConfig = {
|
|
|
28
26
|
autoUpdate: SharedNodeConfig['autoUpdate'];
|
|
29
27
|
autoUpdateUrl?: string;
|
|
30
28
|
maxTxPoolSize: number;
|
|
31
|
-
publicIncludeMetrics?: string[];
|
|
32
|
-
publicMetricsCollectorUrl?: string;
|
|
33
|
-
publicMetricsCollectFrom?: string[];
|
|
34
29
|
};
|
|
35
30
|
|
|
36
31
|
export const testnetIgnitionL2ChainConfig: L2ChainConfig = {
|
|
@@ -74,10 +69,7 @@ export const alphaTestnetL2ChainConfig: L2ChainConfig = {
|
|
|
74
69
|
snapshotsUrl: 'https://storage.googleapis.com/aztec-testnet/snapshots/',
|
|
75
70
|
autoUpdate: 'config-and-version',
|
|
76
71
|
autoUpdateUrl: 'https://storage.googleapis.com/aztec-testnet/auto-update/alpha-testnet.json',
|
|
77
|
-
maxTxPoolSize:
|
|
78
|
-
publicIncludeMetrics,
|
|
79
|
-
publicMetricsCollectorUrl: 'https://telemetry.alpha-testnet.aztec.network',
|
|
80
|
-
publicMetricsCollectFrom: ['sequencer'],
|
|
72
|
+
maxTxPoolSize: 2 * 1024 * 1024 * 1024, // 2GB
|
|
81
73
|
};
|
|
82
74
|
|
|
83
75
|
export async function getBootnodes(networkName: NetworkNames) {
|
|
@@ -153,18 +145,6 @@ export async function enrichEnvironmentWithChainConfig(networkName: NetworkNames
|
|
|
153
145
|
enrichVar('AUTO_UPDATE_URL', config.autoUpdateUrl);
|
|
154
146
|
}
|
|
155
147
|
|
|
156
|
-
if (config.publicIncludeMetrics) {
|
|
157
|
-
enrichVar('PUBLIC_OTEL_INCLUDE_METRICS', config.publicIncludeMetrics.join(','));
|
|
158
|
-
}
|
|
159
|
-
|
|
160
|
-
if (config.publicMetricsCollectorUrl) {
|
|
161
|
-
enrichVar('PUBLIC_OTEL_EXPORTER_OTLP_METRICS_ENDPOINT', config.publicMetricsCollectorUrl);
|
|
162
|
-
}
|
|
163
|
-
|
|
164
|
-
if (config.publicMetricsCollectFrom) {
|
|
165
|
-
enrichVar('PUBLIC_OTEL_COLLECT_FROM', config.publicMetricsCollectFrom.join(','));
|
|
166
|
-
}
|
|
167
|
-
|
|
168
148
|
enrichEthAddressVar('REGISTRY_CONTRACT_ADDRESS', config.registryAddress);
|
|
169
149
|
enrichEthAddressVar('SLASH_FACTORY_CONTRACT_ADDRESS', config.slashFactoryAddress);
|
|
170
150
|
enrichEthAddressVar('FEE_ASSET_HANDLER_CONTRACT_ADDRESS', config.feeAssetHandlerAddress);
|
package/src/cli/util.ts
CHANGED
|
@@ -14,54 +14,13 @@ import type { Command } from 'commander';
|
|
|
14
14
|
|
|
15
15
|
import { type AztecStartOption, aztecStartOptions } from './aztec_start_options.js';
|
|
16
16
|
|
|
17
|
-
export const enum ExitCode {
|
|
18
|
-
SUCCESS = 0,
|
|
19
|
-
ERROR = 1,
|
|
20
|
-
ROLLUP_UPGRADE = 78, // EX_CONFIG from FreeBSD (https://man.freebsd.org/cgi/man.cgi?query=sysexits)
|
|
21
|
-
VERSION_UPGRADE = 79, // prev + 1 because there's nothing better
|
|
22
|
-
// 128 + int(SIGNAL)
|
|
23
|
-
SIGHUP = 129,
|
|
24
|
-
SIGINT = 130,
|
|
25
|
-
SIGQUIT = 131,
|
|
26
|
-
SIGTERM = 143,
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
let shutdownPromise: Promise<never> | undefined;
|
|
30
|
-
export function shutdown(logFn: LogFn, exitCode: ExitCode, cb?: Array<() => Promise<void>>): Promise<never> {
|
|
31
|
-
if (shutdownPromise) {
|
|
32
|
-
logFn('Already shutting down.');
|
|
33
|
-
return shutdownPromise;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
logFn('Shutting down...', { exitCode });
|
|
37
|
-
if (cb) {
|
|
38
|
-
shutdownPromise = Promise.allSettled(cb).then(() => process.exit(exitCode));
|
|
39
|
-
} else {
|
|
40
|
-
// synchronously shuts down the process
|
|
41
|
-
// no need to set shutdownPromise on this branch of the if statement because no more code will be executed
|
|
42
|
-
process.exit(exitCode);
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
return shutdownPromise;
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
export function isShuttingDown(): boolean {
|
|
49
|
-
return shutdownPromise !== undefined;
|
|
50
|
-
}
|
|
51
|
-
|
|
52
17
|
export const installSignalHandlers = (logFn: LogFn, cb?: Array<() => Promise<void>>) => {
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
for (const [signal, exitCode] of signals) {
|
|
61
|
-
process.removeAllListeners(signal);
|
|
62
|
-
// eslint-disable-next-line @typescript-eslint/no-misused-promises
|
|
63
|
-
process.once(signal, () => shutdown(logFn, exitCode, cb));
|
|
64
|
-
}
|
|
18
|
+
process.removeAllListeners('SIGINT');
|
|
19
|
+
process.removeAllListeners('SIGTERM');
|
|
20
|
+
// eslint-disable-next-line @typescript-eslint/no-misused-promises
|
|
21
|
+
process.once('SIGINT', () => shutdown(logFn, cb));
|
|
22
|
+
// eslint-disable-next-line @typescript-eslint/no-misused-promises
|
|
23
|
+
process.once('SIGTERM', () => shutdown(logFn, cb));
|
|
65
24
|
};
|
|
66
25
|
|
|
67
26
|
/**
|
|
@@ -303,10 +262,6 @@ export async function setupUpdateMonitor(
|
|
|
303
262
|
|
|
304
263
|
// eslint-disable-next-line @typescript-eslint/no-misused-promises
|
|
305
264
|
checker.on('newRollupVersion', async ({ latestVersion, currentVersion }) => {
|
|
306
|
-
if (isShuttingDown()) {
|
|
307
|
-
return;
|
|
308
|
-
}
|
|
309
|
-
|
|
310
265
|
// if node follows canonical rollup then this is equivalent to a config update
|
|
311
266
|
if (!followsCanonicalRollup) {
|
|
312
267
|
return;
|
|
@@ -314,7 +269,7 @@ export async function setupUpdateMonitor(
|
|
|
314
269
|
|
|
315
270
|
if (autoUpdateMode === 'config' || autoUpdateMode === 'config-and-version') {
|
|
316
271
|
logger.info(`New rollup version detected. Please restart the node`, { latestVersion, currentVersion });
|
|
317
|
-
await shutdown(logger.info,
|
|
272
|
+
await shutdown(logger.info, signalHandlers);
|
|
318
273
|
} else if (autoUpdateMode === 'notify') {
|
|
319
274
|
logger.warn(`New rollup detected. Please restart the node`, { latestVersion, currentVersion });
|
|
320
275
|
}
|
|
@@ -322,12 +277,9 @@ export async function setupUpdateMonitor(
|
|
|
322
277
|
|
|
323
278
|
// eslint-disable-next-line @typescript-eslint/no-misused-promises
|
|
324
279
|
checker.on('newNodeVersion', async ({ latestVersion, currentVersion }) => {
|
|
325
|
-
if (isShuttingDown()) {
|
|
326
|
-
return;
|
|
327
|
-
}
|
|
328
280
|
if (autoUpdateMode === 'config-and-version') {
|
|
329
281
|
logger.info(`New node version detected. Please update and restart the node`, { latestVersion, currentVersion });
|
|
330
|
-
await shutdown(logger.info,
|
|
282
|
+
await shutdown(logger.info, signalHandlers);
|
|
331
283
|
} else if (autoUpdateMode === 'notify') {
|
|
332
284
|
logger.info(`New node version detected. Please update and restart the node`, { latestVersion, currentVersion });
|
|
333
285
|
}
|
|
@@ -335,10 +287,6 @@ export async function setupUpdateMonitor(
|
|
|
335
287
|
|
|
336
288
|
// eslint-disable-next-line @typescript-eslint/no-misused-promises
|
|
337
289
|
checker.on('updateNodeConfig', async config => {
|
|
338
|
-
if (isShuttingDown()) {
|
|
339
|
-
return;
|
|
340
|
-
}
|
|
341
|
-
|
|
342
290
|
if ((autoUpdateMode === 'config' || autoUpdateMode === 'config-and-version') && updateNodeConfig) {
|
|
343
291
|
logger.warn(`Config change detected. Updating node`, config);
|
|
344
292
|
try {
|
|
@@ -358,10 +306,6 @@ export async function setupUpdateMonitor(
|
|
|
358
306
|
if (Array.isArray(publicIncludeMetrics) && publicIncludeMetrics.every(m => typeof m === 'string')) {
|
|
359
307
|
getTelemetryClient().setExportedPublicTelemetry(publicIncludeMetrics);
|
|
360
308
|
}
|
|
361
|
-
const publicMetricsCollectFrom: unknown = (config as any).publicMetricsCollectFrom;
|
|
362
|
-
if (Array.isArray(publicMetricsCollectFrom) && publicMetricsCollectFrom.every(m => typeof m === 'string')) {
|
|
363
|
-
getTelemetryClient().setPublicTelemetryCollectFrom(publicMetricsCollectFrom);
|
|
364
|
-
}
|
|
365
309
|
} catch (err) {
|
|
366
310
|
logger.warn('Failed to update config', { err });
|
|
367
311
|
}
|
|
@@ -371,3 +315,11 @@ export async function setupUpdateMonitor(
|
|
|
371
315
|
|
|
372
316
|
checker.start();
|
|
373
317
|
}
|
|
318
|
+
|
|
319
|
+
export async function shutdown(logFn: LogFn, cb?: Array<() => Promise<void>>) {
|
|
320
|
+
logFn('Shutting down...');
|
|
321
|
+
if (cb) {
|
|
322
|
+
await Promise.all(cb);
|
|
323
|
+
}
|
|
324
|
+
process.exit(0);
|
|
325
|
+
}
|