@aztec/cli 3.0.0-canary.a9708bd → 3.0.0-devnet.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (173) hide show
  1. package/README.md +1 -427
  2. package/dest/cmds/aztec_node/block_number.d.ts +3 -0
  3. package/dest/cmds/aztec_node/block_number.d.ts.map +1 -0
  4. package/dest/cmds/aztec_node/block_number.js +10 -0
  5. package/dest/cmds/aztec_node/get_block.d.ts +3 -0
  6. package/dest/cmds/aztec_node/get_block.d.ts.map +1 -0
  7. package/dest/cmds/aztec_node/get_block.js +9 -0
  8. package/dest/cmds/aztec_node/get_current_base_fee.d.ts +3 -0
  9. package/dest/cmds/aztec_node/get_current_base_fee.d.ts.map +1 -0
  10. package/dest/cmds/aztec_node/get_current_base_fee.js +7 -0
  11. package/dest/cmds/aztec_node/get_l1_to_l2_message_witness.d.ts +5 -0
  12. package/dest/cmds/aztec_node/get_l1_to_l2_message_witness.d.ts.map +1 -0
  13. package/dest/cmds/aztec_node/get_l1_to_l2_message_witness.js +12 -0
  14. package/dest/cmds/aztec_node/get_logs.d.ts +6 -0
  15. package/dest/cmds/aztec_node/get_logs.d.ts.map +1 -0
  16. package/dest/cmds/{pxe → aztec_node}/get_logs.js +4 -4
  17. package/dest/cmds/aztec_node/get_node_info.d.ts +3 -0
  18. package/dest/cmds/aztec_node/get_node_info.d.ts.map +1 -0
  19. package/dest/cmds/{pxe → aztec_node}/get_node_info.js +3 -8
  20. package/dest/cmds/aztec_node/index.d.ts.map +1 -0
  21. package/dest/cmds/aztec_node/index.js +28 -0
  22. package/dest/cmds/infrastructure/index.d.ts +2 -2
  23. package/dest/cmds/infrastructure/index.d.ts.map +1 -1
  24. package/dest/cmds/infrastructure/index.js +7 -8
  25. package/dest/cmds/infrastructure/sequencers.d.ts +2 -3
  26. package/dest/cmds/infrastructure/sequencers.d.ts.map +1 -1
  27. package/dest/cmds/infrastructure/sequencers.js +4 -3
  28. package/dest/cmds/infrastructure/setup_l2_contract.d.ts +1 -1
  29. package/dest/cmds/infrastructure/setup_l2_contract.d.ts.map +1 -1
  30. package/dest/cmds/infrastructure/setup_l2_contract.js +10 -25
  31. package/dest/cmds/l1/advance_epoch.d.ts +1 -1
  32. package/dest/cmds/l1/advance_epoch.d.ts.map +1 -1
  33. package/dest/cmds/l1/advance_epoch.js +6 -5
  34. package/dest/cmds/l1/assume_proven_through.d.ts +1 -1
  35. package/dest/cmds/l1/assume_proven_through.d.ts.map +1 -1
  36. package/dest/cmds/l1/assume_proven_through.js +7 -6
  37. package/dest/cmds/l1/bridge_erc20.d.ts +1 -1
  38. package/dest/cmds/l1/bridge_erc20.d.ts.map +1 -1
  39. package/dest/cmds/l1/bridge_erc20.js +1 -1
  40. package/dest/cmds/l1/deploy_l1_contracts.d.ts +2 -2
  41. package/dest/cmds/l1/deploy_l1_contracts.d.ts.map +1 -1
  42. package/dest/cmds/l1/deploy_l1_contracts.js +5 -5
  43. package/dest/cmds/l1/deploy_new_rollup.d.ts +1 -1
  44. package/dest/cmds/l1/deploy_new_rollup.d.ts.map +1 -1
  45. package/dest/cmds/l1/deploy_new_rollup.js +4 -4
  46. package/dest/cmds/l1/get_l1_addresses.d.ts +1 -1
  47. package/dest/cmds/l1/get_l1_addresses.d.ts.map +1 -1
  48. package/dest/cmds/l1/index.d.ts.map +1 -1
  49. package/dest/cmds/l1/index.js +18 -34
  50. package/dest/cmds/l1/update_l1_validators.d.ts +5 -0
  51. package/dest/cmds/l1/update_l1_validators.d.ts.map +1 -1
  52. package/dest/cmds/l1/update_l1_validators.js +67 -6
  53. package/dest/cmds/misc/generate_secret_and_hash.js +1 -1
  54. package/dest/cmds/misc/generate_secret_key.d.ts +1 -1
  55. package/dest/cmds/misc/generate_secret_key.d.ts.map +1 -1
  56. package/dest/cmds/misc/generate_secret_key.js +1 -1
  57. package/dest/config/cached_fetch.d.ts +18 -0
  58. package/dest/config/cached_fetch.d.ts.map +1 -0
  59. package/dest/config/cached_fetch.js +54 -0
  60. package/dest/config/chain_l2_config.d.ts +37 -0
  61. package/dest/config/chain_l2_config.d.ts.map +1 -0
  62. package/dest/config/chain_l2_config.js +444 -0
  63. package/dest/config/enrich_env.d.ts +4 -0
  64. package/dest/config/enrich_env.d.ts.map +1 -0
  65. package/dest/config/enrich_env.js +12 -0
  66. package/dest/config/get_l1_config.d.ts +8 -0
  67. package/dest/config/get_l1_config.d.ts.map +1 -0
  68. package/dest/config/get_l1_config.js +22 -0
  69. package/dest/config/index.d.ts +5 -0
  70. package/dest/config/index.d.ts.map +1 -0
  71. package/dest/config/index.js +4 -0
  72. package/dest/config/network_config.d.ts +19 -0
  73. package/dest/config/network_config.d.ts.map +1 -0
  74. package/dest/config/network_config.js +79 -0
  75. package/dest/utils/aztec.d.ts +3 -9
  76. package/dest/utils/aztec.d.ts.map +1 -1
  77. package/dest/utils/aztec.js +8 -32
  78. package/dest/utils/commands.d.ts +6 -7
  79. package/dest/utils/commands.d.ts.map +1 -1
  80. package/dest/utils/commands.js +5 -6
  81. package/dest/utils/inspect.d.ts +3 -10
  82. package/dest/utils/inspect.d.ts.map +1 -1
  83. package/dest/utils/inspect.js +13 -95
  84. package/dest/utils/setup_contracts.d.ts +1 -3
  85. package/dest/utils/setup_contracts.d.ts.map +1 -1
  86. package/dest/utils/setup_contracts.js +2 -22
  87. package/package.json +28 -25
  88. package/src/cmds/aztec_node/block_number.ts +9 -0
  89. package/src/cmds/aztec_node/get_block.ts +10 -0
  90. package/src/cmds/aztec_node/get_current_base_fee.ts +9 -0
  91. package/src/cmds/aztec_node/get_l1_to_l2_message_witness.ts +27 -0
  92. package/src/cmds/{pxe → aztec_node}/get_logs.ts +8 -7
  93. package/src/cmds/{pxe → aztec_node}/get_node_info.ts +5 -16
  94. package/src/cmds/aztec_node/index.ts +87 -0
  95. package/src/cmds/infrastructure/index.ts +7 -17
  96. package/src/cmds/infrastructure/sequencers.ts +6 -6
  97. package/src/cmds/infrastructure/setup_l2_contract.ts +13 -30
  98. package/src/cmds/l1/advance_epoch.ts +6 -5
  99. package/src/cmds/l1/assume_proven_through.ts +7 -6
  100. package/src/cmds/l1/bridge_erc20.ts +3 -1
  101. package/src/cmds/l1/deploy_l1_contracts.ts +6 -3
  102. package/src/cmds/l1/deploy_new_rollup.ts +4 -2
  103. package/src/cmds/l1/get_l1_addresses.ts +1 -1
  104. package/src/cmds/l1/index.ts +25 -53
  105. package/src/cmds/l1/update_l1_validators.ts +81 -6
  106. package/src/cmds/misc/generate_secret_and_hash.ts +1 -1
  107. package/src/cmds/misc/generate_secret_key.ts +1 -1
  108. package/src/config/cached_fetch.ts +67 -0
  109. package/src/config/chain_l2_config.ts +585 -0
  110. package/src/config/enrich_env.ts +15 -0
  111. package/src/config/get_l1_config.ts +28 -0
  112. package/src/config/index.ts +4 -0
  113. package/src/config/network_config.ts +102 -0
  114. package/src/utils/aztec.ts +8 -40
  115. package/src/utils/commands.ts +8 -10
  116. package/src/utils/inspect.ts +18 -111
  117. package/src/utils/setup_contracts.ts +4 -43
  118. package/dest/cmds/devnet/bootstrap_network.d.ts +0 -3
  119. package/dest/cmds/devnet/bootstrap_network.d.ts.map +0 -1
  120. package/dest/cmds/devnet/bootstrap_network.js +0 -216
  121. package/dest/cmds/devnet/faucet.d.ts +0 -4
  122. package/dest/cmds/devnet/faucet.d.ts.map +0 -1
  123. package/dest/cmds/devnet/faucet.js +0 -26
  124. package/dest/cmds/devnet/index.d.ts.map +0 -1
  125. package/dest/cmds/devnet/index.js +0 -14
  126. package/dest/cmds/pxe/add_contract.d.ts +0 -5
  127. package/dest/cmds/pxe/add_contract.d.ts.map +0 -1
  128. package/dest/cmds/pxe/add_contract.js +0 -29
  129. package/dest/cmds/pxe/block_number.d.ts +0 -3
  130. package/dest/cmds/pxe/block_number.d.ts.map +0 -1
  131. package/dest/cmds/pxe/block_number.js +0 -10
  132. package/dest/cmds/pxe/get_account.d.ts +0 -4
  133. package/dest/cmds/pxe/get_account.d.ts.map +0 -1
  134. package/dest/cmds/pxe/get_account.js +0 -10
  135. package/dest/cmds/pxe/get_accounts.d.ts +0 -3
  136. package/dest/cmds/pxe/get_accounts.d.ts.map +0 -1
  137. package/dest/cmds/pxe/get_accounts.js +0 -25
  138. package/dest/cmds/pxe/get_block.d.ts +0 -3
  139. package/dest/cmds/pxe/get_block.d.ts.map +0 -1
  140. package/dest/cmds/pxe/get_block.js +0 -9
  141. package/dest/cmds/pxe/get_contract_data.d.ts +0 -4
  142. package/dest/cmds/pxe/get_contract_data.d.ts.map +0 -1
  143. package/dest/cmds/pxe/get_contract_data.js +0 -31
  144. package/dest/cmds/pxe/get_current_base_fee.d.ts +0 -3
  145. package/dest/cmds/pxe/get_current_base_fee.d.ts.map +0 -1
  146. package/dest/cmds/pxe/get_current_base_fee.js +0 -7
  147. package/dest/cmds/pxe/get_l1_to_l2_message_witness.d.ts +0 -4
  148. package/dest/cmds/pxe/get_l1_to_l2_message_witness.d.ts.map +0 -1
  149. package/dest/cmds/pxe/get_l1_to_l2_message_witness.js +0 -11
  150. package/dest/cmds/pxe/get_logs.d.ts +0 -4
  151. package/dest/cmds/pxe/get_logs.d.ts.map +0 -1
  152. package/dest/cmds/pxe/get_node_info.d.ts +0 -3
  153. package/dest/cmds/pxe/get_node_info.d.ts.map +0 -1
  154. package/dest/cmds/pxe/get_pxe_info.d.ts +0 -3
  155. package/dest/cmds/pxe/get_pxe_info.d.ts.map +0 -1
  156. package/dest/cmds/pxe/get_pxe_info.js +0 -11
  157. package/dest/cmds/pxe/index.d.ts +0 -4
  158. package/dest/cmds/pxe/index.d.ts.map +0 -1
  159. package/dest/cmds/pxe/index.js +0 -55
  160. package/src/cmds/devnet/bootstrap_network.ts +0 -321
  161. package/src/cmds/devnet/faucet.ts +0 -33
  162. package/src/cmds/devnet/index.ts +0 -60
  163. package/src/cmds/pxe/add_contract.ts +0 -41
  164. package/src/cmds/pxe/block_number.ts +0 -9
  165. package/src/cmds/pxe/get_account.ts +0 -16
  166. package/src/cmds/pxe/get_accounts.ts +0 -35
  167. package/src/cmds/pxe/get_block.ts +0 -10
  168. package/src/cmds/pxe/get_contract_data.ts +0 -51
  169. package/src/cmds/pxe/get_current_base_fee.ts +0 -9
  170. package/src/cmds/pxe/get_l1_to_l2_message_witness.ts +0 -25
  171. package/src/cmds/pxe/get_pxe_info.ts +0 -13
  172. package/src/cmds/pxe/index.ts +0 -170
  173. /package/dest/cmds/{devnet → aztec_node}/index.d.ts +0 -0
@@ -0,0 +1,79 @@
1
+ import { NetworkConfigMapSchema } from '@aztec/foundation/config';
2
+ import { readFile } from 'fs/promises';
3
+ import { join } from 'path';
4
+ import { cachedFetch } from './cached_fetch.js';
5
+ import { enrichEthAddressVar, enrichVar } from './enrich_env.js';
6
+ const DEFAULT_CONFIG_URL = 'https://raw.githubusercontent.com/AztecProtocol/networks/refs/heads/main/network_config.json';
7
+ const NETWORK_CONFIG_CACHE_DURATION_MS = 60 * 60 * 1000; // 1 hour
8
+ /**
9
+ * Fetches remote network configuration from GitHub with caching support.
10
+ * Uses the reusable cachedFetch utility.
11
+ *
12
+ * @param networkName - The network name to fetch config for
13
+ * @param cacheDir - Optional cache directory for storing fetched config
14
+ * @returns Remote configuration for the specified network, or undefined if not found/error
15
+ */ export async function getNetworkConfig(networkName, cacheDir) {
16
+ let url;
17
+ const configLocation = process.env.NETWORK_CONFIG_LOCATION || DEFAULT_CONFIG_URL;
18
+ if (!configLocation) {
19
+ return undefined;
20
+ }
21
+ try {
22
+ if (configLocation.includes('://')) {
23
+ url = new URL(configLocation);
24
+ } else {
25
+ url = new URL(`file://${configLocation}`);
26
+ }
27
+ } catch {
28
+ /* no-op */ }
29
+ if (!url) {
30
+ return undefined;
31
+ }
32
+ try {
33
+ let rawConfig;
34
+ if (url.protocol === 'http:' || url.protocol === 'https:') {
35
+ rawConfig = await cachedFetch(url.href, {
36
+ cacheDurationMs: NETWORK_CONFIG_CACHE_DURATION_MS,
37
+ cacheFile: cacheDir ? join(cacheDir, networkName, 'network_config.json') : undefined
38
+ });
39
+ } else if (url.protocol === 'file:') {
40
+ rawConfig = JSON.parse(await readFile(url.pathname, 'utf-8'));
41
+ } else {
42
+ throw new Error('Unsupported Aztec network config protocol: ' + url.href);
43
+ }
44
+ if (!rawConfig) {
45
+ return undefined;
46
+ }
47
+ const networkConfigMap = NetworkConfigMapSchema.parse(rawConfig);
48
+ if (networkName in networkConfigMap) {
49
+ return networkConfigMap[networkName];
50
+ } else {
51
+ return undefined;
52
+ }
53
+ } catch {
54
+ return undefined;
55
+ }
56
+ }
57
+ /**
58
+ * Enriches environment variables with remote network configuration.
59
+ * This function is called before node config initialization to set env vars
60
+ * from the remote config, following the same pattern as enrichEnvironmentWithChainConfig().
61
+ *
62
+ * @param networkName - The network name to fetch remote config for
63
+ */ export async function enrichEnvironmentWithNetworkConfig(networkName) {
64
+ if (networkName === 'local') {
65
+ return; // No remote config for local development
66
+ }
67
+ const cacheDir = process.env.DATA_DIRECTORY ? join(process.env.DATA_DIRECTORY, 'cache') : undefined;
68
+ const networkConfig = await getNetworkConfig(networkName, cacheDir);
69
+ if (!networkConfig) {
70
+ return;
71
+ }
72
+ enrichVar('BOOTSTRAP_NODES', networkConfig.bootnodes.join(','));
73
+ enrichVar('L1_CHAIN_ID', String(networkConfig.l1ChainId));
74
+ enrichVar('SYNC_SNAPSHOTS_URLS', networkConfig.snapshots.join(','));
75
+ enrichEthAddressVar('REGISTRY_CONTRACT_ADDRESS', networkConfig.registryAddress.toString());
76
+ if (networkConfig.feeAssetHandlerAddress) {
77
+ enrichEthAddressVar('FEE_ASSET_HANDLER_CONTRACT_ADDRESS', networkConfig.feeAssetHandlerAddress.toString());
78
+ }
79
+ }
@@ -1,5 +1,5 @@
1
- import { EthAddress, type PXE } from '@aztec/aztec.js';
2
1
  import { type ContractArtifact, type FunctionAbi } from '@aztec/aztec.js/abi';
2
+ import { EthAddress } from '@aztec/aztec.js/addresses';
3
3
  import { type DeployL1ContractsReturnType, type L1ContractsConfig, type Operator, RollupContract } from '@aztec/ethereum';
4
4
  import { Fr } from '@aztec/foundation/fields';
5
5
  import type { LogFn, Logger } from '@aztec/foundation/log';
@@ -18,8 +18,8 @@ export declare function getFunctionAbi(artifact: ContractArtifact, fnName: strin
18
18
  * @param privateKey - The private key to be used in contract deployment.
19
19
  * @param mnemonic - The mnemonic to be used in contract deployment.
20
20
  */
21
- export declare function deployAztecContracts(rpcUrls: string[], chainId: number, privateKey: string | undefined, mnemonic: string, mnemonicIndex: number, salt: number | undefined, initialValidators: Operator[], genesisArchiveRoot: Fr, feeJuicePortalInitialBalance: bigint, acceleratedTestDeployments: boolean, config: L1ContractsConfig, realVerifier: boolean, createVerificationJson: string | false, debugLogger: Logger): Promise<DeployL1ContractsReturnType>;
22
- export declare function deployNewRollupContracts(registryAddress: EthAddress, rpcUrls: string[], chainId: number, privateKey: string | undefined, mnemonic: string, mnemonicIndex: number, salt: number | undefined, initialValidators: Operator[], genesisArchiveRoot: Fr, feeJuicePortalInitialBalance: bigint, config: L1ContractsConfig, realVerifier: boolean, logger: Logger): Promise<{
21
+ export declare function deployAztecContracts(rpcUrls: string[], chainId: number, privateKey: string | undefined, mnemonic: string, mnemonicIndex: number, salt: number | undefined, initialValidators: Operator[], genesisArchiveRoot: Fr, feeJuicePortalInitialBalance: bigint, acceleratedTestDeployments: boolean, config: L1ContractsConfig, existingToken: EthAddress | undefined, realVerifier: boolean, createVerificationJson: string | false, debugLogger: Logger): Promise<DeployL1ContractsReturnType>;
22
+ export declare function deployNewRollupContracts(registryAddress: EthAddress, rpcUrls: string[], chainId: number, privateKey: string | undefined, mnemonic: string, mnemonicIndex: number, salt: number | undefined, initialValidators: Operator[], genesisArchiveRoot: Fr, feeJuicePortalInitialBalance: bigint, config: L1ContractsConfig, realVerifier: boolean, createVerificationJson: string | false, logger: Logger): Promise<{
23
23
  rollup: RollupContract;
24
24
  slashFactoryAddress: EthAddress;
25
25
  }>;
@@ -60,10 +60,4 @@ export declare const stripLeadingHex: (hex: string) => string;
60
60
  */
61
61
  export declare const addLeadingHex: (hex: string) => `0x${string}`;
62
62
  export declare function prettyPrintNargoToml(config: NoirPackageConfig): string;
63
- /**
64
- * Checks that Private eXecution Environment (PXE) version matches the expected one by this CLI. Throws if not.
65
- * @param pxe - PXE client.
66
- * @param expectedVersionRange - Expected version by CLI.
67
- */
68
- export declare function checkServerVersion(pxe: PXE, expectedVersionRange: string): Promise<void>;
69
63
  //# sourceMappingURL=aztec.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"aztec.d.ts","sourceRoot":"","sources":["../../src/utils/aztec.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,KAAK,GAAG,EAAE,MAAM,iBAAiB,CAAC;AACvD,OAAO,EACL,KAAK,gBAAgB,EACrB,KAAK,WAAW,EAIjB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EACL,KAAK,2BAA2B,EAChC,KAAK,iBAAiB,EACtB,KAAK,QAAQ,EACb,cAAc,EACf,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EAAE,EAAE,EAAE,MAAM,0BAA0B,CAAC;AAC9C,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAC3D,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAShE;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,QAAQ,EAAE,gBAAgB,EAAE,MAAM,EAAE,MAAM,GAAG,WAAW,CAMtF;AAED;;;;;;GAMG;AACH,wBAAsB,oBAAoB,CACxC,OAAO,EAAE,MAAM,EAAE,EACjB,OAAO,EAAE,MAAM,EACf,UAAU,EAAE,MAAM,GAAG,SAAS,EAC9B,QAAQ,EAAE,MAAM,EAChB,aAAa,EAAE,MAAM,EACrB,IAAI,EAAE,MAAM,GAAG,SAAS,EACxB,iBAAiB,EAAE,QAAQ,EAAE,EAC7B,kBAAkB,EAAE,EAAE,EACtB,4BAA4B,EAAE,MAAM,EACpC,0BAA0B,EAAE,O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EAC3B,OAAO,EAAE,MAAM,EAAE,EACjB,OAAO,EAAE,MAAM,EACf,UAAU,EAAE,MAAM,GAAG,SAAS,EAC9B,QAAQ,EAAE,MAAM,EAChB,aAAa,EAAE,MAAM,EACrB,IAAI,EAAE,MAAM,GAAG,SAAS,EACxB,iBAAiB,EAAE,QAAQ,EAAE,EAC7B,kBAAkB,EAAE,EAAE,EACtB,4BAA4B,EAAE,MAAM,EACpC,MAAM,EAAE,iBAAiB,EACzB,YAAY,EAAE,OAAO,EACrB,sBAAsB,EAAE,MAAM,GAAG,KAAK,EACtC,MAAM,EAAE,MAAM,GACb,OAAO,CAAC;IAAE,MAAM,EAAE,cAAc,CAAC;IAAC,mBAAmB,EAAE,UAAU,CAAA;CAAE,CAAC,CA8CtE;AAED;;;GAGG;AACH,wBAAsB,uBAAuB,IAAI,OAAO,CAAC,MAAM,EAAE,CAAC,CAKjE;AAED;;;;GAIG;AACH,wBAAsB,mBAAmB,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,EAAE,KAAK,6BA4BpE;AAED;;;;;;;GAOG;AACH,wBAAsB,MAAM,CAAC,YAAY,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,EAAE,EAAE,GAAG,EAAE,KAAK;;;;GAO3G;AAED;;;;GAIG;AACH,eAAO,MAAM,eAAe,GAAI,KAAK,MAAM,KAAG,MAK7C,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,aAAa,GAAI,KAAK,MAAM,KAAG,KAAK,MAAM,EAKtD,CAAC;AAOF,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,iBAAiB,GAAG,MAAM,CAUtE"}
@@ -1,11 +1,10 @@
1
- import { EthAddress } from '@aztec/aztec.js';
2
1
  import { FunctionType, getAllFunctionAbis, loadContractArtifact } from '@aztec/aztec.js/abi';
2
+ import { EthAddress } from '@aztec/aztec.js/addresses';
3
3
  import { SecretValue } from '@aztec/foundation/config';
4
4
  import { Fr } from '@aztec/foundation/fields';
5
- import { protocolContractTreeRoot } from '@aztec/protocol-contracts';
5
+ import { protocolContractsHash } from '@aztec/protocol-contracts';
6
6
  import TOML from '@iarna/toml';
7
7
  import { readFile } from 'fs/promises';
8
- import { gtr, ltr, satisfies, valid } from 'semver';
9
8
  import { encodeArgs } from './encoding.js';
10
9
  /**
11
10
  * Helper to get an ABI function or throw error if it doesn't exist.
@@ -25,7 +24,7 @@ import { encodeArgs } from './encoding.js';
25
24
  * @param chainId - The chain ID of the L1 host.
26
25
  * @param privateKey - The private key to be used in contract deployment.
27
26
  * @param mnemonic - The mnemonic to be used in contract deployment.
28
- */ export async function deployAztecContracts(rpcUrls, chainId, privateKey, mnemonic, mnemonicIndex, salt, initialValidators, genesisArchiveRoot, feeJuicePortalInitialBalance, acceleratedTestDeployments, config, realVerifier, createVerificationJson, debugLogger) {
27
+ */ export async function deployAztecContracts(rpcUrls, chainId, privateKey, mnemonic, mnemonicIndex, salt, initialValidators, genesisArchiveRoot, feeJuicePortalInitialBalance, acceleratedTestDeployments, config, existingToken, realVerifier, createVerificationJson, debugLogger) {
29
28
  const { createEthereumChain, deployL1Contracts } = await import('@aztec/ethereum');
30
29
  const { mnemonicToAccount, privateKeyToAccount } = await import('viem/accounts');
31
30
  const account = !privateKey ? mnemonicToAccount(mnemonic, {
@@ -35,18 +34,19 @@ import { encodeArgs } from './encoding.js';
35
34
  const { getVKTreeRoot } = await import('@aztec/noir-protocol-circuits-types/vk-tree');
36
35
  const result = await deployL1Contracts(chain.rpcUrls, account, chain.chainInfo, debugLogger, {
37
36
  vkTreeRoot: getVKTreeRoot(),
38
- protocolContractTreeRoot,
37
+ protocolContractsHash,
39
38
  genesisArchiveRoot,
40
39
  salt,
41
40
  initialValidators,
42
41
  acceleratedTestDeployments,
43
42
  feeJuicePortalInitialBalance,
44
43
  realVerifier,
44
+ existingTokenAddress: existingToken,
45
45
  ...config
46
46
  }, config, createVerificationJson);
47
47
  return result;
48
48
  }
49
- export async function deployNewRollupContracts(registryAddress, rpcUrls, chainId, privateKey, mnemonic, mnemonicIndex, salt, initialValidators, genesisArchiveRoot, feeJuicePortalInitialBalance, config, realVerifier, logger) {
49
+ export async function deployNewRollupContracts(registryAddress, rpcUrls, chainId, privateKey, mnemonic, mnemonicIndex, salt, initialValidators, genesisArchiveRoot, feeJuicePortalInitialBalance, config, realVerifier, createVerificationJson, logger) {
50
50
  const { createEthereumChain, deployRollupForUpgrade, createExtendedL1Client } = await import('@aztec/ethereum');
51
51
  const { mnemonicToAccount, privateKeyToAccount } = await import('viem/accounts');
52
52
  const { getVKTreeRoot } = await import('@aztec/noir-protocol-circuits-types/vk-tree');
@@ -74,13 +74,13 @@ export async function deployNewRollupContracts(registryAddress, rpcUrls, chainId
74
74
  const { rollup, slashFactoryAddress } = await deployRollupForUpgrade(client, {
75
75
  salt,
76
76
  vkTreeRoot: getVKTreeRoot(),
77
- protocolContractTreeRoot,
77
+ protocolContractsHash,
78
78
  genesisArchiveRoot,
79
79
  initialValidators,
80
80
  feeJuicePortalInitialBalance,
81
81
  realVerifier,
82
82
  ...config
83
- }, registryAddress, logger, config);
83
+ }, registryAddress, logger, config, createVerificationJson);
84
84
  return {
85
85
  rollup,
86
86
  slashFactoryAddress
@@ -177,27 +177,3 @@ export async function deployNewRollupContracts(registryAddress, rpcUrls, chainId
177
177
  });
178
178
  return partialToml + '\n[dependencies]\n' + dependenciesToml.join('\n') + '\n';
179
179
  }
180
- /** Mismatch between server and client versions. */ class VersionMismatchError extends Error {
181
- }
182
- /**
183
- * Checks that Private eXecution Environment (PXE) version matches the expected one by this CLI. Throws if not.
184
- * @param pxe - PXE client.
185
- * @param expectedVersionRange - Expected version by CLI.
186
- */ export async function checkServerVersion(pxe, expectedVersionRange) {
187
- const serverName = 'Aztec Node';
188
- const { nodeVersion } = await pxe.getNodeInfo();
189
- if (!nodeVersion) {
190
- throw new VersionMismatchError(`Couldn't determine ${serverName} version. You may run into issues.`);
191
- }
192
- if (!nodeVersion || !valid(nodeVersion)) {
193
- throw new VersionMismatchError(`Missing or invalid version identifier for ${serverName} (${nodeVersion ?? 'empty'}).`);
194
- } else if (!satisfies(nodeVersion, expectedVersionRange)) {
195
- if (gtr(nodeVersion, expectedVersionRange)) {
196
- throw new VersionMismatchError(`${serverName} is running version ${nodeVersion} which is newer than the expected by this CLI (${expectedVersionRange}). Consider upgrading your CLI to a newer version.`);
197
- } else if (ltr(nodeVersion, expectedVersionRange)) {
198
- throw new VersionMismatchError(`${serverName} is running version ${nodeVersion} which is older than the expected by this CLI (${expectedVersionRange}). Consider upgrading your ${serverName} to a newer version.`);
199
- } else {
200
- throw new VersionMismatchError(`${serverName} is running version ${nodeVersion} which does not match the expected by this CLI (${expectedVersionRange}).`);
201
- }
202
- }
203
- }
@@ -1,11 +1,10 @@
1
1
  import { FunctionSelector } from '@aztec/aztec.js/abi';
2
- import { AztecAddress } from '@aztec/aztec.js/addresses';
3
- import { EthAddress } from '@aztec/aztec.js/eth_address';
2
+ import { AztecAddress, EthAddress } from '@aztec/aztec.js/addresses';
4
3
  import { Fr } from '@aztec/aztec.js/fields';
5
- import { LogId } from '@aztec/aztec.js/log_id';
6
- import { TxHash } from '@aztec/aztec.js/tx_hash';
4
+ import { LogId } from '@aztec/aztec.js/log';
5
+ import { TxHash } from '@aztec/aztec.js/tx';
7
6
  import type { LogFn } from '@aztec/foundation/log';
8
- import type { PXE } from '@aztec/stdlib/interfaces/client';
7
+ import type { PXE } from '@aztec/pxe/server';
9
8
  import { PublicKeys } from '@aztec/stdlib/keys';
10
9
  import { type Command, Option } from 'commander';
11
10
  /**
@@ -16,8 +15,8 @@ export declare const getLocalhost: () => Promise<string>;
16
15
  export declare const LOCALHOST: string;
17
16
  export declare const ETHEREUM_HOSTS: string, PRIVATE_KEY: string | undefined, MNEMONIC: string | undefined, API_KEY: string | undefined, CLI_VERSION: string | undefined;
18
17
  export declare function addOptions(program: Command, options: Option[]): Command;
19
- export declare const makePxeOption: (mandatory: boolean) => Option;
20
- export declare const pxeOption: Option;
18
+ export declare const makeNodeOption: (mandatory: boolean) => Option;
19
+ export declare const nodeOption: Option;
21
20
  export declare const l1ChainIdOption: Option;
22
21
  export declare const createSecretKeyOption: (description: string, mandatory: boolean, argsParser?: (value: string, previous: Fr) => Fr) => Option;
23
22
  export declare const logJson: (log: LogFn) => (obj: object) => void;
@@ -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,aAAa,GAAI,WAAW,OAAO,WAKb,CAAC;AAEpC,eAAO,MAAM,SAAS,QAAsB,CAAC;AAE7C,eAAO,MAAM,eAAe,QASxB,CAAC;A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AKnE;AAED;;;;;GAKG;AACH,wBAAgB,qBAAqB,CAAC,QAAQ,EAAE,MAAM,GAAG,gBAAgB,GAAG,SAAS,CASpF;AAED;;;;;;GAMG;AACH,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAStE;AAED;;;;;GAKG;AACH,wBAAgB,WAAW,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAMlD;AAED;;;;;;GAMG;AACH,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAKtE;AAED;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,SAAS,EAAE,MAAM,GAAG,UAAU,GAAG,SAAS,CASxE;AAED;;;;;GAKG;AACH,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,MAAM,GAAG,EAAE,CAMvD;AAED;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,SAAS,EAAE,MAAM,GAAG,EAAE,CAMpD;AAED;;;;;GAKG;AACH,wBAAgB,UAAU,CAAC,KAAK,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"}
@@ -1,9 +1,8 @@
1
1
  import { FunctionSelector } from '@aztec/aztec.js/abi';
2
- import { AztecAddress } from '@aztec/aztec.js/addresses';
3
- import { EthAddress } from '@aztec/aztec.js/eth_address';
2
+ import { AztecAddress, EthAddress } from '@aztec/aztec.js/addresses';
4
3
  import { Fr } from '@aztec/aztec.js/fields';
5
- import { LogId } from '@aztec/aztec.js/log_id';
6
- import { TxHash } from '@aztec/aztec.js/tx_hash';
4
+ import { LogId } from '@aztec/aztec.js/log';
5
+ import { TxHash } from '@aztec/aztec.js/tx';
7
6
  import { PublicKeys } from '@aztec/stdlib/keys';
8
7
  import { CommanderError, InvalidArgumentError, Option } from 'commander';
9
8
  import { lookup } from 'dns/promises';
@@ -18,8 +17,8 @@ export function addOptions(program, options) {
18
17
  options.forEach((option)=>program.addOption(option));
19
18
  return program;
20
19
  }
21
- export const makePxeOption = (mandatory)=>new Option('-u, --rpc-url <string>', 'URL of the PXE').env('PXE_URL').default(`http://${LOCALHOST}:8080`).conflicts('remote-pxe').makeOptionMandatory(mandatory);
22
- export const pxeOption = makePxeOption(true);
20
+ 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);
21
+ export const nodeOption = makeNodeOption(true);
23
22
  export const l1ChainIdOption = new Option('-c, --l1-chain-id <number>', 'Chain ID of the ethereum host').env('L1_CHAIN_ID').default(31337).argParser((value)=>{
24
23
  const parsedValue = Number(value);
25
24
  if (isNaN(parsedValue)) {
@@ -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 { PXE } from '@aztec/stdlib/interfaces/client';
2
+ import type { AztecNode } from '@aztec/stdlib/interfaces/client';
4
3
  import type { TxHash } from '@aztec/stdlib/tx';
5
- export declare function inspectBlock(pxe: PXE, blockNumber: number, log: LogFn, opts?: {
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(pxe: PXE, txHash: TxHash, log: LogFn, opts?: {
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,EAAgB,gBAAgB,EAAE,EAAE,EAAE,MAAM,iBAAiB,CAAC;AAC1E,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AAGnD,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,iCAAiC,CAAC;AAE3D,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAE/C,wBAAsB,YAAY,CAAC,GAAG,EAAE,GAAG,EAAE,WAAW,EAAE,MAAM,EAAE,GAAG,EAAE,KAAK,EAAE,IAAI,GAAE;IAAE,OAAO,CAAC,EAAE,OAAO,CAAA;CAAO,iBA0B7G;AAED,wBAAsB,SAAS,CAC7B,GAAG,EAAE,GAAG,EACR,MAAM,EAAE,MAAM,EACd,GAAG,EAAE,KAAK,EACV,IAAI,GAAE;IAAE,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAAC,WAAW,CAAC,EAAE,WAAW,CAAA;CAAO,iBA8FrE;AAuCD,KAAK,WAAW,GAAG,MAAM,CAAC,MAAM,EAAE,2BAA2B,CAAC,CAAC;AAC/D,KAAK,2BAA2B,GAAG,gBAAgB,GAAG;IAAE,OAAO,EAAE,EAAE,CAAA;CAAE,CAAC"}
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"}
@@ -1,7 +1,5 @@
1
- import { ProtocolContractAddress } from '@aztec/protocol-contracts';
2
- import { siloNullifier } from '@aztec/stdlib/hash';
3
- export async function inspectBlock(pxe, blockNumber, log, opts = {}) {
4
- const block = await pxe.getBlock(blockNumber);
1
+ export async function inspectBlock(aztecNode, blockNumber, log, opts = {}) {
2
+ const block = await aztecNode.getBlock(blockNumber);
5
3
  if (!block) {
6
4
  log(`No block found for block number ${blockNumber}`);
7
5
  return;
@@ -16,21 +14,19 @@ export async function inspectBlock(pxe, 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(pxe, txHash, log, {
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(pxe, txHash, log, opts = {}) {
26
+ export async function inspectTx(aztecNode, txHash, log, opts = {}) {
31
27
  const [receipt, effectsInBlock] = await Promise.all([
32
- pxe.getTxReceipt(txHash),
33
- pxe.getTxEffect(txHash)
28
+ aztecNode.getTxReceipt(txHash),
29
+ aztecNode.getTxEffect(txHash)
34
30
  ]);
35
31
  // Base tx data
36
32
  log(`Tx ${txHash.toString()}`);
@@ -42,7 +38,6 @@ export async function inspectTx(pxe, 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, txHash, log, opts = {}) {
74
69
  log(` Note hash: ${note.toShortString()}`);
75
70
  }
76
71
  }
77
- // Nullifiers
78
- const nullifierCount = effects.nullifiers.length;
79
- const { deployNullifiers, initNullifiers, classNullifiers } = await getKnownNullifiers(pxe, artifactMap);
80
- if (nullifierCount > 0) {
81
- log(' Nullifiers:');
82
- for (const nullifier of effects.nullifiers){
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, 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,3 @@
1
- import { AztecAddress, type PXE, type WaitForProvenOpts } from '@aztec/aztec.js';
2
- import type { LogFn } from '@aztec/foundation/log';
1
+ import type { AztecAddress } from '@aztec/aztec.js/addresses';
3
2
  export declare function getSponsoredFPCAddress(): Promise<AztecAddress>;
4
- export declare function setupSponsoredFPC(pxe: PXE, log: LogFn, waitOpts?: import("@aztec/aztec.js").WaitOpts, waitForProvenOptions?: WaitForProvenOpts): Promise<void>;
5
3
  //# 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":"AAAA,OAAO,EACL,YAAY,EAGZ,KAAK,GAAG,EAGR,KAAK,iBAAiB,EAGvB,MAAM,iBAAiB,CAAC;AAGzB,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AASnD,wBAAsB,sBAAsB,0BAM3C;AAED,wBAAsB,iBAAiB,CACrC,GAAG,EAAE,GAAG,EACR,GAAG,EAAE,KAAK,EACV,QAAQ,qCAAkB,EAC1B,oBAAoB,CAAC,EAAE,iBAAiB,iBAuBzC"}
1
+ {"version":3,"file":"setup_contracts.d.ts","sourceRoot":"","sources":["../../src/utils/setup_contracts.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAY9D,wBAAsB,sBAAsB,IAAI,OAAO,CAAC,YAAY,CAAC,CAMpE"}
@@ -1,6 +1,6 @@
1
- import { AztecAddress, DefaultWaitOpts, Fr, SignerlessWallet, SponsoredFeePaymentMethod, getContractInstanceFromInstantiationParams, waitForProven } from '@aztec/aztec.js';
1
+ import { getContractInstanceFromInstantiationParams } from '@aztec/aztec.js/contracts';
2
+ import { Fr } from '@aztec/aztec.js/fields';
2
3
  import { SPONSORED_FPC_SALT } from '@aztec/constants';
3
- import { DefaultMultiCallEntrypoint } from '@aztec/entrypoints/multicall';
4
4
  async function getSponsoredFPCContract() {
5
5
  // eslint-disable-next-line @typescript-eslint/ban-ts-comment
6
6
  // @ts-ignore - Importing noir-contracts.js even in devDeps results in a circular dependency error. Need to ignore because this line doesn't cause an error in a dev environment
@@ -14,23 +14,3 @@ export async function getSponsoredFPCAddress() {
14
14
  });
15
15
  return sponsoredFPCInstance.address;
16
16
  }
17
- export async function setupSponsoredFPC(pxe, log, waitOpts = DefaultWaitOpts, waitForProvenOptions) {
18
- const SponsoredFPCContract = await getSponsoredFPCContract();
19
- const address = await getSponsoredFPCAddress();
20
- const paymentMethod = new SponsoredFeePaymentMethod(address);
21
- const { l1ChainId: chainId, rollupVersion } = await pxe.getNodeInfo();
22
- const deployer = new SignerlessWallet(pxe, new DefaultMultiCallEntrypoint(chainId, rollupVersion));
23
- const deployTx = SponsoredFPCContract.deploy(deployer).send({
24
- from: AztecAddress.ZERO,
25
- contractAddressSalt: new Fr(SPONSORED_FPC_SALT),
26
- universalDeploy: true,
27
- fee: {
28
- paymentMethod
29
- }
30
- });
31
- const deployed = await deployTx.deployed(waitOpts);
32
- if (waitForProvenOptions !== undefined) {
33
- await waitForProven(pxe, await deployTx.getReceipt(), waitForProvenOptions);
34
- }
35
- log(`SponsoredFPC: ${deployed.address}`);
36
- }
package/package.json CHANGED
@@ -1,18 +1,19 @@
1
1
  {
2
2
  "name": "@aztec/cli",
3
- "version": "3.0.0-canary.a9708bd",
3
+ "version": "3.0.0-devnet.2",
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",
10
+ "./aztec_node": "./dest/cmds/aztec_node/index.js",
11
11
  "./cli-utils": "./dest/utils/index.js",
12
12
  "./misc": "./dest/cmds/misc/index.js",
13
13
  "./setup-contracts": "./dest/cmds/misc/setup_contracts.js",
14
14
  "./utils": "./dest/utils/index.js",
15
- "./inspect": "./dest/utils/inspect.js"
15
+ "./inspect": "./dest/utils/inspect.js",
16
+ "./config": "./dest/config/index.js"
16
17
  },
17
18
  "typedocOptions": {
18
19
  "entryPoints": [
@@ -69,16 +70,20 @@
69
70
  ]
70
71
  },
71
72
  "dependencies": {
72
- "@aztec/archiver": "3.0.0-canary.a9708bd",
73
- "@aztec/aztec.js": "3.0.0-canary.a9708bd",
74
- "@aztec/constants": "3.0.0-canary.a9708bd",
75
- "@aztec/entrypoints": "3.0.0-canary.a9708bd",
76
- "@aztec/ethereum": "3.0.0-canary.a9708bd",
77
- "@aztec/foundation": "3.0.0-canary.a9708bd",
78
- "@aztec/l1-artifacts": "3.0.0-canary.a9708bd",
79
- "@aztec/p2p": "3.0.0-canary.a9708bd",
80
- "@aztec/stdlib": "3.0.0-canary.a9708bd",
81
- "@aztec/world-state": "3.0.0-canary.a9708bd",
73
+ "@aztec/accounts": "3.0.0-devnet.2",
74
+ "@aztec/archiver": "3.0.0-devnet.2",
75
+ "@aztec/aztec.js": "3.0.0-devnet.2",
76
+ "@aztec/constants": "3.0.0-devnet.2",
77
+ "@aztec/entrypoints": "3.0.0-devnet.2",
78
+ "@aztec/ethereum": "3.0.0-devnet.2",
79
+ "@aztec/foundation": "3.0.0-devnet.2",
80
+ "@aztec/l1-artifacts": "3.0.0-devnet.2",
81
+ "@aztec/node-lib": "3.0.0-devnet.2",
82
+ "@aztec/p2p": "3.0.0-devnet.2",
83
+ "@aztec/protocol-contracts": "3.0.0-devnet.2",
84
+ "@aztec/stdlib": "3.0.0-devnet.2",
85
+ "@aztec/test-wallet": "3.0.0-devnet.2",
86
+ "@aztec/world-state": "3.0.0-devnet.2",
82
87
  "@iarna/toml": "^2.2.5",
83
88
  "@libp2p/peer-id-factory": "^3.0.4",
84
89
  "commander": "^12.1.0",
@@ -87,11 +92,9 @@
87
92
  "semver": "^7.5.4",
88
93
  "source-map-support": "^0.5.21",
89
94
  "tslib": "^2.4.0",
90
- "viem": "2.23.7"
95
+ "viem": "npm:@spalladino/viem@2.38.2-eip7594.0"
91
96
  },
92
97
  "devDependencies": {
93
- "@aztec/accounts": "3.0.0-canary.a9708bd",
94
- "@aztec/protocol-contracts": "3.0.0-canary.a9708bd",
95
98
  "@jest/globals": "^30.0.0",
96
99
  "@types/jest": "^30.0.0",
97
100
  "@types/lodash.chunk": "^4.2.9",
@@ -107,15 +110,15 @@
107
110
  "typescript": "^5.3.3"
108
111
  },
109
112
  "peerDependencies": {
110
- "@aztec/accounts": "3.0.0-canary.a9708bd",
111
- "@aztec/bb-prover": "3.0.0-canary.a9708bd",
112
- "@aztec/ethereum": "3.0.0-canary.a9708bd",
113
- "@aztec/l1-artifacts": "3.0.0-canary.a9708bd",
114
- "@aztec/noir-contracts.js": "3.0.0-canary.a9708bd",
115
- "@aztec/noir-protocol-circuits-types": "3.0.0-canary.a9708bd",
116
- "@aztec/noir-test-contracts.js": "3.0.0-canary.a9708bd",
117
- "@aztec/protocol-contracts": "3.0.0-canary.a9708bd",
118
- "@aztec/stdlib": "3.0.0-canary.a9708bd"
113
+ "@aztec/accounts": "3.0.0-devnet.2",
114
+ "@aztec/bb-prover": "3.0.0-devnet.2",
115
+ "@aztec/ethereum": "3.0.0-devnet.2",
116
+ "@aztec/l1-artifacts": "3.0.0-devnet.2",
117
+ "@aztec/noir-contracts.js": "3.0.0-devnet.2",
118
+ "@aztec/noir-protocol-circuits-types": "3.0.0-devnet.2",
119
+ "@aztec/noir-test-contracts.js": "3.0.0-devnet.2",
120
+ "@aztec/protocol-contracts": "3.0.0-devnet.2",
121
+ "@aztec/stdlib": "3.0.0-devnet.2"
119
122
  },
120
123
  "files": [
121
124
  "dest",
@@ -0,0 +1,9 @@
1
+ import { createAztecNodeClient } from '@aztec/aztec.js/node';
2
+ import type { LogFn } from '@aztec/foundation/log';
3
+
4
+ export async function blockNumber(nodeUrl: string, log: LogFn) {
5
+ const aztecNode = createAztecNodeClient(nodeUrl);
6
+ const [latestNum, provenNum] = await Promise.all([aztecNode.getBlockNumber(), aztecNode.getProvenBlockNumber()]);
7
+ log(`Latest block: ${latestNum}`);
8
+ log(`Proven block: ${provenNum}`);
9
+ }
@@ -0,0 +1,10 @@
1
+ import { createAztecNodeClient } from '@aztec/aztec.js/node';
2
+ import type { LogFn } from '@aztec/foundation/log';
3
+
4
+ import { inspectBlock } from '../../utils/inspect.js';
5
+
6
+ export async function getBlock(nodeUrl: string, maybeBlockNumber: number | undefined, log: LogFn) {
7
+ const aztecNode = createAztecNodeClient(nodeUrl);
8
+ const blockNumber = maybeBlockNumber ?? (await aztecNode.getBlockNumber());
9
+ await inspectBlock(aztecNode, blockNumber, log, { showTxs: true });
10
+ }
@@ -0,0 +1,9 @@
1
+ import { createAztecNodeClient } from '@aztec/aztec.js/node';
2
+ import { jsonStringify } from '@aztec/foundation/json-rpc';
3
+ import type { LogFn, Logger } from '@aztec/foundation/log';
4
+
5
+ export async function getCurrentBaseFee(nodeUrl: string, debugLogger: Logger, log: LogFn) {
6
+ const node = createAztecNodeClient(nodeUrl);
7
+ const fees = await node.getCurrentBaseFees();
8
+ log(`Current fees: ${jsonStringify(fees)}`);
9
+ }