@aztec/aztec 0.0.1-commit.033589e → 0.0.1-commit.04852196a
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/bin/index.js +2 -2
- package/dest/cli/aztec_start_action.d.ts +1 -1
- package/dest/cli/aztec_start_action.d.ts.map +1 -1
- package/dest/cli/aztec_start_action.js +5 -3
- package/dest/cli/aztec_start_options.d.ts +1 -1
- package/dest/cli/aztec_start_options.d.ts.map +1 -1
- package/dest/cli/aztec_start_options.js +2 -3
- package/dest/cli/cmds/compile.d.ts +1 -1
- package/dest/cli/cmds/compile.d.ts.map +1 -1
- package/dest/cli/cmds/compile.js +5 -0
- package/dest/cli/cmds/standby.d.ts +27 -0
- package/dest/cli/cmds/standby.d.ts.map +1 -0
- package/dest/cli/cmds/standby.js +78 -0
- package/dest/cli/cmds/start_archiver.d.ts +2 -2
- package/dest/cli/cmds/start_archiver.d.ts.map +1 -1
- package/dest/cli/cmds/start_archiver.js +1 -1
- package/dest/cli/cmds/start_node.d.ts +3 -2
- package/dest/cli/cmds/start_node.d.ts.map +1 -1
- package/dest/cli/cmds/start_node.js +13 -71
- package/dest/cli/cmds/start_prover_broker.d.ts +1 -1
- package/dest/cli/cmds/start_prover_broker.d.ts.map +1 -1
- package/dest/cli/cmds/start_prover_broker.js +6 -6
- package/dest/cli/cmds/utils/needs_recompile.d.ts +10 -0
- package/dest/cli/cmds/utils/needs_recompile.d.ts.map +1 -0
- package/dest/cli/cmds/utils/needs_recompile.js +124 -0
- package/dest/cli/util.d.ts +3 -5
- package/dest/cli/util.d.ts.map +1 -1
- package/dest/cli/util.js +37 -78
- package/dest/local-network/local-network.d.ts +1 -1
- package/dest/local-network/local-network.d.ts.map +1 -1
- package/dest/local-network/local-network.js +9 -1
- package/dest/testing/index.d.ts +2 -1
- package/dest/testing/index.d.ts.map +1 -1
- package/dest/testing/index.js +1 -0
- package/dest/testing/token_allowed_setup.d.ts +7 -0
- package/dest/testing/token_allowed_setup.d.ts.map +1 -0
- package/dest/testing/token_allowed_setup.js +20 -0
- package/package.json +35 -34
- package/scripts/aztec.sh +3 -0
- package/src/bin/index.ts +2 -2
- package/src/cli/aztec_start_action.ts +5 -3
- package/src/cli/aztec_start_options.ts +2 -3
- package/src/cli/cmds/compile.ts +6 -0
- package/src/cli/cmds/standby.ts +111 -0
- package/src/cli/cmds/start_archiver.ts +1 -1
- package/src/cli/cmds/start_node.ts +21 -106
- package/src/cli/cmds/start_prover_broker.ts +7 -14
- package/src/cli/cmds/utils/needs_recompile.ts +139 -0
- package/src/cli/util.ts +41 -74
- package/src/local-network/local-network.ts +6 -0
- package/src/testing/index.ts +1 -0
- package/src/testing/token_allowed_setup.ts +19 -0
- package/dest/cli/release_version.d.ts +0 -2
- package/dest/cli/release_version.d.ts.map +0 -1
- package/dest/cli/release_version.js +0 -14
- package/src/cli/release_version.ts +0 -21
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
import TOML from '@iarna/toml';
|
|
2
|
+
import { readFile, readdir, stat } from 'fs/promises';
|
|
3
|
+
import { join, resolve } from 'path';
|
|
4
|
+
/**
|
|
5
|
+
* Returns true if recompilation is needed: either no artifacts exist in target/ or any .nr or Nargo.toml source file
|
|
6
|
+
* (including path-based dependencies) is newer than the oldest artifact. We compare against the oldest artifact so
|
|
7
|
+
* that a source change between the oldest and newest compilation (e.g. in a multi-contract workspace) still triggers
|
|
8
|
+
* a recompile.
|
|
9
|
+
*
|
|
10
|
+
* Note: The above implies that if there is a random json file in the target dir we would be always recompiling.
|
|
11
|
+
*/ export async function needsRecompile() {
|
|
12
|
+
const oldestArtifactMs = await getOldestArtifactModificationTime('target');
|
|
13
|
+
if (oldestArtifactMs === undefined) {
|
|
14
|
+
return true;
|
|
15
|
+
}
|
|
16
|
+
const crateDirs = await collectCrateDirs('.');
|
|
17
|
+
return hasNewerSourceFile(crateDirs, oldestArtifactMs);
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Returns the last modification time (timestamp in ms) of the oldest .json artifact in targetDir, or undefined if
|
|
21
|
+
* none exist.
|
|
22
|
+
*/ async function getOldestArtifactModificationTime(targetDir) {
|
|
23
|
+
let entries;
|
|
24
|
+
try {
|
|
25
|
+
entries = (await readdir(targetDir)).filter((f)=>f.endsWith('.json'));
|
|
26
|
+
} catch (err) {
|
|
27
|
+
if (err?.code === 'ENOENT') {
|
|
28
|
+
return undefined;
|
|
29
|
+
}
|
|
30
|
+
throw err;
|
|
31
|
+
}
|
|
32
|
+
if (entries.length === 0) {
|
|
33
|
+
return undefined;
|
|
34
|
+
}
|
|
35
|
+
let oldest = Infinity;
|
|
36
|
+
for (const entry of entries){
|
|
37
|
+
const s = await stat(join(targetDir, entry));
|
|
38
|
+
if (s.mtimeMs < oldest) {
|
|
39
|
+
oldest = s.mtimeMs;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
return oldest;
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Recursively collects crate directories starting from startCrateDir by following path-based dependencies declared in
|
|
46
|
+
* Nargo.toml files. Git-based deps are ignored (they only change when Nargo.toml itself is modified since the deps are
|
|
47
|
+
* tagged).
|
|
48
|
+
*/ async function collectCrateDirs(startCrateDir) {
|
|
49
|
+
// We have a set of visited dirs we check against when entering a new dir because we could stumble upon a directory
|
|
50
|
+
// multiple times in case multiple deps shared a dep (e.g. dep A and dep B both sharing dep C).
|
|
51
|
+
const visited = new Set();
|
|
52
|
+
async function visit(crateDir) {
|
|
53
|
+
const absDir = resolve(crateDir);
|
|
54
|
+
if (visited.has(absDir)) {
|
|
55
|
+
return;
|
|
56
|
+
}
|
|
57
|
+
visited.add(absDir);
|
|
58
|
+
// Every dep is its own crate and every crate needs to have Nargo.toml defined in the root so we try to load it and
|
|
59
|
+
// error out if it's not the case.
|
|
60
|
+
const tomlPath = join(absDir, 'Nargo.toml');
|
|
61
|
+
const content = await readFile(tomlPath, 'utf-8').catch(()=>{
|
|
62
|
+
throw new Error(`Incorrectly defined dependency. Nargo.toml not found in ${absDir}`);
|
|
63
|
+
});
|
|
64
|
+
// We parse and iterate over the dependencies
|
|
65
|
+
const parsed = TOML.parse(content);
|
|
66
|
+
const deps = parsed.dependencies ?? {};
|
|
67
|
+
for (const dep of Object.values(deps)){
|
|
68
|
+
if (dep && typeof dep === 'object' && typeof dep.path === 'string') {
|
|
69
|
+
const depPath = resolve(absDir, dep.path);
|
|
70
|
+
const s = await stat(depPath);
|
|
71
|
+
if (!s.isDirectory()) {
|
|
72
|
+
throw new Error(`Dependency path "${dep.path}" in ${tomlPath} resolves to ${depPath} which is not a directory`);
|
|
73
|
+
}
|
|
74
|
+
await visit(depPath);
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
await visit(startCrateDir);
|
|
79
|
+
return [
|
|
80
|
+
...visited
|
|
81
|
+
];
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* Walks crate dirs looking for .nr and Nargo.toml files newer than thresholdMs. Short-circuits on the first match.
|
|
85
|
+
*/ async function hasNewerSourceFile(crateDirs, thresholdMs) {
|
|
86
|
+
// Returns true if it find a new file than thresholdMs, false otherwise
|
|
87
|
+
async function walkForNewer(dir) {
|
|
88
|
+
let entries;
|
|
89
|
+
try {
|
|
90
|
+
entries = await readdir(dir, {
|
|
91
|
+
withFileTypes: true
|
|
92
|
+
});
|
|
93
|
+
} catch {
|
|
94
|
+
return false;
|
|
95
|
+
}
|
|
96
|
+
// We iterate over the entries in the dir
|
|
97
|
+
for (const entry of entries){
|
|
98
|
+
const fullPath = join(dir, entry.name);
|
|
99
|
+
if (entry.isDirectory()) {
|
|
100
|
+
// If the entry is a dir and it's not called `target` we recursively enter it
|
|
101
|
+
if (entry.name === 'target') {
|
|
102
|
+
continue;
|
|
103
|
+
}
|
|
104
|
+
if (await walkForNewer(fullPath)) {
|
|
105
|
+
return true;
|
|
106
|
+
}
|
|
107
|
+
} else if (entry.name === 'Nargo.toml' || entry.name.endsWith('.nr')) {
|
|
108
|
+
// The entry is a Nargo.toml file or *.nr file so we check the timestamp
|
|
109
|
+
const s = await stat(fullPath);
|
|
110
|
+
if (s.mtimeMs > thresholdMs) {
|
|
111
|
+
return true;
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
return false;
|
|
116
|
+
}
|
|
117
|
+
// We search through the crate dirs
|
|
118
|
+
for (const dir of crateDirs){
|
|
119
|
+
if (await walkForNewer(dir)) {
|
|
120
|
+
return true;
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
return false;
|
|
124
|
+
}
|
package/dest/cli/util.d.ts
CHANGED
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
import type { AztecNodeConfig } from '@aztec/aztec-node';
|
|
2
2
|
import type { AccountManager } from '@aztec/aztec.js/wallet';
|
|
3
3
|
import type { ViemClient } from '@aztec/ethereum/types';
|
|
4
|
-
import type { ConfigMappingsType } from '@aztec/foundation/config';
|
|
5
|
-
import { EthAddress } from '@aztec/foundation/eth-address';
|
|
4
|
+
import type { ConfigMappingsType, NetworkNames } from '@aztec/foundation/config';
|
|
6
5
|
import { type LogFn } from '@aztec/foundation/log';
|
|
7
|
-
import type { SharedNodeConfig } from '@aztec/node-lib/config';
|
|
8
6
|
import type { ProverConfig } from '@aztec/stdlib/interfaces/server';
|
|
9
7
|
import type { EmbeddedWallet } from '@aztec/wallets/embedded';
|
|
10
8
|
import type { Command } from 'commander';
|
|
@@ -63,6 +61,6 @@ export declare function preloadCrsDataForVerifying({ realProofs }: Pick<AztecNod
|
|
|
63
61
|
* @param log - Logging function
|
|
64
62
|
*/
|
|
65
63
|
export declare function preloadCrsDataForServerSideProving({ realProofs }: Pick<ProverConfig, 'realProofs'>, log: LogFn): Promise<void>;
|
|
66
|
-
export declare function
|
|
64
|
+
export declare function setupVersionChecker(network: NetworkNames, followsCanonicalRollup: boolean, publicClient: ViemClient, signalHandlers: Array<() => Promise<void>>, cacheDir?: string): Promise<void>;
|
|
67
65
|
export declare function stringifyConfig(config: object): string;
|
|
68
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
66
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidXRpbC5kLnRzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vc3JjL2NsaS91dGlsLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sS0FBSyxFQUFFLGVBQWUsRUFBRSxNQUFNLG1CQUFtQixDQUFDO0FBQ3pELE9BQU8sS0FBSyxFQUFFLGNBQWMsRUFBRSxNQUFNLHdCQUF3QixDQUFDO0FBRzdELE9BQU8sS0FBSyxFQUFFLFVBQVUsRUFBRSxNQUFNLHVCQUF1QixDQUFDO0FBQ3hELE9BQU8sS0FBSyxFQUFFLGtCQUFrQixFQUFFLFlBQVksRUFBRSxNQUFNLDBCQUEwQixDQUFDO0FBRWpGLE9BQU8sRUFBRSxLQUFLLEtBQUssRUFBZ0IsTUFBTSx1QkFBdUIsQ0FBQztBQUNqRSxPQUFPLEtBQUssRUFBRSxZQUFZLEVBQUUsTUFBTSxpQ0FBaUMsQ0FBQztBQUVwRSxPQUFPLEtBQUssRUFBRSxjQUFjLEVBQUUsTUFBTSx5QkFBeUIsQ0FBQztBQUc5RCxPQUFPLEtBQUssRUFBRSxPQUFPLEVBQUUsTUFBTSxXQUFXLENBQUM7QUFHekMsT0FBTyxFQUFFLEtBQUssZ0JBQWdCLEVBQXFCLE1BQU0sMEJBQTBCLENBQUM7QUFFcEYsMEJBQWtCLFFBQVE7SUFDeEIsT0FBTyxJQUFJO0lBQ1gsS0FBSyxJQUFJO0lBQ1QsY0FBYyxLQUFLO0lBQ25CLGVBQWUsS0FBSztJQUVwQixNQUFNLE1BQU07SUFDWixNQUFNLE1BQU07SUFDWixPQUFPLE1BQU07SUFDYixPQUFPLE1BQU07Q0FDZDtBQUdELHdCQUFnQixRQUFRLENBQUMsS0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BRSxJQUFJLENBQUMsZUFBZSxFQUFFLFlBQVksQ0FBQyxFQUNuRCxHQUFHLEVBQUUsS0FBSyxHQUNULE9BQU8sQ0FBQyxJQUFJLENBQUMsQ0FLZjtBQUVEOzs7O0dBSUc7QUFDSCx3QkFBc0Isa0NBQWtDLENBQ3RELEVBQUUsVUFBVSxFQUFFLEVBQUUsSUFBSSxDQUFDLFlBQVksRUFBRSxZQUFZLENBQUMsRUFDaEQsR0FBRyxFQUFFLEtBQUssR0FDVCxPQUFPLENBQUMsSUFBSSxDQUFDLENBS2Y7QUFFRCx3QkFBc0IsbUJBQW1CLENBQ3ZDLE9BQU8sRUFBRSxZQUFZLEVBQ3JCLHNCQUFzQixFQUFFLE9BQU8sRUFDL0IsWUFBWSxFQUFFLFVBQVUsRUFDeEIsY0FBYyxFQUFFLEtBQUssQ0FBQyxNQUFNLE9BQU8sQ0FBQyxJQUFJLENBQUMsQ0FBQyxFQUMxQyxRQUFRLENBQUMsRUFBRSxNQUFNLEdBQ2hCLE9BQU8sQ0FBQyxJQUFJLENBQUMsQ0E4Q2Y7QUFFRCx3QkFBZ0IsZUFBZSxDQUFDLE1BQU0sRUFBRSxNQUFNLEdBQUcsTUFBTSxDQUl0RCJ9
|
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,KAAK,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACzD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;
|
|
1
|
+
{"version":3,"file":"util.d.ts","sourceRoot":"","sources":["../../src/cli/util.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACzD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAG7D,OAAO,KAAK,EAAE,UAAU,EAAE,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AM,UAAU,qDAStB,CAAC;AAEF,eAAO,MAAM,uBAAuB,cAyBnC,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,wBAAwB,0EASpC,CAAC;AAEF;;;;;;;GAOG;AACH,eAAO,MAAM,sBAAsB,GAAI,CAAC,wFAkCvC,CAAC;AAEF;;;;GAIG;AACH,wBAAsB,0BAA0B,CAC9C,EAAE,UAAU,EAAE,EAAE,IAAI,CAAC,eAAe,EAAE,YAAY,CAAC,EACnD,GAAG,EAAE,KAAK,GACT,OAAO,CAAC,IAAI,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,mBAAmB,CACvC,OAAO,EAAE,YAAY,EACrB,sBAAsB,EAAE,OAAO,EAC/B,YAAY,EAAE,UAAU,EACxB,cAAc,EAAE,KAAK,CAAC,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC,EAC1C,QAAQ,CAAC,EAAE,MAAM,GAChB,OAAO,CAAC,IAAI,CAAC,CA8Cf;AAED,wBAAgB,eAAe,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAItD"}
|
package/dest/cli/util.js
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
|
+
import { getNetworkConfig } from '@aztec/cli/config';
|
|
2
|
+
import { RegistryContract } from '@aztec/ethereum/contracts';
|
|
1
3
|
import { jsonStringify } from '@aztec/foundation/json-rpc';
|
|
2
4
|
import { createLogger } from '@aztec/foundation/log';
|
|
3
|
-
import {
|
|
5
|
+
import { getPackageVersion } from '@aztec/stdlib/update-checker';
|
|
4
6
|
import chalk from 'chalk';
|
|
5
7
|
import { aztecStartOptions } from './aztec_start_options.js';
|
|
6
8
|
export var ExitCode = /*#__PURE__*/ function(ExitCode) {
|
|
@@ -237,92 +239,49 @@ export const printAztecStartHelpText = ()=>{
|
|
|
237
239
|
]);
|
|
238
240
|
}
|
|
239
241
|
}
|
|
240
|
-
export async function
|
|
241
|
-
const
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
return;
|
|
256
|
-
}
|
|
257
|
-
if (autoUpdateMode === 'config' || autoUpdateMode === 'config-and-version') {
|
|
258
|
-
logger.info(`New rollup version detected. Please restart the node`, {
|
|
259
|
-
latestVersion,
|
|
260
|
-
currentVersion
|
|
261
|
-
});
|
|
262
|
-
await shutdown(logger.info, 78, signalHandlers);
|
|
263
|
-
} else if (autoUpdateMode === 'notify') {
|
|
264
|
-
logger.warn(`New rollup detected. Please restart the node`, {
|
|
265
|
-
latestVersion,
|
|
266
|
-
currentVersion
|
|
267
|
-
});
|
|
242
|
+
export async function setupVersionChecker(network, followsCanonicalRollup, publicClient, signalHandlers, cacheDir) {
|
|
243
|
+
const networkConfig = await getNetworkConfig(network, cacheDir);
|
|
244
|
+
if (!networkConfig) {
|
|
245
|
+
return;
|
|
246
|
+
}
|
|
247
|
+
const { VersionChecker } = await import('@aztec/stdlib/update-checker');
|
|
248
|
+
const logger = createLogger('version_check');
|
|
249
|
+
const registry = new RegistryContract(publicClient, networkConfig.registryAddress);
|
|
250
|
+
const checks = [];
|
|
251
|
+
checks.push({
|
|
252
|
+
name: 'node',
|
|
253
|
+
currentVersion: getPackageVersion() ?? 'unknown',
|
|
254
|
+
getLatestVersion: async ()=>{
|
|
255
|
+
const cfg = await getNetworkConfig(network, cacheDir);
|
|
256
|
+
return cfg?.nodeVersion;
|
|
268
257
|
}
|
|
269
258
|
});
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
return;
|
|
274
|
-
}
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
} else if (autoUpdateMode === 'notify') {
|
|
282
|
-
logger.info(`New node version detected. Please update and restart the node`, {
|
|
283
|
-
latestVersion,
|
|
284
|
-
currentVersion
|
|
259
|
+
if (followsCanonicalRollup) {
|
|
260
|
+
const getLatestVersion = async ()=>{
|
|
261
|
+
const version = (await registry.getRollupVersions()).at(-1);
|
|
262
|
+
return version !== undefined ? String(version) : undefined;
|
|
263
|
+
};
|
|
264
|
+
const currentVersion = await getLatestVersion();
|
|
265
|
+
if (currentVersion !== undefined) {
|
|
266
|
+
checks.push({
|
|
267
|
+
name: 'rollup',
|
|
268
|
+
currentVersion,
|
|
269
|
+
getLatestVersion
|
|
285
270
|
});
|
|
286
271
|
}
|
|
287
|
-
}
|
|
288
|
-
|
|
289
|
-
checker.on('
|
|
272
|
+
}
|
|
273
|
+
const checker = new VersionChecker(checks, 600_000, logger);
|
|
274
|
+
checker.on('newVersion', ({ name, latestVersion, currentVersion })=>{
|
|
290
275
|
if (isShuttingDown()) {
|
|
291
276
|
return;
|
|
292
277
|
}
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
} catch (err) {
|
|
298
|
-
logger.warn('Failed to update config', {
|
|
299
|
-
err
|
|
300
|
-
});
|
|
301
|
-
}
|
|
302
|
-
}
|
|
303
|
-
// don't notify on these config changes
|
|
304
|
-
});
|
|
305
|
-
checker.on('updatePublicTelemetryConfig', (config)=>{
|
|
306
|
-
if (autoUpdateMode === 'config' || autoUpdateMode === 'config-and-version') {
|
|
307
|
-
logger.warn(`Public telemetry config change detected. Updating telemetry client`, config);
|
|
308
|
-
try {
|
|
309
|
-
const publicIncludeMetrics = config.publicIncludeMetrics;
|
|
310
|
-
if (Array.isArray(publicIncludeMetrics) && publicIncludeMetrics.every((m)=>typeof m === 'string')) {
|
|
311
|
-
getTelemetryClient().setExportedPublicTelemetry(publicIncludeMetrics);
|
|
312
|
-
}
|
|
313
|
-
const publicMetricsCollectFrom = config.publicMetricsCollectFrom;
|
|
314
|
-
if (Array.isArray(publicMetricsCollectFrom) && publicMetricsCollectFrom.every((m)=>typeof m === 'string')) {
|
|
315
|
-
getTelemetryClient().setPublicTelemetryCollectFrom(publicMetricsCollectFrom);
|
|
316
|
-
}
|
|
317
|
-
} catch (err) {
|
|
318
|
-
logger.warn('Failed to update config', {
|
|
319
|
-
err
|
|
320
|
-
});
|
|
321
|
-
}
|
|
322
|
-
}
|
|
323
|
-
// don't notify on these config changes
|
|
278
|
+
logger.warn(`New ${name} version available`, {
|
|
279
|
+
latestVersion,
|
|
280
|
+
currentVersion
|
|
281
|
+
});
|
|
324
282
|
});
|
|
325
283
|
checker.start();
|
|
284
|
+
signalHandlers.push(()=>checker.stop());
|
|
326
285
|
}
|
|
327
286
|
export function stringifyConfig(config) {
|
|
328
287
|
return Object.entries(config).map(([key, value])=>`${key}=${jsonStringify(value)}`).join(' ');
|
|
@@ -70,4 +70,4 @@ export declare function createAztecNode(config?: Partial<AztecNodeConfig>, deps?
|
|
|
70
70
|
}, options?: {
|
|
71
71
|
prefilledPublicData?: PublicDataTreeLeaf[];
|
|
72
72
|
}): Promise<AztecNodeService>;
|
|
73
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
73
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibG9jYWwtbmV0d29yay5kLnRzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vc3JjL2xvY2FsLW5ldHdvcmsvbG9jYWwtbmV0d29yay50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiO0FBRUEsT0FBTyxFQUFFLGdCQUFnQixFQUFFLE1BQU0sbUJBQW1CLENBQUM7QUFDckQsT0FBTyxFQUFFLEtBQUssZUFBZSxFQUFvQixNQUFNLDBCQUEwQixDQUFDO0FBQ2xGLE9BQU8sRUFBRSxFQUFFLEVBQUUsTUFBTSx3QkFBd0IsQ0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UsS0FBSzs7O0dBd0poRztBQUVEOzs7R0FHRztBQUNILHdCQUFzQixlQUFlLENBQ25DLE1BQU0sR0FBRSxPQUFPLENBQUMsZUFBZSxDQUFNLEVBQ3JDLElBQUksR0FBRTtJQUNKLFNBQVMsQ0FBQyxFQUFFLGVBQWUsQ0FBQztJQUM1QixVQUFVLENBQUMsRUFBRSxtQkFBbUIsQ0FBQztJQUNqQyxZQUFZLENBQUMsRUFBRSxZQUFZLENBQUM7SUFDNUIsWUFBWSxDQUFDLEVBQUUsZ0JBQWdCLENBQUM7Q0FDNUIsRUFDTixPQUFPLEdBQUU7SUFBRSxtQkFBbUIsQ0FBQyxFQUFFLGtCQUFrQixFQUFFLENBQUE7Q0FBTyw2QkFlN0QifQ==
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"local-network.d.ts","sourceRoot":"","sources":["../../src/local-network/local-network.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AACrD,OAAO,EAAE,KAAK,eAAe,EAAoB,MAAM,0BAA0B,CAAC;AAClF,OAAO,EAAE,EAAE,EAAE,MAAM,wBAAwB,CAAC;AAE5C,OAAO,EAAE,KAAK,mBAAmB,EAAoB,MAAM,2BAA2B,CAAC;AASvF,OAAO,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAC3D,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AACnD,OAAO,EAAE,YAAY,EAAoB,MAAM,yBAAyB,CAAC;AAKzE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AACxE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAC9D,OAAO,EACL,KAAK,eAAe,EAGrB,MAAM,yBAAyB,CAAC;AAKjC,OAAO,EAAE,KAAK,GAAG,EAA2D,MAAM,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"local-network.d.ts","sourceRoot":"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AS,CAAC,EAAE,eAAe,CAAC;IAC5B,UAAU,CAAC,EAAE,mBAAmB,CAAC;IACjC,YAAY,CAAC,EAAE,YAAY,CAAC;IAC5B,YAAY,CAAC,EAAE,gBAAgB,CAAC;CAC5B,EACN,OAAO,GAAE;IAAE,mBAAmB,CAAC,EAAE,kBAAkB,EAAE,CAAA;CAAO,6BAe7D"}
|
|
@@ -30,6 +30,7 @@ import { createAccountLogs } from '../cli/util.js';
|
|
|
30
30
|
import { DefaultMnemonic } from '../mnemonic.js';
|
|
31
31
|
import { AnvilTestWatcher } from '../testing/anvil_test_watcher.js';
|
|
32
32
|
import { EpochTestSettler } from '../testing/epoch_test_settler.js';
|
|
33
|
+
import { getTokenAllowedSetupFunctions } from '../testing/token_allowed_setup.js';
|
|
33
34
|
import { getBananaFPCAddress, setupBananaFPC } from './banana_fpc.js';
|
|
34
35
|
import { getSponsoredFPCAddress } from './sponsored_fpc.js';
|
|
35
36
|
const logger = createLogger('local-network');
|
|
@@ -68,9 +69,16 @@ const localAnvil = foundry;
|
|
|
68
69
|
if ((config.l1RpcUrls?.length || 0) > 1) {
|
|
69
70
|
logger.warn(`Multiple L1 RPC URLs provided. Local networks will only use the first one: ${l1RpcUrl}`);
|
|
70
71
|
}
|
|
72
|
+
// The local network deploys a banana FPC with Token contracts, so include Token entries
|
|
73
|
+
// in the setup allowlist so FPC-based fee payments work out of the box.
|
|
74
|
+
const tokenAllowList = await getTokenAllowedSetupFunctions();
|
|
71
75
|
const aztecNodeConfig = {
|
|
72
76
|
...getConfigEnvVars(),
|
|
73
|
-
...config
|
|
77
|
+
...config,
|
|
78
|
+
txPublicSetupAllowListExtend: [
|
|
79
|
+
...tokenAllowList,
|
|
80
|
+
...config.txPublicSetupAllowListExtend ?? []
|
|
81
|
+
]
|
|
74
82
|
};
|
|
75
83
|
const hdAccount = mnemonicToAccount(config.l1Mnemonic || DefaultMnemonic);
|
|
76
84
|
if (aztecNodeConfig.sequencerPublisherPrivateKeys == undefined || !aztecNodeConfig.sequencerPublisherPrivateKeys.length || aztecNodeConfig.sequencerPublisherPrivateKeys[0].getValue() === NULL_KEY) {
|
package/dest/testing/index.d.ts
CHANGED
|
@@ -2,4 +2,5 @@ export { AnvilTestWatcher } from './anvil_test_watcher.js';
|
|
|
2
2
|
export { EthCheatCodes, RollupCheatCodes } from '@aztec/ethereum/test';
|
|
3
3
|
export { CheatCodes } from './cheat_codes.js';
|
|
4
4
|
export { EpochTestSettler } from './epoch_test_settler.js';
|
|
5
|
-
|
|
5
|
+
export { getTokenAllowedSetupFunctions } from './token_allowed_setup.js';
|
|
6
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguZC50cyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy90ZXN0aW5nL2luZGV4LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sRUFBRSxnQkFBZ0IsRUFBRSxNQUFNLHlCQUF5QixDQUFDO0FBQzNELE9BQU8sRUFBRSxhQUFhLEVBQUUsZ0JBQWdCLEVBQUUsTUFBTSxzQkFBc0IsQ0FBQztBQUN2RSxPQUFPLEVBQUUsVUFBVSxFQUFFLE1BQU0sa0JBQWtCLENBQUM7QUFDOUMsT0FBTyxFQUFFLGdCQUFnQixFQUFFLE1BQU0seUJBQXlCLENBQUM7QUFDM0QsT0FBTyxFQUFFLDZCQUE2QixFQUFFLE1BQU0sMEJBQTBCLENBQUMifQ==
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/testing/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,EAAE,aAAa,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AACvE,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/testing/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,EAAE,aAAa,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AACvE,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,EAAE,6BAA6B,EAAE,MAAM,0BAA0B,CAAC"}
|
package/dest/testing/index.js
CHANGED
|
@@ -2,3 +2,4 @@ export { AnvilTestWatcher } from './anvil_test_watcher.js';
|
|
|
2
2
|
export { EthCheatCodes, RollupCheatCodes } from '@aztec/ethereum/test';
|
|
3
3
|
export { CheatCodes } from './cheat_codes.js';
|
|
4
4
|
export { EpochTestSettler } from './epoch_test_settler.js';
|
|
5
|
+
export { getTokenAllowedSetupFunctions } from './token_allowed_setup.js';
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { AllowedElement } from '@aztec/stdlib/interfaces/server';
|
|
2
|
+
/**
|
|
3
|
+
* Returns Token-specific allowlist entries needed for FPC-based fee payments.
|
|
4
|
+
* These are test-only: FPC-based fee payment with custom tokens won't work on mainnet alpha.
|
|
5
|
+
*/
|
|
6
|
+
export declare function getTokenAllowedSetupFunctions(): Promise<AllowedElement[]>;
|
|
7
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidG9rZW5fYWxsb3dlZF9zZXR1cC5kLnRzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vc3JjL3Rlc3RpbmcvdG9rZW5fYWxsb3dlZF9zZXR1cC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFHQSxPQUFPLEtBQUssRUFBRSxjQUFjLEVBQUUsTUFBTSxpQ0FBaUMsQ0FBQztBQUV0RTs7O0dBR0c7QUFDSCx3QkFBc0IsNkJBQTZCLElBQUksT0FBTyxDQUFDLGNBQWMsRUFBRSxDQUFDLENBUy9FIn0=
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"token_allowed_setup.d.ts","sourceRoot":"","sources":["../../src/testing/token_allowed_setup.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAC;AAEtE;;;GAGG;AACH,wBAAsB,6BAA6B,IAAI,OAAO,CAAC,cAAc,EAAE,CAAC,CAS/E"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { TokenContractArtifact } from '@aztec/noir-contracts.js/Token';
|
|
2
|
+
import { buildAllowedElement } from '@aztec/p2p/msg_validators';
|
|
3
|
+
import { getContractClassFromArtifact } from '@aztec/stdlib/contract';
|
|
4
|
+
/**
|
|
5
|
+
* Returns Token-specific allowlist entries needed for FPC-based fee payments.
|
|
6
|
+
* These are test-only: FPC-based fee payment with custom tokens won't work on mainnet alpha.
|
|
7
|
+
*/ export async function getTokenAllowedSetupFunctions() {
|
|
8
|
+
const tokenClassId = (await getContractClassFromArtifact(TokenContractArtifact)).id;
|
|
9
|
+
const target = {
|
|
10
|
+
classId: tokenClassId
|
|
11
|
+
};
|
|
12
|
+
return Promise.all([
|
|
13
|
+
// Token: needed for private transfers via FPC (transfer_to_public enqueues this)
|
|
14
|
+
buildAllowedElement(TokenContractArtifact, target, '_increase_public_balance', {
|
|
15
|
+
onlySelf: true
|
|
16
|
+
}),
|
|
17
|
+
// Token: needed for public transfers via FPC (fee_entrypoint_public enqueues this)
|
|
18
|
+
buildAllowedElement(TokenContractArtifact, target, 'transfer_in_public')
|
|
19
|
+
]);
|
|
20
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aztec/aztec",
|
|
3
|
-
"version": "0.0.1-commit.
|
|
3
|
+
"version": "0.0.1-commit.04852196a",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"exports": {
|
|
6
6
|
".": "./dest/index.js",
|
|
@@ -28,39 +28,40 @@
|
|
|
28
28
|
"../package.common.json"
|
|
29
29
|
],
|
|
30
30
|
"dependencies": {
|
|
31
|
-
"@aztec/accounts": "0.0.1-commit.
|
|
32
|
-
"@aztec/archiver": "0.0.1-commit.
|
|
33
|
-
"@aztec/aztec-faucet": "0.0.1-commit.
|
|
34
|
-
"@aztec/aztec-node": "0.0.1-commit.
|
|
35
|
-
"@aztec/aztec.js": "0.0.1-commit.
|
|
36
|
-
"@aztec/bb-prover": "0.0.1-commit.
|
|
37
|
-
"@aztec/bb.js": "0.0.1-commit.
|
|
38
|
-
"@aztec/blob-client": "0.0.1-commit.
|
|
39
|
-
"@aztec/bot": "0.0.1-commit.
|
|
40
|
-
"@aztec/builder": "0.0.1-commit.
|
|
41
|
-
"@aztec/cli": "0.0.1-commit.
|
|
42
|
-
"@aztec/constants": "0.0.1-commit.
|
|
43
|
-
"@aztec/entrypoints": "0.0.1-commit.
|
|
44
|
-
"@aztec/ethereum": "0.0.1-commit.
|
|
45
|
-
"@aztec/foundation": "0.0.1-commit.
|
|
46
|
-
"@aztec/kv-store": "0.0.1-commit.
|
|
47
|
-
"@aztec/l1-artifacts": "0.0.1-commit.
|
|
48
|
-
"@aztec/node-lib": "0.0.1-commit.
|
|
49
|
-
"@aztec/noir-contracts.js": "0.0.1-commit.
|
|
50
|
-
"@aztec/noir-protocol-circuits-types": "0.0.1-commit.
|
|
51
|
-
"@aztec/p2p": "0.0.1-commit.
|
|
52
|
-
"@aztec/p2p-bootstrap": "0.0.1-commit.
|
|
53
|
-
"@aztec/protocol-contracts": "0.0.1-commit.
|
|
54
|
-
"@aztec/prover-client": "0.0.1-commit.
|
|
55
|
-
"@aztec/prover-node": "0.0.1-commit.
|
|
56
|
-
"@aztec/pxe": "0.0.1-commit.
|
|
57
|
-
"@aztec/sequencer-client": "0.0.1-commit.
|
|
58
|
-
"@aztec/stdlib": "0.0.1-commit.
|
|
59
|
-
"@aztec/telemetry-client": "0.0.1-commit.
|
|
60
|
-
"@aztec/txe": "0.0.1-commit.
|
|
61
|
-
"@aztec/validator-ha-signer": "0.0.1-commit.
|
|
62
|
-
"@aztec/wallets": "0.0.1-commit.
|
|
63
|
-
"@aztec/world-state": "0.0.1-commit.
|
|
31
|
+
"@aztec/accounts": "0.0.1-commit.04852196a",
|
|
32
|
+
"@aztec/archiver": "0.0.1-commit.04852196a",
|
|
33
|
+
"@aztec/aztec-faucet": "0.0.1-commit.04852196a",
|
|
34
|
+
"@aztec/aztec-node": "0.0.1-commit.04852196a",
|
|
35
|
+
"@aztec/aztec.js": "0.0.1-commit.04852196a",
|
|
36
|
+
"@aztec/bb-prover": "0.0.1-commit.04852196a",
|
|
37
|
+
"@aztec/bb.js": "0.0.1-commit.04852196a",
|
|
38
|
+
"@aztec/blob-client": "0.0.1-commit.04852196a",
|
|
39
|
+
"@aztec/bot": "0.0.1-commit.04852196a",
|
|
40
|
+
"@aztec/builder": "0.0.1-commit.04852196a",
|
|
41
|
+
"@aztec/cli": "0.0.1-commit.04852196a",
|
|
42
|
+
"@aztec/constants": "0.0.1-commit.04852196a",
|
|
43
|
+
"@aztec/entrypoints": "0.0.1-commit.04852196a",
|
|
44
|
+
"@aztec/ethereum": "0.0.1-commit.04852196a",
|
|
45
|
+
"@aztec/foundation": "0.0.1-commit.04852196a",
|
|
46
|
+
"@aztec/kv-store": "0.0.1-commit.04852196a",
|
|
47
|
+
"@aztec/l1-artifacts": "0.0.1-commit.04852196a",
|
|
48
|
+
"@aztec/node-lib": "0.0.1-commit.04852196a",
|
|
49
|
+
"@aztec/noir-contracts.js": "0.0.1-commit.04852196a",
|
|
50
|
+
"@aztec/noir-protocol-circuits-types": "0.0.1-commit.04852196a",
|
|
51
|
+
"@aztec/p2p": "0.0.1-commit.04852196a",
|
|
52
|
+
"@aztec/p2p-bootstrap": "0.0.1-commit.04852196a",
|
|
53
|
+
"@aztec/protocol-contracts": "0.0.1-commit.04852196a",
|
|
54
|
+
"@aztec/prover-client": "0.0.1-commit.04852196a",
|
|
55
|
+
"@aztec/prover-node": "0.0.1-commit.04852196a",
|
|
56
|
+
"@aztec/pxe": "0.0.1-commit.04852196a",
|
|
57
|
+
"@aztec/sequencer-client": "0.0.1-commit.04852196a",
|
|
58
|
+
"@aztec/stdlib": "0.0.1-commit.04852196a",
|
|
59
|
+
"@aztec/telemetry-client": "0.0.1-commit.04852196a",
|
|
60
|
+
"@aztec/txe": "0.0.1-commit.04852196a",
|
|
61
|
+
"@aztec/validator-ha-signer": "0.0.1-commit.04852196a",
|
|
62
|
+
"@aztec/wallets": "0.0.1-commit.04852196a",
|
|
63
|
+
"@aztec/world-state": "0.0.1-commit.04852196a",
|
|
64
|
+
"@iarna/toml": "^2.2.5",
|
|
64
65
|
"@types/chalk": "^2.2.0",
|
|
65
66
|
"abitype": "^0.8.11",
|
|
66
67
|
"chalk": "^5.3.0",
|
package/scripts/aztec.sh
CHANGED
|
@@ -20,6 +20,9 @@ function aztec {
|
|
|
20
20
|
|
|
21
21
|
case $cmd in
|
|
22
22
|
test)
|
|
23
|
+
# Attempt to compile, no-op if there are no changes
|
|
24
|
+
node --no-warnings "$script_dir/../dest/bin/index.js" compile
|
|
25
|
+
|
|
23
26
|
export LOG_LEVEL="${LOG_LEVEL:-"error;trace:contract_log"}"
|
|
24
27
|
aztec start --txe --port 8081 &
|
|
25
28
|
server_pid=$!
|
package/src/bin/index.ts
CHANGED
|
@@ -11,6 +11,7 @@ import { injectCommands as injectMiscCommands } from '@aztec/cli/misc';
|
|
|
11
11
|
import { injectCommands as injectValidatorKeysCommands } from '@aztec/cli/validator_keys';
|
|
12
12
|
import { getActiveNetworkName } from '@aztec/foundation/config';
|
|
13
13
|
import { createConsoleLogger, createLogger } from '@aztec/foundation/log';
|
|
14
|
+
import { getPackageVersion } from '@aztec/stdlib/update-checker';
|
|
14
15
|
|
|
15
16
|
import { Command } from 'commander';
|
|
16
17
|
|
|
@@ -18,7 +19,6 @@ import { injectCompileCommand } from '../cli/cmds/compile.js';
|
|
|
18
19
|
import { injectMigrateCommand } from '../cli/cmds/migrate_ha_db.js';
|
|
19
20
|
import { injectProfileCommand } from '../cli/cmds/profile.js';
|
|
20
21
|
import { injectAztecCommands } from '../cli/index.js';
|
|
21
|
-
import { getCliVersion } from '../cli/release_version.js';
|
|
22
22
|
|
|
23
23
|
const NETWORK_FLAG = 'network';
|
|
24
24
|
|
|
@@ -47,7 +47,7 @@ async function main() {
|
|
|
47
47
|
await enrichEnvironmentWithNetworkConfig(networkName);
|
|
48
48
|
enrichEnvironmentWithChainName(networkName);
|
|
49
49
|
|
|
50
|
-
const cliVersion =
|
|
50
|
+
const cliVersion = getPackageVersion() ?? 'unknown';
|
|
51
51
|
let program = new Command('aztec');
|
|
52
52
|
program.description('Aztec command line interface').version(cliVersion).enablePositionalOptions();
|
|
53
53
|
program = injectAztecCommands(program, userLog, debugLogger);
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { getActiveNetworkName } from '@aztec/foundation/config';
|
|
1
2
|
import {
|
|
2
3
|
type NamespacedApiHandlers,
|
|
3
4
|
createNamespacedSafeJsonRpcServer,
|
|
@@ -7,13 +8,13 @@ import {
|
|
|
7
8
|
import type { LogFn, Logger } from '@aztec/foundation/log';
|
|
8
9
|
import type { ChainConfig } from '@aztec/stdlib/config';
|
|
9
10
|
import { AztecNodeApiSchema } from '@aztec/stdlib/interfaces/client';
|
|
11
|
+
import { getPackageVersion } from '@aztec/stdlib/update-checker';
|
|
10
12
|
import { getVersioningMiddleware } from '@aztec/stdlib/versioning';
|
|
11
13
|
import { getOtelJsonRpcPropagationMiddleware } from '@aztec/telemetry-client';
|
|
12
14
|
|
|
13
15
|
import { createLocalNetwork } from '../local-network/index.js';
|
|
14
16
|
import { github, splash } from '../splash.js';
|
|
15
17
|
import { resolveAdminApiKey } from './admin_api_key_store.js';
|
|
16
|
-
import { getCliVersion } from './release_version.js';
|
|
17
18
|
import { extractNamespacedOptions, installSignalHandlers } from './util.js';
|
|
18
19
|
import { getVersions } from './versioning.js';
|
|
19
20
|
|
|
@@ -25,7 +26,7 @@ export async function aztecStart(options: any, userLog: LogFn, debugLogger: Logg
|
|
|
25
26
|
let config: ChainConfig | undefined = undefined;
|
|
26
27
|
|
|
27
28
|
if (options.localNetwork) {
|
|
28
|
-
const cliVersion =
|
|
29
|
+
const cliVersion = getPackageVersion() ?? 'unknown';
|
|
29
30
|
const localNetwork = extractNamespacedOptions(options, 'local-network');
|
|
30
31
|
localNetwork.testAccounts = true;
|
|
31
32
|
userLog(`${splash}\n${github}\n\n`);
|
|
@@ -57,7 +58,8 @@ export async function aztecStart(options: any, userLog: LogFn, debugLogger: Logg
|
|
|
57
58
|
|
|
58
59
|
if (options.node) {
|
|
59
60
|
const { startNode } = await import('./cmds/start_node.js');
|
|
60
|
-
|
|
61
|
+
const networkName = getActiveNetworkName(options.network);
|
|
62
|
+
({ config } = await startNode(options, signalHandlers, services, adminServices, userLog, networkName));
|
|
61
63
|
} else if (options.bot) {
|
|
62
64
|
const { startBot } = await import('./cmds/start_bot.js');
|
|
63
65
|
await startBot(options, signalHandlers, services, userLog);
|
|
@@ -12,7 +12,6 @@ import {
|
|
|
12
12
|
isBooleanConfigValue,
|
|
13
13
|
omitConfigMappings,
|
|
14
14
|
} from '@aztec/foundation/config';
|
|
15
|
-
import { dataConfigMappings } from '@aztec/kv-store/config';
|
|
16
15
|
import { sharedNodeConfigMappings } from '@aztec/node-lib/config';
|
|
17
16
|
import { bootnodeConfigMappings, p2pConfigMappings } from '@aztec/p2p/config';
|
|
18
17
|
import { proverAgentConfigMappings, proverBrokerConfigMappings } from '@aztec/prover-client/broker/config';
|
|
@@ -20,6 +19,7 @@ import { proverNodeConfigMappings } from '@aztec/prover-node/config';
|
|
|
20
19
|
import { allPxeConfigMappings } from '@aztec/pxe/config';
|
|
21
20
|
import { sequencerClientConfigMappings } from '@aztec/sequencer-client/config';
|
|
22
21
|
import { chainConfigMappings, nodeRpcConfigMappings } from '@aztec/stdlib/config';
|
|
22
|
+
import { dataConfigMappings } from '@aztec/stdlib/kv-store';
|
|
23
23
|
import { telemetryClientConfigMappings } from '@aztec/telemetry-client/config';
|
|
24
24
|
import { worldStateConfigMappings } from '@aztec/world-state/config';
|
|
25
25
|
|
|
@@ -105,8 +105,7 @@ export const aztecStartOptions: { [key: string]: AztecStartOption[] } = {
|
|
|
105
105
|
env: 'NETWORK',
|
|
106
106
|
},
|
|
107
107
|
|
|
108
|
-
configToFlag('--
|
|
109
|
-
configToFlag('--auto-update-url', sharedNodeConfigMappings.autoUpdateUrl),
|
|
108
|
+
configToFlag('--enable-version-check', sharedNodeConfigMappings.enableVersionCheck),
|
|
110
109
|
|
|
111
110
|
configToFlag('--sync-mode', sharedNodeConfigMappings.syncMode),
|
|
112
111
|
configToFlag('--snapshots-urls', sharedNodeConfigMappings.snapshotsUrls),
|
package/src/cli/cmds/compile.ts
CHANGED
|
@@ -6,6 +6,7 @@ import { readFile, writeFile } from 'fs/promises';
|
|
|
6
6
|
import { join } from 'path';
|
|
7
7
|
|
|
8
8
|
import { readArtifactFiles } from './utils/artifacts.js';
|
|
9
|
+
import { needsRecompile } from './utils/needs_recompile.js';
|
|
9
10
|
import { run } from './utils/spawn.js';
|
|
10
11
|
|
|
11
12
|
/** Returns paths to contract artifacts in the target directory. */
|
|
@@ -137,6 +138,11 @@ async function checkNoTestsInContracts(nargo: string, log: LogFn): Promise<void>
|
|
|
137
138
|
|
|
138
139
|
/** Compiles Aztec Noir contracts and postprocesses artifacts. */
|
|
139
140
|
async function compileAztecContract(nargoArgs: string[], log: LogFn): Promise<void> {
|
|
141
|
+
if (!(await needsRecompile())) {
|
|
142
|
+
log('No source changes detected, skipping compilation.');
|
|
143
|
+
return;
|
|
144
|
+
}
|
|
145
|
+
|
|
140
146
|
const nargo = process.env.NARGO ?? 'nargo';
|
|
141
147
|
const bb = process.env.BB ?? 'bb';
|
|
142
148
|
|