@aztec/cli 3.0.0-nightly.20250918 → 3.0.0-nightly.20250920
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/cmds/aztec_node/block_number.d.ts +3 -0
- package/dest/cmds/aztec_node/block_number.d.ts.map +1 -0
- package/dest/cmds/aztec_node/block_number.js +10 -0
- package/dest/cmds/aztec_node/get_block.d.ts +3 -0
- package/dest/cmds/aztec_node/get_block.d.ts.map +1 -0
- package/dest/cmds/aztec_node/get_block.js +10 -0
- package/dest/cmds/aztec_node/get_current_base_fee.d.ts +3 -0
- package/dest/cmds/aztec_node/get_current_base_fee.d.ts.map +1 -0
- package/dest/cmds/aztec_node/get_current_base_fee.js +7 -0
- package/dest/cmds/aztec_node/get_l1_to_l2_message_witness.d.ts +4 -0
- package/dest/cmds/aztec_node/get_l1_to_l2_message_witness.d.ts.map +1 -0
- package/dest/cmds/aztec_node/get_l1_to_l2_message_witness.js +12 -0
- package/dest/cmds/{pxe → aztec_node}/get_logs.d.ts +2 -2
- package/dest/cmds/aztec_node/get_logs.d.ts.map +1 -0
- package/dest/cmds/{pxe → aztec_node}/get_logs.js +4 -4
- package/dest/cmds/aztec_node/get_node_info.d.ts +3 -0
- package/dest/cmds/aztec_node/get_node_info.d.ts.map +1 -0
- package/dest/cmds/{pxe → aztec_node}/get_node_info.js +3 -8
- package/dest/cmds/aztec_node/index.d.ts +4 -0
- package/dest/cmds/aztec_node/index.d.ts.map +1 -0
- package/dest/cmds/aztec_node/index.js +28 -0
- package/dest/cmds/devnet/bootstrap_network.d.ts +1 -1
- package/dest/cmds/devnet/bootstrap_network.d.ts.map +1 -1
- package/dest/cmds/devnet/bootstrap_network.js +13 -12
- package/dest/cmds/devnet/index.d.ts.map +1 -1
- package/dest/cmds/devnet/index.js +3 -3
- package/dest/cmds/infrastructure/index.d.ts +2 -2
- package/dest/cmds/infrastructure/index.d.ts.map +1 -1
- package/dest/cmds/infrastructure/index.js +7 -8
- package/dest/cmds/infrastructure/sequencers.d.ts +2 -3
- package/dest/cmds/infrastructure/sequencers.d.ts.map +1 -1
- package/dest/cmds/infrastructure/sequencers.js +3 -3
- package/dest/cmds/infrastructure/setup_l2_contract.d.ts +1 -1
- package/dest/cmds/infrastructure/setup_l2_contract.d.ts.map +1 -1
- package/dest/cmds/infrastructure/setup_l2_contract.js +5 -4
- package/dest/cmds/l1/advance_epoch.d.ts +1 -1
- package/dest/cmds/l1/advance_epoch.d.ts.map +1 -1
- package/dest/cmds/l1/advance_epoch.js +4 -4
- package/dest/cmds/l1/assume_proven_through.d.ts +1 -1
- package/dest/cmds/l1/assume_proven_through.d.ts.map +1 -1
- package/dest/cmds/l1/assume_proven_through.js +5 -5
- package/dest/cmds/l1/deploy_l1_contracts.d.ts +1 -1
- package/dest/cmds/l1/deploy_l1_contracts.d.ts.map +1 -1
- package/dest/cmds/l1/deploy_l1_contracts.js +2 -2
- package/dest/cmds/l1/index.d.ts.map +1 -1
- package/dest/cmds/l1/index.js +5 -5
- package/dest/cmds/pxe/index.d.ts.map +1 -1
- package/dest/cmds/pxe/index.js +1 -31
- package/dest/config/chain_l2_config.js +3 -3
- package/dest/utils/aztec.d.ts +2 -8
- package/dest/utils/aztec.d.ts.map +1 -1
- package/dest/utils/aztec.js +2 -27
- package/dest/utils/commands.d.ts +2 -0
- package/dest/utils/commands.d.ts.map +1 -1
- package/dest/utils/commands.js +2 -0
- package/dest/utils/inspect.d.ts +3 -3
- package/dest/utils/inspect.d.ts.map +1 -1
- package/dest/utils/inspect.js +6 -6
- package/package.json +25 -24
- package/src/cmds/aztec_node/block_number.ts +9 -0
- package/src/cmds/aztec_node/get_block.ts +17 -0
- package/src/cmds/aztec_node/get_current_base_fee.ts +9 -0
- package/src/cmds/aztec_node/get_l1_to_l2_message_witness.ts +25 -0
- package/src/cmds/{pxe → aztec_node}/get_logs.ts +5 -6
- package/src/cmds/{pxe → aztec_node}/get_node_info.ts +5 -16
- package/src/cmds/aztec_node/index.ts +89 -0
- package/src/cmds/devnet/bootstrap_network.ts +19 -11
- package/src/cmds/devnet/index.ts +3 -1
- package/src/cmds/infrastructure/index.ts +14 -7
- package/src/cmds/infrastructure/sequencers.ts +5 -6
- package/src/cmds/infrastructure/setup_l2_contract.ts +13 -4
- package/src/cmds/l1/advance_epoch.ts +4 -4
- package/src/cmds/l1/assume_proven_through.ts +5 -5
- package/src/cmds/l1/deploy_l1_contracts.ts +0 -2
- package/src/cmds/l1/index.ts +3 -4
- package/src/cmds/pxe/index.ts +0 -82
- package/src/config/chain_l2_config.ts +3 -3
- package/src/utils/aztec.ts +1 -39
- package/src/utils/commands.ts +8 -0
- package/src/utils/inspect.ts +12 -5
- package/dest/cmds/pxe/block_number.d.ts +0 -3
- package/dest/cmds/pxe/block_number.d.ts.map +0 -1
- package/dest/cmds/pxe/block_number.js +0 -10
- package/dest/cmds/pxe/get_block.d.ts +0 -3
- package/dest/cmds/pxe/get_block.d.ts.map +0 -1
- package/dest/cmds/pxe/get_block.js +0 -9
- package/dest/cmds/pxe/get_current_base_fee.d.ts +0 -3
- package/dest/cmds/pxe/get_current_base_fee.d.ts.map +0 -1
- package/dest/cmds/pxe/get_current_base_fee.js +0 -7
- package/dest/cmds/pxe/get_l1_to_l2_message_witness.d.ts +0 -4
- package/dest/cmds/pxe/get_l1_to_l2_message_witness.d.ts.map +0 -1
- package/dest/cmds/pxe/get_l1_to_l2_message_witness.js +0 -11
- package/dest/cmds/pxe/get_logs.d.ts.map +0 -1
- package/dest/cmds/pxe/get_node_info.d.ts +0 -3
- package/dest/cmds/pxe/get_node_info.d.ts.map +0 -1
- package/src/cmds/pxe/block_number.ts +0 -9
- package/src/cmds/pxe/get_block.ts +0 -10
- package/src/cmds/pxe/get_current_base_fee.ts +0 -9
- package/src/cmds/pxe/get_l1_to_l2_message_witness.ts +0 -25
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
import { getInitialTestAccountsData } from '@aztec/accounts/testing';
|
|
2
2
|
import {
|
|
3
3
|
AztecAddress,
|
|
4
|
+
type AztecNode,
|
|
4
5
|
BatchCall,
|
|
5
6
|
EthAddress,
|
|
6
7
|
Fr,
|
|
7
8
|
L1FeeJuicePortalManager,
|
|
8
|
-
type PXE,
|
|
9
9
|
type WaitForProvenOpts,
|
|
10
10
|
type WaitOpts,
|
|
11
11
|
type Wallet,
|
|
12
|
+
createAztecNodeClient,
|
|
12
13
|
createCompatibleClient,
|
|
13
14
|
retryUntil,
|
|
14
15
|
waitForProven,
|
|
@@ -44,6 +45,7 @@ const provenWaitOpts: WaitForProvenOpts = {
|
|
|
44
45
|
|
|
45
46
|
export async function bootstrapNetwork(
|
|
46
47
|
pxeUrl: string,
|
|
48
|
+
nodeUrl: string,
|
|
47
49
|
l1Urls: string[],
|
|
48
50
|
l1ChainId: string,
|
|
49
51
|
l1PrivateKey: `0x${string}` | undefined,
|
|
@@ -54,7 +56,8 @@ export async function bootstrapNetwork(
|
|
|
54
56
|
debugLog: Logger,
|
|
55
57
|
) {
|
|
56
58
|
const pxe = await createCompatibleClient(pxeUrl, debugLog);
|
|
57
|
-
const
|
|
59
|
+
const node = createAztecNodeClient(nodeUrl);
|
|
60
|
+
const wallet = new TestWallet(pxe, node);
|
|
58
61
|
|
|
59
62
|
// We assume here that the initial test accounts were prefunded with deploy-l1-contracts, and deployed with setup-l2-contracts
|
|
60
63
|
// so all we need to do is register them to our pxe.
|
|
@@ -81,14 +84,14 @@ export async function bootstrapNetwork(
|
|
|
81
84
|
|
|
82
85
|
const { token, bridge } = await deployToken(wallet, defaultAccountAddress, portalAddress);
|
|
83
86
|
|
|
84
|
-
await initPortal(
|
|
87
|
+
await initPortal(node, l1Client, erc20Address, portalAddress, bridge.address);
|
|
85
88
|
|
|
86
89
|
const fpcAdmin = defaultAccountAddress;
|
|
87
90
|
const fpc = await deployFPC(wallet, defaultAccountAddress, token.address, fpcAdmin);
|
|
88
91
|
|
|
89
92
|
const counter = await deployCounter(wallet, defaultAccountAddress);
|
|
90
93
|
|
|
91
|
-
await fundFPC(
|
|
94
|
+
await fundFPC(node, counter.address, wallet, defaultAccountAddress, l1Client, fpc.address, debugLog);
|
|
92
95
|
|
|
93
96
|
if (json) {
|
|
94
97
|
log(
|
|
@@ -215,7 +218,7 @@ async function deployToken(
|
|
|
215
218
|
* Step 3. Initialize DevCoin's L1 portal
|
|
216
219
|
*/
|
|
217
220
|
async function initPortal(
|
|
218
|
-
|
|
221
|
+
aztecNode: AztecNode,
|
|
219
222
|
l1Client: ExtendedViemWalletClient,
|
|
220
223
|
erc20: EthAddress,
|
|
221
224
|
portal: EthAddress,
|
|
@@ -224,7 +227,7 @@ async function initPortal(
|
|
|
224
227
|
const { TokenPortalAbi } = await import('@aztec/l1-artifacts');
|
|
225
228
|
const {
|
|
226
229
|
l1ContractAddresses: { registryAddress },
|
|
227
|
-
} = await
|
|
230
|
+
} = await aztecNode.getNodeInfo();
|
|
228
231
|
|
|
229
232
|
const contract = getContract({
|
|
230
233
|
abi: TokenPortalAbi,
|
|
@@ -274,7 +277,7 @@ async function deployCounter(wallet: Wallet, defaultAccountAddress: AztecAddress
|
|
|
274
277
|
|
|
275
278
|
// NOTE: Disabling for now in order to get devnet running
|
|
276
279
|
async function fundFPC(
|
|
277
|
-
|
|
280
|
+
node: AztecNode,
|
|
278
281
|
counterAddress: AztecAddress,
|
|
279
282
|
wallet: Wallet,
|
|
280
283
|
defaultAccountAddress: AztecAddress,
|
|
@@ -290,11 +293,11 @@ async function fundFPC(
|
|
|
290
293
|
const { CounterContract } = await import('@aztec/noir-test-contracts.js/Counter');
|
|
291
294
|
const {
|
|
292
295
|
protocolContractAddresses: { feeJuice },
|
|
293
|
-
} = await
|
|
296
|
+
} = await node.getNodeInfo();
|
|
294
297
|
|
|
295
298
|
const feeJuiceContract = await FeeJuiceContract.at(feeJuice, wallet);
|
|
296
299
|
|
|
297
|
-
const feeJuicePortal = await L1FeeJuicePortalManager.new(
|
|
300
|
+
const feeJuicePortal = await L1FeeJuicePortalManager.new(node, l1Client, debugLog);
|
|
298
301
|
|
|
299
302
|
const { claimAmount, claimSecret, messageLeafIndex, messageHash } = await feeJuicePortal.bridgeTokensPublic(
|
|
300
303
|
fpcAddress,
|
|
@@ -302,7 +305,12 @@ async function fundFPC(
|
|
|
302
305
|
true,
|
|
303
306
|
);
|
|
304
307
|
|
|
305
|
-
await retryUntil(
|
|
308
|
+
await retryUntil(
|
|
309
|
+
async () => (await node.getL1ToL2MessageBlock(Fr.fromHexString(messageHash))) !== undefined,
|
|
310
|
+
'message sync',
|
|
311
|
+
600,
|
|
312
|
+
1,
|
|
313
|
+
);
|
|
306
314
|
|
|
307
315
|
const counter = await CounterContract.at(counterAddress, wallet);
|
|
308
316
|
|
|
@@ -320,7 +328,7 @@ async function fundFPC(
|
|
|
320
328
|
.send({ from: defaultAccountAddress })
|
|
321
329
|
.wait({ ...waitOpts });
|
|
322
330
|
|
|
323
|
-
await waitForProven(
|
|
331
|
+
await waitForProven(node, receipt, provenWaitOpts);
|
|
324
332
|
|
|
325
333
|
debugLog.info('Finished claiming FPC');
|
|
326
334
|
}
|
package/src/cmds/devnet/index.ts
CHANGED
|
@@ -2,13 +2,14 @@ import type { LogFn, Logger } from '@aztec/foundation/log';
|
|
|
2
2
|
|
|
3
3
|
import type { Command } from 'commander';
|
|
4
4
|
|
|
5
|
-
import { ETHEREUM_HOSTS, l1ChainIdOption, parseEthereumAddress, pxeOption } from '../../utils/commands.js';
|
|
5
|
+
import { ETHEREUM_HOSTS, l1ChainIdOption, nodeOption, parseEthereumAddress, pxeOption } from '../../utils/commands.js';
|
|
6
6
|
|
|
7
7
|
export function injectCommands(program: Command, log: LogFn, debugLogger: Logger) {
|
|
8
8
|
program
|
|
9
9
|
.command('bootstrap-network')
|
|
10
10
|
.description('Bootstrap a new network')
|
|
11
11
|
.addOption(pxeOption)
|
|
12
|
+
.addOption(nodeOption)
|
|
12
13
|
.addOption(l1ChainIdOption)
|
|
13
14
|
.requiredOption<string[]>(
|
|
14
15
|
'--l1-rpc-urls <string>',
|
|
@@ -33,6 +34,7 @@ export function injectCommands(program: Command, log: LogFn, debugLogger: Logger
|
|
|
33
34
|
const { bootstrapNetwork } = await import('./bootstrap_network.js');
|
|
34
35
|
await bootstrapNetwork(
|
|
35
36
|
options[pxeOption.attributeName()],
|
|
37
|
+
options[nodeOption.attributeName()],
|
|
36
38
|
options.l1RpcUrls,
|
|
37
39
|
options[l1ChainIdOption.attributeName()],
|
|
38
40
|
options.l1PrivateKey,
|
|
@@ -1,20 +1,28 @@
|
|
|
1
|
-
import type { LogFn
|
|
1
|
+
import type { LogFn } from '@aztec/foundation/log';
|
|
2
2
|
|
|
3
3
|
import type { Command } from 'commander';
|
|
4
4
|
|
|
5
|
-
import { ETHEREUM_HOSTS, l1ChainIdOption, parseOptionalInteger, pxeOption } from '../../utils/commands.js';
|
|
5
|
+
import { ETHEREUM_HOSTS, l1ChainIdOption, nodeOption, parseOptionalInteger, pxeOption } from '../../utils/commands.js';
|
|
6
6
|
|
|
7
|
-
export function injectCommands(program: Command, log: LogFn
|
|
7
|
+
export function injectCommands(program: Command, log: LogFn) {
|
|
8
8
|
program
|
|
9
9
|
.command('setup-protocol-contracts')
|
|
10
10
|
.description('Bootstrap the blockchain by initializing all the protocol contracts')
|
|
11
11
|
.addOption(pxeOption)
|
|
12
|
+
.addOption(nodeOption)
|
|
12
13
|
.option('--testAccounts', 'Deploy funded test accounts.')
|
|
13
14
|
.option('--sponsoredFPC', 'Deploy a sponsored FPC.')
|
|
14
15
|
.option('--json', 'Output the contract addresses in JSON format')
|
|
15
16
|
.action(async options => {
|
|
16
17
|
const { setupL2Contracts } = await import('./setup_l2_contract.js');
|
|
17
|
-
await setupL2Contracts(
|
|
18
|
+
await setupL2Contracts(
|
|
19
|
+
options.rpcUrl,
|
|
20
|
+
options.nodeUrl,
|
|
21
|
+
options.testAccounts,
|
|
22
|
+
options.sponsoredFPC,
|
|
23
|
+
options.json,
|
|
24
|
+
log,
|
|
25
|
+
);
|
|
18
26
|
});
|
|
19
27
|
|
|
20
28
|
program
|
|
@@ -34,7 +42,7 @@ export function injectCommands(program: Command, log: LogFn, debugLogger: Logger
|
|
|
34
42
|
'test test test test test test test test test test test junk',
|
|
35
43
|
)
|
|
36
44
|
.option('--block-number <number>', 'Block number to query next sequencer for', parseOptionalInteger)
|
|
37
|
-
.addOption(
|
|
45
|
+
.addOption(nodeOption)
|
|
38
46
|
.addOption(l1ChainIdOption)
|
|
39
47
|
.action(async (command, who, options) => {
|
|
40
48
|
const { sequencers } = await import('./sequencers.js');
|
|
@@ -42,12 +50,11 @@ export function injectCommands(program: Command, log: LogFn, debugLogger: Logger
|
|
|
42
50
|
command: command,
|
|
43
51
|
who,
|
|
44
52
|
mnemonic: options.mnemonic,
|
|
45
|
-
|
|
53
|
+
nodeUrl: options.nodeUrl,
|
|
46
54
|
l1RpcUrls: options.l1RpcUrls,
|
|
47
55
|
chainId: options.l1ChainId,
|
|
48
56
|
blockNumber: options.blockNumber,
|
|
49
57
|
log,
|
|
50
|
-
debugLogger,
|
|
51
58
|
});
|
|
52
59
|
});
|
|
53
60
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Fr,
|
|
1
|
+
import { Fr, createAztecNodeClient } from '@aztec/aztec.js';
|
|
2
2
|
import { GSEContract, RollupContract, createEthereumChain, getL1ContractsConfigEnvVars } from '@aztec/ethereum';
|
|
3
|
-
import type { LogFn
|
|
3
|
+
import type { LogFn } from '@aztec/foundation/log';
|
|
4
4
|
import { RollupAbi, TestERC20Abi } from '@aztec/l1-artifacts';
|
|
5
5
|
|
|
6
6
|
import { createPublicClient, createWalletClient, fallback, getContract, http } from 'viem';
|
|
@@ -11,15 +11,14 @@ export async function sequencers(opts: {
|
|
|
11
11
|
who?: string;
|
|
12
12
|
mnemonic?: string;
|
|
13
13
|
bn254SecretKey?: bigint;
|
|
14
|
-
|
|
14
|
+
nodeUrl: string;
|
|
15
15
|
l1RpcUrls: string[];
|
|
16
16
|
chainId: number;
|
|
17
17
|
blockNumber?: number;
|
|
18
18
|
log: LogFn;
|
|
19
|
-
debugLogger: Logger;
|
|
20
19
|
}) {
|
|
21
|
-
const { command, who: maybeWho, mnemonic, bn254SecretKey,
|
|
22
|
-
const client =
|
|
20
|
+
const { command, who: maybeWho, mnemonic, bn254SecretKey, nodeUrl, l1RpcUrls, chainId, log } = opts;
|
|
21
|
+
const client = createAztecNodeClient(nodeUrl);
|
|
23
22
|
const { l1ContractAddresses } = await client.getNodeInfo();
|
|
24
23
|
|
|
25
24
|
const chain = createEthereumChain(l1RpcUrls, chainId);
|
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
import { getInitialTestAccountsData } from '@aztec/accounts/testing';
|
|
2
|
-
import {
|
|
2
|
+
import {
|
|
3
|
+
AccountManager,
|
|
4
|
+
type AztecAddress,
|
|
5
|
+
type WaitOpts,
|
|
6
|
+
createAztecNodeClient,
|
|
7
|
+
createPXEClient,
|
|
8
|
+
makeFetch,
|
|
9
|
+
} from '@aztec/aztec.js';
|
|
3
10
|
import { jsonStringify } from '@aztec/foundation/json-rpc';
|
|
4
11
|
import type { LogFn } from '@aztec/foundation/log';
|
|
5
12
|
import { ProtocolContractAddress } from '@aztec/protocol-contracts';
|
|
@@ -8,7 +15,8 @@ import { TestWallet, deployFundedSchnorrAccounts } from '@aztec/test-wallet';
|
|
|
8
15
|
import { setupSponsoredFPC } from '../../utils/setup_contracts.js';
|
|
9
16
|
|
|
10
17
|
export async function setupL2Contracts(
|
|
11
|
-
|
|
18
|
+
pxeUrl: string,
|
|
19
|
+
nodeUrl: string,
|
|
12
20
|
testAccounts: boolean,
|
|
13
21
|
sponsoredFPC: boolean,
|
|
14
22
|
json: boolean,
|
|
@@ -20,8 +28,9 @@ export async function setupL2Contracts(
|
|
|
20
28
|
};
|
|
21
29
|
log('setupL2Contracts: Wait options' + jsonStringify(waitOpts));
|
|
22
30
|
log('setupL2Contracts: Creating PXE client...');
|
|
23
|
-
const pxe = createPXEClient(
|
|
24
|
-
const
|
|
31
|
+
const pxe = createPXEClient(pxeUrl, {}, makeFetch([1, 1, 1, 1, 1], false));
|
|
32
|
+
const node = createAztecNodeClient(nodeUrl);
|
|
33
|
+
const wallet = new TestWallet(pxe, node);
|
|
25
34
|
|
|
26
35
|
let deployedAccountManagers: AccountManager[] = [];
|
|
27
36
|
if (testAccounts) {
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { createAztecNodeClient } from '@aztec/aztec.js';
|
|
2
2
|
import { RollupCheatCodes } from '@aztec/ethereum/test';
|
|
3
3
|
import type { LogFn } from '@aztec/foundation/log';
|
|
4
4
|
|
|
5
|
-
export async function advanceEpoch(l1RpcUrls: string[],
|
|
6
|
-
const
|
|
7
|
-
const rollupAddress = await
|
|
5
|
+
export async function advanceEpoch(l1RpcUrls: string[], nodeUrl: string, log: LogFn) {
|
|
6
|
+
const aztecNode = createAztecNodeClient(nodeUrl);
|
|
7
|
+
const rollupAddress = await aztecNode.getNodeInfo().then(i => i.l1ContractAddresses.rollupAddress);
|
|
8
8
|
|
|
9
9
|
const cheat = RollupCheatCodes.create(l1RpcUrls, { rollupAddress });
|
|
10
10
|
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { createAztecNodeClient } from '@aztec/aztec.js';
|
|
2
2
|
import { RollupCheatCodes } from '@aztec/ethereum/test';
|
|
3
3
|
import type { LogFn } from '@aztec/foundation/log';
|
|
4
4
|
|
|
5
5
|
export async function assumeProvenThrough(
|
|
6
6
|
blockNumberOrLatest: number | undefined,
|
|
7
7
|
l1RpcUrls: string[],
|
|
8
|
-
|
|
8
|
+
nodeUrl: string,
|
|
9
9
|
log: LogFn,
|
|
10
10
|
) {
|
|
11
|
-
const
|
|
12
|
-
const rollupAddress = await
|
|
13
|
-
const blockNumber = blockNumberOrLatest ?? (await
|
|
11
|
+
const aztecNode = createAztecNodeClient(nodeUrl);
|
|
12
|
+
const rollupAddress = await aztecNode.getNodeInfo().then(i => i.l1ContractAddresses.rollupAddress);
|
|
13
|
+
const blockNumber = blockNumberOrLatest ?? (await aztecNode.getBlockNumber());
|
|
14
14
|
|
|
15
15
|
const rollupCheatCodes = RollupCheatCodes.create(l1RpcUrls, { rollupAddress });
|
|
16
16
|
|
|
@@ -22,7 +22,6 @@ export async function deployL1Contracts(
|
|
|
22
22
|
createVerificationJson: string | false,
|
|
23
23
|
initialValidators: EthAddress[],
|
|
24
24
|
realVerifier: boolean,
|
|
25
|
-
flushEntryQueue: boolean,
|
|
26
25
|
log: LogFn,
|
|
27
26
|
debugLogger: Logger,
|
|
28
27
|
) {
|
|
@@ -53,7 +52,6 @@ export async function deployL1Contracts(
|
|
|
53
52
|
config,
|
|
54
53
|
realVerifier,
|
|
55
54
|
createVerificationJson,
|
|
56
|
-
flushEntryQueue,
|
|
57
55
|
debugLogger,
|
|
58
56
|
);
|
|
59
57
|
|
package/src/cmds/l1/index.ts
CHANGED
|
@@ -9,6 +9,7 @@ import {
|
|
|
9
9
|
MNEMONIC,
|
|
10
10
|
PRIVATE_KEY,
|
|
11
11
|
l1ChainIdOption,
|
|
12
|
+
nodeOption,
|
|
12
13
|
parseAztecAddress,
|
|
13
14
|
parseBigint,
|
|
14
15
|
parseEthereumAddress,
|
|
@@ -48,7 +49,6 @@ export function injectCommands(program: Command, log: LogFn, debugLogger: Logger
|
|
|
48
49
|
.option('--sponsored-fpc', 'Populate genesis state with a testing sponsored FPC contract')
|
|
49
50
|
.option('--accelerated-test-deployments', 'Fire and forget deployment transactions, use in testing only', false)
|
|
50
51
|
.option('--real-verifier', 'Deploy the real verifier', false)
|
|
51
|
-
.option('--flush-entry-queue', 'Whether to flush the entry queue after adding initial validators', false)
|
|
52
52
|
.option('--create-verification-json [path]', 'Create JSON file for etherscan contract verification', false)
|
|
53
53
|
.action(async options => {
|
|
54
54
|
const { deployL1Contracts } = await import('./deploy_l1_contracts.js');
|
|
@@ -69,7 +69,6 @@ export function injectCommands(program: Command, log: LogFn, debugLogger: Logger
|
|
|
69
69
|
options.createVerificationJson,
|
|
70
70
|
initialValidators,
|
|
71
71
|
options.realVerifier,
|
|
72
|
-
options.flushEntryQueue,
|
|
73
72
|
log,
|
|
74
73
|
debugLogger,
|
|
75
74
|
);
|
|
@@ -509,10 +508,10 @@ export function injectCommands(program: Command, log: LogFn, debugLogger: Logger
|
|
|
509
508
|
)
|
|
510
509
|
.argument('[blockNumber]', 'The target block number, defaults to the latest pending block number.', parseBigint)
|
|
511
510
|
.addOption(l1RpcUrlsOption)
|
|
512
|
-
.addOption(
|
|
511
|
+
.addOption(nodeOption)
|
|
513
512
|
.action(async (blockNumber, options) => {
|
|
514
513
|
const { assumeProvenThrough } = await import('./assume_proven_through.js');
|
|
515
|
-
await assumeProvenThrough(blockNumber, options.l1RpcUrls, options.
|
|
514
|
+
await assumeProvenThrough(blockNumber, options.l1RpcUrls, options.nodeUrl, log);
|
|
516
515
|
});
|
|
517
516
|
|
|
518
517
|
program
|
package/src/cmds/pxe/index.ts
CHANGED
|
@@ -5,15 +5,9 @@ import type { Command } from 'commander';
|
|
|
5
5
|
|
|
6
6
|
import {
|
|
7
7
|
logJson,
|
|
8
|
-
makePxeOption,
|
|
9
8
|
parseAztecAddress,
|
|
10
9
|
parseEthereumAddress,
|
|
11
|
-
parseField,
|
|
12
10
|
parseFieldFromHexString,
|
|
13
|
-
parseOptionalAztecAddress,
|
|
14
|
-
parseOptionalInteger,
|
|
15
|
-
parseOptionalLogId,
|
|
16
|
-
parseOptionalTxHash,
|
|
17
11
|
parsePublicKey,
|
|
18
12
|
pxeOption,
|
|
19
13
|
} from '../../utils/commands.js';
|
|
@@ -50,25 +44,6 @@ export function injectCommands(program: Command, log: LogFn, debugLogger: Logger
|
|
|
50
44
|
);
|
|
51
45
|
});
|
|
52
46
|
|
|
53
|
-
program
|
|
54
|
-
.command('get-block')
|
|
55
|
-
.description('Gets info for a given block or latest.')
|
|
56
|
-
.argument('[blockNumber]', 'Block height', parseOptionalInteger)
|
|
57
|
-
.addOption(pxeOption)
|
|
58
|
-
.action(async (blockNumber, options) => {
|
|
59
|
-
const { getBlock } = await import('./get_block.js');
|
|
60
|
-
await getBlock(options.rpcUrl, blockNumber, debugLogger, log);
|
|
61
|
-
});
|
|
62
|
-
|
|
63
|
-
program
|
|
64
|
-
.command('get-current-base-fee')
|
|
65
|
-
.description('Gets the current base fee.')
|
|
66
|
-
.addOption(pxeOption)
|
|
67
|
-
.action(async options => {
|
|
68
|
-
const { getCurrentBaseFee } = await import('./get_current_base_fee.js');
|
|
69
|
-
await getCurrentBaseFee(options.rpcUrl, debugLogger, log);
|
|
70
|
-
});
|
|
71
|
-
|
|
72
47
|
program
|
|
73
48
|
.command('get-contract-data')
|
|
74
49
|
.description('Gets information about the Aztec contract deployed at the specified address.')
|
|
@@ -80,25 +55,6 @@ export function injectCommands(program: Command, log: LogFn, debugLogger: Logger
|
|
|
80
55
|
await getContractData(options.rpcUrl, contractAddress, options.includeBytecode, debugLogger, log);
|
|
81
56
|
});
|
|
82
57
|
|
|
83
|
-
program
|
|
84
|
-
.command('get-logs')
|
|
85
|
-
.description('Gets all the public logs from an intersection of all the filter params.')
|
|
86
|
-
.option('-tx, --tx-hash <txHash>', 'A transaction hash to get the receipt for.', parseOptionalTxHash)
|
|
87
|
-
.option(
|
|
88
|
-
'-fb, --from-block <blockNum>',
|
|
89
|
-
'Initial block number for getting logs (defaults to 1).',
|
|
90
|
-
parseOptionalInteger,
|
|
91
|
-
)
|
|
92
|
-
.option('-tb, --to-block <blockNum>', 'Up to which block to fetch logs (defaults to latest).', parseOptionalInteger)
|
|
93
|
-
.option('-al --after-log <logId>', 'ID of a log after which to fetch the logs.', parseOptionalLogId)
|
|
94
|
-
.option('-ca, --contract-address <address>', 'Contract address to filter logs by.', parseOptionalAztecAddress)
|
|
95
|
-
.addOption(pxeOption)
|
|
96
|
-
.option('--follow', 'If set, will keep polling for new logs until interrupted.')
|
|
97
|
-
.action(async ({ txHash, fromBlock, toBlock, afterLog, contractAddress, rpcUrl, follow }) => {
|
|
98
|
-
const { getLogs } = await import('./get_logs.js');
|
|
99
|
-
await getLogs(txHash, fromBlock, toBlock, afterLog, contractAddress, rpcUrl, follow, debugLogger, log);
|
|
100
|
-
});
|
|
101
|
-
|
|
102
58
|
program
|
|
103
59
|
.command('get-accounts')
|
|
104
60
|
.description('Gets all the Aztec accounts stored in the PXE.')
|
|
@@ -119,44 +75,6 @@ export function injectCommands(program: Command, log: LogFn, debugLogger: Logger
|
|
|
119
75
|
await getAccount(address, options.rpcUrl, debugLogger, log);
|
|
120
76
|
});
|
|
121
77
|
|
|
122
|
-
program
|
|
123
|
-
.command('block-number')
|
|
124
|
-
.description('Gets the current Aztec L2 block number.')
|
|
125
|
-
.addOption(pxeOption)
|
|
126
|
-
.action(async (options: any) => {
|
|
127
|
-
const { blockNumber } = await import('./block_number.js');
|
|
128
|
-
await blockNumber(options.rpcUrl, debugLogger, log);
|
|
129
|
-
});
|
|
130
|
-
|
|
131
|
-
program
|
|
132
|
-
.command('get-l1-to-l2-message-witness')
|
|
133
|
-
.description('Gets a L1 to L2 message witness.')
|
|
134
|
-
.requiredOption('-ca, --contract-address <address>', 'Aztec address of the contract.', parseAztecAddress)
|
|
135
|
-
.requiredOption('--message-hash <messageHash>', 'The L1 to L2 message hash.', parseField)
|
|
136
|
-
.requiredOption('--secret <secret>', 'The secret used to claim the L1 to L2 message', parseField)
|
|
137
|
-
.addOption(pxeOption)
|
|
138
|
-
.action(async ({ contractAddress, messageHash, secret, rpcUrl }) => {
|
|
139
|
-
const { getL1ToL2MessageWitness } = await import('./get_l1_to_l2_message_witness.js');
|
|
140
|
-
await getL1ToL2MessageWitness(rpcUrl, contractAddress, messageHash, secret, debugLogger, log);
|
|
141
|
-
});
|
|
142
|
-
|
|
143
|
-
program
|
|
144
|
-
.command('get-node-info')
|
|
145
|
-
.description('Gets the information of an Aztec node from a PXE or directly from an Aztec node.')
|
|
146
|
-
.option('--node-url <string>', 'URL of the node.')
|
|
147
|
-
.option('--json', 'Emit output as json')
|
|
148
|
-
.addOption(makePxeOption(false))
|
|
149
|
-
.action(async options => {
|
|
150
|
-
const { getNodeInfo } = await import('./get_node_info.js');
|
|
151
|
-
let url: string;
|
|
152
|
-
if (options.nodeUrl) {
|
|
153
|
-
url = options.nodeUrl;
|
|
154
|
-
} else {
|
|
155
|
-
url = options.rpcUrl;
|
|
156
|
-
}
|
|
157
|
-
await getNodeInfo(url, !options.nodeUrl, debugLogger, options.json, log, logJson(log));
|
|
158
|
-
});
|
|
159
|
-
|
|
160
78
|
program
|
|
161
79
|
.command('get-pxe-info')
|
|
162
80
|
.description('Gets the information of a PXE at a URL.')
|
|
@@ -76,9 +76,9 @@ export const stagingIgnitionL2ChainConfig: L2ChainConfig = {
|
|
|
76
76
|
sponsoredFPC: false,
|
|
77
77
|
p2pEnabled: true,
|
|
78
78
|
p2pBootstrapNodes: [],
|
|
79
|
-
registryAddress: '
|
|
80
|
-
slashFactoryAddress: '',
|
|
81
|
-
feeAssetHandlerAddress: '',
|
|
79
|
+
registryAddress: '0xa2ed20f46dc58e5af6035ec61d463ac85a6d52d3',
|
|
80
|
+
slashFactoryAddress: '0x2c03d596f4b5f0c1d0d2dbf92a5964dfc658763c',
|
|
81
|
+
feeAssetHandlerAddress: '0x48be40187f2932bd14cd4d111fba26646da96c36',
|
|
82
82
|
seqMinTxsPerBlock: 0,
|
|
83
83
|
seqMaxTxsPerBlock: 0,
|
|
84
84
|
realProofs: true,
|
package/src/utils/aztec.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { EthAddress
|
|
1
|
+
import { EthAddress } from '@aztec/aztec.js';
|
|
2
2
|
import {
|
|
3
3
|
type ContractArtifact,
|
|
4
4
|
type FunctionAbi,
|
|
@@ -20,7 +20,6 @@ import { protocolContractTreeRoot } from '@aztec/protocol-contracts';
|
|
|
20
20
|
|
|
21
21
|
import TOML from '@iarna/toml';
|
|
22
22
|
import { readFile } from 'fs/promises';
|
|
23
|
-
import { gtr, ltr, satisfies, valid } from 'semver';
|
|
24
23
|
|
|
25
24
|
import { encodeArgs } from './encoding.js';
|
|
26
25
|
|
|
@@ -59,7 +58,6 @@ export async function deployAztecContracts(
|
|
|
59
58
|
config: L1ContractsConfig,
|
|
60
59
|
realVerifier: boolean,
|
|
61
60
|
createVerificationJson: string | false,
|
|
62
|
-
flushEntryQueue: boolean,
|
|
63
61
|
debugLogger: Logger,
|
|
64
62
|
): Promise<DeployL1ContractsReturnType> {
|
|
65
63
|
const { createEthereumChain, deployL1Contracts } = await import('@aztec/ethereum');
|
|
@@ -90,7 +88,6 @@ export async function deployAztecContracts(
|
|
|
90
88
|
},
|
|
91
89
|
config,
|
|
92
90
|
createVerificationJson,
|
|
93
|
-
flushEntryQueue,
|
|
94
91
|
);
|
|
95
92
|
|
|
96
93
|
return result;
|
|
@@ -260,38 +257,3 @@ export function prettyPrintNargoToml(config: NoirPackageConfig): string {
|
|
|
260
257
|
|
|
261
258
|
return partialToml + '\n[dependencies]\n' + dependenciesToml.join('\n') + '\n';
|
|
262
259
|
}
|
|
263
|
-
|
|
264
|
-
/** Mismatch between server and client versions. */
|
|
265
|
-
class VersionMismatchError extends Error {}
|
|
266
|
-
|
|
267
|
-
/**
|
|
268
|
-
* Checks that Private eXecution Environment (PXE) version matches the expected one by this CLI. Throws if not.
|
|
269
|
-
* @param pxe - PXE client.
|
|
270
|
-
* @param expectedVersionRange - Expected version by CLI.
|
|
271
|
-
*/
|
|
272
|
-
export async function checkServerVersion(pxe: PXE, expectedVersionRange: string) {
|
|
273
|
-
const serverName = 'Aztec Node';
|
|
274
|
-
const { nodeVersion } = await pxe.getNodeInfo();
|
|
275
|
-
if (!nodeVersion) {
|
|
276
|
-
throw new VersionMismatchError(`Couldn't determine ${serverName} version. You may run into issues.`);
|
|
277
|
-
}
|
|
278
|
-
if (!nodeVersion || !valid(nodeVersion)) {
|
|
279
|
-
throw new VersionMismatchError(
|
|
280
|
-
`Missing or invalid version identifier for ${serverName} (${nodeVersion ?? 'empty'}).`,
|
|
281
|
-
);
|
|
282
|
-
} else if (!satisfies(nodeVersion, expectedVersionRange)) {
|
|
283
|
-
if (gtr(nodeVersion, expectedVersionRange)) {
|
|
284
|
-
throw new VersionMismatchError(
|
|
285
|
-
`${serverName} is running version ${nodeVersion} which is newer than the expected by this CLI (${expectedVersionRange}). Consider upgrading your CLI to a newer version.`,
|
|
286
|
-
);
|
|
287
|
-
} else if (ltr(nodeVersion, expectedVersionRange)) {
|
|
288
|
-
throw new VersionMismatchError(
|
|
289
|
-
`${serverName} is running version ${nodeVersion} which is older than the expected by this CLI (${expectedVersionRange}). Consider upgrading your ${serverName} to a newer version.`,
|
|
290
|
-
);
|
|
291
|
-
} else {
|
|
292
|
-
throw new VersionMismatchError(
|
|
293
|
-
`${serverName} is running version ${nodeVersion} which does not match the expected by this CLI (${expectedVersionRange}).`,
|
|
294
|
-
);
|
|
295
|
-
}
|
|
296
|
-
}
|
|
297
|
-
}
|
package/src/utils/commands.ts
CHANGED
|
@@ -38,6 +38,14 @@ export const makePxeOption = (mandatory: boolean) =>
|
|
|
38
38
|
|
|
39
39
|
export const pxeOption = makePxeOption(true);
|
|
40
40
|
|
|
41
|
+
export const makeNodeOption = (mandatory: boolean) =>
|
|
42
|
+
new Option('-n, --node-url <string>', 'URL of the Aztec node')
|
|
43
|
+
.env('AZTEC_NODE_URL')
|
|
44
|
+
.default(`http://${LOCALHOST}:8079`)
|
|
45
|
+
.makeOptionMandatory(mandatory);
|
|
46
|
+
|
|
47
|
+
export const nodeOption = makeNodeOption(true);
|
|
48
|
+
|
|
41
49
|
export const l1ChainIdOption = new Option('-c, --l1-chain-id <number>', 'Chain ID of the ethereum host')
|
|
42
50
|
.env('L1_CHAIN_ID')
|
|
43
51
|
.default(31337)
|
package/src/utils/inspect.ts
CHANGED
|
@@ -2,12 +2,18 @@ import type { AztecAddress, ContractArtifact, Fr } from '@aztec/aztec.js';
|
|
|
2
2
|
import type { LogFn } from '@aztec/foundation/log';
|
|
3
3
|
import { ProtocolContractAddress } from '@aztec/protocol-contracts';
|
|
4
4
|
import { siloNullifier } from '@aztec/stdlib/hash';
|
|
5
|
-
import type { PXE } from '@aztec/stdlib/interfaces/client';
|
|
5
|
+
import type { AztecNode, PXE } from '@aztec/stdlib/interfaces/client';
|
|
6
6
|
import type { ExtendedNote } from '@aztec/stdlib/note';
|
|
7
7
|
import type { TxHash } from '@aztec/stdlib/tx';
|
|
8
8
|
|
|
9
|
-
export async function inspectBlock(
|
|
10
|
-
|
|
9
|
+
export async function inspectBlock(
|
|
10
|
+
pxe: PXE,
|
|
11
|
+
aztecNode: AztecNode,
|
|
12
|
+
blockNumber: number,
|
|
13
|
+
log: LogFn,
|
|
14
|
+
opts: { showTxs?: boolean } = {},
|
|
15
|
+
) {
|
|
16
|
+
const block = await aztecNode.getBlock(blockNumber);
|
|
11
17
|
if (!block) {
|
|
12
18
|
log(`No block found for block number ${blockNumber}`);
|
|
13
19
|
return;
|
|
@@ -27,7 +33,7 @@ export async function inspectBlock(pxe: PXE, blockNumber: number, log: LogFn, op
|
|
|
27
33
|
log(``);
|
|
28
34
|
const artifactMap = await getKnownArtifacts(pxe);
|
|
29
35
|
for (const txHash of block.body.txEffects.map(tx => tx.txHash)) {
|
|
30
|
-
await inspectTx(pxe, txHash, log, { includeBlockInfo: false, artifactMap });
|
|
36
|
+
await inspectTx(pxe, aztecNode, txHash, log, { includeBlockInfo: false, artifactMap });
|
|
31
37
|
}
|
|
32
38
|
} else {
|
|
33
39
|
log(` Transactions: ${block.body.txEffects.length}`);
|
|
@@ -36,11 +42,12 @@ export async function inspectBlock(pxe: PXE, blockNumber: number, log: LogFn, op
|
|
|
36
42
|
|
|
37
43
|
export async function inspectTx(
|
|
38
44
|
pxe: PXE,
|
|
45
|
+
aztecNode: AztecNode,
|
|
39
46
|
txHash: TxHash,
|
|
40
47
|
log: LogFn,
|
|
41
48
|
opts: { includeBlockInfo?: boolean; artifactMap?: ArtifactMap } = {},
|
|
42
49
|
) {
|
|
43
|
-
const [receipt, effectsInBlock] = await Promise.all([
|
|
50
|
+
const [receipt, effectsInBlock] = await Promise.all([aztecNode.getTxReceipt(txHash), aztecNode.getTxEffect(txHash)]);
|
|
44
51
|
// Base tx data
|
|
45
52
|
log(`Tx ${txHash.toString()}`);
|
|
46
53
|
log(` Status: ${receipt.status} ${effectsInBlock ? `(${effectsInBlock.data.revertCode.getDescription()})` : ''}`);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"block_number.d.ts","sourceRoot":"","sources":["../../../src/cmds/pxe/block_number.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAE3D,wBAAsB,WAAW,CAAC,MAAM,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,EAAE,GAAG,EAAE,KAAK,iBAKhF"}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { createCompatibleClient } from '@aztec/aztec.js';
|
|
2
|
-
export async function blockNumber(rpcUrl, debugLogger, log) {
|
|
3
|
-
const client = await createCompatibleClient(rpcUrl, debugLogger);
|
|
4
|
-
const [latestNum, provenNum] = await Promise.all([
|
|
5
|
-
client.getBlockNumber(),
|
|
6
|
-
client.getProvenBlockNumber()
|
|
7
|
-
]);
|
|
8
|
-
log(`Latest block: ${latestNum}`);
|
|
9
|
-
log(`Proven block: ${provenNum}`);
|
|
10
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"get_block.d.ts","sourceRoot":"","sources":["../../../src/cmds/pxe/get_block.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAI3D,wBAAsB,QAAQ,CAAC,MAAM,EAAE,MAAM,EAAE,gBAAgB,EAAE,MAAM,GAAG,SAAS,EAAE,WAAW,EAAE,MAAM,EAAE,GAAG,EAAE,KAAK,iBAInH"}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { createCompatibleClient } from '@aztec/aztec.js';
|
|
2
|
-
import { inspectBlock } from '../../utils/inspect.js';
|
|
3
|
-
export async function getBlock(rpcUrl, maybeBlockNumber, debugLogger, log) {
|
|
4
|
-
const client = await createCompatibleClient(rpcUrl, debugLogger);
|
|
5
|
-
const blockNumber = maybeBlockNumber ?? await client.getBlockNumber();
|
|
6
|
-
await inspectBlock(client, blockNumber, log, {
|
|
7
|
-
showTxs: true
|
|
8
|
-
});
|
|
9
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"get_current_base_fee.d.ts","sourceRoot":"","sources":["../../../src/cmds/pxe/get_current_base_fee.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAE3D,wBAAsB,iBAAiB,CAAC,MAAM,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,EAAE,GAAG,EAAE,KAAK,iBAItF"}
|