@aztec/cli 3.0.0-nightly.20250924 → 3.0.0-nightly.20250926
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/index.d.ts.map +1 -1
- package/dest/cmds/l1/index.js +3 -3
- package/dest/config/chain_l2_config.d.ts.map +1 -1
- package/dest/config/chain_l2_config.js +13 -10
- 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/index.ts +2 -3
- package/src/config/chain_l2_config.ts +12 -8
- 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/README.md
CHANGED
|
@@ -37,18 +37,8 @@ These options are:
|
|
|
37
37
|
|
|
38
38
|
- `SECRET_KEY` -> `-sk, --secret-key` for all commands that require an Aztec secret key.
|
|
39
39
|
- `PUBLIC_KEY` -> `-k, --public-key` for all commands that require a public key.
|
|
40
|
-
- `PXE_URL` -> `-u, --rpc-url` for commands that require a PXE
|
|
41
40
|
- `ETHEREUM_HOSTS` -> `-u, --rpc-urls` or `--l1-rpc-urls` for `deploy-l1-contracts`.
|
|
42
41
|
|
|
43
|
-
So if for example you are running your Private eXecution Environment (PXE) remotely you can do:
|
|
44
|
-
|
|
45
|
-
```shell
|
|
46
|
-
export PXE_URL=http://external.site/rpc:8080
|
|
47
|
-
aztec-cli deploy my_contract.json
|
|
48
|
-
```
|
|
49
|
-
|
|
50
|
-
And this will send the request to `http://external.site/rpc:8080`.
|
|
51
|
-
|
|
52
42
|
**NOTE**: Entering an option value will override the environment variable.
|
|
53
43
|
|
|
54
44
|
## Available Commands
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import type { LogFn
|
|
2
|
-
export declare function getBlock(
|
|
1
|
+
import type { LogFn } from '@aztec/foundation/log';
|
|
2
|
+
export declare function getBlock(nodeUrl: string, maybeBlockNumber: number | undefined, log: LogFn): Promise<void>;
|
|
3
3
|
//# sourceMappingURL=get_block.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get_block.d.ts","sourceRoot":"","sources":["../../../src/cmds/aztec_node/get_block.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"get_block.d.ts","sourceRoot":"","sources":["../../../src/cmds/aztec_node/get_block.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AAInD,wBAAsB,QAAQ,CAAC,OAAO,EAAE,MAAM,EAAE,gBAAgB,EAAE,MAAM,GAAG,SAAS,EAAE,GAAG,EAAE,KAAK,iBAI/F"}
|
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
import { createAztecNodeClient
|
|
1
|
+
import { createAztecNodeClient } from '@aztec/aztec.js';
|
|
2
2
|
import { inspectBlock } from '../../utils/inspect.js';
|
|
3
|
-
export async function getBlock(
|
|
4
|
-
const client = await createCompatibleClient(pxeUrl, debugLogger);
|
|
3
|
+
export async function getBlock(nodeUrl, maybeBlockNumber, log) {
|
|
5
4
|
const aztecNode = createAztecNodeClient(nodeUrl);
|
|
6
5
|
const blockNumber = maybeBlockNumber ?? await aztecNode.getBlockNumber();
|
|
7
|
-
await inspectBlock(
|
|
6
|
+
await inspectBlock(aztecNode, blockNumber, log, {
|
|
8
7
|
showTxs: true
|
|
9
8
|
});
|
|
10
9
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/cmds/aztec_node/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAE3D,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/cmds/aztec_node/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAE3D,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAazC,wBAAgB,cAAc,CAAC,OAAO,EAAE,OAAO,EAAE,GAAG,EAAE,KAAK,EAAE,WAAW,EAAE,MAAM,WAuE/E"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { logJson, nodeOption, parseAztecAddress, parseField, parseOptionalAztecAddress, parseOptionalInteger, parseOptionalLogId, parseOptionalTxHash
|
|
1
|
+
import { logJson, nodeOption, parseAztecAddress, parseField, parseOptionalAztecAddress, parseOptionalInteger, parseOptionalLogId, parseOptionalTxHash } from '../../utils/commands.js';
|
|
2
2
|
export function injectCommands(program, log, debugLogger) {
|
|
3
|
-
program.command('get-block').description('Gets info for a given block or latest.').argument('[blockNumber]', 'Block height', parseOptionalInteger).addOption(
|
|
3
|
+
program.command('get-block').description('Gets info for a given block or latest.').argument('[blockNumber]', 'Block height', parseOptionalInteger).addOption(nodeOption).action(async (blockNumber, options)=>{
|
|
4
4
|
const { getBlock } = await import('./get_block.js');
|
|
5
|
-
await getBlock(options.
|
|
5
|
+
await getBlock(options.nodeUrl, blockNumber, log);
|
|
6
6
|
});
|
|
7
7
|
program.command('get-current-base-fee').description('Gets the current base fee.').addOption(nodeOption).action(async (options)=>{
|
|
8
8
|
const { getCurrentBaseFee } = await import('./get_current_base_fee.js');
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type { LogFn, Logger } from '@aztec/foundation/log';
|
|
2
|
-
export declare function bootstrapNetwork(
|
|
2
|
+
export declare function bootstrapNetwork(nodeUrl: string, l1Urls: string[], l1ChainId: string, l1PrivateKey: `0x${string}` | undefined, l1Mnemonic: string, addressIndex: number, json: boolean, log: LogFn, debugLog: Logger): Promise<void>;
|
|
3
3
|
//# sourceMappingURL=bootstrap_network.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bootstrap_network.d.ts","sourceRoot":"","sources":["../../../src/cmds/devnet/bootstrap_network.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"bootstrap_network.d.ts","sourceRoot":"","sources":["../../../src/cmds/devnet/bootstrap_network.ts"],"names":[],"mappings":"AAsBA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAsB3D,wBAAsB,gBAAgB,CACpC,OAAO,EAAE,MAAM,EACf,MAAM,EAAE,MAAM,EAAE,EAChB,SAAS,EAAE,MAAM,EACjB,YAAY,EAAE,KAAK,MAAM,EAAE,GAAG,SAAS,EACvC,UAAU,EAAE,MAAM,EAClB,YAAY,EAAE,MAAM,EACpB,IAAI,EAAE,OAAO,EACb,GAAG,EAAE,KAAK,EACV,QAAQ,EAAE,MAAM,iBAsFjB"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { getInitialTestAccountsData } from '@aztec/accounts/testing';
|
|
2
|
-
import { BatchCall, Fr, L1FeeJuicePortalManager, createAztecNodeClient,
|
|
2
|
+
import { BatchCall, Fr, L1FeeJuicePortalManager, createAztecNodeClient, retryUntil, waitForProven } from '@aztec/aztec.js';
|
|
3
3
|
import { createEthereumChain, createExtendedL1Client, deployL1Contract } from '@aztec/ethereum';
|
|
4
4
|
import { TestWallet } from '@aztec/test-wallet';
|
|
5
5
|
import { getContract } from 'viem';
|
|
@@ -12,10 +12,9 @@ const provenWaitOpts = {
|
|
|
12
12
|
provenTimeout: 4800,
|
|
13
13
|
interval: 1
|
|
14
14
|
};
|
|
15
|
-
export async function bootstrapNetwork(
|
|
16
|
-
const pxe = await createCompatibleClient(pxeUrl, debugLog);
|
|
15
|
+
export async function bootstrapNetwork(nodeUrl, l1Urls, l1ChainId, l1PrivateKey, l1Mnemonic, addressIndex, json, log, debugLog) {
|
|
17
16
|
const node = createAztecNodeClient(nodeUrl);
|
|
18
|
-
const wallet =
|
|
17
|
+
const wallet = await TestWallet.create(node);
|
|
19
18
|
// We assume here that the initial test accounts were prefunded with deploy-l1-contracts, and deployed with setup-l2-contracts
|
|
20
19
|
// so all we need to do is register them to our pxe.
|
|
21
20
|
const [accountData] = await getInitialTestAccountsData();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/cmds/devnet/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAE3D,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAIzC,wBAAgB,cAAc,CAAC,OAAO,EAAE,OAAO,EAAE,GAAG,EAAE,KAAK,EAAE,WAAW,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/cmds/devnet/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAE3D,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAIzC,wBAAgB,cAAc,CAAC,OAAO,EAAE,OAAO,EAAE,GAAG,EAAE,KAAK,EAAE,WAAW,EAAE,MAAM,WAqD/E"}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { ETHEREUM_HOSTS, l1ChainIdOption, nodeOption, parseEthereumAddress
|
|
1
|
+
import { ETHEREUM_HOSTS, l1ChainIdOption, nodeOption, parseEthereumAddress } from '../../utils/commands.js';
|
|
2
2
|
export function injectCommands(program, log, debugLogger) {
|
|
3
|
-
program.command('bootstrap-network').description('Bootstrap a new network').addOption(
|
|
3
|
+
program.command('bootstrap-network').description('Bootstrap a new network').addOption(nodeOption).addOption(l1ChainIdOption).requiredOption('--l1-rpc-urls <string>', 'List of Ethereum host URLs. Chain identifiers localhost and testnet can be used (comma separated)', (arg)=>arg.split(','), [
|
|
4
4
|
ETHEREUM_HOSTS
|
|
5
5
|
]).option('--l1-private-key <string>', 'The private key to use for deployment', process.env.PRIVATE_KEY).option('-m, --mnemonic <string>', 'The mnemonic to use in deployment', 'test test test test test test test test test test test junk').option('-ai, --address-index <number>', 'The address index to use when calculating an address', (arg)=>BigInt(arg), 0n).option('--json', 'Output the result as JSON').action(async (options)=>{
|
|
6
6
|
const { bootstrapNetwork } = await import('./bootstrap_network.js');
|
|
7
|
-
await bootstrapNetwork(options[
|
|
7
|
+
await bootstrapNetwork(options[nodeOption.attributeName()], options.l1RpcUrls, options[l1ChainIdOption.attributeName()], options.l1PrivateKey, options.mnemonic, options.addressIndex, options.json, log, debugLogger);
|
|
8
8
|
});
|
|
9
9
|
program.command('drip-faucet').description('Drip the faucet').requiredOption('-u, --faucet-url <string>', 'Url of the faucet', 'http://localhost:8082').requiredOption('-t, --token <string>', 'The asset to drip', 'eth').requiredOption('-a, --address <string>', 'The Ethereum address to drip to', parseEthereumAddress).option('--json', 'Output the result as JSON').action(async (options)=>{
|
|
10
10
|
const { dripFaucet } = await import('./faucet.js');
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/cmds/infrastructure/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AAEnD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAIzC,wBAAgB,cAAc,CAAC,OAAO,EAAE,OAAO,EAAE,GAAG,EAAE,KAAK,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/cmds/infrastructure/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AAEnD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAIzC,wBAAgB,cAAc,CAAC,OAAO,EAAE,OAAO,EAAE,GAAG,EAAE,KAAK,WA8C1D"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { ETHEREUM_HOSTS, l1ChainIdOption, nodeOption, parseOptionalInteger
|
|
1
|
+
import { ETHEREUM_HOSTS, l1ChainIdOption, nodeOption, parseOptionalInteger } from '../../utils/commands.js';
|
|
2
2
|
export function injectCommands(program, log) {
|
|
3
|
-
program.command('setup-protocol-contracts').description('Bootstrap the blockchain by initializing all the protocol contracts').addOption(
|
|
3
|
+
program.command('setup-protocol-contracts').description('Bootstrap the blockchain by initializing all the protocol contracts').addOption(nodeOption).option('--testAccounts', 'Deploy funded test accounts.').option('--json', 'Output the contract addresses in JSON format').action(async (options)=>{
|
|
4
4
|
const { setupL2Contracts } = await import('./setup_l2_contract.js');
|
|
5
|
-
await setupL2Contracts(options.
|
|
5
|
+
await setupL2Contracts(options.nodeUrl, options.testAccounts, options.json, log);
|
|
6
6
|
});
|
|
7
7
|
program.command('sequencers').argument('<command>', 'Command to run: list, add, remove, who-next').argument('[who]', 'Who to add/remove').description('Manages or queries registered sequencers on the L1 rollup contract.').requiredOption('--l1-rpc-urls <string>', 'List of Ethereum host URLs. Chain identifiers localhost and testnet can be used (comma separated)', (arg)=>arg.split(','), [
|
|
8
8
|
ETHEREUM_HOSTS
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type { LogFn } from '@aztec/foundation/log';
|
|
2
|
-
export declare function setupL2Contracts(
|
|
2
|
+
export declare function setupL2Contracts(nodeUrl: string, testAccounts: boolean, json: boolean, log: LogFn): Promise<void>;
|
|
3
3
|
//# sourceMappingURL=setup_l2_contract.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"setup_l2_contract.d.ts","sourceRoot":"","sources":["../../../src/cmds/infrastructure/setup_l2_contract.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"setup_l2_contract.d.ts","sourceRoot":"","sources":["../../../src/cmds/infrastructure/setup_l2_contract.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AAInD,wBAAsB,gBAAgB,CAAC,OAAO,EAAE,MAAM,EAAE,YAAY,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,GAAG,EAAE,KAAK,iBAwBvG"}
|
|
@@ -1,35 +1,23 @@
|
|
|
1
1
|
import { getInitialTestAccountsData } from '@aztec/accounts/testing';
|
|
2
|
-
import { createAztecNodeClient
|
|
2
|
+
import { createAztecNodeClient } from '@aztec/aztec.js';
|
|
3
3
|
import { jsonStringify } from '@aztec/foundation/json-rpc';
|
|
4
4
|
import { ProtocolContractAddress } from '@aztec/protocol-contracts';
|
|
5
5
|
import { TestWallet, deployFundedSchnorrAccounts } from '@aztec/test-wallet';
|
|
6
|
-
|
|
7
|
-
export async function setupL2Contracts(pxeUrl, nodeUrl, testAccounts, sponsoredFPC, json, log) {
|
|
6
|
+
export async function setupL2Contracts(nodeUrl, testAccounts, json, log) {
|
|
8
7
|
const waitOpts = {
|
|
9
8
|
timeout: 180,
|
|
10
9
|
interval: 1
|
|
11
10
|
};
|
|
12
11
|
log('setupL2Contracts: Wait options' + jsonStringify(waitOpts));
|
|
13
12
|
log('setupL2Contracts: Creating PXE client...');
|
|
14
|
-
const pxe = createPXEClient(pxeUrl, {}, makeFetch([
|
|
15
|
-
1,
|
|
16
|
-
1,
|
|
17
|
-
1,
|
|
18
|
-
1,
|
|
19
|
-
1
|
|
20
|
-
], false));
|
|
21
13
|
const node = createAztecNodeClient(nodeUrl);
|
|
22
|
-
const wallet =
|
|
14
|
+
const wallet = await TestWallet.create(node);
|
|
23
15
|
let deployedAccountManagers = [];
|
|
24
16
|
if (testAccounts) {
|
|
25
17
|
log('setupL2Contracts: Deploying test accounts...');
|
|
26
18
|
const initialAccountsData = await getInitialTestAccountsData();
|
|
27
19
|
deployedAccountManagers = await deployFundedSchnorrAccounts(wallet, initialAccountsData, waitOpts);
|
|
28
20
|
}
|
|
29
|
-
if (sponsoredFPC) {
|
|
30
|
-
log('setupL2Contracts: Setting up sponsored FPC...');
|
|
31
|
-
await setupSponsoredFPC(pxe, log);
|
|
32
|
-
}
|
|
33
21
|
if (json) {
|
|
34
22
|
const toPrint = {
|
|
35
23
|
...ProtocolContractAddress
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/cmds/l1/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAE3D,OAAO,EAAE,KAAK,OAAO,EAAU,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/cmds/l1/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAE3D,OAAO,EAAE,KAAK,OAAO,EAAU,MAAM,WAAW,CAAC;AAcjD,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAa3D,wBAAgB,cAAc,CAAC,OAAO,EAAE,OAAO,EAAE,GAAG,EAAE,KAAK,EAAE,WAAW,EAAE,MAAM,WAghB/E"}
|
package/dest/cmds/l1/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { EthAddress } from '@aztec/foundation/eth-address';
|
|
2
2
|
import { Option } from 'commander';
|
|
3
3
|
import { getL1RollupAddressFromEnv } from '../../config/get_l1_config.js';
|
|
4
|
-
import { ETHEREUM_HOSTS, MNEMONIC, PRIVATE_KEY, l1ChainIdOption, nodeOption, parseAztecAddress, parseBigint, parseEthereumAddress
|
|
4
|
+
import { ETHEREUM_HOSTS, MNEMONIC, PRIVATE_KEY, l1ChainIdOption, nodeOption, parseAztecAddress, parseBigint, parseEthereumAddress } from '../../utils/commands.js';
|
|
5
5
|
export { addL1Validator } from './update_l1_validators.js';
|
|
6
6
|
const l1RpcUrlsOption = new Option('--l1-rpc-urls <string>', 'List of Ethereum host URLs. Chain identifiers localhost and testnet can be used (comma separated)').env('ETHEREUM_HOSTS').default([
|
|
7
7
|
ETHEREUM_HOSTS
|
|
@@ -190,9 +190,9 @@ export function injectCommands(program, log, debugLogger) {
|
|
|
190
190
|
const { assumeProvenThrough } = await import('./assume_proven_through.js');
|
|
191
191
|
await assumeProvenThrough(blockNumber, options.l1RpcUrls, options.nodeUrl, log);
|
|
192
192
|
});
|
|
193
|
-
program.command('advance-epoch').description('Use L1 cheat codes to warp time until the next epoch.').addOption(l1RpcUrlsOption).addOption(
|
|
193
|
+
program.command('advance-epoch').description('Use L1 cheat codes to warp time until the next epoch.').addOption(l1RpcUrlsOption).addOption(nodeOption).action(async (options)=>{
|
|
194
194
|
const { advanceEpoch } = await import('./advance_epoch.js');
|
|
195
|
-
await advanceEpoch(options.l1RpcUrls, options.
|
|
195
|
+
await advanceEpoch(options.l1RpcUrls, options.nodeUrl, log);
|
|
196
196
|
});
|
|
197
197
|
program.command('prover-stats', {
|
|
198
198
|
hidden: true
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chain_l2_config.d.ts","sourceRoot":"","sources":["../../src/config/ch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AAC;IAChC,yBAAyB,CAAC,EAAE,MAAM,CAAC;IACnC,wBAAwB,CAAC,EAAE,MAAM,EAAE,CAAC;IAGpC,eAAe,EAAE,OAAO,CAAC;CAC1B,CAAC;AAuCJ,eAAO,MAAM,4BAA4B,EAAE,aA+E1C,CAAC;AAEF,eAAO,MAAM,0BAA0B,EAAE,aAmDxC,CAAC;AAEF,eAAO,MAAM,oBAAoB,EAAE,aAqDlC,CAAC;AAIF,wBAAsB,YAAY,CAAC,WAAW,EAAE,YAAY,EAAE,QAAQ,CAAC,EAAE,MAAM,gBAgC9E;AAED,wBAAsB,gBAAgB,CACpC,WAAW,EAAE,YAAY,EACzB,QAAQ,CAAC,EAAE,MAAM,GAChB,OAAO,CAAC,aAAa,GAAG,SAAS,CAAC,CAkBpC;AAuBD,wBAAsB,gCAAgC,CAAC,WAAW,EAAE,YAAY,iBA0F/E"}
|
|
@@ -5,6 +5,7 @@ import path, { dirname, join } from 'path';
|
|
|
5
5
|
import publicIncludeMetrics from '../../public_include_metric_prefixes.json' with {
|
|
6
6
|
type: 'json'
|
|
7
7
|
};
|
|
8
|
+
const SNAPSHOT_URL = 'https://pub-f4a8c34d4bb7441ebf8f48d904512180.r2.dev/snapshots';
|
|
8
9
|
const DefaultSlashConfig = {
|
|
9
10
|
/** Tally-style slashing */ slasherFlavor: 'tally',
|
|
10
11
|
/** Allow one round for vetoing */ slashingExecutionDelayInRounds: 1,
|
|
@@ -26,11 +27,12 @@ const DefaultSlashConfig = {
|
|
|
26
27
|
slashProposeInvalidAttestationsPenalty: DefaultL1ContractsConfig.slashAmountLarge,
|
|
27
28
|
slashAttestDescendantOfInvalidPenalty: DefaultL1ContractsConfig.slashAmountLarge,
|
|
28
29
|
slashUnknownPenalty: DefaultL1ContractsConfig.slashAmountSmall,
|
|
29
|
-
slashBroadcastedInvalidBlockPenalty:
|
|
30
|
+
slashBroadcastedInvalidBlockPenalty: 0n,
|
|
30
31
|
slashMaxPayloadSize: 50,
|
|
31
32
|
slashGracePeriodL2Slots: 32 * 2,
|
|
32
33
|
slashOffenseExpirationRounds: 8,
|
|
33
|
-
sentinelEnabled: true
|
|
34
|
+
sentinelEnabled: true,
|
|
35
|
+
slashExecuteRoundsLookBack: 4
|
|
34
36
|
};
|
|
35
37
|
export const stagingIgnitionL2ChainConfig = {
|
|
36
38
|
l1ChainId: 11155111,
|
|
@@ -38,13 +40,13 @@ export const stagingIgnitionL2ChainConfig = {
|
|
|
38
40
|
sponsoredFPC: false,
|
|
39
41
|
p2pEnabled: true,
|
|
40
42
|
p2pBootstrapNodes: [],
|
|
41
|
-
registryAddress: '
|
|
42
|
-
slashFactoryAddress: '
|
|
43
|
-
feeAssetHandlerAddress: '
|
|
43
|
+
registryAddress: '0x5f85fa0f40bc4b5ccd53c9f34258aa55d25cdde8',
|
|
44
|
+
slashFactoryAddress: '0x257db2ca1471b7f76f414d2997404bfbe916c8c9',
|
|
45
|
+
feeAssetHandlerAddress: '0x67d645b0a3e053605ea861d7e8909be6669812c4',
|
|
44
46
|
seqMinTxsPerBlock: 0,
|
|
45
47
|
seqMaxTxsPerBlock: 0,
|
|
46
48
|
realProofs: true,
|
|
47
|
-
snapshotsUrl:
|
|
49
|
+
snapshotsUrl: `${SNAPSHOT_URL}/staging-ignition/`,
|
|
48
50
|
autoUpdate: 'config-and-version',
|
|
49
51
|
autoUpdateUrl: 'https://storage.googleapis.com/aztec-testnet/auto-update/staging-ignition.json',
|
|
50
52
|
maxTxPoolSize: 100_000_000,
|
|
@@ -89,12 +91,13 @@ export const stagingIgnitionL2ChainConfig = {
|
|
|
89
91
|
slashProposeInvalidAttestationsPenalty: 50_000n * 10n ** 18n,
|
|
90
92
|
slashAttestDescendantOfInvalidPenalty: 50_000n * 10n ** 18n,
|
|
91
93
|
slashUnknownPenalty: 2_000n * 10n ** 18n,
|
|
92
|
-
slashBroadcastedInvalidBlockPenalty:
|
|
94
|
+
slashBroadcastedInvalidBlockPenalty: 0n,
|
|
93
95
|
slashMaxPayloadSize: 50,
|
|
94
96
|
slashGracePeriodL2Slots: 32 * 4,
|
|
95
97
|
slashOffenseExpirationRounds: 8,
|
|
96
98
|
sentinelEnabled: true,
|
|
97
|
-
slashingDisableDuration: 5 * 24 * 60 * 60
|
|
99
|
+
slashingDisableDuration: 5 * 24 * 60 * 60,
|
|
100
|
+
slashExecuteRoundsLookBack: 4
|
|
98
101
|
};
|
|
99
102
|
export const stagingPublicL2ChainConfig = {
|
|
100
103
|
l1ChainId: 11155111,
|
|
@@ -108,7 +111,7 @@ export const stagingPublicL2ChainConfig = {
|
|
|
108
111
|
seqMinTxsPerBlock: 0,
|
|
109
112
|
seqMaxTxsPerBlock: 20,
|
|
110
113
|
realProofs: true,
|
|
111
|
-
snapshotsUrl:
|
|
114
|
+
snapshotsUrl: `${SNAPSHOT_URL}/staging-public/`,
|
|
112
115
|
autoUpdate: 'config-and-version',
|
|
113
116
|
autoUpdateUrl: 'https://storage.googleapis.com/aztec-testnet/auto-update/staging-public.json',
|
|
114
117
|
publicIncludeMetrics,
|
|
@@ -146,7 +149,7 @@ export const testnetL2ChainConfig = {
|
|
|
146
149
|
seqMinTxsPerBlock: 0,
|
|
147
150
|
seqMaxTxsPerBlock: 20,
|
|
148
151
|
realProofs: true,
|
|
149
|
-
snapshotsUrl:
|
|
152
|
+
snapshotsUrl: `${SNAPSHOT_URL}/testnet/`,
|
|
150
153
|
autoUpdate: 'config-and-version',
|
|
151
154
|
autoUpdateUrl: 'https://storage.googleapis.com/aztec-testnet/auto-update/testnet.json',
|
|
152
155
|
maxTxPoolSize: 100_000_000,
|
package/dest/utils/commands.d.ts
CHANGED
|
@@ -16,8 +16,6 @@ export declare const getLocalhost: () => Promise<string>;
|
|
|
16
16
|
export declare const LOCALHOST: string;
|
|
17
17
|
export declare const ETHEREUM_HOSTS: string, PRIVATE_KEY: string | undefined, MNEMONIC: string | undefined, API_KEY: string | undefined, CLI_VERSION: string | undefined;
|
|
18
18
|
export declare function addOptions(program: Command, options: Option[]): Command;
|
|
19
|
-
export declare const makePxeOption: (mandatory: boolean) => Option;
|
|
20
|
-
export declare const pxeOption: Option;
|
|
21
19
|
export declare const makeNodeOption: (mandatory: boolean) => Option;
|
|
22
20
|
export declare const nodeOption: Option;
|
|
23
21
|
export declare const l1ChainIdOption: Option;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"commands.d.ts","sourceRoot":"","sources":["../../src/utils/commands.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AACzD,OAAO,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAC;AACzD,OAAO,EAAE,EAAE,EAAE,MAAM,wBAAwB,CAAC;AAC5C,OAAO,EAAE,KAAK,EAAE,MAAM,wBAAwB,CAAC;AAC/C,OAAO,EAAE,MAAM,EAAE,MAAM,yBAAyB,CAAC;AACjD,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AACnD,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,iCAAiC,CAAC;AAC3D,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAEhD,OAAO,EAAE,KAAK,OAAO,EAAwC,MAAM,EAAE,MAAM,WAAW,CAAC;AAIvF;;;GAGG;AACH,eAAO,MAAM,YAAY,uBAGI,CAAC;AAE9B,eAAO,MAAM,SAAS,QAAuB,CAAC;AAC9C,eAAO,MAAQ,cAAc,UAA+B,WAAW,sBAAE,QAAQ,sBAAE,OAAO,sBAAE,WAAW,oBAAgB,CAAC;AAExH,wBAAgB,UAAU,CAAC,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,WAG7D;AAED,eAAO,MAAM,
|
|
1
|
+
{"version":3,"file":"commands.d.ts","sourceRoot":"","sources":["../../src/utils/commands.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,C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K,EAAE,MAAM,GAAG,EAAE,CAyB5C;AAED;;;;GAIG;AACH,wBAAgB,WAAW,CAAC,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,EAAE,CAElD;AAED;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,MAAM,CAcjE"}
|
package/dest/utils/commands.js
CHANGED
|
@@ -18,9 +18,7 @@ export function addOptions(program, options) {
|
|
|
18
18
|
options.forEach((option)=>program.addOption(option));
|
|
19
19
|
return program;
|
|
20
20
|
}
|
|
21
|
-
export const
|
|
22
|
-
export const pxeOption = makePxeOption(true);
|
|
23
|
-
export const makeNodeOption = (mandatory)=>new Option('-n, --node-url <string>', 'URL of the Aztec node').env('AZTEC_NODE_URL').default(`http://${LOCALHOST}:8079`).makeOptionMandatory(mandatory);
|
|
21
|
+
export const makeNodeOption = (mandatory)=>new Option('-n, --node-url <string>', 'URL of the Aztec node').env('AZTEC_NODE_URL').default(`http://${LOCALHOST}:8080`).makeOptionMandatory(mandatory);
|
|
24
22
|
export const nodeOption = makeNodeOption(true);
|
|
25
23
|
export const l1ChainIdOption = new Option('-c, --l1-chain-id <number>', 'Chain ID of the ethereum host').env('L1_CHAIN_ID').default(31337).argParser((value)=>{
|
|
26
24
|
const parsedValue = Number(value);
|
package/dest/utils/inspect.d.ts
CHANGED
|
@@ -1,17 +1,10 @@
|
|
|
1
|
-
import type { ContractArtifact, Fr } from '@aztec/aztec.js';
|
|
2
1
|
import type { LogFn } from '@aztec/foundation/log';
|
|
3
|
-
import type { AztecNode
|
|
2
|
+
import type { AztecNode } from '@aztec/stdlib/interfaces/client';
|
|
4
3
|
import type { TxHash } from '@aztec/stdlib/tx';
|
|
5
|
-
export declare function inspectBlock(
|
|
4
|
+
export declare function inspectBlock(aztecNode: AztecNode, blockNumber: number, log: LogFn, opts?: {
|
|
6
5
|
showTxs?: boolean;
|
|
7
6
|
}): Promise<void>;
|
|
8
|
-
export declare function inspectTx(
|
|
7
|
+
export declare function inspectTx(aztecNode: AztecNode, txHash: TxHash, log: LogFn, opts?: {
|
|
9
8
|
includeBlockInfo?: boolean;
|
|
10
|
-
artifactMap?: ArtifactMap;
|
|
11
9
|
}): Promise<void>;
|
|
12
|
-
type ArtifactMap = Record<string, ContractArtifactWithClassId>;
|
|
13
|
-
type ContractArtifactWithClassId = ContractArtifact & {
|
|
14
|
-
classId: Fr;
|
|
15
|
-
};
|
|
16
|
-
export {};
|
|
17
10
|
//# sourceMappingURL=inspect.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"inspect.d.ts","sourceRoot":"","sources":["../../src/utils/inspect.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"inspect.d.ts","sourceRoot":"","sources":["../../src/utils/inspect.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AACnD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iCAAiC,CAAC;AACjE,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAE/C,wBAAsB,YAAY,CAChC,SAAS,EAAE,SAAS,EACpB,WAAW,EAAE,MAAM,EACnB,GAAG,EAAE,KAAK,EACV,IAAI,GAAE;IAAE,OAAO,CAAC,EAAE,OAAO,CAAA;CAAO,iBA0BjC;AAED,wBAAsB,SAAS,CAC7B,SAAS,EAAE,SAAS,EACpB,MAAM,EAAE,MAAM,EACd,GAAG,EAAE,KAAK,EACV,IAAI,GAAE;IAAE,gBAAgB,CAAC,EAAE,OAAO,CAAA;CAAO,iBAmE1C"}
|
package/dest/utils/inspect.js
CHANGED
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
import { siloNullifier } from '@aztec/stdlib/hash';
|
|
3
|
-
export async function inspectBlock(pxe, aztecNode, blockNumber, log, opts = {}) {
|
|
1
|
+
export async function inspectBlock(aztecNode, blockNumber, log, opts = {}) {
|
|
4
2
|
const block = await aztecNode.getBlock(blockNumber);
|
|
5
3
|
if (!block) {
|
|
6
4
|
log(`No block found for block number ${blockNumber}`);
|
|
@@ -16,18 +14,16 @@ export async function inspectBlock(pxe, aztecNode, blockNumber, log, opts = {})
|
|
|
16
14
|
log(` Timestamp: ${new Date(Number(block.header.globalVariables.timestamp) * 500)}`);
|
|
17
15
|
if (opts.showTxs) {
|
|
18
16
|
log(``);
|
|
19
|
-
const artifactMap = await getKnownArtifacts(pxe);
|
|
20
17
|
for (const txHash of block.body.txEffects.map((tx)=>tx.txHash)){
|
|
21
|
-
await inspectTx(
|
|
22
|
-
includeBlockInfo: false
|
|
23
|
-
artifactMap
|
|
18
|
+
await inspectTx(aztecNode, txHash, log, {
|
|
19
|
+
includeBlockInfo: false
|
|
24
20
|
});
|
|
25
21
|
}
|
|
26
22
|
} else {
|
|
27
23
|
log(` Transactions: ${block.body.txEffects.length}`);
|
|
28
24
|
}
|
|
29
25
|
}
|
|
30
|
-
export async function inspectTx(
|
|
26
|
+
export async function inspectTx(aztecNode, txHash, log, opts = {}) {
|
|
31
27
|
const [receipt, effectsInBlock] = await Promise.all([
|
|
32
28
|
aztecNode.getTxReceipt(txHash),
|
|
33
29
|
aztecNode.getTxEffect(txHash)
|
|
@@ -42,7 +38,6 @@ export async function inspectTx(pxe, aztecNode, txHash, log, opts = {}) {
|
|
|
42
38
|
return;
|
|
43
39
|
}
|
|
44
40
|
const effects = effectsInBlock.data;
|
|
45
|
-
const artifactMap = opts?.artifactMap ?? await getKnownArtifacts(pxe);
|
|
46
41
|
if (opts.includeBlockInfo) {
|
|
47
42
|
log(` Block: ${receipt.blockNumber} (${receipt.blockHash?.toString()})`);
|
|
48
43
|
}
|
|
@@ -74,32 +69,12 @@ export async function inspectTx(pxe, aztecNode, txHash, log, opts = {}) {
|
|
|
74
69
|
log(` Note hash: ${note.toShortString()}`);
|
|
75
70
|
}
|
|
76
71
|
}
|
|
77
|
-
//
|
|
78
|
-
const
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
const deployed = deployNullifiers[nullifier.toString()];
|
|
84
|
-
const note = deployed ? (await pxe.getNotes({
|
|
85
|
-
siloedNullifier: nullifier,
|
|
86
|
-
contractAddress: deployed
|
|
87
|
-
}))[0] : undefined;
|
|
88
|
-
const initialized = initNullifiers[nullifier.toString()];
|
|
89
|
-
const registered = classNullifiers[nullifier.toString()];
|
|
90
|
-
if (nullifier.toBuffer().equals(txHash.toBuffer())) {
|
|
91
|
-
log(` Transaction hash nullifier ${nullifier.toShortString()}`);
|
|
92
|
-
} else if (note) {
|
|
93
|
-
inspectNote(note, artifactMap, log, `Nullifier ${nullifier.toShortString()} for note`);
|
|
94
|
-
} else if (deployed) {
|
|
95
|
-
log(` Contract ${toFriendlyAddress(deployed, artifactMap)} deployed via nullifier ${nullifier.toShortString()}`);
|
|
96
|
-
} else if (initialized) {
|
|
97
|
-
log(` Contract ${toFriendlyAddress(initialized, artifactMap)} initialized via nullifier ${nullifier.toShortString()}`);
|
|
98
|
-
} else if (registered) {
|
|
99
|
-
log(` Class ${registered} registered via nullifier ${nullifier.toShortString()}`);
|
|
100
|
-
} else {
|
|
101
|
-
log(` Unknown nullifier ${nullifier.toString()}`);
|
|
102
|
-
}
|
|
72
|
+
// Created nullifiers
|
|
73
|
+
const nullifiers = effects.nullifiers;
|
|
74
|
+
if (nullifiers.length > 0) {
|
|
75
|
+
log(' Created nullifiers:');
|
|
76
|
+
for (const nullifier of nullifiers){
|
|
77
|
+
log(` Nullifier: ${nullifier.toShortString()}`);
|
|
103
78
|
}
|
|
104
79
|
}
|
|
105
80
|
// L2 to L1 messages
|
|
@@ -110,60 +85,3 @@ export async function inspectTx(pxe, aztecNode, txHash, log, opts = {}) {
|
|
|
110
85
|
}
|
|
111
86
|
}
|
|
112
87
|
}
|
|
113
|
-
function inspectNote(note, artifactMap, log, text = 'Note') {
|
|
114
|
-
const artifact = artifactMap[note.contractAddress.toString()];
|
|
115
|
-
const contract = artifact?.name ?? note.contractAddress.toString();
|
|
116
|
-
log(` ${text} at ${contract}`);
|
|
117
|
-
log(` Recipient: ${toFriendlyAddress(note.recipient, artifactMap)}`);
|
|
118
|
-
for (const field of note.note.items){
|
|
119
|
-
log(` ${field.toString()}`);
|
|
120
|
-
}
|
|
121
|
-
}
|
|
122
|
-
function toFriendlyAddress(address, artifactMap) {
|
|
123
|
-
const artifact = artifactMap[address.toString()];
|
|
124
|
-
if (!artifact) {
|
|
125
|
-
return address.toString();
|
|
126
|
-
}
|
|
127
|
-
return `${artifact.name}<${address.toString()}>`;
|
|
128
|
-
}
|
|
129
|
-
async function getKnownNullifiers(pxe, artifactMap) {
|
|
130
|
-
const knownContracts = await pxe.getContracts();
|
|
131
|
-
const deployerAddress = ProtocolContractAddress.ContractInstanceRegistry;
|
|
132
|
-
const classRegistryAddress = ProtocolContractAddress.ContractClassRegistry;
|
|
133
|
-
const initNullifiers = {};
|
|
134
|
-
const deployNullifiers = {};
|
|
135
|
-
const classNullifiers = {};
|
|
136
|
-
for (const contract of knownContracts){
|
|
137
|
-
initNullifiers[(await siloNullifier(contract, contract.toField())).toString()] = contract;
|
|
138
|
-
deployNullifiers[(await siloNullifier(deployerAddress, contract.toField())).toString()] = contract;
|
|
139
|
-
}
|
|
140
|
-
for (const artifact of Object.values(artifactMap)){
|
|
141
|
-
classNullifiers[(await siloNullifier(classRegistryAddress, artifact.classId)).toString()] = `${artifact.name}Class<${artifact.classId}>`;
|
|
142
|
-
}
|
|
143
|
-
return {
|
|
144
|
-
initNullifiers,
|
|
145
|
-
deployNullifiers,
|
|
146
|
-
classNullifiers
|
|
147
|
-
};
|
|
148
|
-
}
|
|
149
|
-
async function getKnownArtifacts(pxe) {
|
|
150
|
-
const knownContractAddresses = await pxe.getContracts();
|
|
151
|
-
const knownContracts = (await Promise.all(knownContractAddresses.map((contractAddress)=>pxe.getContractMetadata(contractAddress)))).map((contractMetadata)=>contractMetadata.contractInstance);
|
|
152
|
-
const classIds = [
|
|
153
|
-
...new Set(knownContracts.map((contract)=>contract?.currentContractClassId))
|
|
154
|
-
];
|
|
155
|
-
const knownArtifacts = (await Promise.all(classIds.map((classId)=>classId ? pxe.getContractClassMetadata(classId) : undefined))).map((contractClassMetadata)=>contractClassMetadata ? {
|
|
156
|
-
...contractClassMetadata.artifact,
|
|
157
|
-
classId: contractClassMetadata.contractClass?.id
|
|
158
|
-
} : undefined);
|
|
159
|
-
const map = {};
|
|
160
|
-
for (const instance of knownContracts){
|
|
161
|
-
if (instance) {
|
|
162
|
-
const artifact = knownArtifacts.find((a)=>a?.classId?.equals(instance.currentContractClassId));
|
|
163
|
-
if (artifact) {
|
|
164
|
-
map[instance.address.toString()] = artifact;
|
|
165
|
-
}
|
|
166
|
-
}
|
|
167
|
-
}
|
|
168
|
-
return map;
|
|
169
|
-
}
|
|
@@ -1,5 +1,2 @@
|
|
|
1
|
-
import { type PXE } from '@aztec/aztec.js';
|
|
2
|
-
import type { LogFn } from '@aztec/foundation/log';
|
|
3
1
|
export declare function getSponsoredFPCAddress(): Promise<import("@aztec/aztec.js").AztecAddress>;
|
|
4
|
-
export declare function setupSponsoredFPC(pxe: PXE, log: LogFn): Promise<void>;
|
|
5
2
|
//# sourceMappingURL=setup_contracts.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"setup_contracts.d.ts","sourceRoot":"","sources":["../../src/utils/setup_contracts.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"setup_contracts.d.ts","sourceRoot":"","sources":["../../src/utils/setup_contracts.ts"],"names":[],"mappings":"AAUA,wBAAsB,sBAAsB,oDAM3C"}
|
|
@@ -13,14 +13,3 @@ export async function getSponsoredFPCAddress() {
|
|
|
13
13
|
});
|
|
14
14
|
return sponsoredFPCInstance.address;
|
|
15
15
|
}
|
|
16
|
-
export async function setupSponsoredFPC(pxe, log) {
|
|
17
|
-
const SponsoredFPCContract = await getSponsoredFPCContract();
|
|
18
|
-
const sponsoredFPCInstance = await getContractInstanceFromInstantiationParams(SponsoredFPCContract.artifact, {
|
|
19
|
-
salt: new Fr(SPONSORED_FPC_SALT)
|
|
20
|
-
});
|
|
21
|
-
await pxe.registerContract({
|
|
22
|
-
instance: sponsoredFPCInstance,
|
|
23
|
-
artifact: SponsoredFPCContract.artifact
|
|
24
|
-
});
|
|
25
|
-
log(`SponsoredFPC: ${sponsoredFPCInstance.address}`);
|
|
26
|
-
}
|
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.20250926",
|
|
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.20250926",
|
|
74
|
+
"@aztec/archiver": "3.0.0-nightly.20250926",
|
|
75
|
+
"@aztec/aztec.js": "3.0.0-nightly.20250926",
|
|
76
|
+
"@aztec/constants": "3.0.0-nightly.20250926",
|
|
77
|
+
"@aztec/entrypoints": "3.0.0-nightly.20250926",
|
|
78
|
+
"@aztec/ethereum": "3.0.0-nightly.20250926",
|
|
79
|
+
"@aztec/foundation": "3.0.0-nightly.20250926",
|
|
80
|
+
"@aztec/l1-artifacts": "3.0.0-nightly.20250926",
|
|
81
|
+
"@aztec/node-lib": "3.0.0-nightly.20250926",
|
|
82
|
+
"@aztec/p2p": "3.0.0-nightly.20250926",
|
|
83
|
+
"@aztec/protocol-contracts": "3.0.0-nightly.20250926",
|
|
84
|
+
"@aztec/stdlib": "3.0.0-nightly.20250926",
|
|
85
|
+
"@aztec/test-wallet": "3.0.0-nightly.20250926",
|
|
86
|
+
"@aztec/world-state": "3.0.0-nightly.20250926",
|
|
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.20250926",
|
|
114
|
+
"@aztec/bb-prover": "3.0.0-nightly.20250926",
|
|
115
|
+
"@aztec/ethereum": "3.0.0-nightly.20250926",
|
|
116
|
+
"@aztec/l1-artifacts": "3.0.0-nightly.20250926",
|
|
117
|
+
"@aztec/noir-contracts.js": "3.0.0-nightly.20250926",
|
|
118
|
+
"@aztec/noir-protocol-circuits-types": "3.0.0-nightly.20250926",
|
|
119
|
+
"@aztec/noir-test-contracts.js": "3.0.0-nightly.20250926",
|
|
120
|
+
"@aztec/protocol-contracts": "3.0.0-nightly.20250926",
|
|
121
|
+
"@aztec/stdlib": "3.0.0-nightly.20250926"
|
|
123
122
|
},
|
|
124
123
|
"files": [
|
|
125
124
|
"dest",
|