@aztec/aztec 0.0.1-commit.993d240 → 0.0.1-commit.9a89641
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 -0
- 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 +10 -26
- package/dest/cli/aztec_start_options.js +1 -1
- 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 +25 -17
- package/dest/cli/cmds/prover.d.ts +4 -0
- package/dest/cli/cmds/prover.d.ts.map +1 -0
- package/dest/cli/cmds/prover.js +24 -0
- package/dest/cli/cmds/standby.d.ts +28 -2
- package/dest/cli/cmds/standby.d.ts.map +1 -1
- package/dest/cli/cmds/standby.js +45 -2
- package/dest/cli/cmds/start_bot.d.ts +1 -1
- package/dest/cli/cmds/start_bot.d.ts.map +1 -1
- package/dest/cli/cmds/start_bot.js +5 -1
- package/dest/cli/cmds/start_node.d.ts +1 -1
- package/dest/cli/cmds/start_node.d.ts.map +1 -1
- package/dest/cli/cmds/start_node.js +14 -23
- package/dest/cli/cmds/utils/artifacts.d.ts +6 -1
- package/dest/cli/cmds/utils/artifacts.d.ts.map +1 -1
- package/dest/cli/util.d.ts +10 -5
- package/dest/cli/util.d.ts.map +1 -1
- package/dest/cli/util.js +20 -49
- package/dest/examples/token.js +3 -3
- package/dest/local-network/auth_registry.d.ts +3 -2
- package/dest/local-network/auth_registry.d.ts.map +1 -1
- package/dest/local-network/auth_registry.js +5 -3
- package/dest/local-network/banana_fpc.d.ts +3 -2
- package/dest/local-network/banana_fpc.d.ts.map +1 -1
- package/dest/local-network/banana_fpc.js +5 -3
- package/dest/local-network/local-network.d.ts +6 -5
- package/dest/local-network/local-network.d.ts.map +1 -1
- package/dest/local-network/local-network.js +43 -78
- package/dest/testing/cheat_codes.d.ts +16 -23
- package/dest/testing/cheat_codes.d.ts.map +1 -1
- package/dest/testing/cheat_codes.js +20 -82
- package/dest/testing/epoch_test_settler.d.ts +2 -2
- package/dest/testing/epoch_test_settler.d.ts.map +1 -1
- package/dest/testing/epoch_test_settler.js +5 -26
- package/dest/testing/index.d.ts +2 -2
- package/dest/testing/index.d.ts.map +1 -1
- package/dest/testing/index.js +1 -1
- package/dest/testing/local-network.d.ts +51 -0
- package/dest/testing/local-network.d.ts.map +1 -0
- package/dest/testing/local-network.js +60 -0
- package/dest/testing/token_allowed_setup.d.ts +9 -4
- package/dest/testing/token_allowed_setup.d.ts.map +1 -1
- package/dest/testing/token_allowed_setup.js +12 -8
- package/package.json +34 -34
- package/scripts/templates/counter/contract/src/main.nr +4 -4
- package/src/bin/index.ts +2 -0
- package/src/cli/aztec_start_action.ts +8 -13
- package/src/cli/aztec_start_options.ts +1 -1
- package/src/cli/cmds/compile.ts +29 -16
- package/src/cli/cmds/prover.ts +42 -0
- package/src/cli/cmds/standby.ts +55 -3
- package/src/cli/cmds/start_bot.ts +6 -1
- package/src/cli/cmds/start_node.ts +17 -23
- package/src/cli/cmds/utils/artifacts.ts +5 -0
- package/src/cli/util.ts +21 -62
- package/src/examples/token.ts +11 -3
- package/src/local-network/auth_registry.ts +8 -3
- package/src/local-network/banana_fpc.ts +9 -2
- package/src/local-network/local-network.ts +48 -89
- package/src/testing/cheat_codes.ts +19 -103
- package/src/testing/epoch_test_settler.ts +8 -30
- package/src/testing/index.ts +1 -1
- package/src/testing/local-network.ts +97 -0
- package/src/testing/token_allowed_setup.ts +15 -8
- package/dest/testing/anvil_test_watcher.d.ts +0 -54
- package/dest/testing/anvil_test_watcher.d.ts.map +0 -1
- package/dest/testing/anvil_test_watcher.js +0 -235
- package/src/testing/anvil_test_watcher.ts +0 -273
package/dest/cli/util.js
CHANGED
|
@@ -1,8 +1,4 @@
|
|
|
1
|
-
import { getNetworkConfig } from '@aztec/cli/config';
|
|
2
|
-
import { RegistryContract } from '@aztec/ethereum/contracts';
|
|
3
1
|
import { jsonStringify } from '@aztec/foundation/json-rpc';
|
|
4
|
-
import { createLogger } from '@aztec/foundation/log';
|
|
5
|
-
import { getPackageVersion } from '@aztec/stdlib/update-checker';
|
|
6
2
|
import chalk from 'chalk';
|
|
7
3
|
import { aztecStartOptions } from './aztec_start_options.js';
|
|
8
4
|
export var ExitCode = /*#__PURE__*/ function(ExitCode) {
|
|
@@ -38,6 +34,25 @@ export function shutdown(logFn, exitCode, cb) {
|
|
|
38
34
|
export function isShuttingDown() {
|
|
39
35
|
return shutdownPromise !== undefined;
|
|
40
36
|
}
|
|
37
|
+
/**
|
|
38
|
+
* Stops the node's subsystems (via the registered signal handlers) without exiting the process, leaving
|
|
39
|
+
* the HTTP health server listening so K8s liveness/readiness probes keep passing. Unlike {@link shutdown}
|
|
40
|
+
* this deliberately does not latch `shutdownPromise` or call `process.exit`; instead it re-arms
|
|
41
|
+
* SIGTERM/SIGINT so a later K8s pod deletion still terminates the wound-down pod with a clean exit.
|
|
42
|
+
*/ export async function softShutdown(logFn, signalHandlers) {
|
|
43
|
+
logFn('Canonical rollup upgrade detected: stopping subsystems, health server stays up.', {
|
|
44
|
+
exitCode: 78
|
|
45
|
+
});
|
|
46
|
+
await Promise.allSettled(signalHandlers.map((fn)=>fn()));
|
|
47
|
+
for (const sig of [
|
|
48
|
+
'SIGTERM',
|
|
49
|
+
'SIGINT'
|
|
50
|
+
]){
|
|
51
|
+
process.removeAllListeners(sig);
|
|
52
|
+
process.once(sig, ()=>process.exit(78));
|
|
53
|
+
}
|
|
54
|
+
logFn('Subsystems stopped due to rollup upgrade. Health server remains active.');
|
|
55
|
+
}
|
|
41
56
|
export const installSignalHandlers = (logFn, cb)=>{
|
|
42
57
|
const signals = [
|
|
43
58
|
[
|
|
@@ -79,7 +94,7 @@ export const installSignalHandlers = (logFn, cb)=>{
|
|
|
79
94
|
if (registeredAccounts.find((a)=>a.item.equals(completeAddress.address))) {
|
|
80
95
|
accountLogStrings.push(` Address: ${completeAddress.address.toString()}\n`);
|
|
81
96
|
accountLogStrings.push(` Partial Address: ${completeAddress.partialAddress.toString()}\n`);
|
|
82
|
-
accountLogStrings.push(` Secret Key: ${
|
|
97
|
+
accountLogStrings.push(` Secret Key: ${accountManager.getSecretKey().toString()}\n`);
|
|
83
98
|
accountLogStrings.push(` Master nullifier public key hash: ${completeAddress.publicKeys.npkMHash.toString()}\n`);
|
|
84
99
|
accountLogStrings.push(` Master incoming viewing public key: ${completeAddress.publicKeys.ivpkM.toString()}\n\n`);
|
|
85
100
|
accountLogStrings.push(` Master outgoing viewing public key hash: ${completeAddress.publicKeys.ovpkMHash.toString()}\n\n`);
|
|
@@ -241,50 +256,6 @@ export const printAztecStartHelpText = ()=>{
|
|
|
241
256
|
]);
|
|
242
257
|
}
|
|
243
258
|
}
|
|
244
|
-
export async function setupVersionChecker(network, followsCanonicalRollup, publicClient, signalHandlers, cacheDir) {
|
|
245
|
-
const networkConfig = await getNetworkConfig(network, cacheDir);
|
|
246
|
-
if (!networkConfig) {
|
|
247
|
-
return;
|
|
248
|
-
}
|
|
249
|
-
const { VersionChecker } = await import('@aztec/stdlib/update-checker');
|
|
250
|
-
const logger = createLogger('version_check');
|
|
251
|
-
const registry = new RegistryContract(publicClient, networkConfig.registryAddress);
|
|
252
|
-
const checks = [];
|
|
253
|
-
checks.push({
|
|
254
|
-
name: 'node',
|
|
255
|
-
currentVersion: getPackageVersion(),
|
|
256
|
-
getLatestVersion: async ()=>{
|
|
257
|
-
const cfg = await getNetworkConfig(network, cacheDir);
|
|
258
|
-
return cfg?.nodeVersion;
|
|
259
|
-
}
|
|
260
|
-
});
|
|
261
|
-
if (followsCanonicalRollup) {
|
|
262
|
-
const getLatestVersion = async ()=>{
|
|
263
|
-
const version = (await registry.getRollupVersions()).at(-1);
|
|
264
|
-
return version !== undefined ? String(version) : undefined;
|
|
265
|
-
};
|
|
266
|
-
const currentVersion = await getLatestVersion();
|
|
267
|
-
if (currentVersion !== undefined) {
|
|
268
|
-
checks.push({
|
|
269
|
-
name: 'rollup',
|
|
270
|
-
currentVersion,
|
|
271
|
-
getLatestVersion
|
|
272
|
-
});
|
|
273
|
-
}
|
|
274
|
-
}
|
|
275
|
-
const checker = new VersionChecker(checks, 600_000, logger);
|
|
276
|
-
checker.on('newVersion', ({ name, latestVersion, currentVersion })=>{
|
|
277
|
-
if (isShuttingDown()) {
|
|
278
|
-
return;
|
|
279
|
-
}
|
|
280
|
-
logger.warn(`New ${name} version available`, {
|
|
281
|
-
latestVersion,
|
|
282
|
-
currentVersion
|
|
283
|
-
});
|
|
284
|
-
});
|
|
285
|
-
checker.start();
|
|
286
|
-
signalHandlers.push(()=>checker.stop());
|
|
287
|
-
}
|
|
288
259
|
export function stringifyConfig(config) {
|
|
289
260
|
return Object.entries(config).map(([key, value])=>`${key}=${jsonStringify(value)}`).join(' ');
|
|
290
261
|
}
|
package/dest/examples/token.js
CHANGED
|
@@ -13,10 +13,10 @@ const TRANSFER_AMOUNT = 33n;
|
|
|
13
13
|
*/ async function main() {
|
|
14
14
|
logger.info('Running token contract test on HTTP interface.');
|
|
15
15
|
const wallet = await EmbeddedWallet.create(node);
|
|
16
|
-
// During local network setup we
|
|
16
|
+
// During local network setup we create a few initializerless accounts. Below we add them to our wallet.
|
|
17
17
|
const [aliceInitialAccountData, bobInitialAccountData] = await getInitialTestAccountsData();
|
|
18
|
-
await wallet.
|
|
19
|
-
await wallet.
|
|
18
|
+
await wallet.createSchnorrInitializerlessAccount(aliceInitialAccountData.secret, aliceInitialAccountData.salt, aliceInitialAccountData.signingKey);
|
|
19
|
+
await wallet.createSchnorrInitializerlessAccount(bobInitialAccountData.secret, bobInitialAccountData.salt, bobInitialAccountData.signingKey);
|
|
20
20
|
const alice = aliceInitialAccountData.address;
|
|
21
21
|
const bob = bobInitialAccountData.address;
|
|
22
22
|
logger.info(`Fetched Alice and Bob accounts: ${alice.toString()}, ${bob.toString()}`);
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
+
import type { WaitOpts } from '@aztec/aztec.js/contracts';
|
|
1
2
|
import type { Wallet } from '@aztec/aztec.js/wallet';
|
|
2
3
|
import type { AztecAddress } from '@aztec/stdlib/aztec-address';
|
|
3
|
-
export declare function publishStandardAuthRegistry(wallet: Wallet, from: AztecAddress): Promise<void>;
|
|
4
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
4
|
+
export declare function publishStandardAuthRegistry(wallet: Wallet, from: AztecAddress, waitOpts?: WaitOpts): Promise<void>;
|
|
5
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYXV0aF9yZWdpc3RyeS5kLnRzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vc3JjL2xvY2FsLW5ldHdvcmsvYXV0aF9yZWdpc3RyeS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEtBQUssRUFBRSxRQUFRLEVBQUUsTUFBTSwyQkFBMkIsQ0FBQztBQUUxRCxPQUFPLEtBQUssRUFBRSxNQUFNLEVBQUUsTUFBTSx3QkFBd0IsQ0FBQztBQUVyRCxPQUFPLEtBQUssRUFBRSxZQUFZLEVBQUUsTUFBTSw2QkFBNkIsQ0FBQztBQUVoRSx3QkFBc0IsMkJBQTJCLENBQy9DLE1BQU0sRUFBRSxNQUFNLEVBQ2QsSUFBSSxFQUFFLFlBQVksRUFDbEIsUUFBUSxDQUFDLEVBQUUsUUFBUSxHQUNsQixPQUFPLENBQUMsSUFBSSxDQUFDLENBUWYifQ==
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"auth_registry.d.ts","sourceRoot":"","sources":["../../src/local-network/auth_registry.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"auth_registry.d.ts","sourceRoot":"","sources":["../../src/local-network/auth_registry.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,2BAA2B,CAAC;AAE1D,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAErD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAEhE,wBAAsB,2BAA2B,CAC/C,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,YAAY,EAClB,QAAQ,CAAC,EAAE,QAAQ,GAClB,OAAO,CAAC,IAAI,CAAC,CAQf"}
|
|
@@ -1,15 +1,17 @@
|
|
|
1
1
|
import { publishContractClass, publishInstance } from '@aztec/aztec.js/deployment';
|
|
2
2
|
import { AuthRegistryArtifact, getStandardAuthRegistry } from '@aztec/standard-contracts/auth-registry';
|
|
3
|
-
export async function publishStandardAuthRegistry(wallet, from) {
|
|
3
|
+
export async function publishStandardAuthRegistry(wallet, from, waitOpts) {
|
|
4
4
|
const { instance, contractClass } = await getStandardAuthRegistry();
|
|
5
5
|
if (!(await wallet.getContractClassMetadata(contractClass.id)).isContractClassPubliclyRegistered) {
|
|
6
6
|
await (await publishContractClass(wallet, AuthRegistryArtifact)).send({
|
|
7
|
-
from
|
|
7
|
+
from,
|
|
8
|
+
wait: waitOpts
|
|
8
9
|
});
|
|
9
10
|
}
|
|
10
11
|
if (!(await wallet.getContractMetadata(instance.address)).isContractPublished) {
|
|
11
12
|
await publishInstance(wallet, instance).send({
|
|
12
|
-
from
|
|
13
|
+
from,
|
|
14
|
+
wait: waitOpts
|
|
13
15
|
});
|
|
14
16
|
}
|
|
15
17
|
}
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { type InitialAccountData } from '@aztec/accounts/testing';
|
|
2
|
+
import type { WaitOpts } from '@aztec/aztec.js/contracts';
|
|
2
3
|
import type { Wallet } from '@aztec/aztec.js/wallet';
|
|
3
4
|
import type { LogFn } from '@aztec/foundation/log';
|
|
4
5
|
import { AztecAddress } from '@aztec/stdlib/aztec-address';
|
|
5
6
|
export declare function getBananaCoinAddress(initialAccounts: InitialAccountData[]): Promise<AztecAddress>;
|
|
6
7
|
export declare function getBananaFPCAddress(initialAccounts: InitialAccountData[]): Promise<AztecAddress>;
|
|
7
|
-
export declare function setupBananaFPC(initialAccounts: InitialAccountData[], wallet: Wallet, log: LogFn): Promise<void>;
|
|
8
|
+
export declare function setupBananaFPC(initialAccounts: InitialAccountData[], wallet: Wallet, log: LogFn, waitOpts?: WaitOpts): Promise<void>;
|
|
8
9
|
export declare function registerDeployedBananaCoinInWalletAndGetAddress(wallet: Wallet): Promise<AztecAddress>;
|
|
9
10
|
export declare function registerDeployedBananaFPCInWalletAndGetAddress(wallet: Wallet): Promise<AztecAddress>;
|
|
10
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
11
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYmFuYW5hX2ZwYy5kLnRzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vc3JjL2xvY2FsLW5ldHdvcmsvYmFuYW5hX2ZwYy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEVBQUUsS0FBSyxrQkFBa0IsRUFBOEIsTUFBTSx5QkFBeUIsQ0FBQztBQUM5RixPQUFPLEtBQUssRUFBRSxRQUFRLEVBQUUsTUFBTSwyQkFBMkIsQ0FBQztBQUMxRCxPQUFPLEtBQUssRUFBRSxNQUFNLEVBQUUsTUFBTSx3QkFBd0IsQ0FBQztBQUVyRCxPQUFPLEtBQUssRUFBRSxLQUFLLEVBQUUsTUFBTSx1QkFBdUIsQ0FBQztBQUduRCxPQUFPLEVBQUUsWUFBWSxFQUFFLE1BQU0sNkJBQTZCLENBQUM7QUF3QjNELHdCQUFzQixvQkFBb0IsQ0FBQyxlQUFlLEVBQUUsa0JBQWtCLEVBQUUseUJBRS9FO0FBV0Qsd0JBQXNCLG1CQUFtQixDQUFDLGVBQWUsRUFBRSxrQkFBa0IsRUFBRSx5QkFFOUU7QUFFRCx3QkFBc0IsY0FBYyxDQUNsQyxlQUFlLEVBQUUsa0JBQWtCLEVBQUUsRUFDckMsTUFBTSxFQUFFLE1BQU0sRUFDZCxHQUFHLEVBQUUsS0FBSyxFQUNWLFFBQVEsQ0FBQyxFQUFFLFFBQVEsaUJBaUJwQjtBQUVELHdCQUFzQiwrQ0FBK0MsQ0FBQyxNQUFNLEVBQUUsTUFBTSx5QkFNbkY7QUFFRCx3QkFBc0IsOENBQThDLENBQUMsTUFBTSxFQUFFLE1BQU0seUJBTWxGIn0=
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"banana_fpc.d.ts","sourceRoot":"","sources":["../../src/local-network/banana_fpc.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,kBAAkB,EAA8B,MAAM,yBAAyB,CAAC;AAC9F,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAErD,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AAGnD,OAAO,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAwB3D,wBAAsB,oBAAoB,CAAC,eAAe,EAAE,kBAAkB,EAAE,yBAE/E;AAWD,wBAAsB,mBAAmB,CAAC,eAAe,EAAE,kBAAkB,EAAE,yBAE9E;AAED,wBAAsB,cAAc,
|
|
1
|
+
{"version":3,"file":"banana_fpc.d.ts","sourceRoot":"","sources":["../../src/local-network/banana_fpc.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,kBAAkB,EAA8B,MAAM,yBAAyB,CAAC;AAC9F,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,2BAA2B,CAAC;AAC1D,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAErD,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AAGnD,OAAO,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAwB3D,wBAAsB,oBAAoB,CAAC,eAAe,EAAE,kBAAkB,EAAE,yBAE/E;AAWD,wBAAsB,mBAAmB,CAAC,eAAe,EAAE,kBAAkB,EAAE,yBAE9E;AAED,wBAAsB,cAAc,CAClC,eAAe,EAAE,kBAAkB,EAAE,EACrC,MAAM,EAAE,MAAM,EACd,GAAG,EAAE,KAAK,EACV,QAAQ,CAAC,EAAE,QAAQ,iBAiBpB;AAED,wBAAsB,+CAA+C,CAAC,MAAM,EAAE,MAAM,yBAMnF;AAED,wBAAsB,8CAA8C,CAAC,MAAM,EAAE,MAAM,yBAMlF"}
|
|
@@ -43,7 +43,7 @@ async function getBananaFPCInstance(initialAccounts) {
|
|
|
43
43
|
export async function getBananaFPCAddress(initialAccounts) {
|
|
44
44
|
return (await getBananaFPCInstance(initialAccounts)).address;
|
|
45
45
|
}
|
|
46
|
-
export async function setupBananaFPC(initialAccounts, wallet, log) {
|
|
46
|
+
export async function setupBananaFPC(initialAccounts, wallet, log, waitOpts) {
|
|
47
47
|
const bananaCoinAddress = await getBananaCoinAddress(initialAccounts);
|
|
48
48
|
const admin = getBananaAdmin(initialAccounts);
|
|
49
49
|
const [{ contract: bananaCoin }, { contract: fpc }] = await Promise.all([
|
|
@@ -51,13 +51,15 @@ export async function setupBananaFPC(initialAccounts, wallet, log) {
|
|
|
51
51
|
salt: BANANA_COIN_SALT,
|
|
52
52
|
universalDeploy: true
|
|
53
53
|
}).send({
|
|
54
|
-
from: admin
|
|
54
|
+
from: admin,
|
|
55
|
+
wait: waitOpts
|
|
55
56
|
}),
|
|
56
57
|
FPCContract.deploy(wallet, bananaCoinAddress, admin, {
|
|
57
58
|
salt: BANANA_FPC_SALT,
|
|
58
59
|
universalDeploy: true
|
|
59
60
|
}).send({
|
|
60
|
-
from: admin
|
|
61
|
+
from: admin,
|
|
62
|
+
wait: waitOpts
|
|
61
63
|
})
|
|
62
64
|
]);
|
|
63
65
|
log(`BananaCoin: ${bananaCoin.address}`);
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
#!/usr/bin/env -S node --no-warnings
|
|
2
|
-
import { AztecNodeService } from '@aztec/aztec-node';
|
|
3
2
|
import { type AztecNodeConfig } from '@aztec/aztec-node/config';
|
|
4
3
|
import { Fr } from '@aztec/aztec.js/fields';
|
|
5
4
|
import { type BlobClientInterface } from '@aztec/blob-client/client';
|
|
@@ -9,7 +8,7 @@ import { DateProvider } from '@aztec/foundation/timer';
|
|
|
9
8
|
import type { ProvingJobBroker } from '@aztec/stdlib/interfaces/server';
|
|
10
9
|
import type { GenesisData } from '@aztec/stdlib/world-state';
|
|
11
10
|
import { type TelemetryClient } from '@aztec/telemetry-client';
|
|
12
|
-
import {
|
|
11
|
+
import type { Hex } from 'viem';
|
|
13
12
|
/**
|
|
14
13
|
* Function to deploy our L1 contracts to the local network L1
|
|
15
14
|
* @param aztecNodeConfig - The Aztec Node Config
|
|
@@ -25,6 +24,8 @@ export type LocalNetworkConfig = AztecNodeConfig & {
|
|
|
25
24
|
l1Mnemonic: string;
|
|
26
25
|
/** Whether to deploy test accounts on local network start.*/
|
|
27
26
|
testAccounts: boolean;
|
|
27
|
+
/** Override the default per-address fee juice granted at genesis to funded addresses. */
|
|
28
|
+
initialAccountFeeJuice?: Fr;
|
|
28
29
|
};
|
|
29
30
|
/**
|
|
30
31
|
* Create and start a new Aztec Node and PXE. Deploys L1 contracts.
|
|
@@ -32,7 +33,7 @@ export type LocalNetworkConfig = AztecNodeConfig & {
|
|
|
32
33
|
* @param config - Optional local network settings.
|
|
33
34
|
*/
|
|
34
35
|
export declare function createLocalNetwork(config: Partial<LocalNetworkConfig> | undefined, userLog: LogFn): Promise<{
|
|
35
|
-
node: AztecNodeService;
|
|
36
|
+
node: import("@aztec/aztec-node").AztecNodeService;
|
|
36
37
|
stop: () => Promise<void>;
|
|
37
38
|
}>;
|
|
38
39
|
/**
|
|
@@ -46,5 +47,5 @@ export declare function createAztecNode(config?: Partial<AztecNodeConfig>, deps?
|
|
|
46
47
|
proverBroker?: ProvingJobBroker;
|
|
47
48
|
}, options?: {
|
|
48
49
|
genesis?: GenesisData;
|
|
49
|
-
}): Promise<AztecNodeService>;
|
|
50
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
50
|
+
}): Promise<import("@aztec/aztec-node").AztecNodeService>;
|
|
51
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibG9jYWwtbmV0d29yay5kLnRzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vc3JjL2xvY2FsLW5ldHdvcmsvbG9jYWwtbmV0d29yay50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiO0FBR0EsT0FBTyxFQUFFLEtBQUssZUFBZSxFQUFvQixNQUFNLDBCQUEwQixDQUFDO0FBQ2xGLE9BQU8sRUFBRSxFQUFFLEVBQUUsTUFBTSx3QkFBd0IsQ0FBQztBQUU1QyxPQUFPLEVBQUUsS0FBSyxtQkFBbUIsRUFBb0IsTUFBTSwyQkFBMkIsQ0FBQztBQU12RixPQUFPLEtBQUssRUFBRSxtQkFBbUIsRUFBRSxNQUFNLHVDQUF1QyxDQUFDO0FBR2pGLE9BQU8sS0FBSyxFQUFFLEtBQUssRUFBRSxNQUFNLHVCQUF1QixDQUFDO0FBQ25ELE9BQU8sRUFBRSxZQUFZLEVBQW9CLE1BQU0seUJBQXlCLENBQUM7QUFJekUsT0FBTyxLQUFLLEVBQUUsZ0JBQWdCLEVBQUUsTUFBTSxpQ0FBaUMsQ0FBQztBQUV4RSxPQUFPLEtBQUssRUFBRSxXQUFXLEVBQUUsTUFBTSwyQkFBMkIsQ0FBQztBQUM3RCxPQUFPLEVBQ0wsS0FBSyxlQUFlLEVBR3JCLE1BQU0seUJBQXlCLENBQUM7QUFLakMsT0FBTyxLQUFLLEVBQUUsR0FBRyxFQUFFLE1BQU0sTUFBTSxDQUFDO0FBbUJoQzs7OztHQUlHO0FBQ0gsd0JBQXNCLG1CQUFtQixDQUN2QyxlQUFlLEVBQUUsZUFBZSxFQUNoQyxVQUFVLEVBQUUsR0FBRyxFQUNmLElBQUksR0FBRTtJQUNKLGtCQUFrQixDQUFDLEVBQUUsRUFBRSxDQUFDO0lBQ3hCLDRCQUE0QixDQUFDLEVBQUUsTUFBTSxDQUFDO0NBQ2xDLEdBQ0wsT0FBTyxDQUFDLG1CQUFtQixDQUFDLENBbUI5QjtBQUVELDhCQUE4QjtBQUM5QixNQUFNLE1BQU0sa0JBQWtCLEdBQUcsZUFBZSxHQUFHO0lBQ2pELDBEQUEwRDtJQUMxRCxVQUFVLEVBQUUsTUFBTSxDQUFDO0lBQ25CLDZEQUE2RDtJQUM3RCxZQUFZLEVBQUUsT0FBTyxDQUFDO0lBQ3RCLHlGQUF5RjtJQUN6RixzQkFBc0IsQ0FBQyxFQUFFLEVBQUUsQ0FBQztDQUM3QixDQUFDO0FBRUY7Ozs7R0FJRztBQUNILHdCQUFzQixrQkFBa0IsQ0FBQyxNQUFNLHlDQUFrQyxFQUFFLE9BQU8sRUFBRSxLQUFLOzs7R0ErSGhHO0FBRUQ7OztHQUdHO0FBQ0gsd0JBQXNCLGVBQWUsQ0FDbkMsTUFBTSxHQUFFLE9BQU8sQ0FBQyxlQUFlLENBQU0sRUFDckMsSUFBSSxHQUFFO0lBQ0osU0FBUyxDQUFDLEVBQUUsZUFBZSxDQUFDO0lBQzVCLFVBQVUsQ0FBQyxFQUFFLG1CQUFtQixDQUFDO0lBQ2pDLFlBQVksQ0FBQyxFQUFFLFlBQVksQ0FBQztJQUM1QixZQUFZLENBQUMsRUFBRSxnQkFBZ0IsQ0FBQztDQUM1QixFQUNOLE9BQU8sR0FBRTtJQUFFLE9BQU8sQ0FBQyxFQUFFLFdBQVcsQ0FBQTtDQUFPLHlEQWN4QyJ9
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"local-network.d.ts","sourceRoot":"","sources":["../../src/local-network/local-network.ts"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"local-network.d.ts","sourceRoot":"","sources":["../../src/local-network/local-network.ts"],"names":[],"mappings":";AAGA,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;AAMvF,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,uCAAuC,CAAC;AAGjF,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AACnD,OAAO,EAAE,YAAY,EAAoB,MAAM,yBAAyB,CAAC;AAIzE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AAExE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAC7D,OAAO,EACL,KAAK,eAAe,EAGrB,MAAM,yBAAyB,CAAC;AAKjC,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,MAAM,CAAC;AAmBhC;;;;GAIG;AACH,wBAAsB,mBAAmB,CACvC,eAAe,EAAE,eAAe,EAChC,UAAU,EAAE,GAAG,EACf,IAAI,GAAE;IACJ,kBAAkB,CAAC,EAAE,EAAE,CAAC;IACxB,4BAA4B,CAAC,EAAE,MAAM,CAAC;CAClC,GACL,OAAO,CAAC,mBAAmB,CAAC,CAmB9B;AAED,8BAA8B;AAC9B,MAAM,MAAM,kBAAkB,GAAG,eAAe,GAAG;IACjD,0DAA0D;IAC1D,UAAU,EAAE,MAAM,CAAC;IACnB,6DAA6D;IAC7D,YAAY,EAAE,OAAO,CAAC;IACtB,yFAAyF;IACzF,sBAAsB,CAAC,EAAE,EAAE,CAAC;CAC7B,CAAC;AAEF;;;;GAIG;AACH,wBAAsB,kBAAkB,CAAC,MAAM,yCAAkC,EAAE,OAAO,EAAE,KAAK;;;GA+HhG;AAED;;;GAGG;AACH,wBAAsB,eAAe,CACnC,MAAM,GAAE,OAAO,CAAC,eAAe,CAAM,EACrC,IAAI,GAAE;IACJ,SAAS,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,OAAO,CAAC,EAAE,WAAW,CAAA;CAAO,yDAcxC"}
|
|
@@ -1,41 +1,42 @@
|
|
|
1
1
|
#!/usr/bin/env -S node --no-warnings
|
|
2
2
|
import { getInitialTestAccountsData } from '@aztec/accounts/testing';
|
|
3
|
-
import {
|
|
3
|
+
import { createAztecNodeService } from '@aztec/aztec-node';
|
|
4
4
|
import { getConfigEnvVars } from '@aztec/aztec-node/config';
|
|
5
5
|
import { Fr } from '@aztec/aztec.js/fields';
|
|
6
6
|
import { createLogger } from '@aztec/aztec.js/log';
|
|
7
7
|
import { createBlobClient } from '@aztec/blob-client/client';
|
|
8
8
|
import { GENESIS_ARCHIVE_ROOT } from '@aztec/constants';
|
|
9
|
-
import { createEthereumChain } from '@aztec/ethereum/chain';
|
|
10
9
|
import { waitForPublicClient } from '@aztec/ethereum/client';
|
|
11
10
|
import { getL1ContractsConfigEnvVars } from '@aztec/ethereum/config';
|
|
12
11
|
import { NULL_KEY } from '@aztec/ethereum/constants';
|
|
13
12
|
import { deployAztecL1Contracts } from '@aztec/ethereum/deploy-aztec-l1-contracts';
|
|
14
|
-
import { EthCheatCodes } from '@aztec/ethereum/test';
|
|
15
13
|
import { SecretValue } from '@aztec/foundation/config';
|
|
16
14
|
import { EthAddress } from '@aztec/foundation/eth-address';
|
|
17
15
|
import { TestDateProvider } from '@aztec/foundation/timer';
|
|
18
16
|
import { getVKTreeRoot } from '@aztec/noir-protocol-circuits-types/vk-tree';
|
|
19
17
|
import { protocolContractsHash } from '@aztec/protocol-contracts';
|
|
20
|
-
import { SequencerState } from '@aztec/sequencer-client';
|
|
21
18
|
import { AztecAddress } from '@aztec/stdlib/aztec-address';
|
|
19
|
+
import { TxStatus } from '@aztec/stdlib/tx';
|
|
22
20
|
import { getConfigEnvVars as getTelemetryClientConfig, initTelemetryClient } from '@aztec/telemetry-client';
|
|
23
21
|
import { EmbeddedWallet } from '@aztec/wallets/embedded';
|
|
24
|
-
import {
|
|
22
|
+
import { createFundedInitializerlessAccounts } from '@aztec/wallets/testing';
|
|
25
23
|
import { getGenesisValues } from '@aztec/world-state/testing';
|
|
26
|
-
import { createPublicClient, fallback, http as httpViemTransport } from 'viem';
|
|
27
24
|
import { mnemonicToAccount, privateKeyToAddress } from 'viem/accounts';
|
|
28
25
|
import { foundry } from 'viem/chains';
|
|
29
26
|
import { createAccountLogs } from '../cli/util.js';
|
|
30
27
|
import { DefaultMnemonic } from '../mnemonic.js';
|
|
31
|
-
import { AnvilTestWatcher } from '../testing/anvil_test_watcher.js';
|
|
32
|
-
import { EpochTestSettler } from '../testing/epoch_test_settler.js';
|
|
33
28
|
import { getTokenAllowedSetupFunctions } from '../testing/token_allowed_setup.js';
|
|
34
29
|
import { publishStandardAuthRegistry } from './auth_registry.js';
|
|
35
30
|
import { getBananaFPCAddress, setupBananaFPC } from './banana_fpc.js';
|
|
36
31
|
import { getSponsoredFPCAddress } from './sponsored_fpc.js';
|
|
37
32
|
const logger = createLogger('local-network');
|
|
38
|
-
|
|
33
|
+
// The embedded wallet defaults to waiting for PROPOSED, which returns as soon as a tx lands in a
|
|
34
|
+
// proposed L2 block. That is flaky for the serial sandbox setup below: a proposed block can be
|
|
35
|
+
// pruned before its checkpoint is published, dropping a tx we already moved on from ("Tx dropped by
|
|
36
|
+
// P2P node"). Wait for the checkpoint so each setup tx is durably included before the next is sent.
|
|
37
|
+
const setupWaitOpts = {
|
|
38
|
+
waitForStatus: TxStatus.CHECKPOINTED
|
|
39
|
+
};
|
|
39
40
|
/**
|
|
40
41
|
* Function to deploy our L1 contracts to the local network L1
|
|
41
42
|
* @param aztecNodeConfig - The Aztec Node Config
|
|
@@ -73,13 +74,36 @@ const localAnvil = foundry;
|
|
|
73
74
|
// The local network deploys a banana FPC with Token contracts, so include Token entries
|
|
74
75
|
// in the setup allowlist so FPC-based fee payments work out of the box.
|
|
75
76
|
const tokenAllowList = await getTokenAllowedSetupFunctions();
|
|
77
|
+
const envConfig = getConfigEnvVars();
|
|
76
78
|
const aztecNodeConfig = {
|
|
77
|
-
...
|
|
79
|
+
...envConfig,
|
|
78
80
|
...config,
|
|
81
|
+
skipOrphanProposedBlockPruning: true,
|
|
82
|
+
// The local network builds node config from env without a DATA_DIRECTORY, so the validator's
|
|
83
|
+
// local signing protection runs against an ephemeral store. That is acceptable for this dev
|
|
84
|
+
// network; production validators must persist it and fail-fast when the data directory is unset.
|
|
85
|
+
allowEphemeralSigningProtection: config.allowEphemeralSigningProtection ?? true,
|
|
79
86
|
txPublicSetupAllowListExtend: [
|
|
80
87
|
...tokenAllowList,
|
|
81
88
|
...config.txPublicSetupAllowListExtend ?? []
|
|
82
|
-
]
|
|
89
|
+
],
|
|
90
|
+
// The local network runs against anvil with no committee, so it defaults to the deterministic
|
|
91
|
+
// AutomineSequencer, which owns L1 time control (warps the dateProvider and L1 timestamps to slot
|
|
92
|
+
// boundaries as it builds), replacing the deleted AnvilTestWatcher. This remains true when p2p is
|
|
93
|
+
// enabled for local peer testing; local-network is not a mode for connecting to an existing network.
|
|
94
|
+
useAutomineSequencer: config.useAutomineSequencer ?? true,
|
|
95
|
+
// The AutomineSequencer owns epoch proving in the local network — it writes epoch out hashes to
|
|
96
|
+
// the L1 Outbox and advances the proven tip as checkpoints land, through the same serial queue as
|
|
97
|
+
// its builds — replacing the standalone EpochTestSettler that used to race the build loop.
|
|
98
|
+
automineEnableProveEpoch: config.automineEnableProveEpoch ?? true,
|
|
99
|
+
// Defaults for the local network / sandbox; callers (e.g. the CLI) may override. No real proving
|
|
100
|
+
// happens here — the AutomineSequencer synthetically settles epochs. Short epochs let it write out
|
|
101
|
+
// hashes quickly (so users can consume L2-to-L1 messages without a long wait), with a wider
|
|
102
|
+
// proof-submission window so the synthetic settler has headroom before the rollup would prune an
|
|
103
|
+
// unproven checkpoint.
|
|
104
|
+
realProofs: config.realProofs ?? false,
|
|
105
|
+
aztecEpochDuration: config.aztecEpochDuration ?? 4,
|
|
106
|
+
aztecProofSubmissionEpochs: config.aztecProofSubmissionEpochs ?? 2
|
|
83
107
|
};
|
|
84
108
|
const hdAccount = mnemonicToAccount(config.l1Mnemonic || DefaultMnemonic);
|
|
85
109
|
if (aztecNodeConfig.sequencerPublisherPrivateKeys == undefined || !aztecNodeConfig.sequencerPublisherPrivateKeys.length || aztecNodeConfig.sequencerPublisherPrivateKeys[0].getValue() === NULL_KEY) {
|
|
@@ -98,7 +122,7 @@ const localAnvil = foundry;
|
|
|
98
122
|
const initialAccounts = await (async ()=>{
|
|
99
123
|
if (config.testAccounts === true || config.testAccounts === undefined) {
|
|
100
124
|
if (aztecNodeConfig.p2pEnabled) {
|
|
101
|
-
userLog(`Not setting up test accounts
|
|
125
|
+
userLog(`Not setting up test accounts when p2p is enabled`);
|
|
102
126
|
} else {
|
|
103
127
|
userLog(`Setting up test accounts`);
|
|
104
128
|
return await getInitialTestAccountsData();
|
|
@@ -108,7 +132,7 @@ const localAnvil = foundry;
|
|
|
108
132
|
})();
|
|
109
133
|
const bananaFPC = await getBananaFPCAddress(initialAccounts);
|
|
110
134
|
const sponsoredFPC = await getSponsoredFPCAddress();
|
|
111
|
-
const prefundAddresses = (aztecNodeConfig.prefundAddresses ?? []).map((a)=>AztecAddress.
|
|
135
|
+
const prefundAddresses = (aztecNodeConfig.prefundAddresses ?? []).map((a)=>AztecAddress.fromStringUnsafe(a));
|
|
112
136
|
const fundedAddresses = [
|
|
113
137
|
...initialAccounts.map((a)=>a.address),
|
|
114
138
|
...initialAccounts.length ? [
|
|
@@ -117,34 +141,13 @@ const localAnvil = foundry;
|
|
|
117
141
|
] : [],
|
|
118
142
|
...prefundAddresses
|
|
119
143
|
];
|
|
120
|
-
const { genesisArchiveRoot, genesis, fundingNeeded } = await getGenesisValues(fundedAddresses);
|
|
144
|
+
const { genesisArchiveRoot, genesis, fundingNeeded } = await getGenesisValues(fundedAddresses, config.initialAccountFeeJuice);
|
|
121
145
|
const dateProvider = new TestDateProvider();
|
|
122
|
-
let cheatcodes;
|
|
123
|
-
let rollupAddress;
|
|
124
|
-
let watcher;
|
|
125
146
|
if (!aztecNodeConfig.p2pEnabled) {
|
|
126
|
-
|
|
147
|
+
await deployContractsToL1(aztecNodeConfig, aztecNodeConfig.validatorPrivateKeys.getValue()[0], {
|
|
127
148
|
genesisArchiveRoot,
|
|
128
149
|
feeJuicePortalInitialBalance: fundingNeeded
|
|
129
|
-
}));
|
|
130
|
-
const chain = aztecNodeConfig.l1RpcUrls.length > 0 ? createEthereumChain([
|
|
131
|
-
l1RpcUrl
|
|
132
|
-
], aztecNodeConfig.l1ChainId) : {
|
|
133
|
-
chainInfo: localAnvil
|
|
134
|
-
};
|
|
135
|
-
const publicClient = createPublicClient({
|
|
136
|
-
chain: chain.chainInfo,
|
|
137
|
-
transport: fallback([
|
|
138
|
-
httpViemTransport(l1RpcUrl)
|
|
139
|
-
])
|
|
140
150
|
});
|
|
141
|
-
cheatcodes = new EthCheatCodes([
|
|
142
|
-
l1RpcUrl
|
|
143
|
-
], dateProvider);
|
|
144
|
-
watcher = new AnvilTestWatcher(cheatcodes, rollupAddress, publicClient, dateProvider);
|
|
145
|
-
watcher.setisLocalNetwork(true);
|
|
146
|
-
watcher.setIsMarkingAsProven(false); // Do not mark as proven in the watcher. It's marked in the epochTestSettler after the out hash is set.
|
|
147
|
-
await watcher.start();
|
|
148
151
|
}
|
|
149
152
|
const telemetry = await initTelemetryClient(getTelemetryClientConfig());
|
|
150
153
|
// Create a local blob client client inside the local network, no http connectivity
|
|
@@ -156,42 +159,6 @@ const localAnvil = foundry;
|
|
|
156
159
|
}, {
|
|
157
160
|
genesis
|
|
158
161
|
});
|
|
159
|
-
// Now that the node is up, let the watcher check for pending txs so it can skip unfilled slots faster when
|
|
160
|
-
// transactions are waiting in the mempool. Also let it check if the sequencer is actively building, to avoid
|
|
161
|
-
// warping time out from under an in-progress block.
|
|
162
|
-
watcher?.setGetPendingTxCount(()=>node.getPendingTxCount());
|
|
163
|
-
const sequencer = node.getSequencer()?.getSequencer();
|
|
164
|
-
if (sequencer) {
|
|
165
|
-
const idleStates = new Set([
|
|
166
|
-
SequencerState.STOPPED,
|
|
167
|
-
SequencerState.STOPPING,
|
|
168
|
-
SequencerState.IDLE,
|
|
169
|
-
SequencerState.SYNCHRONIZING
|
|
170
|
-
]);
|
|
171
|
-
watcher?.setIsSequencerBuilding(()=>!idleStates.has(sequencer.getState()));
|
|
172
|
-
// Under proposer pipelining the L1 publish for slot N happens during wall-clock slot N,
|
|
173
|
-
// but the proposer for slot N has already built the checkpoint during slot N-1 and is
|
|
174
|
-
// waiting for L1 to advance. We need to fast-forward L1 to wake that wait — and the wait
|
|
175
|
-
// we have to break first is `waitForValidParentCheckpointOnL1`, which blocks the
|
|
176
|
-
// checkpoint_proposal_job's background submission task until the archiver has synced past
|
|
177
|
-
// the build slot. That wait happens *before* `PUBLISHING_CHECKPOINT` is set, so a hook on
|
|
178
|
-
// that state transition would be circular (L1 has to advance before the state we'd use to
|
|
179
|
-
// advance L1 fires). The earliest pre-wait signal is `block-proposed`, which the sequencer
|
|
180
|
-
// emits once each block is built. In sandbox single-block-per-slot mode this is
|
|
181
|
-
// effectively "checkpoint built", and the watcher warp is harmless if a subsequent
|
|
182
|
-
// assembly/validation/parent-wait step aborts: L1 just sits one slot ahead, which the
|
|
183
|
-
// cascade absorbs.
|
|
184
|
-
if (watcher) {
|
|
185
|
-
sequencer.on('block-proposed', ({ slot })=>watcher.setProposedTargetSlot(Number(slot)));
|
|
186
|
-
}
|
|
187
|
-
}
|
|
188
|
-
let epochTestSettler;
|
|
189
|
-
if (!aztecNodeConfig.p2pEnabled) {
|
|
190
|
-
epochTestSettler = new EpochTestSettler(cheatcodes, rollupAddress, node.getBlockSource(), logger.createChild('epoch-settler'), {
|
|
191
|
-
pollingIntervalMs: 200
|
|
192
|
-
});
|
|
193
|
-
await epochTestSettler.start();
|
|
194
|
-
}
|
|
195
162
|
if (initialAccounts.length) {
|
|
196
163
|
const wallet = await EmbeddedWallet.create(node, {
|
|
197
164
|
pxeConfig: {
|
|
@@ -200,20 +167,18 @@ const localAnvil = foundry;
|
|
|
200
167
|
ephemeral: true
|
|
201
168
|
});
|
|
202
169
|
userLog('Setting up funded test accounts...');
|
|
203
|
-
const accountManagers = await
|
|
170
|
+
const accountManagers = await createFundedInitializerlessAccounts(wallet, initialAccounts);
|
|
204
171
|
const accLogs = await createAccountLogs(accountManagers, wallet);
|
|
205
172
|
userLog(accLogs.join(''));
|
|
206
173
|
userLog('Publishing standard AuthRegistry contract...');
|
|
207
|
-
await publishStandardAuthRegistry(wallet, initialAccounts[0].address);
|
|
208
|
-
await setupBananaFPC(initialAccounts, wallet, userLog);
|
|
174
|
+
await publishStandardAuthRegistry(wallet, initialAccounts[0].address, setupWaitOpts);
|
|
175
|
+
await setupBananaFPC(initialAccounts, wallet, userLog, setupWaitOpts);
|
|
209
176
|
userLog(`SponsoredFPC: ${await getSponsoredFPCAddress()}`);
|
|
210
177
|
// We no longer need the wallet once we've setup the accounts so we stop the underlying PXE job queue
|
|
211
178
|
await wallet.stop();
|
|
212
179
|
}
|
|
213
180
|
const stop = async ()=>{
|
|
214
181
|
await node.stop();
|
|
215
|
-
await watcher?.stop();
|
|
216
|
-
await epochTestSettler?.stop();
|
|
217
182
|
};
|
|
218
183
|
return {
|
|
219
184
|
node,
|
|
@@ -230,7 +195,7 @@ const localAnvil = foundry;
|
|
|
230
195
|
...getConfigEnvVars(),
|
|
231
196
|
...config
|
|
232
197
|
};
|
|
233
|
-
const node = await
|
|
198
|
+
const node = await createAztecNodeService(aztecNodeConfig, {
|
|
234
199
|
...deps,
|
|
235
200
|
proverNodeDeps: {
|
|
236
201
|
broker: deps.proverBroker
|
|
@@ -1,44 +1,37 @@
|
|
|
1
1
|
import { EthCheatCodes, RollupCheatCodes } from '@aztec/ethereum/test';
|
|
2
2
|
import type { DateProvider } from '@aztec/foundation/timer';
|
|
3
|
-
import type { AutomineSequencer } from '@aztec/sequencer-client';
|
|
4
3
|
import type { AztecNode, AztecNodeDebug } from '@aztec/stdlib/interfaces/client';
|
|
5
4
|
/**
|
|
6
|
-
*
|
|
7
|
-
* @deprecated
|
|
8
|
-
* they became unused (we now have better testing tools). If you are introducing a new functionality to the cheat
|
|
9
|
-
* codes, please consider whether it makes sense to just introduce new utils in your tests instead.
|
|
5
|
+
* Wrapper for Aztec Debug API.
|
|
6
|
+
* @deprecated use the AztecNode debug API directly.
|
|
10
7
|
*/
|
|
11
8
|
export declare class CheatCodes {
|
|
12
9
|
/** Cheat codes for L1.*/
|
|
13
10
|
eth: EthCheatCodes;
|
|
14
11
|
/** Cheat codes for the Aztec Rollup contract on L1. */
|
|
15
12
|
rollup: RollupCheatCodes;
|
|
16
|
-
/** When wired, redirects time-warps through the AutomineSequencer queue (test-only). */
|
|
17
|
-
private automine?;
|
|
18
|
-
private logger;
|
|
19
13
|
constructor(
|
|
20
14
|
/** Cheat codes for L1.*/
|
|
21
15
|
eth: EthCheatCodes,
|
|
22
16
|
/** Cheat codes for the Aztec Rollup contract on L1. */
|
|
23
|
-
rollup: RollupCheatCodes
|
|
24
|
-
|
|
25
|
-
automine?: AutomineSequencer | undefined);
|
|
26
|
-
static create(rpcUrls: string[], node: AztecNode, dateProvider: DateProvider, automine?: AutomineSequencer): Promise<CheatCodes>;
|
|
17
|
+
rollup: RollupCheatCodes);
|
|
18
|
+
static create(rpcUrls: string[], node: AztecNode, dateProvider: DateProvider): Promise<CheatCodes>;
|
|
27
19
|
/**
|
|
28
|
-
* Warps the L1 timestamp to
|
|
29
|
-
* the target
|
|
30
|
-
*
|
|
31
|
-
* @param
|
|
32
|
-
* @
|
|
20
|
+
* Warps the L1 timestamp to at least `targetTimestamp` and mines an L2 block advancing the L2 timestamp to at least
|
|
21
|
+
* the target. Forwards to the node's debug API, which serializes the warp through the automine sequencer queue.
|
|
22
|
+
* @param node - The Aztec node whose debug API performs the warp. Must run an automine sequencer.
|
|
23
|
+
* @param targetTimestamp - The target timestamp to warp to (in seconds).
|
|
24
|
+
* @deprecated Call `node.warpL2TimeAtLeastTo(targetTimestamp)` on the node debug API directly.
|
|
33
25
|
*/
|
|
34
26
|
warpL2TimeAtLeastTo(node: AztecNode & AztecNodeDebug, targetTimestamp: bigint | number): Promise<void>;
|
|
35
27
|
/**
|
|
36
|
-
* Warps the L1 timestamp forward by
|
|
37
|
-
* least by the duration.
|
|
38
|
-
*
|
|
39
|
-
* @param node - The Aztec node
|
|
40
|
-
* @param duration - The duration to advance time by (in seconds)
|
|
28
|
+
* Warps the L1 timestamp forward by at least `duration` seconds and mines an L2 block advancing the L2 timestamp at
|
|
29
|
+
* least by the duration. Forwards to the node's debug API, which serializes the warp through the automine sequencer
|
|
30
|
+
* queue.
|
|
31
|
+
* @param node - The Aztec node whose debug API performs the warp. Must run an automine sequencer.
|
|
32
|
+
* @param duration - The duration to advance time by (in seconds).
|
|
33
|
+
* @deprecated Call `node.warpL2TimeAtLeastBy(duration)` on the node debug API directly.
|
|
41
34
|
*/
|
|
42
35
|
warpL2TimeAtLeastBy(node: AztecNode & AztecNodeDebug, duration: bigint | number): Promise<void>;
|
|
43
36
|
}
|
|
44
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
37
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY2hlYXRfY29kZXMuZC50cyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy90ZXN0aW5nL2NoZWF0X2NvZGVzLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sRUFBRSxhQUFhLEVBQUUsZ0JBQWdCLEVBQUUsTUFBTSxzQkFBc0IsQ0FBQztBQUN2RSxPQUFPLEtBQUssRUFBRSxZQUFZLEVBQUUsTUFBTSx5QkFBeUIsQ0FBQztBQUM1RCxPQUFPLEtBQUssRUFBRSxTQUFTLEVBQUUsY0FBYyxFQUFFLE1BQU0saUNBQWlDLENBQUM7QUFFakY7OztHQUdHO0FBQ0gscUJBQWEsVUFBVTtJQUVuQix5QkFBeUI7SUFDbEIsR0FBRyxFQUFFLGFBQWE7SUFDekIsdURBQXVEO0lBQ2hELE1BQU0sRUFBRSxnQkFBZ0I7SUFKakM7SUFDRSx5QkFBeUI7SUFDbEIsR0FBRyxFQUFFLGFBQWE7SUFDekIsdURBQXVEO0lBQ2hELE1BQU0sRUFBRSxnQkFBZ0IsRUFDN0I7SUFFSixPQUFhLE1BQU0sQ0FBQyxPQUFPLEVBQUUsTUFBTSxFQUFFLEVBQUUsSUFBSSxFQUFFLFNBQVMsRUFBRSxZQUFZLEVBQUUsWUFBWSxHQUFHLE9BQU8sQ0FBQyxVQUFVLENBQUMsQ0FPdkc7SUFFRDs7Ozs7O09BTUc7SUFDSCxtQkFBbUIsQ0FBQyxJQUFJLEVBQUUsU0FBUyxHQUFHLGNBQWMsRUFBRSxlQUFlLEVBQUUsTUFBTSxHQUFHLE1BQU0sR0FBRyxPQUFPLENBQUMsSUFBSSxDQUFDLENBRXJHO0lBRUQ7Ozs7Ozs7T0FPRztJQUNILG1CQUFtQixDQUFDLElBQUksRUFBRSxTQUFTLEdBQUcsY0FBYyxFQUFFLFFBQVEsRUFBRSxNQUFNLEdBQUcsTUFBTSxHQUFHLE9BQU8sQ0FBQyxJQUFJLENBQUMsQ0FFOUY7Q0FDRiJ9
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cheat_codes.d.ts","sourceRoot":"","sources":["../../src/testing/cheat_codes.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"cheat_codes.d.ts","sourceRoot":"","sources":["../../src/testing/cheat_codes.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AACvE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAC5D,OAAO,KAAK,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAC;AAEjF;;;GAGG;AACH,qBAAa,UAAU;IAEnB,yBAAyB;IAClB,GAAG,EAAE,aAAa;IACzB,uDAAuD;IAChD,MAAM,EAAE,gBAAgB;IAJjC;IACE,yBAAyB;IAClB,GAAG,EAAE,aAAa;IACzB,uDAAuD;IAChD,MAAM,EAAE,gBAAgB,EAC7B;IAEJ,OAAa,MAAM,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,YAAY,EAAE,YAAY,GAAG,OAAO,CAAC,UAAU,CAAC,CAOvG;IAED;;;;;;OAMG;IACH,mBAAmB,CAAC,IAAI,EAAE,SAAS,GAAG,cAAc,EAAE,eAAe,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAErG;IAED;;;;;;;OAOG;IACH,mBAAmB,CAAC,IAAI,EAAE,SAAS,GAAG,cAAc,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAE9F;CACF"}
|