@aztec/cli 3.0.0-nightly.20250923 → 3.0.0-nightly.20250925
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/README.md +0 -10
- package/dest/cmds/aztec_node/get_block.d.ts +2 -2
- package/dest/cmds/aztec_node/get_block.d.ts.map +1 -1
- package/dest/cmds/aztec_node/get_block.js +3 -4
- package/dest/cmds/aztec_node/index.d.ts.map +1 -1
- package/dest/cmds/aztec_node/index.js +3 -3
- 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 +3 -4
- 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.map +1 -1
- package/dest/cmds/infrastructure/index.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 +3 -15
- package/dest/cmds/l1/advance_epoch.d.ts.map +1 -1
- package/dest/cmds/l1/advance_epoch.js +2 -1
- package/dest/cmds/l1/assume_proven_through.d.ts.map +1 -1
- package/dest/cmds/l1/assume_proven_through.js +2 -1
- package/dest/cmds/l1/index.d.ts.map +1 -1
- package/dest/cmds/l1/index.js +3 -3
- package/dest/cmds/l1/update_l1_validators.d.ts.map +1 -1
- package/dest/cmds/l1/update_l1_validators.js +4 -3
- package/dest/config/chain_l2_config.js +3 -3
- package/dest/utils/commands.d.ts +0 -2
- package/dest/utils/commands.d.ts.map +1 -1
- package/dest/utils/commands.js +1 -3
- package/dest/utils/inspect.d.ts +3 -10
- package/dest/utils/inspect.d.ts.map +1 -1
- package/dest/utils/inspect.js +10 -92
- package/dest/utils/setup_contracts.d.ts +0 -3
- package/dest/utils/setup_contracts.d.ts.map +1 -1
- package/dest/utils/setup_contracts.js +0 -11
- package/package.json +24 -25
- package/src/cmds/aztec_node/get_block.ts +4 -11
- package/src/cmds/aztec_node/index.ts +1 -3
- package/src/cmds/devnet/bootstrap_network.ts +1 -4
- package/src/cmds/devnet/index.ts +1 -3
- package/src/cmds/infrastructure/index.ts +2 -11
- package/src/cmds/infrastructure/setup_l2_contract.ts +3 -25
- package/src/cmds/l1/advance_epoch.ts +2 -1
- package/src/cmds/l1/assume_proven_through.ts +2 -1
- package/src/cmds/l1/index.ts +2 -3
- package/src/cmds/l1/update_l1_validators.ts +4 -3
- package/src/config/chain_l2_config.ts +3 -3
- package/src/utils/commands.ts +1 -10
- package/src/utils/inspect.ts +9 -109
- package/src/utils/setup_contracts.ts +1 -12
- package/dest/cmds/pxe/add_contract.d.ts +0 -5
- package/dest/cmds/pxe/add_contract.d.ts.map +0 -1
- package/dest/cmds/pxe/add_contract.js +0 -29
- package/dest/cmds/pxe/get_account.d.ts +0 -4
- package/dest/cmds/pxe/get_account.d.ts.map +0 -1
- package/dest/cmds/pxe/get_account.js +0 -10
- package/dest/cmds/pxe/get_accounts.d.ts +0 -3
- package/dest/cmds/pxe/get_accounts.d.ts.map +0 -1
- package/dest/cmds/pxe/get_accounts.js +0 -25
- package/dest/cmds/pxe/get_contract_data.d.ts +0 -4
- package/dest/cmds/pxe/get_contract_data.d.ts.map +0 -1
- package/dest/cmds/pxe/get_contract_data.js +0 -31
- package/dest/cmds/pxe/get_pxe_info.d.ts +0 -3
- package/dest/cmds/pxe/get_pxe_info.d.ts.map +0 -1
- package/dest/cmds/pxe/get_pxe_info.js +0 -11
- package/dest/cmds/pxe/index.d.ts +0 -4
- package/dest/cmds/pxe/index.d.ts.map +0 -1
- package/dest/cmds/pxe/index.js +0 -25
- package/src/cmds/pxe/add_contract.ts +0 -41
- package/src/cmds/pxe/get_account.ts +0 -16
- package/src/cmds/pxe/get_accounts.ts +0 -35
- package/src/cmds/pxe/get_contract_data.ts +0 -51
- package/src/cmds/pxe/get_pxe_info.ts +0 -13
- package/src/cmds/pxe/index.ts +0 -88
package/package.json
CHANGED
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aztec/cli",
|
|
3
|
-
"version": "3.0.0-nightly.
|
|
3
|
+
"version": "3.0.0-nightly.20250925",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"exports": {
|
|
6
6
|
"./contracts": "./dest/cmds/contracts/index.js",
|
|
7
7
|
"./devnet": "./dest/cmds/devnet/index.js",
|
|
8
8
|
"./infrastructure": "./dest/cmds/infrastructure/index.js",
|
|
9
9
|
"./l1": "./dest/cmds/l1/index.js",
|
|
10
|
-
"./pxe": "./dest/cmds/pxe/index.js",
|
|
11
10
|
"./aztec_node": "./dest/cmds/aztec_node/index.js",
|
|
12
11
|
"./cli-utils": "./dest/utils/index.js",
|
|
13
12
|
"./misc": "./dest/cmds/misc/index.js",
|
|
@@ -71,20 +70,20 @@
|
|
|
71
70
|
]
|
|
72
71
|
},
|
|
73
72
|
"dependencies": {
|
|
74
|
-
"@aztec/accounts": "3.0.0-nightly.
|
|
75
|
-
"@aztec/archiver": "3.0.0-nightly.
|
|
76
|
-
"@aztec/aztec.js": "3.0.0-nightly.
|
|
77
|
-
"@aztec/constants": "3.0.0-nightly.
|
|
78
|
-
"@aztec/entrypoints": "3.0.0-nightly.
|
|
79
|
-
"@aztec/ethereum": "3.0.0-nightly.
|
|
80
|
-
"@aztec/foundation": "3.0.0-nightly.
|
|
81
|
-
"@aztec/l1-artifacts": "3.0.0-nightly.
|
|
82
|
-
"@aztec/node-lib": "3.0.0-nightly.
|
|
83
|
-
"@aztec/p2p": "3.0.0-nightly.
|
|
84
|
-
"@aztec/protocol-contracts": "3.0.0-nightly.
|
|
85
|
-
"@aztec/stdlib": "3.0.0-nightly.
|
|
86
|
-
"@aztec/test-wallet": "3.0.0-nightly.
|
|
87
|
-
"@aztec/world-state": "3.0.0-nightly.
|
|
73
|
+
"@aztec/accounts": "3.0.0-nightly.20250925",
|
|
74
|
+
"@aztec/archiver": "3.0.0-nightly.20250925",
|
|
75
|
+
"@aztec/aztec.js": "3.0.0-nightly.20250925",
|
|
76
|
+
"@aztec/constants": "3.0.0-nightly.20250925",
|
|
77
|
+
"@aztec/entrypoints": "3.0.0-nightly.20250925",
|
|
78
|
+
"@aztec/ethereum": "3.0.0-nightly.20250925",
|
|
79
|
+
"@aztec/foundation": "3.0.0-nightly.20250925",
|
|
80
|
+
"@aztec/l1-artifacts": "3.0.0-nightly.20250925",
|
|
81
|
+
"@aztec/node-lib": "3.0.0-nightly.20250925",
|
|
82
|
+
"@aztec/p2p": "3.0.0-nightly.20250925",
|
|
83
|
+
"@aztec/protocol-contracts": "3.0.0-nightly.20250925",
|
|
84
|
+
"@aztec/stdlib": "3.0.0-nightly.20250925",
|
|
85
|
+
"@aztec/test-wallet": "3.0.0-nightly.20250925",
|
|
86
|
+
"@aztec/world-state": "3.0.0-nightly.20250925",
|
|
88
87
|
"@iarna/toml": "^2.2.5",
|
|
89
88
|
"@libp2p/peer-id-factory": "^3.0.4",
|
|
90
89
|
"commander": "^12.1.0",
|
|
@@ -111,15 +110,15 @@
|
|
|
111
110
|
"typescript": "^5.3.3"
|
|
112
111
|
},
|
|
113
112
|
"peerDependencies": {
|
|
114
|
-
"@aztec/accounts": "3.0.0-nightly.
|
|
115
|
-
"@aztec/bb-prover": "3.0.0-nightly.
|
|
116
|
-
"@aztec/ethereum": "3.0.0-nightly.
|
|
117
|
-
"@aztec/l1-artifacts": "3.0.0-nightly.
|
|
118
|
-
"@aztec/noir-contracts.js": "3.0.0-nightly.
|
|
119
|
-
"@aztec/noir-protocol-circuits-types": "3.0.0-nightly.
|
|
120
|
-
"@aztec/noir-test-contracts.js": "3.0.0-nightly.
|
|
121
|
-
"@aztec/protocol-contracts": "3.0.0-nightly.
|
|
122
|
-
"@aztec/stdlib": "3.0.0-nightly.
|
|
113
|
+
"@aztec/accounts": "3.0.0-nightly.20250925",
|
|
114
|
+
"@aztec/bb-prover": "3.0.0-nightly.20250925",
|
|
115
|
+
"@aztec/ethereum": "3.0.0-nightly.20250925",
|
|
116
|
+
"@aztec/l1-artifacts": "3.0.0-nightly.20250925",
|
|
117
|
+
"@aztec/noir-contracts.js": "3.0.0-nightly.20250925",
|
|
118
|
+
"@aztec/noir-protocol-circuits-types": "3.0.0-nightly.20250925",
|
|
119
|
+
"@aztec/noir-test-contracts.js": "3.0.0-nightly.20250925",
|
|
120
|
+
"@aztec/protocol-contracts": "3.0.0-nightly.20250925",
|
|
121
|
+
"@aztec/stdlib": "3.0.0-nightly.20250925"
|
|
123
122
|
},
|
|
124
123
|
"files": [
|
|
125
124
|
"dest",
|
|
@@ -1,17 +1,10 @@
|
|
|
1
|
-
import { createAztecNodeClient
|
|
2
|
-
import type { LogFn
|
|
1
|
+
import { createAztecNodeClient } from '@aztec/aztec.js';
|
|
2
|
+
import type { LogFn } from '@aztec/foundation/log';
|
|
3
3
|
|
|
4
4
|
import { inspectBlock } from '../../utils/inspect.js';
|
|
5
5
|
|
|
6
|
-
export async function getBlock(
|
|
7
|
-
pxeUrl: string,
|
|
8
|
-
nodeUrl: string,
|
|
9
|
-
maybeBlockNumber: number | undefined,
|
|
10
|
-
debugLogger: Logger,
|
|
11
|
-
log: LogFn,
|
|
12
|
-
) {
|
|
13
|
-
const client = await createCompatibleClient(pxeUrl, debugLogger);
|
|
6
|
+
export async function getBlock(nodeUrl: string, maybeBlockNumber: number | undefined, log: LogFn) {
|
|
14
7
|
const aztecNode = createAztecNodeClient(nodeUrl);
|
|
15
8
|
const blockNumber = maybeBlockNumber ?? (await aztecNode.getBlockNumber());
|
|
16
|
-
await inspectBlock(
|
|
9
|
+
await inspectBlock(aztecNode, blockNumber, log, { showTxs: true });
|
|
17
10
|
}
|
|
@@ -11,7 +11,6 @@ import {
|
|
|
11
11
|
parseOptionalInteger,
|
|
12
12
|
parseOptionalLogId,
|
|
13
13
|
parseOptionalTxHash,
|
|
14
|
-
pxeOption,
|
|
15
14
|
} from '../../utils/commands.js';
|
|
16
15
|
|
|
17
16
|
export function injectCommands(program: Command, log: LogFn, debugLogger: Logger) {
|
|
@@ -19,11 +18,10 @@ export function injectCommands(program: Command, log: LogFn, debugLogger: Logger
|
|
|
19
18
|
.command('get-block')
|
|
20
19
|
.description('Gets info for a given block or latest.')
|
|
21
20
|
.argument('[blockNumber]', 'Block height', parseOptionalInteger)
|
|
22
|
-
.addOption(pxeOption)
|
|
23
21
|
.addOption(nodeOption)
|
|
24
22
|
.action(async (blockNumber, options) => {
|
|
25
23
|
const { getBlock } = await import('./get_block.js');
|
|
26
|
-
await getBlock(options.
|
|
24
|
+
await getBlock(options.nodeUrl, blockNumber, log);
|
|
27
25
|
});
|
|
28
26
|
|
|
29
27
|
program
|
|
@@ -10,7 +10,6 @@ import {
|
|
|
10
10
|
type WaitOpts,
|
|
11
11
|
type Wallet,
|
|
12
12
|
createAztecNodeClient,
|
|
13
|
-
createCompatibleClient,
|
|
14
13
|
retryUntil,
|
|
15
14
|
waitForProven,
|
|
16
15
|
} from '@aztec/aztec.js';
|
|
@@ -44,7 +43,6 @@ const provenWaitOpts: WaitForProvenOpts = {
|
|
|
44
43
|
};
|
|
45
44
|
|
|
46
45
|
export async function bootstrapNetwork(
|
|
47
|
-
pxeUrl: string,
|
|
48
46
|
nodeUrl: string,
|
|
49
47
|
l1Urls: string[],
|
|
50
48
|
l1ChainId: string,
|
|
@@ -55,9 +53,8 @@ export async function bootstrapNetwork(
|
|
|
55
53
|
log: LogFn,
|
|
56
54
|
debugLog: Logger,
|
|
57
55
|
) {
|
|
58
|
-
const pxe = await createCompatibleClient(pxeUrl, debugLog);
|
|
59
56
|
const node = createAztecNodeClient(nodeUrl);
|
|
60
|
-
const wallet =
|
|
57
|
+
const wallet = await TestWallet.create(node);
|
|
61
58
|
|
|
62
59
|
// We assume here that the initial test accounts were prefunded with deploy-l1-contracts, and deployed with setup-l2-contracts
|
|
63
60
|
// so all we need to do is register them to our pxe.
|
package/src/cmds/devnet/index.ts
CHANGED
|
@@ -2,13 +2,12 @@ import type { LogFn, Logger } from '@aztec/foundation/log';
|
|
|
2
2
|
|
|
3
3
|
import type { Command } from 'commander';
|
|
4
4
|
|
|
5
|
-
import { ETHEREUM_HOSTS, l1ChainIdOption, nodeOption, parseEthereumAddress
|
|
5
|
+
import { ETHEREUM_HOSTS, l1ChainIdOption, nodeOption, parseEthereumAddress } 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
|
-
.addOption(pxeOption)
|
|
12
11
|
.addOption(nodeOption)
|
|
13
12
|
.addOption(l1ChainIdOption)
|
|
14
13
|
.requiredOption<string[]>(
|
|
@@ -33,7 +32,6 @@ export function injectCommands(program: Command, log: LogFn, debugLogger: Logger
|
|
|
33
32
|
.action(async options => {
|
|
34
33
|
const { bootstrapNetwork } = await import('./bootstrap_network.js');
|
|
35
34
|
await bootstrapNetwork(
|
|
36
|
-
options[pxeOption.attributeName()],
|
|
37
35
|
options[nodeOption.attributeName()],
|
|
38
36
|
options.l1RpcUrls,
|
|
39
37
|
options[l1ChainIdOption.attributeName()],
|
|
@@ -2,27 +2,18 @@ import type { LogFn } from '@aztec/foundation/log';
|
|
|
2
2
|
|
|
3
3
|
import type { Command } from 'commander';
|
|
4
4
|
|
|
5
|
-
import { ETHEREUM_HOSTS, l1ChainIdOption, nodeOption, parseOptionalInteger
|
|
5
|
+
import { ETHEREUM_HOSTS, l1ChainIdOption, nodeOption, parseOptionalInteger } from '../../utils/commands.js';
|
|
6
6
|
|
|
7
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
|
-
.addOption(pxeOption)
|
|
12
11
|
.addOption(nodeOption)
|
|
13
12
|
.option('--testAccounts', 'Deploy funded test accounts.')
|
|
14
|
-
.option('--sponsoredFPC', 'Deploy a sponsored FPC.')
|
|
15
13
|
.option('--json', 'Output the contract addresses in JSON format')
|
|
16
14
|
.action(async options => {
|
|
17
15
|
const { setupL2Contracts } = await import('./setup_l2_contract.js');
|
|
18
|
-
await setupL2Contracts(
|
|
19
|
-
options.rpcUrl,
|
|
20
|
-
options.nodeUrl,
|
|
21
|
-
options.testAccounts,
|
|
22
|
-
options.sponsoredFPC,
|
|
23
|
-
options.json,
|
|
24
|
-
log,
|
|
25
|
-
);
|
|
16
|
+
await setupL2Contracts(options.nodeUrl, options.testAccounts, options.json, log);
|
|
26
17
|
});
|
|
27
18
|
|
|
28
19
|
program
|
|
@@ -1,36 +1,19 @@
|
|
|
1
1
|
import { getInitialTestAccountsData } from '@aztec/accounts/testing';
|
|
2
|
-
import {
|
|
3
|
-
AccountManager,
|
|
4
|
-
type AztecAddress,
|
|
5
|
-
type WaitOpts,
|
|
6
|
-
createAztecNodeClient,
|
|
7
|
-
createPXEClient,
|
|
8
|
-
makeFetch,
|
|
9
|
-
} from '@aztec/aztec.js';
|
|
2
|
+
import { AccountManager, type AztecAddress, type WaitOpts, createAztecNodeClient } from '@aztec/aztec.js';
|
|
10
3
|
import { jsonStringify } from '@aztec/foundation/json-rpc';
|
|
11
4
|
import type { LogFn } from '@aztec/foundation/log';
|
|
12
5
|
import { ProtocolContractAddress } from '@aztec/protocol-contracts';
|
|
13
6
|
import { TestWallet, deployFundedSchnorrAccounts } from '@aztec/test-wallet';
|
|
14
7
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
export async function setupL2Contracts(
|
|
18
|
-
pxeUrl: string,
|
|
19
|
-
nodeUrl: string,
|
|
20
|
-
testAccounts: boolean,
|
|
21
|
-
sponsoredFPC: boolean,
|
|
22
|
-
json: boolean,
|
|
23
|
-
log: LogFn,
|
|
24
|
-
) {
|
|
8
|
+
export async function setupL2Contracts(nodeUrl: string, testAccounts: boolean, json: boolean, log: LogFn) {
|
|
25
9
|
const waitOpts: WaitOpts = {
|
|
26
10
|
timeout: 180,
|
|
27
11
|
interval: 1,
|
|
28
12
|
};
|
|
29
13
|
log('setupL2Contracts: Wait options' + jsonStringify(waitOpts));
|
|
30
14
|
log('setupL2Contracts: Creating PXE client...');
|
|
31
|
-
const pxe = createPXEClient(pxeUrl, {}, makeFetch([1, 1, 1, 1, 1], false));
|
|
32
15
|
const node = createAztecNodeClient(nodeUrl);
|
|
33
|
-
const wallet =
|
|
16
|
+
const wallet = await TestWallet.create(node);
|
|
34
17
|
|
|
35
18
|
let deployedAccountManagers: AccountManager[] = [];
|
|
36
19
|
if (testAccounts) {
|
|
@@ -39,11 +22,6 @@ export async function setupL2Contracts(
|
|
|
39
22
|
deployedAccountManagers = await deployFundedSchnorrAccounts(wallet, initialAccountsData, waitOpts);
|
|
40
23
|
}
|
|
41
24
|
|
|
42
|
-
if (sponsoredFPC) {
|
|
43
|
-
log('setupL2Contracts: Setting up sponsored FPC...');
|
|
44
|
-
await setupSponsoredFPC(pxe, log);
|
|
45
|
-
}
|
|
46
|
-
|
|
47
25
|
if (json) {
|
|
48
26
|
const toPrint: Record<string, AztecAddress> = { ...ProtocolContractAddress };
|
|
49
27
|
deployedAccountManagers.forEach((a, i) => {
|
|
@@ -1,12 +1,13 @@
|
|
|
1
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
|
+
import { DateProvider } from '@aztec/foundation/timer';
|
|
4
5
|
|
|
5
6
|
export async function advanceEpoch(l1RpcUrls: string[], nodeUrl: string, log: LogFn) {
|
|
6
7
|
const aztecNode = createAztecNodeClient(nodeUrl);
|
|
7
8
|
const rollupAddress = await aztecNode.getNodeInfo().then(i => i.l1ContractAddresses.rollupAddress);
|
|
8
9
|
|
|
9
|
-
const cheat = RollupCheatCodes.create(l1RpcUrls, { rollupAddress });
|
|
10
|
+
const cheat = RollupCheatCodes.create(l1RpcUrls, { rollupAddress }, new DateProvider());
|
|
10
11
|
|
|
11
12
|
await cheat.advanceToNextEpoch();
|
|
12
13
|
log(`Warped time to advance to next epoch`);
|
|
@@ -1,6 +1,7 @@
|
|
|
1
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
|
+
import { DateProvider } from '@aztec/foundation/timer';
|
|
4
5
|
|
|
5
6
|
export async function assumeProvenThrough(
|
|
6
7
|
blockNumberOrLatest: number | undefined,
|
|
@@ -12,7 +13,7 @@ export async function assumeProvenThrough(
|
|
|
12
13
|
const rollupAddress = await aztecNode.getNodeInfo().then(i => i.l1ContractAddresses.rollupAddress);
|
|
13
14
|
const blockNumber = blockNumberOrLatest ?? (await aztecNode.getBlockNumber());
|
|
14
15
|
|
|
15
|
-
const rollupCheatCodes = RollupCheatCodes.create(l1RpcUrls, { rollupAddress });
|
|
16
|
+
const rollupCheatCodes = RollupCheatCodes.create(l1RpcUrls, { rollupAddress }, new DateProvider());
|
|
16
17
|
|
|
17
18
|
await rollupCheatCodes.markAsProven(blockNumber);
|
|
18
19
|
log(`Assumed proven through block ${blockNumber}`);
|
package/src/cmds/l1/index.ts
CHANGED
|
@@ -13,7 +13,6 @@ import {
|
|
|
13
13
|
parseAztecAddress,
|
|
14
14
|
parseBigint,
|
|
15
15
|
parseEthereumAddress,
|
|
16
|
-
pxeOption,
|
|
17
16
|
} from '../../utils/commands.js';
|
|
18
17
|
|
|
19
18
|
export { addL1Validator } from './update_l1_validators.js';
|
|
@@ -518,10 +517,10 @@ export function injectCommands(program: Command, log: LogFn, debugLogger: Logger
|
|
|
518
517
|
.command('advance-epoch')
|
|
519
518
|
.description('Use L1 cheat codes to warp time until the next epoch.')
|
|
520
519
|
.addOption(l1RpcUrlsOption)
|
|
521
|
-
.addOption(
|
|
520
|
+
.addOption(nodeOption)
|
|
522
521
|
.action(async options => {
|
|
523
522
|
const { advanceEpoch } = await import('./advance_epoch.js');
|
|
524
|
-
await advanceEpoch(options.l1RpcUrls, options.
|
|
523
|
+
await advanceEpoch(options.l1RpcUrls, options.nodeUrl, log);
|
|
525
524
|
});
|
|
526
525
|
|
|
527
526
|
program
|
|
@@ -11,6 +11,7 @@ import {
|
|
|
11
11
|
import { EthCheatCodes } from '@aztec/ethereum/test';
|
|
12
12
|
import type { EthAddress } from '@aztec/foundation/eth-address';
|
|
13
13
|
import type { LogFn, Logger } from '@aztec/foundation/log';
|
|
14
|
+
import { DateProvider } from '@aztec/foundation/timer';
|
|
14
15
|
import { RollupAbi, StakingAssetHandlerAbi } from '@aztec/l1-artifacts';
|
|
15
16
|
import { ZkPassportProofParams } from '@aztec/stdlib/zkpassport';
|
|
16
17
|
|
|
@@ -120,7 +121,7 @@ export async function addL1Validator({
|
|
|
120
121
|
await l1Client.waitForTransactionReceipt({ hash: receipt.transactionHash });
|
|
121
122
|
if (isAnvilTestChain(chainId)) {
|
|
122
123
|
dualLog(`Funding validator on L1`);
|
|
123
|
-
const cheatCodes = new EthCheatCodes(rpcUrls, debugLogger);
|
|
124
|
+
const cheatCodes = new EthCheatCodes(rpcUrls, new DateProvider(), debugLogger);
|
|
124
125
|
await cheatCodes.setBalance(attesterAddress, 10n ** 20n);
|
|
125
126
|
} else {
|
|
126
127
|
const balance = await l1Client.getBalance({ address: attesterAddress.toString() });
|
|
@@ -194,7 +195,7 @@ export async function addL1ValidatorViaRollup({
|
|
|
194
195
|
await l1Client.waitForTransactionReceipt({ hash: receipt.transactionHash });
|
|
195
196
|
if (isAnvilTestChain(chainId)) {
|
|
196
197
|
dualLog(`Funding validator on L1`);
|
|
197
|
-
const cheatCodes = new EthCheatCodes(rpcUrls, debugLogger);
|
|
198
|
+
const cheatCodes = new EthCheatCodes(rpcUrls, new DateProvider(), debugLogger);
|
|
198
199
|
await cheatCodes.setBalance(attesterAddress, 10n ** 20n);
|
|
199
200
|
} else {
|
|
200
201
|
const balance = await l1Client.getBalance({ address: attesterAddress.toString() });
|
|
@@ -275,7 +276,7 @@ export async function fastForwardEpochs({
|
|
|
275
276
|
client: publicClient,
|
|
276
277
|
});
|
|
277
278
|
|
|
278
|
-
const cheatCodes = new EthCheatCodes(rpcUrls, debugLogger);
|
|
279
|
+
const cheatCodes = new EthCheatCodes(rpcUrls, new DateProvider(), debugLogger);
|
|
279
280
|
const currentSlot = await rollup.read.getCurrentSlot();
|
|
280
281
|
const l2SlotsInEpoch = await rollup.read.getEpochDuration();
|
|
281
282
|
const timestamp = await rollup.read.getTimestampForSlot([currentSlot + l2SlotsInEpoch * numEpochs]);
|
|
@@ -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: '0x5f85fa0f40bc4b5ccd53c9f34258aa55d25cdde8',
|
|
80
|
+
slashFactoryAddress: '0x257db2ca1471b7f76f414d2997404bfbe916c8c9',
|
|
81
|
+
feeAssetHandlerAddress: '0x67d645b0a3e053605ea861d7e8909be6669812c4',
|
|
82
82
|
seqMinTxsPerBlock: 0,
|
|
83
83
|
seqMaxTxsPerBlock: 0,
|
|
84
84
|
realProofs: true,
|
package/src/utils/commands.ts
CHANGED
|
@@ -29,19 +29,10 @@ export function addOptions(program: Command, options: Option[]) {
|
|
|
29
29
|
return program;
|
|
30
30
|
}
|
|
31
31
|
|
|
32
|
-
export const makePxeOption = (mandatory: boolean) =>
|
|
33
|
-
new Option('-u, --rpc-url <string>', 'URL of the PXE')
|
|
34
|
-
.env('PXE_URL')
|
|
35
|
-
.default(`http://${LOCALHOST}:8080`)
|
|
36
|
-
.conflicts('remote-pxe')
|
|
37
|
-
.makeOptionMandatory(mandatory);
|
|
38
|
-
|
|
39
|
-
export const pxeOption = makePxeOption(true);
|
|
40
|
-
|
|
41
32
|
export const makeNodeOption = (mandatory: boolean) =>
|
|
42
33
|
new Option('-n, --node-url <string>', 'URL of the Aztec node')
|
|
43
34
|
.env('AZTEC_NODE_URL')
|
|
44
|
-
.default(`http://${LOCALHOST}:
|
|
35
|
+
.default(`http://${LOCALHOST}:8080`)
|
|
45
36
|
.makeOptionMandatory(mandatory);
|
|
46
37
|
|
|
47
38
|
export const nodeOption = makeNodeOption(true);
|
package/src/utils/inspect.ts
CHANGED
|
@@ -1,13 +1,8 @@
|
|
|
1
|
-
import type { AztecAddress, ContractArtifact, Fr } from '@aztec/aztec.js';
|
|
2
1
|
import type { LogFn } from '@aztec/foundation/log';
|
|
3
|
-
import {
|
|
4
|
-
import { siloNullifier } from '@aztec/stdlib/hash';
|
|
5
|
-
import type { AztecNode, PXE } from '@aztec/stdlib/interfaces/client';
|
|
6
|
-
import type { ExtendedNote } from '@aztec/stdlib/note';
|
|
2
|
+
import type { AztecNode } from '@aztec/stdlib/interfaces/client';
|
|
7
3
|
import type { TxHash } from '@aztec/stdlib/tx';
|
|
8
4
|
|
|
9
5
|
export async function inspectBlock(
|
|
10
|
-
pxe: PXE,
|
|
11
6
|
aztecNode: AztecNode,
|
|
12
7
|
blockNumber: number,
|
|
13
8
|
log: LogFn,
|
|
@@ -31,9 +26,8 @@ export async function inspectBlock(
|
|
|
31
26
|
log(` Timestamp: ${new Date(Number(block.header.globalVariables.timestamp) * 500)}`);
|
|
32
27
|
if (opts.showTxs) {
|
|
33
28
|
log(``);
|
|
34
|
-
const artifactMap = await getKnownArtifacts(pxe);
|
|
35
29
|
for (const txHash of block.body.txEffects.map(tx => tx.txHash)) {
|
|
36
|
-
await inspectTx(
|
|
30
|
+
await inspectTx(aztecNode, txHash, log, { includeBlockInfo: false });
|
|
37
31
|
}
|
|
38
32
|
} else {
|
|
39
33
|
log(` Transactions: ${block.body.txEffects.length}`);
|
|
@@ -41,11 +35,10 @@ export async function inspectBlock(
|
|
|
41
35
|
}
|
|
42
36
|
|
|
43
37
|
export async function inspectTx(
|
|
44
|
-
pxe: PXE,
|
|
45
38
|
aztecNode: AztecNode,
|
|
46
39
|
txHash: TxHash,
|
|
47
40
|
log: LogFn,
|
|
48
|
-
opts: { includeBlockInfo?: boolean
|
|
41
|
+
opts: { includeBlockInfo?: boolean } = {},
|
|
49
42
|
) {
|
|
50
43
|
const [receipt, effectsInBlock] = await Promise.all([aztecNode.getTxReceipt(txHash), aztecNode.getTxEffect(txHash)]);
|
|
51
44
|
// Base tx data
|
|
@@ -60,7 +53,6 @@ export async function inspectTx(
|
|
|
60
53
|
}
|
|
61
54
|
|
|
62
55
|
const effects = effectsInBlock.data;
|
|
63
|
-
const artifactMap = opts?.artifactMap ?? (await getKnownArtifacts(pxe));
|
|
64
56
|
|
|
65
57
|
if (opts.includeBlockInfo) {
|
|
66
58
|
log(` Block: ${receipt.blockNumber} (${receipt.blockHash?.toString()})`);
|
|
@@ -97,38 +89,12 @@ export async function inspectTx(
|
|
|
97
89
|
}
|
|
98
90
|
}
|
|
99
91
|
|
|
100
|
-
//
|
|
101
|
-
const
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
const deployed = deployNullifiers[nullifier.toString()];
|
|
107
|
-
const note = deployed
|
|
108
|
-
? (await pxe.getNotes({ siloedNullifier: nullifier, contractAddress: deployed }))[0]
|
|
109
|
-
: undefined;
|
|
110
|
-
const initialized = initNullifiers[nullifier.toString()];
|
|
111
|
-
const registered = classNullifiers[nullifier.toString()];
|
|
112
|
-
if (nullifier.toBuffer().equals(txHash.toBuffer())) {
|
|
113
|
-
log(` Transaction hash nullifier ${nullifier.toShortString()}`);
|
|
114
|
-
} else if (note) {
|
|
115
|
-
inspectNote(note, artifactMap, log, `Nullifier ${nullifier.toShortString()} for note`);
|
|
116
|
-
} else if (deployed) {
|
|
117
|
-
log(
|
|
118
|
-
` Contract ${toFriendlyAddress(deployed, artifactMap)} deployed via nullifier ${nullifier.toShortString()}`,
|
|
119
|
-
);
|
|
120
|
-
} else if (initialized) {
|
|
121
|
-
log(
|
|
122
|
-
` Contract ${toFriendlyAddress(
|
|
123
|
-
initialized,
|
|
124
|
-
artifactMap,
|
|
125
|
-
)} initialized via nullifier ${nullifier.toShortString()}`,
|
|
126
|
-
);
|
|
127
|
-
} else if (registered) {
|
|
128
|
-
log(` Class ${registered} registered via nullifier ${nullifier.toShortString()}`);
|
|
129
|
-
} else {
|
|
130
|
-
log(` Unknown nullifier ${nullifier.toString()}`);
|
|
131
|
-
}
|
|
92
|
+
// Created nullifiers
|
|
93
|
+
const nullifiers = effects.nullifiers;
|
|
94
|
+
if (nullifiers.length > 0) {
|
|
95
|
+
log(' Created nullifiers:');
|
|
96
|
+
for (const nullifier of nullifiers) {
|
|
97
|
+
log(` Nullifier: ${nullifier.toShortString()}`);
|
|
132
98
|
}
|
|
133
99
|
}
|
|
134
100
|
|
|
@@ -140,69 +106,3 @@ export async function inspectTx(
|
|
|
140
106
|
}
|
|
141
107
|
}
|
|
142
108
|
}
|
|
143
|
-
|
|
144
|
-
function inspectNote(note: ExtendedNote, artifactMap: ArtifactMap, log: LogFn, text = 'Note') {
|
|
145
|
-
const artifact = artifactMap[note.contractAddress.toString()];
|
|
146
|
-
const contract = artifact?.name ?? note.contractAddress.toString();
|
|
147
|
-
log(` ${text} at ${contract}`);
|
|
148
|
-
log(` Recipient: ${toFriendlyAddress(note.recipient, artifactMap)}`);
|
|
149
|
-
for (const field of note.note.items) {
|
|
150
|
-
log(` ${field.toString()}`);
|
|
151
|
-
}
|
|
152
|
-
}
|
|
153
|
-
|
|
154
|
-
function toFriendlyAddress(address: AztecAddress, artifactMap: ArtifactMap) {
|
|
155
|
-
const artifact = artifactMap[address.toString()];
|
|
156
|
-
if (!artifact) {
|
|
157
|
-
return address.toString();
|
|
158
|
-
}
|
|
159
|
-
|
|
160
|
-
return `${artifact.name}<${address.toString()}>`;
|
|
161
|
-
}
|
|
162
|
-
|
|
163
|
-
async function getKnownNullifiers(pxe: PXE, artifactMap: ArtifactMap) {
|
|
164
|
-
const knownContracts = await pxe.getContracts();
|
|
165
|
-
const deployerAddress = ProtocolContractAddress.ContractInstanceRegistry;
|
|
166
|
-
const classRegistryAddress = ProtocolContractAddress.ContractClassRegistry;
|
|
167
|
-
const initNullifiers: Record<string, AztecAddress> = {};
|
|
168
|
-
const deployNullifiers: Record<string, AztecAddress> = {};
|
|
169
|
-
const classNullifiers: Record<string, string> = {};
|
|
170
|
-
for (const contract of knownContracts) {
|
|
171
|
-
initNullifiers[(await siloNullifier(contract, contract.toField())).toString()] = contract;
|
|
172
|
-
deployNullifiers[(await siloNullifier(deployerAddress, contract.toField())).toString()] = contract;
|
|
173
|
-
}
|
|
174
|
-
for (const artifact of Object.values(artifactMap)) {
|
|
175
|
-
classNullifiers[(await siloNullifier(classRegistryAddress, artifact.classId)).toString()] =
|
|
176
|
-
`${artifact.name}Class<${artifact.classId}>`;
|
|
177
|
-
}
|
|
178
|
-
return { initNullifiers, deployNullifiers, classNullifiers };
|
|
179
|
-
}
|
|
180
|
-
|
|
181
|
-
type ArtifactMap = Record<string, ContractArtifactWithClassId>;
|
|
182
|
-
type ContractArtifactWithClassId = ContractArtifact & { classId: Fr };
|
|
183
|
-
async function getKnownArtifacts(pxe: PXE): Promise<ArtifactMap> {
|
|
184
|
-
const knownContractAddresses = await pxe.getContracts();
|
|
185
|
-
const knownContracts = (
|
|
186
|
-
await Promise.all(knownContractAddresses.map(contractAddress => pxe.getContractMetadata(contractAddress)))
|
|
187
|
-
).map(contractMetadata => contractMetadata.contractInstance);
|
|
188
|
-
const classIds = [...new Set(knownContracts.map(contract => contract?.currentContractClassId))];
|
|
189
|
-
const knownArtifacts = (
|
|
190
|
-
await Promise.all(classIds.map(classId => (classId ? pxe.getContractClassMetadata(classId) : undefined)))
|
|
191
|
-
).map(contractClassMetadata =>
|
|
192
|
-
contractClassMetadata
|
|
193
|
-
? { ...contractClassMetadata.artifact, classId: contractClassMetadata.contractClass?.id }
|
|
194
|
-
: undefined,
|
|
195
|
-
);
|
|
196
|
-
const map: Record<string, ContractArtifactWithClassId> = {};
|
|
197
|
-
for (const instance of knownContracts) {
|
|
198
|
-
if (instance) {
|
|
199
|
-
const artifact = knownArtifacts.find(a =>
|
|
200
|
-
a?.classId?.equals(instance.currentContractClassId),
|
|
201
|
-
) as ContractArtifactWithClassId;
|
|
202
|
-
if (artifact) {
|
|
203
|
-
map[instance.address.toString()] = artifact;
|
|
204
|
-
}
|
|
205
|
-
}
|
|
206
|
-
}
|
|
207
|
-
return map;
|
|
208
|
-
}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { Fr,
|
|
1
|
+
import { Fr, getContractInstanceFromInstantiationParams } from '@aztec/aztec.js';
|
|
2
2
|
import { SPONSORED_FPC_SALT } from '@aztec/constants';
|
|
3
|
-
import type { LogFn } from '@aztec/foundation/log';
|
|
4
3
|
|
|
5
4
|
async function getSponsoredFPCContract() {
|
|
6
5
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
@@ -16,13 +15,3 @@ export async function getSponsoredFPCAddress() {
|
|
|
16
15
|
});
|
|
17
16
|
return sponsoredFPCInstance.address;
|
|
18
17
|
}
|
|
19
|
-
|
|
20
|
-
export async function setupSponsoredFPC(pxe: PXE, log: LogFn) {
|
|
21
|
-
const SponsoredFPCContract = await getSponsoredFPCContract();
|
|
22
|
-
const sponsoredFPCInstance = await getContractInstanceFromInstantiationParams(SponsoredFPCContract.artifact, {
|
|
23
|
-
salt: new Fr(SPONSORED_FPC_SALT),
|
|
24
|
-
});
|
|
25
|
-
await pxe.registerContract({ instance: sponsoredFPCInstance, artifact: SponsoredFPCContract.artifact });
|
|
26
|
-
|
|
27
|
-
log(`SponsoredFPC: ${sponsoredFPCInstance.address}`);
|
|
28
|
-
}
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import { AztecAddress, type Fr } from '@aztec/aztec.js';
|
|
2
|
-
import type { LogFn, Logger } from '@aztec/foundation/log';
|
|
3
|
-
import { PublicKeys } from '@aztec/stdlib/keys';
|
|
4
|
-
export declare function addContract(rpcUrl: string, contractArtifactPath: string, address: AztecAddress, initializationHash: Fr, salt: Fr, publicKeys: PublicKeys, deployer: AztecAddress | undefined, debugLogger: Logger, log: LogFn): Promise<void>;
|
|
5
|
-
//# sourceMappingURL=add_contract.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"add_contract.d.ts","sourceRoot":"","sources":["../../../src/cmds/pxe/add_contract.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAoC,KAAK,EAAE,EAAgC,MAAM,iBAAiB,CAAC;AAExH,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAE3D,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAIhD,wBAAsB,WAAW,CAC/B,MAAM,EAAE,MAAM,EACd,oBAAoB,EAAE,MAAM,EAC5B,OAAO,EAAE,YAAY,EACrB,kBAAkB,EAAE,EAAE,EACtB,IAAI,EAAE,EAAE,EACR,UAAU,EAAE,UAAU,EACtB,QAAQ,EAAE,YAAY,GAAG,SAAS,EAClC,WAAW,EAAE,MAAM,EACnB,GAAG,EAAE,KAAK,iBAuBX"}
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import { AztecAddress, getContractClassFromArtifact } from '@aztec/aztec.js';
|
|
2
|
-
import { createCompatibleClient } from '@aztec/aztec.js';
|
|
3
|
-
import { computeContractAddressFromInstance } from '@aztec/stdlib/contract';
|
|
4
|
-
import { PublicKeys } from '@aztec/stdlib/keys';
|
|
5
|
-
import { getContractArtifact } from '../../utils/aztec.js';
|
|
6
|
-
export async function addContract(rpcUrl, contractArtifactPath, address, initializationHash, salt, publicKeys, deployer, debugLogger, log) {
|
|
7
|
-
const artifact = await getContractArtifact(contractArtifactPath, log);
|
|
8
|
-
const contractClass = await getContractClassFromArtifact(artifact);
|
|
9
|
-
const instance = {
|
|
10
|
-
version: 1,
|
|
11
|
-
salt,
|
|
12
|
-
initializationHash,
|
|
13
|
-
currentContractClassId: contractClass.id,
|
|
14
|
-
originalContractClassId: contractClass.id,
|
|
15
|
-
publicKeys: publicKeys ?? PublicKeys.default(),
|
|
16
|
-
address,
|
|
17
|
-
deployer: deployer ?? AztecAddress.ZERO
|
|
18
|
-
};
|
|
19
|
-
const computed = await computeContractAddressFromInstance(instance);
|
|
20
|
-
if (!computed.equals(address)) {
|
|
21
|
-
throw new Error(`Contract address ${address.toString()} does not match computed address ${computed.toString()}`);
|
|
22
|
-
}
|
|
23
|
-
const client = await createCompatibleClient(rpcUrl, debugLogger);
|
|
24
|
-
await client.registerContract({
|
|
25
|
-
artifact,
|
|
26
|
-
instance
|
|
27
|
-
});
|
|
28
|
-
log(`\nContract added to PXE at ${address.toString()} with class ${instance.currentContractClassId.toString()}\n`);
|
|
29
|
-
}
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import type { AztecAddress } from '@aztec/aztec.js';
|
|
2
|
-
import type { LogFn, Logger } from '@aztec/foundation/log';
|
|
3
|
-
export declare function getAccount(aztecAddress: AztecAddress, rpcUrl: string, debugLogger: Logger, log: LogFn): Promise<void>;
|
|
4
|
-
//# sourceMappingURL=get_account.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"get_account.d.ts","sourceRoot":"","sources":["../../../src/cmds/pxe/get_account.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAEpD,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAE3D,wBAAsB,UAAU,CAAC,YAAY,EAAE,YAAY,EAAE,MAAM,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,EAAE,GAAG,EAAE,KAAK,iBAW3G"}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { createCompatibleClient } from '@aztec/aztec.js';
|
|
2
|
-
export async function getAccount(aztecAddress, rpcUrl, debugLogger, log) {
|
|
3
|
-
const client = await createCompatibleClient(rpcUrl, debugLogger);
|
|
4
|
-
const account = (await client.getRegisteredAccounts()).find((completeAddress)=>completeAddress.address.equals(aztecAddress));
|
|
5
|
-
if (!account) {
|
|
6
|
-
log(`Unknown account ${aztecAddress.toString()}`);
|
|
7
|
-
} else {
|
|
8
|
-
log(account.toReadableString());
|
|
9
|
-
}
|
|
10
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"get_accounts.d.ts","sourceRoot":"","sources":["../../../src/cmds/pxe/get_accounts.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAE3D,wBAAsB,WAAW,CAC/B,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,OAAO,EACb,WAAW,EAAE,MAAM,EACnB,GAAG,EAAE,KAAK,EACV,OAAO,EAAE,CAAC,MAAM,EAAE,GAAG,KAAK,IAAI,iBA0B/B"}
|