@aztec/aztec 2.1.0-rc.9 → 3.0.0-devnet.2
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 +4 -6
- package/dest/cli/aztec_start_action.d.ts.map +1 -1
- package/dest/cli/aztec_start_action.js +2 -14
- package/dest/cli/aztec_start_options.d.ts.map +1 -1
- package/dest/cli/aztec_start_options.js +2 -8
- package/dest/cli/cmds/start_archiver.js +2 -2
- package/dest/cli/cmds/start_bot.d.ts +3 -6
- package/dest/cli/cmds/start_bot.d.ts.map +1 -1
- package/dest/cli/cmds/start_bot.js +13 -17
- package/dest/cli/cmds/start_node.d.ts.map +1 -1
- package/dest/cli/cmds/start_node.js +8 -16
- package/dest/cli/cmds/start_prover_node.js +3 -3
- package/dest/cli/util.d.ts +6 -4
- package/dest/cli/util.d.ts.map +1 -1
- package/dest/cli/util.js +4 -4
- package/dest/cli/versioning.js +3 -3
- package/dest/examples/token.js +18 -16
- package/dest/examples/util.d.ts +1 -1
- package/dest/examples/util.d.ts.map +1 -1
- package/dest/examples/util.js +1 -1
- package/dest/index.d.ts +1 -1
- package/dest/index.d.ts.map +1 -1
- package/dest/index.js +1 -1
- package/dest/sandbox/banana_fpc.d.ts +4 -5
- package/dest/sandbox/banana_fpc.d.ts.map +1 -1
- package/dest/sandbox/banana_fpc.js +14 -18
- package/dest/sandbox/index.d.ts +2 -2
- package/dest/sandbox/index.d.ts.map +1 -1
- package/dest/sandbox/index.js +2 -2
- package/dest/sandbox/sandbox.d.ts +2 -12
- package/dest/sandbox/sandbox.d.ts.map +1 -1
- package/dest/sandbox/sandbox.js +19 -32
- package/dest/sandbox/sponsored_fpc.d.ts +3 -3
- package/dest/sandbox/sponsored_fpc.d.ts.map +1 -1
- package/dest/sandbox/sponsored_fpc.js +7 -8
- package/dest/testing/anvil_test_watcher.d.ts.map +1 -1
- package/dest/testing/anvil_test_watcher.js +3 -4
- package/dest/testing/cheat_codes.d.ts +6 -7
- package/dest/testing/cheat_codes.d.ts.map +1 -1
- package/dest/testing/cheat_codes.js +9 -10
- package/dest/testing/index.d.ts +0 -1
- package/dest/testing/index.d.ts.map +1 -1
- package/dest/testing/index.js +0 -1
- package/package.json +33 -33
- package/src/bin/index.ts +4 -6
- package/src/cli/aztec_start_action.ts +2 -11
- package/src/cli/aztec_start_options.ts +2 -8
- package/src/cli/cmds/start_archiver.ts +2 -2
- package/src/cli/cmds/start_bot.ts +22 -13
- package/src/cli/cmds/start_node.ts +11 -12
- package/src/cli/cmds/start_prover_node.ts +3 -3
- package/src/cli/util.ts +8 -6
- package/src/cli/versioning.ts +3 -3
- package/src/examples/token.ts +20 -17
- package/src/examples/util.ts +1 -1
- package/src/index.ts +3 -3
- package/src/sandbox/banana_fpc.ts +15 -20
- package/src/sandbox/index.ts +5 -2
- package/src/sandbox/sandbox.ts +21 -32
- package/src/sandbox/sponsored_fpc.ts +8 -10
- package/src/testing/anvil_test_watcher.ts +2 -5
- package/src/testing/cheat_codes.ts +10 -11
- package/src/testing/index.ts +0 -1
- package/dest/cli/cmds/start_pxe.d.ts +0 -16
- package/dest/cli/cmds/start_pxe.d.ts.map +0 -1
- package/dest/cli/cmds/start_pxe.js +0 -31
- package/dest/testing/aztec_cheat_codes.d.ts +0 -59
- package/dest/testing/aztec_cheat_codes.d.ts.map +0 -1
- package/dest/testing/aztec_cheat_codes.js +0 -62
- package/src/cli/cmds/start_pxe.ts +0 -49
- package/src/testing/aztec_cheat_codes.ts +0 -77
|
@@ -1,12 +1,10 @@
|
|
|
1
1
|
#!/usr/bin/env -S node --no-warnings
|
|
2
2
|
import { type AztecNodeConfig, AztecNodeService } from '@aztec/aztec-node';
|
|
3
|
-
import { EthAddress } from '@aztec/aztec.js';
|
|
3
|
+
import { EthAddress } from '@aztec/aztec.js/addresses';
|
|
4
4
|
import { type BlobSinkClientInterface } from '@aztec/blob-sink/client';
|
|
5
5
|
import { Fr } from '@aztec/foundation/fields';
|
|
6
6
|
import { type LogFn } from '@aztec/foundation/log';
|
|
7
7
|
import { DateProvider } from '@aztec/foundation/timer';
|
|
8
|
-
import { type PXEServiceConfig } from '@aztec/pxe/server';
|
|
9
|
-
import type { AztecNode } from '@aztec/stdlib/interfaces/client';
|
|
10
8
|
import type { PublicDataTreeLeaf } from '@aztec/stdlib/trees';
|
|
11
9
|
import { type TelemetryClient } from '@aztec/telemetry-client';
|
|
12
10
|
import { type HDAccount, type PrivateKeyAccount } from 'viem';
|
|
@@ -15,7 +13,7 @@ import { type HDAccount, type PrivateKeyAccount } from 'viem';
|
|
|
15
13
|
* @param aztecNodeConfig - The Aztec Node Config
|
|
16
14
|
* @param hdAccount - Account for publishing L1 contracts
|
|
17
15
|
*/
|
|
18
|
-
export declare function deployContractsToL1(aztecNodeConfig: AztecNodeConfig, hdAccount: HDAccount | PrivateKeyAccount, contractDeployLogger?: import("@aztec/
|
|
16
|
+
export declare function deployContractsToL1(aztecNodeConfig: AztecNodeConfig, hdAccount: HDAccount | PrivateKeyAccount, contractDeployLogger?: import("@aztec/foundation/log").Logger, opts?: {
|
|
19
17
|
assumeProvenThroughBlockNumber?: number;
|
|
20
18
|
salt?: number;
|
|
21
19
|
genesisArchiveRoot?: Fr;
|
|
@@ -50,8 +48,6 @@ export type SandboxConfig = AztecNodeConfig & {
|
|
|
50
48
|
l1Mnemonic: string;
|
|
51
49
|
/** Salt used to deploy L1 contracts.*/
|
|
52
50
|
deployAztecContractsSalt: string;
|
|
53
|
-
/** Whether to expose PXE service on sandbox start.*/
|
|
54
|
-
noPXE: boolean;
|
|
55
51
|
/** Whether to deploy test accounts on sandbox start.*/
|
|
56
52
|
testAccounts: boolean;
|
|
57
53
|
};
|
|
@@ -62,7 +58,6 @@ export type SandboxConfig = AztecNodeConfig & {
|
|
|
62
58
|
*/
|
|
63
59
|
export declare function createSandbox(config: Partial<SandboxConfig> | undefined, userLog: LogFn): Promise<{
|
|
64
60
|
node: AztecNodeService;
|
|
65
|
-
pxe: import("@aztec/pxe/server").PXEService;
|
|
66
61
|
stop: () => Promise<void>;
|
|
67
62
|
}>;
|
|
68
63
|
/**
|
|
@@ -76,9 +71,4 @@ export declare function createAztecNode(config?: Partial<AztecNodeConfig>, deps?
|
|
|
76
71
|
}, options?: {
|
|
77
72
|
prefilledPublicData?: PublicDataTreeLeaf[];
|
|
78
73
|
}): Promise<AztecNodeService>;
|
|
79
|
-
/**
|
|
80
|
-
* Create and start a new Aztec PXE HTTP Server
|
|
81
|
-
* @param config - Optional PXE settings.
|
|
82
|
-
*/
|
|
83
|
-
export declare function createAztecPXE(node: AztecNode, config?: Partial<PXEServiceConfig>): Promise<import("@aztec/pxe/server").PXEService>;
|
|
84
74
|
//# sourceMappingURL=sandbox.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sandbox.d.ts","sourceRoot":"","sources":["../../src/sandbox/sandbox.ts"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"sandbox.d.ts","sourceRoot":"","sources":["../../src/sandbox/sandbox.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,KAAK,eAAe,EAAE,gBAAgB,EAAoB,MAAM,mBAAmB,CAAC;AAC7F,OAAO,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AACvD,OAAO,EAAE,KAAK,uBAAuB,EAAwB,MAAM,yBAAyB,CAAC;AAY7F,OAAO,EAAE,EAAE,EAAE,MAAM,0BAA0B,CAAC;AAC9C,OAAO,EAAE,KAAK,KAAK,EAAgB,MAAM,uBAAuB,CAAC;AACjE,OAAO,EAAE,YAAY,EAAoB,MAAM,yBAAyB,CAAC;AAGzE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAC9D,OAAO,EACL,KAAK,eAAe,EAGrB,MAAM,yBAAyB,CAAC;AAIjC,OAAO,EAAE,KAAK,SAAS,EAAE,KAAK,iBAAiB,EAA2D,MAAM,MAAM,CAAC;AAcvH;;;;GAIG;AACH,wBAAsB,mBAAmB,CACvC,eAAe,EAAE,eAAe,EAChC,SAAS,EAAE,SAAS,GAAG,iBAAiB,EACxC,oBAAoB,yCAAS,EAC7B,IAAI,GAAE;IACJ,8BAA8B,CAAC,EAAE,MAAM,CAAC;IACxC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,kBAAkB,CAAC,EAAE,EAAE,CAAC;IACxB,4BAA4B,CAAC,EAAE,MAAM,CAAC;CAClC;;;;;;;;;;;;;;;;;;;;;;;GAkCP;AAED,wBAAwB;AACxB,MAAM,MAAM,aAAa,GAAG,eAAe,GAAG;IAC5C,0DAA0D;IAC1D,UAAU,EAAE,MAAM,CAAC;IACnB,uCAAuC;IACvC,wBAAwB,EAAE,MAAM,CAAC;IACjC,uDAAuD;IACvD,YAAY,EAAE,OAAO,CAAC;CACvB,CAAC;AAEF;;;;GAIG;AACH,wBAAsB,aAAa,CAAC,MAAM,EAAE,OAAO,CAAC,aAAa,CAAC,YAAK,EAAE,OAAO,EAAE,KAAK;;;GAgHtF;AAED;;;GAGG;AACH,wBAAsB,eAAe,CACnC,MAAM,GAAE,OAAO,CAAC,eAAe,CAAM,EACrC,IAAI,GAAE;IAAE,SAAS,CAAC,EAAE,eAAe,CAAC;IAAC,cAAc,CAAC,EAAE,uBAAuB,CAAC;IAAC,YAAY,CAAC,EAAE,YAAY,CAAA;CAAO,EACjH,OAAO,GAAE;IAAE,mBAAmB,CAAC,EAAE,kBAAkB,EAAE,CAAA;CAAO,6BAW7D"}
|
package/dest/sandbox/sandbox.js
CHANGED
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
#!/usr/bin/env -S node --no-warnings
|
|
2
|
-
import {
|
|
3
|
-
import { deployFundedSchnorrAccounts, getInitialTestAccounts } from '@aztec/accounts/testing';
|
|
2
|
+
import { getInitialTestAccountsData } from '@aztec/accounts/testing';
|
|
4
3
|
import { AztecNodeService, getConfigEnvVars } from '@aztec/aztec-node';
|
|
5
|
-
import { EthAddress } from '@aztec/aztec.js';
|
|
4
|
+
import { EthAddress } from '@aztec/aztec.js/addresses';
|
|
6
5
|
import { createBlobSinkClient } from '@aztec/blob-sink/client';
|
|
7
|
-
import { setupSponsoredFPC } from '@aztec/cli/cli-utils';
|
|
8
6
|
import { GENESIS_ARCHIVE_ROOT } from '@aztec/constants';
|
|
9
7
|
import { NULL_KEY, createEthereumChain, deployL1Contracts, deployMulticall3, getL1ContractsConfigEnvVars, waitForPublicClient } from '@aztec/ethereum';
|
|
10
8
|
import { EthCheatCodes } from '@aztec/ethereum/test';
|
|
@@ -13,9 +11,9 @@ import { Fr } from '@aztec/foundation/fields';
|
|
|
13
11
|
import { createLogger } from '@aztec/foundation/log';
|
|
14
12
|
import { TestDateProvider } from '@aztec/foundation/timer';
|
|
15
13
|
import { getVKTreeRoot } from '@aztec/noir-protocol-circuits-types/vk-tree';
|
|
16
|
-
import {
|
|
17
|
-
import { createPXEService, getPXEServiceConfig } from '@aztec/pxe/server';
|
|
14
|
+
import { protocolContractsHash } from '@aztec/protocol-contracts';
|
|
18
15
|
import { getConfigEnvVars as getTelemetryClientConfig, initTelemetryClient } from '@aztec/telemetry-client';
|
|
16
|
+
import { TestWallet, deployFundedSchnorrAccounts } from '@aztec/test-wallet/server';
|
|
19
17
|
import { getGenesisValues } from '@aztec/world-state/testing';
|
|
20
18
|
import { createPublicClient, fallback, http as httpViemTransport } from 'viem';
|
|
21
19
|
import { mnemonicToAccount, privateKeyToAddress } from 'viem/accounts';
|
|
@@ -40,7 +38,7 @@ const localAnvil = foundry;
|
|
|
40
38
|
...getL1ContractsConfigEnvVars(),
|
|
41
39
|
...aztecNodeConfig,
|
|
42
40
|
vkTreeRoot: getVKTreeRoot(),
|
|
43
|
-
|
|
41
|
+
protocolContractsHash,
|
|
44
42
|
genesisArchiveRoot: opts.genesisArchiveRoot ?? new Fr(GENESIS_ARCHIVE_ROOT),
|
|
45
43
|
salt: opts.salt,
|
|
46
44
|
feeJuicePortalInitialBalance: opts.feeJuicePortalInitialBalance,
|
|
@@ -90,7 +88,7 @@ const localAnvil = foundry;
|
|
|
90
88
|
userLog(`Not setting up test accounts as we are connecting to a network`);
|
|
91
89
|
} else {
|
|
92
90
|
userLog(`Setting up test accounts`);
|
|
93
|
-
return await
|
|
91
|
+
return await getInitialTestAccountsData();
|
|
94
92
|
}
|
|
95
93
|
}
|
|
96
94
|
return [];
|
|
@@ -125,7 +123,7 @@ const localAnvil = foundry;
|
|
|
125
123
|
});
|
|
126
124
|
watcher = new AnvilTestWatcher(new EthCheatCodes([
|
|
127
125
|
l1RpcUrl
|
|
128
|
-
]), l1ContractAddresses.rollupAddress, publicClient, dateProvider);
|
|
126
|
+
], dateProvider), l1ContractAddresses.rollupAddress, publicClient, dateProvider);
|
|
129
127
|
watcher.setIsSandbox(true);
|
|
130
128
|
await watcher.start();
|
|
131
129
|
}
|
|
@@ -139,22 +137,23 @@ const localAnvil = foundry;
|
|
|
139
137
|
}, {
|
|
140
138
|
prefilledPublicData
|
|
141
139
|
});
|
|
142
|
-
const pxeServiceConfig = {
|
|
143
|
-
proverEnabled: aztecNodeConfig.realProofs
|
|
144
|
-
};
|
|
145
|
-
const pxe = await createAztecPXE(node, pxeServiceConfig);
|
|
146
140
|
if (initialAccounts.length) {
|
|
141
|
+
const PXEConfig = {
|
|
142
|
+
proverEnabled: aztecNodeConfig.realProofs
|
|
143
|
+
};
|
|
144
|
+
const wallet = await TestWallet.create(node, PXEConfig);
|
|
147
145
|
userLog('Setting up funded test accounts...');
|
|
148
|
-
const
|
|
149
|
-
const accountsWithSecrets =
|
|
150
|
-
account,
|
|
146
|
+
const accountManagers = await deployFundedSchnorrAccounts(wallet, node, initialAccounts);
|
|
147
|
+
const accountsWithSecrets = accountManagers.map((manager, i)=>({
|
|
148
|
+
account: manager,
|
|
151
149
|
secretKey: initialAccounts[i].secret
|
|
152
150
|
}));
|
|
153
|
-
const accLogs = await createAccountLogs(accountsWithSecrets,
|
|
151
|
+
const accLogs = await createAccountLogs(accountsWithSecrets, wallet);
|
|
154
152
|
userLog(accLogs.join(''));
|
|
155
|
-
|
|
156
|
-
await
|
|
157
|
-
|
|
153
|
+
await setupBananaFPC(initialAccounts, wallet, userLog);
|
|
154
|
+
userLog(`SponsoredFPC: ${await getSponsoredFPCAddress()}`);
|
|
155
|
+
// We no longer need the wallet once we've setup the accounts so we stop the underlying PXE job queue
|
|
156
|
+
await wallet.stop();
|
|
158
157
|
}
|
|
159
158
|
const stop = async ()=>{
|
|
160
159
|
await node.stop();
|
|
@@ -162,7 +161,6 @@ const localAnvil = foundry;
|
|
|
162
161
|
};
|
|
163
162
|
return {
|
|
164
163
|
node,
|
|
165
|
-
pxe,
|
|
166
164
|
stop
|
|
167
165
|
};
|
|
168
166
|
}
|
|
@@ -183,14 +181,3 @@ const localAnvil = foundry;
|
|
|
183
181
|
const node = await AztecNodeService.createAndSync(aztecNodeConfig, deps, options);
|
|
184
182
|
return node;
|
|
185
183
|
}
|
|
186
|
-
/**
|
|
187
|
-
* Create and start a new Aztec PXE HTTP Server
|
|
188
|
-
* @param config - Optional PXE settings.
|
|
189
|
-
*/ export async function createAztecPXE(node, config = {}) {
|
|
190
|
-
const pxeServiceConfig = {
|
|
191
|
-
...getPXEServiceConfig(),
|
|
192
|
-
...config
|
|
193
|
-
};
|
|
194
|
-
const pxe = await createPXEService(node, pxeServiceConfig);
|
|
195
|
-
return pxe;
|
|
196
|
-
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export declare function getSponsoredFPCAddress(): Promise<import("@aztec/aztec.js").AztecAddress>;
|
|
3
|
-
export declare function
|
|
1
|
+
import type { Wallet } from '@aztec/aztec.js/wallet';
|
|
2
|
+
export declare function getSponsoredFPCAddress(): Promise<import("@aztec/aztec.js/addresses").AztecAddress>;
|
|
3
|
+
export declare function registerDeployedSponsoredFPCInWalletAndGetAddress(wallet: Wallet): Promise<import("@aztec/aztec.js/addresses").AztecAddress>;
|
|
4
4
|
//# sourceMappingURL=sponsored_fpc.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sponsored_fpc.d.ts","sourceRoot":"","sources":["../../src/sandbox/sponsored_fpc.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"sponsored_fpc.d.ts","sourceRoot":"","sources":["../../src/sandbox/sponsored_fpc.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAUrD,wBAAsB,sBAAsB,8DAE3C;AAED,wBAAsB,iDAAiD,CAAC,MAAM,EAAE,MAAM,6DAKrF"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { getContractInstanceFromInstantiationParams } from '@aztec/aztec.js/contracts';
|
|
2
|
+
import { Fr } from '@aztec/aztec.js/fields';
|
|
2
3
|
import { SPONSORED_FPC_SALT } from '@aztec/constants';
|
|
3
4
|
import { SponsoredFPCContract } from '@aztec/noir-contracts.js/SponsoredFPC';
|
|
4
5
|
async function getSponsoredFPCInstance() {
|
|
@@ -9,11 +10,9 @@ async function getSponsoredFPCInstance() {
|
|
|
9
10
|
export async function getSponsoredFPCAddress() {
|
|
10
11
|
return (await getSponsoredFPCInstance()).address;
|
|
11
12
|
}
|
|
12
|
-
export async function
|
|
13
|
-
const fpc = await
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
}
|
|
18
|
-
return fpc;
|
|
13
|
+
export async function registerDeployedSponsoredFPCInWalletAndGetAddress(wallet) {
|
|
14
|
+
const fpc = await getSponsoredFPCInstance();
|
|
15
|
+
// The following is no-op if the contract is already registered
|
|
16
|
+
await wallet.registerContract(fpc, SponsoredFPCContract.artifact);
|
|
17
|
+
return fpc.address;
|
|
19
18
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"anvil_test_watcher.d.ts","sourceRoot":"","sources":["../../src/testing/anvil_test_watcher.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,EAAE,aAAa,EAAoB,MAAM,sBAAsB,CAAC;AACvE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAGhE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAKhE;;;;;;GAMG;AACH,qBAAa,gBAAgB;IAgBzB,OAAO,CAAC,UAAU;IAGlB,OAAO,CAAC,YAAY,CAAC;IAlBvB,OAAO,CAAC,SAAS,CAAkB;IAEnC,OAAO,CAAC,MAAM,CAAsD;IACpE,OAAO,CAAC,gBAAgB,CAAmB;IAC3C,OAAO,CAAC,cAAc,CAAU;IAEhC,OAAO,CAAC,oBAAoB,CAAC,CAAiB;IAC9C,OAAO,CAAC,uBAAuB,CAAC,CAAiB;IACjD,OAAO,CAAC,6BAA6B,CAAC,CAAiB;IAEvD,OAAO,CAAC,MAAM,CAAiD;IAE/D,OAAO,CAAC,iBAAiB,CAAQ;gBAGvB,UAAU,EAAE,aAAa,EACjC,aAAa,EAAE,UAAU,EACzB,QAAQ,EAAE,UAAU,EACZ,YAAY,CAAC,EAAE,gBAAgB,YAAA;IAezC,oBAAoB,CAAC,iBAAiB,EAAE,OAAO;
|
|
1
|
+
{"version":3,"file":"anvil_test_watcher.d.ts","sourceRoot":"","sources":["../../src/testing/anvil_test_watcher.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,EAAE,aAAa,EAAoB,MAAM,sBAAsB,CAAC;AACvE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAGhE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAKhE;;;;;;GAMG;AACH,qBAAa,gBAAgB;IAgBzB,OAAO,CAAC,UAAU;IAGlB,OAAO,CAAC,YAAY,CAAC;IAlBvB,OAAO,CAAC,SAAS,CAAkB;IAEnC,OAAO,CAAC,MAAM,CAAsD;IACpE,OAAO,CAAC,gBAAgB,CAAmB;IAC3C,OAAO,CAAC,cAAc,CAAU;IAEhC,OAAO,CAAC,oBAAoB,CAAC,CAAiB;IAC9C,OAAO,CAAC,uBAAuB,CAAC,CAAiB;IACjD,OAAO,CAAC,6BAA6B,CAAC,CAAiB;IAEvD,OAAO,CAAC,MAAM,CAAiD;IAE/D,OAAO,CAAC,iBAAiB,CAAQ;gBAGvB,UAAU,EAAE,aAAa,EACjC,aAAa,EAAE,UAAU,EACzB,QAAQ,EAAE,UAAU,EACZ,YAAY,CAAC,EAAE,gBAAgB,YAAA;IAezC,oBAAoB,CAAC,iBAAiB,EAAE,OAAO;IAK/C,YAAY,CAAC,SAAS,EAAE,OAAO;IAIzB,KAAK;IA2BL,IAAI;IAMJ,OAAO;IAMP,YAAY;IAOZ,4BAA4B;IAiB5B,gBAAgB;CAwCvB"}
|
|
@@ -38,6 +38,7 @@ import { getAddress, getContract } from 'viem';
|
|
|
38
38
|
this.logger.debug(`Watcher created for rollup at ${rollupAddress}`);
|
|
39
39
|
}
|
|
40
40
|
setIsMarkingAsProven(isMarkingAsProven) {
|
|
41
|
+
this.logger.warn(`Watcher is now ${isMarkingAsProven ? 'marking' : 'not marking'} blocks as proven`);
|
|
41
42
|
this.isMarkingAsProven = isMarkingAsProven;
|
|
42
43
|
}
|
|
43
44
|
setIsSandbox(isSandbox) {
|
|
@@ -111,8 +112,7 @@ import { getAddress, getContract } from 'viem';
|
|
|
111
112
|
// We should jump to the next slot
|
|
112
113
|
try {
|
|
113
114
|
await this.cheatcodes.warp(nextSlotTimestamp, {
|
|
114
|
-
resetBlockInterval: true
|
|
115
|
-
updateDateProvider: this.dateProvider
|
|
115
|
+
resetBlockInterval: true
|
|
116
116
|
});
|
|
117
117
|
} catch (e) {
|
|
118
118
|
this.logger.error(`Failed to warp to timestamp ${nextSlotTimestamp}: ${e}`);
|
|
@@ -128,8 +128,7 @@ import { getAddress, getContract } from 'viem';
|
|
|
128
128
|
if (currentTimestamp > nextSlotTimestamp * 1000) {
|
|
129
129
|
try {
|
|
130
130
|
await this.cheatcodes.warp(nextSlotTimestamp, {
|
|
131
|
-
resetBlockInterval: true
|
|
132
|
-
updateDateProvider: this.dateProvider
|
|
131
|
+
resetBlockInterval: true
|
|
133
132
|
});
|
|
134
133
|
} catch (e) {
|
|
135
134
|
this.logger.error(`Failed to warp to timestamp ${nextSlotTimestamp}: ${e}`);
|
|
@@ -1,25 +1,24 @@
|
|
|
1
1
|
import { EthCheatCodes, RollupCheatCodes } from '@aztec/ethereum/test';
|
|
2
|
+
import type { DateProvider } from '@aztec/foundation/timer';
|
|
2
3
|
import type { SequencerClient } from '@aztec/sequencer-client';
|
|
3
|
-
import type { AztecNode
|
|
4
|
-
import { AztecCheatCodes } from './aztec_cheat_codes.js';
|
|
4
|
+
import type { AztecNode } from '@aztec/stdlib/interfaces/client';
|
|
5
5
|
/**
|
|
6
6
|
* A class that provides utility functions for interacting with the chain.
|
|
7
|
+
* @deprecated There used to be 3 kinds of cheat codes: eth, rollup and aztec. We have nuked the Aztec ones because
|
|
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.
|
|
7
10
|
*/
|
|
8
11
|
export declare class CheatCodes {
|
|
9
12
|
/** Cheat codes for L1.*/
|
|
10
13
|
eth: EthCheatCodes;
|
|
11
|
-
/** Cheat codes for Aztec L2. */
|
|
12
|
-
aztec: AztecCheatCodes;
|
|
13
14
|
/** Cheat codes for the Aztec Rollup contract on L1. */
|
|
14
15
|
rollup: RollupCheatCodes;
|
|
15
16
|
constructor(
|
|
16
17
|
/** Cheat codes for L1.*/
|
|
17
18
|
eth: EthCheatCodes,
|
|
18
|
-
/** Cheat codes for Aztec L2. */
|
|
19
|
-
aztec: AztecCheatCodes,
|
|
20
19
|
/** Cheat codes for the Aztec Rollup contract on L1. */
|
|
21
20
|
rollup: RollupCheatCodes);
|
|
22
|
-
static create(rpcUrls: string[],
|
|
21
|
+
static create(rpcUrls: string[], node: AztecNode, dateProvider: DateProvider): Promise<CheatCodes>;
|
|
23
22
|
/**
|
|
24
23
|
* Warps the L1 timestamp to a target timestamp and mines an L2 block that advances the L2 timestamp to at least
|
|
25
24
|
* the target timestamp. L2 timestamp is not advanced exactly to the target timestamp because it is determined
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cheat_codes.d.ts","sourceRoot":"","sources":["../../src/testing/cheat_codes.ts"],"names":[],"mappings":"
|
|
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;AAEvE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAC5D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAC/D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iCAAiC,CAAC;AAEjE;;;;;GAKG;AACH,qBAAa,UAAU;IAEnB,yBAAyB;IAClB,GAAG,EAAE,aAAa;IACzB,uDAAuD;IAChD,MAAM,EAAE,gBAAgB;;IAH/B,yBAAyB;IAClB,GAAG,EAAE,aAAa;IACzB,uDAAuD;IAChD,MAAM,EAAE,gBAAgB;WAGpB,MAAM,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,YAAY,EAAE,YAAY,GAAG,OAAO,CAAC,UAAU,CAAC;IASxG;;;;;;;;OAQG;IACG,mBAAmB,CAAC,eAAe,EAAE,eAAe,EAAE,IAAI,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,GAAG,MAAM;IAyB7G;;;;;;;;OAQG;IACG,mBAAmB,CAAC,eAAe,EAAE,eAAe,EAAE,IAAI,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM;CAKvG"}
|
|
@@ -1,22 +1,21 @@
|
|
|
1
|
-
import { retryUntil } from '@aztec/aztec.js';
|
|
2
1
|
import { EthCheatCodes, RollupCheatCodes } from '@aztec/ethereum/test';
|
|
3
|
-
import {
|
|
2
|
+
import { retryUntil } from '@aztec/foundation/retry';
|
|
4
3
|
/**
|
|
5
4
|
* A class that provides utility functions for interacting with the chain.
|
|
5
|
+
* @deprecated There used to be 3 kinds of cheat codes: eth, rollup and aztec. We have nuked the Aztec ones because
|
|
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.
|
|
6
8
|
*/ export class CheatCodes {
|
|
7
9
|
eth;
|
|
8
|
-
aztec;
|
|
9
10
|
rollup;
|
|
10
|
-
constructor(/** Cheat codes for L1.*/ eth, /** Cheat codes for
|
|
11
|
+
constructor(/** Cheat codes for L1.*/ eth, /** Cheat codes for the Aztec Rollup contract on L1. */ rollup){
|
|
11
12
|
this.eth = eth;
|
|
12
|
-
this.aztec = aztec;
|
|
13
13
|
this.rollup = rollup;
|
|
14
14
|
}
|
|
15
|
-
static async create(rpcUrls,
|
|
16
|
-
const ethCheatCodes = new EthCheatCodes(rpcUrls);
|
|
17
|
-
const
|
|
18
|
-
|
|
19
|
-
return new CheatCodes(ethCheatCodes, aztecCheatCodes, rollupCheatCodes);
|
|
15
|
+
static async create(rpcUrls, node, dateProvider) {
|
|
16
|
+
const ethCheatCodes = new EthCheatCodes(rpcUrls, dateProvider);
|
|
17
|
+
const rollupCheatCodes = new RollupCheatCodes(ethCheatCodes, await node.getNodeInfo().then((n)=>n.l1ContractAddresses));
|
|
18
|
+
return new CheatCodes(ethCheatCodes, rollupCheatCodes);
|
|
20
19
|
}
|
|
21
20
|
/**
|
|
22
21
|
* Warps the L1 timestamp to a target timestamp and mines an L2 block that advances the L2 timestamp to at least
|
package/dest/testing/index.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
export { AnvilTestWatcher } from './anvil_test_watcher.js';
|
|
2
2
|
export { EthCheatCodes, RollupCheatCodes } from '@aztec/ethereum/test';
|
|
3
|
-
export { AztecCheatCodes } from './aztec_cheat_codes.js';
|
|
4
3
|
export { CheatCodes } from './cheat_codes.js';
|
|
5
4
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -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,
|
|
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"}
|
package/dest/testing/index.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aztec/aztec",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "3.0.0-devnet.2",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"exports": {
|
|
6
6
|
".": "./dest/index.js",
|
|
@@ -28,44 +28,44 @@
|
|
|
28
28
|
"../package.common.json"
|
|
29
29
|
],
|
|
30
30
|
"dependencies": {
|
|
31
|
-
"@aztec/accounts": "
|
|
32
|
-
"@aztec/archiver": "
|
|
33
|
-
"@aztec/aztec-faucet": "
|
|
34
|
-
"@aztec/aztec-node": "
|
|
35
|
-
"@aztec/aztec.js": "
|
|
36
|
-
"@aztec/bb-prover": "
|
|
37
|
-
"@aztec/bb.js": "
|
|
38
|
-
"@aztec/blob-sink": "
|
|
39
|
-
"@aztec/bot": "
|
|
40
|
-
"@aztec/builder": "
|
|
41
|
-
"@aztec/cli": "
|
|
42
|
-
"@aztec/
|
|
43
|
-
"@aztec/
|
|
44
|
-
"@aztec/
|
|
45
|
-
"@aztec/
|
|
46
|
-
"@aztec/
|
|
47
|
-
"@aztec/
|
|
48
|
-
"@aztec/
|
|
49
|
-
"@aztec/
|
|
50
|
-
"@aztec/noir-
|
|
51
|
-
"@aztec/
|
|
52
|
-
"@aztec/p2p": "
|
|
53
|
-
"@aztec/
|
|
54
|
-
"@aztec/
|
|
55
|
-
"@aztec/prover-
|
|
56
|
-
"@aztec/
|
|
57
|
-
"@aztec/
|
|
58
|
-
"@aztec/
|
|
59
|
-
"@aztec/
|
|
60
|
-
"@aztec/txe": "
|
|
61
|
-
"@aztec/world-state": "
|
|
31
|
+
"@aztec/accounts": "3.0.0-devnet.2",
|
|
32
|
+
"@aztec/archiver": "3.0.0-devnet.2",
|
|
33
|
+
"@aztec/aztec-faucet": "3.0.0-devnet.2",
|
|
34
|
+
"@aztec/aztec-node": "3.0.0-devnet.2",
|
|
35
|
+
"@aztec/aztec.js": "3.0.0-devnet.2",
|
|
36
|
+
"@aztec/bb-prover": "3.0.0-devnet.2",
|
|
37
|
+
"@aztec/bb.js": "3.0.0-devnet.2",
|
|
38
|
+
"@aztec/blob-sink": "3.0.0-devnet.2",
|
|
39
|
+
"@aztec/bot": "3.0.0-devnet.2",
|
|
40
|
+
"@aztec/builder": "3.0.0-devnet.2",
|
|
41
|
+
"@aztec/cli": "3.0.0-devnet.2",
|
|
42
|
+
"@aztec/constants": "3.0.0-devnet.2",
|
|
43
|
+
"@aztec/entrypoints": "3.0.0-devnet.2",
|
|
44
|
+
"@aztec/ethereum": "3.0.0-devnet.2",
|
|
45
|
+
"@aztec/foundation": "3.0.0-devnet.2",
|
|
46
|
+
"@aztec/kv-store": "3.0.0-devnet.2",
|
|
47
|
+
"@aztec/l1-artifacts": "3.0.0-devnet.2",
|
|
48
|
+
"@aztec/node-lib": "3.0.0-devnet.2",
|
|
49
|
+
"@aztec/noir-contracts.js": "3.0.0-devnet.2",
|
|
50
|
+
"@aztec/noir-protocol-circuits-types": "3.0.0-devnet.2",
|
|
51
|
+
"@aztec/p2p": "3.0.0-devnet.2",
|
|
52
|
+
"@aztec/p2p-bootstrap": "3.0.0-devnet.2",
|
|
53
|
+
"@aztec/protocol-contracts": "3.0.0-devnet.2",
|
|
54
|
+
"@aztec/prover-client": "3.0.0-devnet.2",
|
|
55
|
+
"@aztec/prover-node": "3.0.0-devnet.2",
|
|
56
|
+
"@aztec/pxe": "3.0.0-devnet.2",
|
|
57
|
+
"@aztec/stdlib": "3.0.0-devnet.2",
|
|
58
|
+
"@aztec/telemetry-client": "3.0.0-devnet.2",
|
|
59
|
+
"@aztec/test-wallet": "3.0.0-devnet.2",
|
|
60
|
+
"@aztec/txe": "3.0.0-devnet.2",
|
|
61
|
+
"@aztec/world-state": "3.0.0-devnet.2",
|
|
62
62
|
"@types/chalk": "^2.2.0",
|
|
63
63
|
"abitype": "^0.8.11",
|
|
64
64
|
"chalk": "^5.3.0",
|
|
65
65
|
"commander": "^12.1.0",
|
|
66
66
|
"koa": "^2.16.1",
|
|
67
67
|
"koa-router": "^13.1.1",
|
|
68
|
-
"viem": "2.
|
|
68
|
+
"viem": "npm:@spalladino/viem@2.38.2-eip7594.0"
|
|
69
69
|
},
|
|
70
70
|
"files": [
|
|
71
71
|
"dest",
|
package/src/bin/index.ts
CHANGED
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
//
|
|
3
3
|
import { injectCommands as injectBuilderCommands } from '@aztec/builder';
|
|
4
|
-
import { injectCommands as
|
|
4
|
+
import { injectCommands as injectAztecNodeCommands } from '@aztec/cli/aztec_node';
|
|
5
5
|
import { enrichEnvironmentWithChainConfig, enrichEnvironmentWithNetworkConfig } from '@aztec/cli/config';
|
|
6
6
|
import { injectCommands as injectContractCommands } from '@aztec/cli/contracts';
|
|
7
7
|
import { injectCommands as injectInfrastructureCommands } from '@aztec/cli/infrastructure';
|
|
8
8
|
import { injectCommands as injectL1Commands } from '@aztec/cli/l1';
|
|
9
9
|
import { injectCommands as injectMiscCommands } from '@aztec/cli/misc';
|
|
10
|
-
import { injectCommands as injectPXECommands } from '@aztec/cli/pxe';
|
|
11
10
|
import { getActiveNetworkName } from '@aztec/foundation/config';
|
|
12
11
|
import { createConsoleLogger, createLogger } from '@aztec/foundation/log';
|
|
13
12
|
|
|
@@ -39,8 +38,8 @@ async function main() {
|
|
|
39
38
|
}
|
|
40
39
|
|
|
41
40
|
const networkName = getActiveNetworkName(networkValue);
|
|
42
|
-
await enrichEnvironmentWithChainConfig(networkName);
|
|
43
41
|
await enrichEnvironmentWithNetworkConfig(networkName);
|
|
42
|
+
enrichEnvironmentWithChainConfig(networkName);
|
|
44
43
|
|
|
45
44
|
const cliVersion = getCliVersion();
|
|
46
45
|
let program = new Command('aztec');
|
|
@@ -48,11 +47,10 @@ async function main() {
|
|
|
48
47
|
program = injectAztecCommands(program, userLog, debugLogger);
|
|
49
48
|
program = injectBuilderCommands(program);
|
|
50
49
|
program = injectContractCommands(program, userLog, debugLogger);
|
|
51
|
-
program = injectInfrastructureCommands(program, userLog
|
|
50
|
+
program = injectInfrastructureCommands(program, userLog);
|
|
52
51
|
program = injectL1Commands(program, userLog, debugLogger);
|
|
53
|
-
program =
|
|
52
|
+
program = injectAztecNodeCommands(program, userLog, debugLogger);
|
|
54
53
|
program = injectMiscCommands(program, userLog);
|
|
55
|
-
program = injectWalletCommands(program, userLog, debugLogger);
|
|
56
54
|
|
|
57
55
|
await program.parseAsync(process.argv);
|
|
58
56
|
}
|
|
@@ -5,7 +5,7 @@ import {
|
|
|
5
5
|
} from '@aztec/foundation/json-rpc/server';
|
|
6
6
|
import type { LogFn, Logger } from '@aztec/foundation/log';
|
|
7
7
|
import type { ChainConfig } from '@aztec/stdlib/config';
|
|
8
|
-
import { AztecNodeApiSchema
|
|
8
|
+
import { AztecNodeApiSchema } from '@aztec/stdlib/interfaces/client';
|
|
9
9
|
import { getVersioningMiddleware } from '@aztec/stdlib/versioning';
|
|
10
10
|
import { getOtelJsonRpcPropagationMiddleware } from '@aztec/telemetry-client';
|
|
11
11
|
|
|
@@ -29,12 +29,11 @@ export async function aztecStart(options: any, userLog: LogFn, debugLogger: Logg
|
|
|
29
29
|
userLog(`${splash}\n${github}\n\n`);
|
|
30
30
|
userLog(`Setting up Aztec Sandbox ${cliVersion}, please stand by...`);
|
|
31
31
|
|
|
32
|
-
const { node,
|
|
32
|
+
const { node, stop } = await createSandbox(
|
|
33
33
|
{
|
|
34
34
|
l1Mnemonic: sandboxOptions.l1Mnemonic,
|
|
35
35
|
l1RpcUrls: options.l1RpcUrls,
|
|
36
36
|
deployAztecContractsSalt: sandboxOptions.deployAztecContractsSalt,
|
|
37
|
-
noPXE: sandboxOptions.noPXE,
|
|
38
37
|
testAccounts: sandboxOptions.testAccounts,
|
|
39
38
|
realProofs: false,
|
|
40
39
|
},
|
|
@@ -44,11 +43,6 @@ export async function aztecStart(options: any, userLog: LogFn, debugLogger: Logg
|
|
|
44
43
|
// Start Node and PXE JSON-RPC server
|
|
45
44
|
signalHandlers.push(stop);
|
|
46
45
|
services.node = [node, AztecNodeApiSchema];
|
|
47
|
-
if (!sandboxOptions.noPXE) {
|
|
48
|
-
services.pxe = [pxe, PXESchema];
|
|
49
|
-
} else {
|
|
50
|
-
userLog(`Not exposing PXE API through JSON-RPC server`);
|
|
51
|
-
}
|
|
52
46
|
} else {
|
|
53
47
|
if (options.node) {
|
|
54
48
|
const { startNode } = await import('./cmds/start_node.js');
|
|
@@ -62,9 +56,6 @@ export async function aztecStart(options: any, userLog: LogFn, debugLogger: Logg
|
|
|
62
56
|
} else if (options.blobSink) {
|
|
63
57
|
const { startBlobSink } = await import('./cmds/start_blob_sink.js');
|
|
64
58
|
await startBlobSink(options, signalHandlers, userLog);
|
|
65
|
-
} else if (options.pxe) {
|
|
66
|
-
const { startPXE } = await import('./cmds/start_pxe.js');
|
|
67
|
-
({ config } = await startPXE(options, signalHandlers, services, userLog));
|
|
68
59
|
} else if (options.archiver) {
|
|
69
60
|
const { startArchiver } = await import('./cmds/start_archiver.js');
|
|
70
61
|
({ config } = await startArchiver(options, signalHandlers, services));
|
|
@@ -115,12 +115,6 @@ export const aztecStartOptions: { [key: string]: AztecStartOption[] } = {
|
|
|
115
115
|
defaultValue: undefined,
|
|
116
116
|
env: undefined,
|
|
117
117
|
},
|
|
118
|
-
{
|
|
119
|
-
flag: '--sandbox.noPXE',
|
|
120
|
-
description: 'Do not expose PXE service on sandbox start',
|
|
121
|
-
env: 'NO_PXE',
|
|
122
|
-
...booleanConfigHelper(),
|
|
123
|
-
},
|
|
124
118
|
{
|
|
125
119
|
flag: '--sandbox.l1Mnemonic <value>',
|
|
126
120
|
description: 'Mnemonic for L1 accounts. Will be used ',
|
|
@@ -146,7 +140,7 @@ export const aztecStartOptions: { [key: string]: AztecStartOption[] } = {
|
|
|
146
140
|
},
|
|
147
141
|
{
|
|
148
142
|
flag: '--admin-port <value>',
|
|
149
|
-
description: 'Port to run admin APIs of Aztec Services on
|
|
143
|
+
description: 'Port to run admin APIs of Aztec Services on',
|
|
150
144
|
defaultValue: 8880,
|
|
151
145
|
env: 'AZTEC_ADMIN_PORT',
|
|
152
146
|
parseVal: val => parseInt(val, 10),
|
|
@@ -172,7 +166,7 @@ export const aztecStartOptions: { [key: string]: AztecStartOption[] } = {
|
|
|
172
166
|
],
|
|
173
167
|
STORAGE: [
|
|
174
168
|
configToFlag('--data-directory', dataConfigMappings.dataDirectory),
|
|
175
|
-
configToFlag('--data-store-map-size-kb', dataConfigMappings.
|
|
169
|
+
configToFlag('--data-store-map-size-kb', dataConfigMappings.dataStoreMapSizeKb),
|
|
176
170
|
],
|
|
177
171
|
'WORLD STATE': [
|
|
178
172
|
configToFlag('--world-state-data-directory', worldStateConfigMappings.worldStateDataDirectory),
|
|
@@ -5,7 +5,7 @@ import {
|
|
|
5
5
|
archiverConfigMappings,
|
|
6
6
|
getArchiverConfigFromEnv,
|
|
7
7
|
} from '@aztec/archiver';
|
|
8
|
-
import { createLogger } from '@aztec/aztec.js';
|
|
8
|
+
import { createLogger } from '@aztec/aztec.js/log';
|
|
9
9
|
import { type BlobSinkConfig, blobSinkConfigMapping, createBlobSinkClient } from '@aztec/blob-sink/client';
|
|
10
10
|
import { getL1Config } from '@aztec/cli/config';
|
|
11
11
|
import type { NamespacedApiHandlers } from '@aztec/foundation/json-rpc/server';
|
|
@@ -32,7 +32,7 @@ export async function startArchiver(
|
|
|
32
32
|
);
|
|
33
33
|
|
|
34
34
|
let archiverConfig = { ...envConfig, ...cliOptions };
|
|
35
|
-
archiverConfig.
|
|
35
|
+
archiverConfig.dataStoreMapSizeKb = archiverConfig.archiverStoreMapSizeKb ?? archiverConfig.dataStoreMapSizeKb;
|
|
36
36
|
|
|
37
37
|
if (!archiverConfig.l1Contracts.registryAddress || archiverConfig.l1Contracts.registryAddress.isZero()) {
|
|
38
38
|
throw new Error('L1 registry address is required to start an Archiver');
|
|
@@ -1,13 +1,16 @@
|
|
|
1
|
-
import { type BotConfig, BotRunner, botConfigMappings, getBotRunnerApiHandler } from '@aztec/bot';
|
|
1
|
+
import { type BotConfig, BotRunner, BotStore, botConfigMappings, getBotRunnerApiHandler } from '@aztec/bot';
|
|
2
2
|
import type { NamespacedApiHandlers } from '@aztec/foundation/json-rpc/server';
|
|
3
3
|
import type { LogFn } from '@aztec/foundation/log';
|
|
4
|
-
import {
|
|
4
|
+
import { createStore, openTmpStore } from '@aztec/kv-store/lmdb-v2';
|
|
5
|
+
import { type CliPXEOptions, type PXEConfig, allPxeConfigMappings } from '@aztec/pxe/config';
|
|
6
|
+
import { type AztecNode, type AztecNodeAdmin, createAztecNodeClient } from '@aztec/stdlib/interfaces/client';
|
|
5
7
|
import type { TelemetryClient } from '@aztec/telemetry-client';
|
|
6
8
|
import {
|
|
7
9
|
getConfigEnvVars as getTelemetryClientConfig,
|
|
8
10
|
initTelemetryClient,
|
|
9
11
|
makeTracedFetch,
|
|
10
12
|
} from '@aztec/telemetry-client';
|
|
13
|
+
import { TestWallet } from '@aztec/test-wallet/server';
|
|
11
14
|
|
|
12
15
|
import { extractRelevantOptions } from '../util.js';
|
|
13
16
|
import { getVersions } from '../versioning.js';
|
|
@@ -32,28 +35,34 @@ export async function startBot(
|
|
|
32
35
|
throw new Error('The bot requires access to a Node');
|
|
33
36
|
}
|
|
34
37
|
|
|
35
|
-
const
|
|
38
|
+
const aztecNode = createAztecNodeClient(config.nodeUrl, getVersions(), fetch);
|
|
36
39
|
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
if (options.pxe) {
|
|
40
|
-
const { addPXE } = await import('./start_pxe.js');
|
|
41
|
-
({ pxe } = await addPXE(options, signalHandlers, services, userLog, { node }));
|
|
42
|
-
}
|
|
40
|
+
const pxeConfig = extractRelevantOptions<PXEConfig & CliPXEOptions>(options, allPxeConfigMappings, 'pxe');
|
|
41
|
+
const wallet = await TestWallet.create(aztecNode, pxeConfig);
|
|
43
42
|
|
|
44
43
|
const telemetry = initTelemetryClient(getTelemetryClientConfig());
|
|
45
|
-
await addBot(options, signalHandlers, services,
|
|
44
|
+
await addBot(options, signalHandlers, services, wallet, aztecNode, telemetry, undefined);
|
|
46
45
|
}
|
|
47
46
|
|
|
48
|
-
export function addBot(
|
|
47
|
+
export async function addBot(
|
|
49
48
|
options: any,
|
|
50
49
|
signalHandlers: (() => Promise<void>)[],
|
|
51
50
|
services: NamespacedApiHandlers,
|
|
52
|
-
|
|
51
|
+
wallet: TestWallet,
|
|
52
|
+
aztecNode: AztecNode,
|
|
53
|
+
telemetry: TelemetryClient,
|
|
54
|
+
aztecNodeAdmin?: AztecNodeAdmin,
|
|
53
55
|
) {
|
|
54
56
|
const config = extractRelevantOptions<BotConfig>(options, botConfigMappings, 'bot');
|
|
55
57
|
|
|
56
|
-
const
|
|
58
|
+
const db = await (config.dataDirectory
|
|
59
|
+
? createStore('bot', BotStore.SCHEMA_VERSION, config)
|
|
60
|
+
: openTmpStore('bot', true, config.dataStoreMapSizeKb));
|
|
61
|
+
|
|
62
|
+
const store = new BotStore(db);
|
|
63
|
+
await store.cleanupOldClaims();
|
|
64
|
+
|
|
65
|
+
const botRunner = new BotRunner(config, wallet, aztecNode, telemetry, aztecNodeAdmin, store);
|
|
57
66
|
if (!config.noStart) {
|
|
58
67
|
void botRunner.start(); // Do not block since bot setup takes time
|
|
59
68
|
}
|