@aztec/aztec 0.0.1-commit.4d79d1f2d → 0.0.1-commit.4d9804df
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 +9 -3
- package/dest/cli/admin_api_key_store.d.ts +45 -0
- package/dest/cli/admin_api_key_store.d.ts.map +1 -0
- package/dest/cli/admin_api_key_store.js +98 -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 +69 -32
- package/dest/cli/aztec_start_options.d.ts +2 -2
- package/dest/cli/aztec_start_options.d.ts.map +1 -1
- package/dest/cli/aztec_start_options.js +39 -23
- package/dest/cli/cli.d.ts +1 -1
- package/dest/cli/cli.d.ts.map +1 -1
- package/dest/cli/cli.js +3 -4
- package/dest/cli/cmds/compile.d.ts +4 -0
- package/dest/cli/cmds/compile.d.ts.map +1 -0
- package/dest/cli/cmds/compile.js +174 -0
- package/dest/cli/cmds/profile.d.ts +4 -0
- package/dest/cli/cmds/profile.d.ts.map +1 -0
- package/dest/cli/cmds/profile.js +8 -0
- package/dest/cli/cmds/profile_flamegraph.d.ts +4 -0
- package/dest/cli/cmds/profile_flamegraph.d.ts.map +1 -0
- package/dest/cli/cmds/profile_flamegraph.js +52 -0
- package/dest/cli/cmds/profile_gates.d.ts +4 -0
- package/dest/cli/cmds/profile_gates.d.ts.map +1 -0
- package/dest/cli/cmds/profile_gates.js +76 -0
- package/dest/cli/cmds/profile_utils.d.ts +18 -0
- package/dest/cli/cmds/profile_utils.d.ts.map +1 -0
- package/dest/cli/cmds/profile_utils.js +50 -0
- 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 +56 -0
- package/dest/cli/cmds/standby.d.ts.map +1 -0
- package/dest/cli/cmds/standby.js +140 -0
- package/dest/cli/cmds/start_bot.d.ts +2 -2
- package/dest/cli/cmds/start_bot.d.ts.map +1 -1
- package/dest/cli/cmds/start_bot.js +13 -7
- 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 +78 -49
- package/dest/cli/cmds/start_prover_agent.d.ts +1 -1
- package/dest/cli/cmds/start_prover_agent.d.ts.map +1 -1
- package/dest/cli/cmds/start_prover_agent.js +5 -17
- 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 +22 -13
- package/dest/cli/cmds/start_txe.d.ts +2 -2
- package/dest/cli/cmds/start_txe.d.ts.map +1 -1
- package/dest/cli/cmds/start_txe.js +6 -5
- package/dest/cli/cmds/utils/artifacts.d.ts +26 -0
- package/dest/cli/cmds/utils/artifacts.d.ts.map +1 -0
- package/dest/cli/cmds/utils/artifacts.js +24 -0
- package/dest/cli/cmds/utils/collect_crate_dirs.d.ts +21 -0
- package/dest/cli/cmds/utils/collect_crate_dirs.d.ts.map +1 -0
- package/dest/cli/cmds/utils/collect_crate_dirs.js +114 -0
- 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 +90 -0
- package/dest/cli/cmds/utils/spawn.d.ts +3 -0
- package/dest/cli/cmds/utils/spawn.d.ts.map +1 -0
- package/dest/cli/cmds/utils/spawn.js +16 -0
- package/dest/cli/cmds/utils/warn_if_aztec_version_mismatch.d.ts +4 -0
- package/dest/cli/cmds/utils/warn_if_aztec_version_mismatch.d.ts.map +1 -0
- package/dest/cli/cmds/utils/warn_if_aztec_version_mismatch.js +61 -0
- package/dest/cli/util.d.ts +10 -6
- package/dest/cli/util.d.ts.map +1 -1
- package/dest/cli/util.js +32 -96
- package/dest/examples/token.js +7 -7
- package/dest/local-network/auth_registry.d.ts +5 -0
- package/dest/local-network/auth_registry.d.ts.map +1 -0
- package/dest/local-network/auth_registry.js +17 -0
- 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 +12 -8
- package/dest/local-network/local-network.d.ts +12 -32
- package/dest/local-network/local-network.d.ts.map +1 -1
- package/dest/local-network/local-network.js +77 -64
- package/dest/testing/cheat_codes.d.ts +17 -23
- package/dest/testing/cheat_codes.d.ts.map +1 -1
- package/dest/testing/cheat_codes.js +17 -43
- 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 +6 -26
- package/dest/testing/index.d.ts +3 -2
- package/dest/testing/index.d.ts.map +1 -1
- package/dest/testing/index.js +2 -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 +12 -0
- package/dest/testing/token_allowed_setup.d.ts.map +1 -0
- package/dest/testing/token_allowed_setup.js +24 -0
- package/package.json +35 -34
- package/scripts/add_crate.sh +53 -0
- package/scripts/aztec.sh +15 -5
- package/scripts/init.sh +23 -19
- package/scripts/new.sh +48 -24
- package/scripts/setup_workspace.sh +69 -0
- package/scripts/templates/blank/contract/Nargo.toml +6 -0
- package/scripts/templates/blank/contract/src/main.nr +10 -0
- package/scripts/templates/blank/test/Nargo.toml +7 -0
- package/scripts/templates/blank/test/src/lib.nr +11 -0
- package/scripts/templates/counter/contract/Nargo.toml +7 -0
- package/scripts/templates/counter/contract/src/main.nr +48 -0
- package/scripts/templates/counter/test/Nargo.toml +7 -0
- package/scripts/templates/counter/test/src/lib.nr +32 -0
- package/src/bin/index.ts +9 -3
- package/src/cli/admin_api_key_store.ts +128 -0
- package/src/cli/aztec_start_action.ts +69 -24
- package/src/cli/aztec_start_options.ts +48 -30
- package/src/cli/cli.ts +3 -4
- package/src/cli/cmds/compile.ts +205 -0
- package/src/cli/cmds/profile.ts +26 -0
- package/src/cli/cmds/profile_flamegraph.ts +64 -0
- package/src/cli/cmds/profile_gates.ts +84 -0
- package/src/cli/cmds/profile_utils.ts +58 -0
- package/src/cli/cmds/prover.ts +42 -0
- package/src/cli/cmds/standby.ts +184 -0
- package/src/cli/cmds/start_bot.ts +14 -8
- package/src/cli/cmds/start_node.ts +90 -50
- package/src/cli/cmds/start_prover_agent.ts +5 -8
- package/src/cli/cmds/start_prover_broker.ts +23 -24
- package/src/cli/cmds/start_txe.ts +7 -5
- package/src/cli/cmds/utils/artifacts.ts +49 -0
- package/src/cli/cmds/utils/collect_crate_dirs.ts +118 -0
- package/src/cli/cmds/utils/needs_recompile.ts +98 -0
- package/src/cli/cmds/utils/spawn.ts +16 -0
- package/src/cli/cmds/utils/warn_if_aztec_version_mismatch.ts +76 -0
- package/src/cli/util.ts +33 -100
- package/src/examples/token.ts +17 -7
- package/src/local-network/auth_registry.ts +19 -0
- package/src/local-network/banana_fpc.ts +13 -9
- package/src/local-network/local-network.ts +94 -75
- package/src/testing/cheat_codes.ts +18 -49
- package/src/testing/epoch_test_settler.ts +8 -32
- package/src/testing/index.ts +2 -1
- package/src/testing/local-network.ts +97 -0
- package/src/testing/token_allowed_setup.ts +26 -0
- package/dest/cli/cmds/start_archiver.d.ts +0 -9
- package/dest/cli/cmds/start_archiver.d.ts.map +0 -1
- package/dest/cli/cmds/start_archiver.js +0 -48
- package/dest/cli/cmds/start_prover_node.d.ts +0 -7
- package/dest/cli/cmds/start_prover_node.d.ts.map +0 -1
- package/dest/cli/cmds/start_prover_node.js +0 -108
- 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/dest/testing/anvil_test_watcher.d.ts +0 -34
- package/dest/testing/anvil_test_watcher.d.ts.map +0 -1
- package/dest/testing/anvil_test_watcher.js +0 -144
- package/scripts/compile.sh +0 -44
- package/scripts/extract_function.js +0 -47
- package/scripts/flamegraph.sh +0 -59
- package/scripts/setup_project.sh +0 -31
- package/src/cli/cmds/start_archiver.ts +0 -50
- package/src/cli/cmds/start_prover_node.ts +0 -124
- package/src/cli/release_version.ts +0 -21
- package/src/testing/anvil_test_watcher.ts +0 -166
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { publishContractClass, publishInstance } from '@aztec/aztec.js/deployment';
|
|
2
|
+
import { AuthRegistryArtifact, getStandardAuthRegistry } from '@aztec/standard-contracts/auth-registry';
|
|
3
|
+
export async function publishStandardAuthRegistry(wallet, from, waitOpts) {
|
|
4
|
+
const { instance, contractClass } = await getStandardAuthRegistry();
|
|
5
|
+
if (!(await wallet.getContractClassMetadata(contractClass.id)).isContractClassPubliclyRegistered) {
|
|
6
|
+
await (await publishContractClass(wallet, AuthRegistryArtifact)).send({
|
|
7
|
+
from,
|
|
8
|
+
wait: waitOpts
|
|
9
|
+
});
|
|
10
|
+
}
|
|
11
|
+
if (!(await wallet.getContractMetadata(instance.address)).isContractPublished) {
|
|
12
|
+
await publishInstance(wallet, instance).send({
|
|
13
|
+
from,
|
|
14
|
+
wait: waitOpts
|
|
15
|
+
});
|
|
16
|
+
}
|
|
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,19 +43,23 @@ 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
|
-
const [bananaCoin, fpc] = await Promise.all([
|
|
50
|
-
TokenContract.deploy(wallet, admin, bananaCoinArgs.name, bananaCoinArgs.symbol, bananaCoinArgs.decimal
|
|
51
|
-
|
|
52
|
-
contractAddressSalt: BANANA_COIN_SALT,
|
|
49
|
+
const [{ contract: bananaCoin }, { contract: fpc }] = await Promise.all([
|
|
50
|
+
TokenContract.deploy(wallet, admin, bananaCoinArgs.name, bananaCoinArgs.symbol, bananaCoinArgs.decimal, {
|
|
51
|
+
salt: BANANA_COIN_SALT,
|
|
53
52
|
universalDeploy: true
|
|
54
|
-
})
|
|
55
|
-
FPCContract.deploy(wallet, bananaCoinAddress, admin).send({
|
|
53
|
+
}).send({
|
|
56
54
|
from: admin,
|
|
57
|
-
|
|
55
|
+
wait: waitOpts
|
|
56
|
+
}),
|
|
57
|
+
FPCContract.deploy(wallet, bananaCoinAddress, admin, {
|
|
58
|
+
salt: BANANA_FPC_SALT,
|
|
58
59
|
universalDeploy: true
|
|
60
|
+
}).send({
|
|
61
|
+
from: admin,
|
|
62
|
+
wait: waitOpts
|
|
59
63
|
})
|
|
60
64
|
]);
|
|
61
65
|
log(`BananaCoin: ${bananaCoin.address}`);
|
|
@@ -1,14 +1,14 @@
|
|
|
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';
|
|
6
|
-
import {
|
|
5
|
+
import type { L1ContractAddresses } from '@aztec/ethereum/l1-contract-addresses';
|
|
7
6
|
import type { LogFn } from '@aztec/foundation/log';
|
|
8
7
|
import { DateProvider } from '@aztec/foundation/timer';
|
|
9
|
-
import type {
|
|
8
|
+
import type { ProvingJobBroker } from '@aztec/stdlib/interfaces/server';
|
|
9
|
+
import type { GenesisData } from '@aztec/stdlib/world-state';
|
|
10
10
|
import { type TelemetryClient } from '@aztec/telemetry-client';
|
|
11
|
-
import {
|
|
11
|
+
import type { Hex } from 'viem';
|
|
12
12
|
/**
|
|
13
13
|
* Function to deploy our L1 contracts to the local network L1
|
|
14
14
|
* @param aztecNodeConfig - The Aztec Node Config
|
|
@@ -17,36 +17,15 @@ import { type Hex } from 'viem';
|
|
|
17
17
|
export declare function deployContractsToL1(aztecNodeConfig: AztecNodeConfig, privateKey: Hex, opts?: {
|
|
18
18
|
genesisArchiveRoot?: Fr;
|
|
19
19
|
feeJuicePortalInitialBalance?: bigint;
|
|
20
|
-
}): Promise<
|
|
21
|
-
coinIssuerAddress: EthAddress;
|
|
22
|
-
feeJuiceAddress: EthAddress;
|
|
23
|
-
feeJuicePortalAddress: EthAddress;
|
|
24
|
-
governanceAddress: EthAddress;
|
|
25
|
-
governanceProposerAddress: EthAddress;
|
|
26
|
-
inboxAddress: EthAddress;
|
|
27
|
-
outboxAddress: EthAddress;
|
|
28
|
-
registryAddress: EthAddress;
|
|
29
|
-
rewardDistributorAddress: EthAddress;
|
|
30
|
-
rollupAddress: EthAddress;
|
|
31
|
-
stakingAssetAddress: EthAddress;
|
|
32
|
-
} & {
|
|
33
|
-
slashFactoryAddress?: EthAddress | undefined;
|
|
34
|
-
feeAssetHandlerAddress?: EthAddress | undefined;
|
|
35
|
-
stakingAssetHandlerAddress?: EthAddress | undefined;
|
|
36
|
-
zkPassportVerifierAddress?: EthAddress | undefined;
|
|
37
|
-
gseAddress?: EthAddress | undefined;
|
|
38
|
-
dateGatedRelayerAddress?: EthAddress | undefined;
|
|
39
|
-
} & {
|
|
40
|
-
rollupAddress: EthAddress;
|
|
41
|
-
} & Pick<import("@aztec/ethereum/l1-contract-addresses").L1ContractAddresses, "rollupAddress"> & {
|
|
42
|
-
rollupAddress: EthAddress;
|
|
43
|
-
}>;
|
|
20
|
+
}): Promise<L1ContractAddresses>;
|
|
44
21
|
/** Local network settings. */
|
|
45
22
|
export type LocalNetworkConfig = AztecNodeConfig & {
|
|
46
23
|
/** Mnemonic used to derive the L1 deployer private key.*/
|
|
47
24
|
l1Mnemonic: string;
|
|
48
25
|
/** Whether to deploy test accounts on local network start.*/
|
|
49
26
|
testAccounts: boolean;
|
|
27
|
+
/** Override the default per-address fee juice granted at genesis to funded addresses. */
|
|
28
|
+
initialAccountFeeJuice?: Fr;
|
|
50
29
|
};
|
|
51
30
|
/**
|
|
52
31
|
* Create and start a new Aztec Node and PXE. Deploys L1 contracts.
|
|
@@ -54,7 +33,7 @@ export type LocalNetworkConfig = AztecNodeConfig & {
|
|
|
54
33
|
* @param config - Optional local network settings.
|
|
55
34
|
*/
|
|
56
35
|
export declare function createLocalNetwork(config: Partial<LocalNetworkConfig> | undefined, userLog: LogFn): Promise<{
|
|
57
|
-
node: AztecNodeService;
|
|
36
|
+
node: import("@aztec/aztec-node").AztecNodeService;
|
|
58
37
|
stop: () => Promise<void>;
|
|
59
38
|
}>;
|
|
60
39
|
/**
|
|
@@ -65,7 +44,8 @@ export declare function createAztecNode(config?: Partial<AztecNodeConfig>, deps?
|
|
|
65
44
|
telemetry?: TelemetryClient;
|
|
66
45
|
blobClient?: BlobClientInterface;
|
|
67
46
|
dateProvider?: DateProvider;
|
|
47
|
+
proverBroker?: ProvingJobBroker;
|
|
68
48
|
}, options?: {
|
|
69
|
-
|
|
70
|
-
}): Promise<AztecNodeService>;
|
|
71
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
49
|
+
genesis?: GenesisData;
|
|
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,37 +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';
|
|
18
|
+
import { AztecAddress } from '@aztec/stdlib/aztec-address';
|
|
19
|
+
import { TxStatus } from '@aztec/stdlib/tx';
|
|
20
20
|
import { getConfigEnvVars as getTelemetryClientConfig, initTelemetryClient } from '@aztec/telemetry-client';
|
|
21
21
|
import { EmbeddedWallet } from '@aztec/wallets/embedded';
|
|
22
|
-
import {
|
|
22
|
+
import { createFundedInitializerlessAccounts } from '@aztec/wallets/testing';
|
|
23
23
|
import { getGenesisValues } from '@aztec/world-state/testing';
|
|
24
|
-
import { createPublicClient, fallback, http as httpViemTransport } from 'viem';
|
|
25
24
|
import { mnemonicToAccount, privateKeyToAddress } from 'viem/accounts';
|
|
26
25
|
import { foundry } from 'viem/chains';
|
|
27
26
|
import { createAccountLogs } from '../cli/util.js';
|
|
28
27
|
import { DefaultMnemonic } from '../mnemonic.js';
|
|
29
|
-
import {
|
|
30
|
-
import {
|
|
28
|
+
import { getTokenAllowedSetupFunctions } from '../testing/token_allowed_setup.js';
|
|
29
|
+
import { publishStandardAuthRegistry } from './auth_registry.js';
|
|
31
30
|
import { getBananaFPCAddress, setupBananaFPC } from './banana_fpc.js';
|
|
32
31
|
import { getSponsoredFPCAddress } from './sponsored_fpc.js';
|
|
33
32
|
const logger = createLogger('local-network');
|
|
34
|
-
|
|
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
|
+
};
|
|
35
40
|
/**
|
|
36
41
|
* Function to deploy our L1 contracts to the local network L1
|
|
37
42
|
* @param aztecNodeConfig - The Aztec Node Config
|
|
@@ -46,12 +51,12 @@ const localAnvil = foundry;
|
|
|
46
51
|
genesisArchiveRoot: opts.genesisArchiveRoot ?? new Fr(GENESIS_ARCHIVE_ROOT),
|
|
47
52
|
feeJuicePortalInitialBalance: opts.feeJuicePortalInitialBalance,
|
|
48
53
|
aztecTargetCommitteeSize: 0,
|
|
49
|
-
|
|
54
|
+
slasherEnabled: false,
|
|
50
55
|
realVerifier: false
|
|
51
56
|
});
|
|
52
|
-
aztecNodeConfig
|
|
57
|
+
Object.assign(aztecNodeConfig, l1Contracts.l1ContractAddresses);
|
|
53
58
|
aztecNodeConfig.rollupVersion = l1Contracts.rollupVersion;
|
|
54
|
-
return
|
|
59
|
+
return l1Contracts.l1ContractAddresses;
|
|
55
60
|
}
|
|
56
61
|
/**
|
|
57
62
|
* Create and start a new Aztec Node and PXE. Deploys L1 contracts.
|
|
@@ -66,14 +71,44 @@ const localAnvil = foundry;
|
|
|
66
71
|
if ((config.l1RpcUrls?.length || 0) > 1) {
|
|
67
72
|
logger.warn(`Multiple L1 RPC URLs provided. Local networks will only use the first one: ${l1RpcUrl}`);
|
|
68
73
|
}
|
|
74
|
+
// The local network deploys a banana FPC with Token contracts, so include Token entries
|
|
75
|
+
// in the setup allowlist so FPC-based fee payments work out of the box.
|
|
76
|
+
const tokenAllowList = await getTokenAllowedSetupFunctions();
|
|
77
|
+
const envConfig = getConfigEnvVars();
|
|
69
78
|
const aztecNodeConfig = {
|
|
70
|
-
...
|
|
71
|
-
...config
|
|
79
|
+
...envConfig,
|
|
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,
|
|
86
|
+
txPublicSetupAllowListExtend: [
|
|
87
|
+
...tokenAllowList,
|
|
88
|
+
...config.txPublicSetupAllowListExtend ?? []
|
|
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
|
|
72
107
|
};
|
|
73
108
|
const hdAccount = mnemonicToAccount(config.l1Mnemonic || DefaultMnemonic);
|
|
74
|
-
if (aztecNodeConfig.
|
|
109
|
+
if (aztecNodeConfig.sequencerPublisherPrivateKeys == undefined || !aztecNodeConfig.sequencerPublisherPrivateKeys.length || aztecNodeConfig.sequencerPublisherPrivateKeys[0].getValue() === NULL_KEY) {
|
|
75
110
|
const privKey = hdAccount.getHdKey().privateKey;
|
|
76
|
-
aztecNodeConfig.
|
|
111
|
+
aztecNodeConfig.sequencerPublisherPrivateKeys = [
|
|
77
112
|
new SecretValue(`0x${Buffer.from(privKey).toString('hex')}`)
|
|
78
113
|
];
|
|
79
114
|
}
|
|
@@ -87,7 +122,7 @@ const localAnvil = foundry;
|
|
|
87
122
|
const initialAccounts = await (async ()=>{
|
|
88
123
|
if (config.testAccounts === true || config.testAccounts === undefined) {
|
|
89
124
|
if (aztecNodeConfig.p2pEnabled) {
|
|
90
|
-
userLog(`Not setting up test accounts
|
|
125
|
+
userLog(`Not setting up test accounts when p2p is enabled`);
|
|
91
126
|
} else {
|
|
92
127
|
userLog(`Setting up test accounts`);
|
|
93
128
|
return await getInitialTestAccountsData();
|
|
@@ -97,39 +132,22 @@ const localAnvil = foundry;
|
|
|
97
132
|
})();
|
|
98
133
|
const bananaFPC = await getBananaFPCAddress(initialAccounts);
|
|
99
134
|
const sponsoredFPC = await getSponsoredFPCAddress();
|
|
100
|
-
const
|
|
135
|
+
const prefundAddresses = (aztecNodeConfig.prefundAddresses ?? []).map((a)=>AztecAddress.fromStringUnsafe(a));
|
|
136
|
+
const fundedAddresses = [
|
|
101
137
|
...initialAccounts.map((a)=>a.address),
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
138
|
+
...initialAccounts.length ? [
|
|
139
|
+
bananaFPC,
|
|
140
|
+
sponsoredFPC
|
|
141
|
+
] : [],
|
|
142
|
+
...prefundAddresses
|
|
143
|
+
];
|
|
144
|
+
const { genesisArchiveRoot, genesis, fundingNeeded } = await getGenesisValues(fundedAddresses, config.initialAccountFeeJuice);
|
|
106
145
|
const dateProvider = new TestDateProvider();
|
|
107
|
-
let cheatcodes;
|
|
108
|
-
let rollupAddress;
|
|
109
|
-
let watcher;
|
|
110
146
|
if (!aztecNodeConfig.p2pEnabled) {
|
|
111
|
-
|
|
147
|
+
await deployContractsToL1(aztecNodeConfig, aztecNodeConfig.validatorPrivateKeys.getValue()[0], {
|
|
112
148
|
genesisArchiveRoot,
|
|
113
149
|
feeJuicePortalInitialBalance: fundingNeeded
|
|
114
|
-
}));
|
|
115
|
-
const chain = aztecNodeConfig.l1RpcUrls.length > 0 ? createEthereumChain([
|
|
116
|
-
l1RpcUrl
|
|
117
|
-
], aztecNodeConfig.l1ChainId) : {
|
|
118
|
-
chainInfo: localAnvil
|
|
119
|
-
};
|
|
120
|
-
const publicClient = createPublicClient({
|
|
121
|
-
chain: chain.chainInfo,
|
|
122
|
-
transport: fallback([
|
|
123
|
-
httpViemTransport(l1RpcUrl)
|
|
124
|
-
])
|
|
125
150
|
});
|
|
126
|
-
cheatcodes = new EthCheatCodes([
|
|
127
|
-
l1RpcUrl
|
|
128
|
-
], dateProvider);
|
|
129
|
-
watcher = new AnvilTestWatcher(cheatcodes, rollupAddress, publicClient, dateProvider);
|
|
130
|
-
watcher.setisLocalNetwork(true);
|
|
131
|
-
watcher.setIsMarkingAsProven(false); // Do not mark as proven in the watcher. It's marked in the epochTestSettler after the out hash is set.
|
|
132
|
-
await watcher.start();
|
|
133
151
|
}
|
|
134
152
|
const telemetry = await initTelemetryClient(getTelemetryClientConfig());
|
|
135
153
|
// Create a local blob client client inside the local network, no http connectivity
|
|
@@ -139,34 +157,28 @@ const localAnvil = foundry;
|
|
|
139
157
|
blobClient,
|
|
140
158
|
dateProvider
|
|
141
159
|
}, {
|
|
142
|
-
|
|
160
|
+
genesis
|
|
143
161
|
});
|
|
144
|
-
let epochTestSettler;
|
|
145
|
-
if (!aztecNodeConfig.p2pEnabled) {
|
|
146
|
-
epochTestSettler = new EpochTestSettler(cheatcodes, rollupAddress, node.getBlockSource(), logger.createChild('epoch-settler'), {
|
|
147
|
-
pollingIntervalMs: 200
|
|
148
|
-
});
|
|
149
|
-
await epochTestSettler.start();
|
|
150
|
-
}
|
|
151
162
|
if (initialAccounts.length) {
|
|
152
163
|
const wallet = await EmbeddedWallet.create(node, {
|
|
153
164
|
pxeConfig: {
|
|
154
165
|
proverEnabled: aztecNodeConfig.realProofs
|
|
155
|
-
}
|
|
166
|
+
},
|
|
167
|
+
ephemeral: true
|
|
156
168
|
});
|
|
157
169
|
userLog('Setting up funded test accounts...');
|
|
158
|
-
const accountManagers = await
|
|
170
|
+
const accountManagers = await createFundedInitializerlessAccounts(wallet, initialAccounts);
|
|
159
171
|
const accLogs = await createAccountLogs(accountManagers, wallet);
|
|
160
172
|
userLog(accLogs.join(''));
|
|
161
|
-
|
|
173
|
+
userLog('Publishing standard AuthRegistry contract...');
|
|
174
|
+
await publishStandardAuthRegistry(wallet, initialAccounts[0].address, setupWaitOpts);
|
|
175
|
+
await setupBananaFPC(initialAccounts, wallet, userLog, setupWaitOpts);
|
|
162
176
|
userLog(`SponsoredFPC: ${await getSponsoredFPCAddress()}`);
|
|
163
177
|
// We no longer need the wallet once we've setup the accounts so we stop the underlying PXE job queue
|
|
164
178
|
await wallet.stop();
|
|
165
179
|
}
|
|
166
180
|
const stop = async ()=>{
|
|
167
181
|
await node.stop();
|
|
168
|
-
await watcher?.stop();
|
|
169
|
-
await epochTestSettler?.stop();
|
|
170
182
|
};
|
|
171
183
|
return {
|
|
172
184
|
node,
|
|
@@ -178,15 +190,16 @@ const localAnvil = foundry;
|
|
|
178
190
|
* @param config - Optional Aztec node settings.
|
|
179
191
|
*/ export async function createAztecNode(config = {}, deps = {}, options = {}) {
|
|
180
192
|
// TODO(#12272): will clean this up. This is criminal.
|
|
181
|
-
|
|
193
|
+
// Not sure why this was ever done. Will be fixed in A-989, A-991, A-990.
|
|
182
194
|
const aztecNodeConfig = {
|
|
183
|
-
...
|
|
184
|
-
...config
|
|
185
|
-
l1Contracts: {
|
|
186
|
-
...l1Contracts,
|
|
187
|
-
...config.l1Contracts
|
|
188
|
-
}
|
|
195
|
+
...getConfigEnvVars(),
|
|
196
|
+
...config
|
|
189
197
|
};
|
|
190
|
-
const node = await
|
|
198
|
+
const node = await createAztecNodeService(aztecNodeConfig, {
|
|
199
|
+
...deps,
|
|
200
|
+
proverNodeDeps: {
|
|
201
|
+
broker: deps.proverBroker
|
|
202
|
+
}
|
|
203
|
+
}, options);
|
|
191
204
|
return node;
|
|
192
205
|
}
|
|
@@ -1,12 +1,9 @@
|
|
|
1
1
|
import { EthCheatCodes, RollupCheatCodes } from '@aztec/ethereum/test';
|
|
2
2
|
import type { DateProvider } from '@aztec/foundation/timer';
|
|
3
|
-
import type {
|
|
4
|
-
import type { AztecNode } from '@aztec/stdlib/interfaces/client';
|
|
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.*/
|
|
@@ -20,24 +17,21 @@ export declare class CheatCodes {
|
|
|
20
17
|
rollup: RollupCheatCodes);
|
|
21
18
|
static create(rpcUrls: string[], node: AztecNode, dateProvider: DateProvider): Promise<CheatCodes>;
|
|
22
19
|
/**
|
|
23
|
-
* Warps the L1 timestamp to
|
|
24
|
-
* the target
|
|
25
|
-
*
|
|
26
|
-
*
|
|
27
|
-
* @
|
|
28
|
-
* @param node - The Aztec node used to query if a new block has been mined.
|
|
29
|
-
* @param targetTimestamp - The target timestamp to warp to (in seconds)
|
|
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.
|
|
30
25
|
*/
|
|
31
|
-
warpL2TimeAtLeastTo(
|
|
26
|
+
warpL2TimeAtLeastTo(node: AztecNode & AztecNodeDebug, targetTimestamp: bigint | number): Promise<void>;
|
|
32
27
|
/**
|
|
33
|
-
* Warps the L1 timestamp forward by
|
|
34
|
-
* least by the duration.
|
|
35
|
-
*
|
|
36
|
-
*
|
|
37
|
-
* @param
|
|
38
|
-
* @
|
|
39
|
-
* @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.
|
|
40
34
|
*/
|
|
41
|
-
warpL2TimeAtLeastBy(
|
|
35
|
+
warpL2TimeAtLeastBy(node: AztecNode & AztecNodeDebug, duration: bigint | number): Promise<void>;
|
|
42
36
|
}
|
|
43
|
-
//# 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"}
|
|
@@ -1,10 +1,7 @@
|
|
|
1
1
|
import { EthCheatCodes, RollupCheatCodes } from '@aztec/ethereum/test';
|
|
2
|
-
import { retryUntil } from '@aztec/foundation/retry';
|
|
3
2
|
/**
|
|
4
|
-
*
|
|
5
|
-
* @deprecated
|
|
6
|
-
* they became unused (we now have better testing tools). If you are introducing a new functionality to the cheat
|
|
7
|
-
* codes, please consider whether it makes sense to just introduce new utils in your tests instead.
|
|
3
|
+
* Wrapper for Aztec Debug API.
|
|
4
|
+
* @deprecated use the AztecNode debug API directly.
|
|
8
5
|
*/ export class CheatCodes {
|
|
9
6
|
eth;
|
|
10
7
|
rollup;
|
|
@@ -18,45 +15,22 @@ import { retryUntil } from '@aztec/foundation/retry';
|
|
|
18
15
|
return new CheatCodes(ethCheatCodes, rollupCheatCodes);
|
|
19
16
|
}
|
|
20
17
|
/**
|
|
21
|
-
* Warps the L1 timestamp to
|
|
22
|
-
* the target
|
|
23
|
-
*
|
|
24
|
-
*
|
|
25
|
-
* @
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
*/ async warpL2TimeAtLeastTo(sequencerClient, node, targetTimestamp) {
|
|
29
|
-
const currentL2BlockNumber = await node.getBlockNumber();
|
|
30
|
-
// We warp the L1 timestamp
|
|
31
|
-
await this.eth.warp(targetTimestamp, {
|
|
32
|
-
resetBlockInterval: true
|
|
33
|
-
});
|
|
34
|
-
// Wait until an L2 block is mined
|
|
35
|
-
const sequencer = sequencerClient.getSequencer();
|
|
36
|
-
const minTxsPerBlock = sequencer.getConfig().minTxsPerBlock;
|
|
37
|
-
sequencer.updateConfig({
|
|
38
|
-
minTxsPerBlock: 0
|
|
39
|
-
});
|
|
40
|
-
await retryUntil(async ()=>{
|
|
41
|
-
const newL2BlockNumber = await node.getBlockNumber();
|
|
42
|
-
return newL2BlockNumber > currentL2BlockNumber;
|
|
43
|
-
}, 'new block after warping L2 time', 36, 1);
|
|
44
|
-
// Restore original minTxsPerBlock
|
|
45
|
-
sequencer.updateConfig({
|
|
46
|
-
minTxsPerBlock
|
|
47
|
-
});
|
|
18
|
+
* Warps the L1 timestamp to at least `targetTimestamp` and mines an L2 block advancing the L2 timestamp to at least
|
|
19
|
+
* the target. Forwards to the node's debug API, which serializes the warp through the automine sequencer queue.
|
|
20
|
+
* @param node - The Aztec node whose debug API performs the warp. Must run an automine sequencer.
|
|
21
|
+
* @param targetTimestamp - The target timestamp to warp to (in seconds).
|
|
22
|
+
* @deprecated Call `node.warpL2TimeAtLeastTo(targetTimestamp)` on the node debug API directly.
|
|
23
|
+
*/ warpL2TimeAtLeastTo(node, targetTimestamp) {
|
|
24
|
+
return node.warpL2TimeAtLeastTo(Number(targetTimestamp));
|
|
48
25
|
}
|
|
49
26
|
/**
|
|
50
|
-
* Warps the L1 timestamp forward by
|
|
51
|
-
* least by the duration.
|
|
52
|
-
*
|
|
53
|
-
*
|
|
54
|
-
* @param
|
|
55
|
-
* @
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
const currentTimestamp = await this.eth.timestamp();
|
|
59
|
-
const targetTimestamp = BigInt(currentTimestamp) + BigInt(duration);
|
|
60
|
-
await this.warpL2TimeAtLeastTo(sequencerClient, node, targetTimestamp);
|
|
27
|
+
* Warps the L1 timestamp forward by at least `duration` seconds and mines an L2 block advancing the L2 timestamp at
|
|
28
|
+
* least by the duration. Forwards to the node's debug API, which serializes the warp through the automine sequencer
|
|
29
|
+
* queue.
|
|
30
|
+
* @param node - The Aztec node whose debug API performs the warp. Must run an automine sequencer.
|
|
31
|
+
* @param duration - The duration to advance time by (in seconds).
|
|
32
|
+
* @deprecated Call `node.warpL2TimeAtLeastBy(duration)` on the node debug API directly.
|
|
33
|
+
*/ warpL2TimeAtLeastBy(node, duration) {
|
|
34
|
+
return node.warpL2TimeAtLeastBy(Number(duration));
|
|
61
35
|
}
|
|
62
36
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type EthCheatCodes } from '@aztec/ethereum/test';
|
|
2
|
-
import {
|
|
2
|
+
import type { EpochNumber } from '@aztec/foundation/branded-types';
|
|
3
3
|
import type { Logger } from '@aztec/foundation/log';
|
|
4
4
|
import type { EthAddress, L2BlockSource } from '@aztec/stdlib/block';
|
|
5
5
|
export declare class EpochTestSettler {
|
|
@@ -16,4 +16,4 @@ export declare class EpochTestSettler {
|
|
|
16
16
|
stop(): Promise<void>;
|
|
17
17
|
handleEpochReadyToProve(epoch: EpochNumber): Promise<boolean>;
|
|
18
18
|
}
|
|
19
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
19
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZXBvY2hfdGVzdF9zZXR0bGVyLmQudHMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9zcmMvdGVzdGluZy9lcG9jaF90ZXN0X3NldHRsZXIudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxFQUFFLEtBQUssYUFBYSxFQUFvQixNQUFNLHNCQUFzQixDQUFDO0FBQzVFLE9BQU8sS0FBSyxFQUFFLFdBQVcsRUFBRSxNQUFNLGlDQUFpQyxDQUFDO0FBQ25FLE9BQU8sS0FBSyxFQUFFLE1BQU0sRUFBRSxNQUFNLHVCQUF1QixDQUFDO0FBR3BELE9BQU8sS0FBSyxFQUFFLFVBQVUsRUFBRSxhQUFhLEVBQUUsTUFBTSxxQkFBcUIsQ0FBQztBQUVyRSxxQkFBYSxnQkFBZ0I7SUFPekIsT0FBTyxDQUFDLGFBQWE7SUFDckIsT0FBTyxDQUFDLEdBQUc7SUFDWCxPQUFPLENBQUMsT0FBTztJQVJqQixPQUFPLENBQUMsZ0JBQWdCLENBQW1CO0lBQzNDLE9BQU8sQ0FBQyxZQUFZLENBQUMsQ0FBZTtJQUVwQyxZQUNFLFVBQVUsRUFBRSxhQUFhLEVBQ3pCLGFBQWEsRUFBRSxVQUFVLEVBQ2pCLGFBQWEsRUFBRSxhQUFhLEVBQzVCLEdBQUcsRUFBRSxNQUFNLEVBQ1gsT0FBTyxFQUFFO1FBQUUsaUJBQWlCLEVBQUUsTUFBTSxDQUFDO1FBQUMsY0FBYyxDQUFDLEVBQUUsTUFBTSxDQUFBO0tBQUUsRUFHeEU7SUFFSyxLQUFLLGtCQUlWO0lBRUssSUFBSSxrQkFFVDtJQUVLLHVCQUF1QixDQUFDLEtBQUssRUFBRSxXQUFXLEdBQUcsT0FBTyxDQUFDLE9BQU8sQ0FBQyxDQWNsRTtDQUNGIn0=
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"epoch_test_settler.d.ts","sourceRoot":"","sources":["../../src/testing/epoch_test_settler.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"epoch_test_settler.d.ts","sourceRoot":"","sources":["../../src/testing/epoch_test_settler.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,aAAa,EAAoB,MAAM,sBAAsB,CAAC;AAC5E,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,iCAAiC,CAAC;AACnE,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAGpD,OAAO,KAAK,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAErE,qBAAa,gBAAgB;IAOzB,OAAO,CAAC,aAAa;IACrB,OAAO,CAAC,GAAG;IACX,OAAO,CAAC,OAAO;IARjB,OAAO,CAAC,gBAAgB,CAAmB;IAC3C,OAAO,CAAC,YAAY,CAAC,CAAe;IAEpC,YACE,UAAU,EAAE,aAAa,EACzB,aAAa,EAAE,UAAU,EACjB,aAAa,EAAE,aAAa,EAC5B,GAAG,EAAE,MAAM,EACX,OAAO,EAAE;QAAE,iBAAiB,EAAE,MAAM,CAAC;QAAC,cAAc,CAAC,EAAE,MAAM,CAAA;KAAE,EAGxE;IAEK,KAAK,kBAIV;IAEK,IAAI,kBAET;IAEK,uBAAuB,CAAC,KAAK,EAAE,WAAW,GAAG,OAAO,CAAC,OAAO,CAAC,CAclE;CACF"}
|