@aztec/cli 0.0.0-test.1 → 0.0.1-commit.1142ef1

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 (281) hide show
  1. package/README.md +2 -428
  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 +10 -0
  8. package/dest/cmds/aztec_node/get_current_min_fee.d.ts +3 -0
  9. package/dest/cmds/aztec_node/get_current_min_fee.d.ts.map +1 -0
  10. package/dest/cmds/aztec_node/get_current_min_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 +7 -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 +14 -15
  20. package/dest/cmds/aztec_node/index.d.ts +4 -0
  21. package/dest/cmds/aztec_node/index.d.ts.map +1 -0
  22. package/dest/cmds/aztec_node/index.js +28 -0
  23. package/dest/cmds/contracts/index.d.ts +1 -1
  24. package/dest/cmds/contracts/inspect_contract.d.ts +1 -1
  25. package/dest/cmds/contracts/inspect_contract.d.ts.map +1 -1
  26. package/dest/cmds/contracts/inspect_contract.js +13 -15
  27. package/dest/cmds/contracts/parse_parameter_struct.d.ts +1 -1
  28. package/dest/cmds/infrastructure/index.d.ts +3 -3
  29. package/dest/cmds/infrastructure/index.d.ts.map +1 -1
  30. package/dest/cmds/infrastructure/index.js +8 -10
  31. package/dest/cmds/infrastructure/sequencers.d.ts +5 -6
  32. package/dest/cmds/infrastructure/sequencers.d.ts.map +1 -1
  33. package/dest/cmds/infrastructure/sequencers.js +38 -18
  34. package/dest/cmds/infrastructure/setup_l2_contract.d.ts +2 -2
  35. package/dest/cmds/infrastructure/setup_l2_contract.d.ts.map +1 -1
  36. package/dest/cmds/infrastructure/setup_l2_contract.js +11 -24
  37. package/dest/cmds/l1/advance_epoch.d.ts +2 -2
  38. package/dest/cmds/l1/advance_epoch.d.ts.map +1 -1
  39. package/dest/cmds/l1/advance_epoch.js +8 -6
  40. package/dest/cmds/l1/assume_proven_through.d.ts +2 -2
  41. package/dest/cmds/l1/assume_proven_through.d.ts.map +1 -1
  42. package/dest/cmds/l1/assume_proven_through.js +10 -8
  43. package/dest/cmds/l1/bridge_erc20.d.ts +3 -3
  44. package/dest/cmds/l1/bridge_erc20.d.ts.map +1 -1
  45. package/dest/cmds/l1/bridge_erc20.js +6 -5
  46. package/dest/cmds/l1/create_l1_account.d.ts +1 -1
  47. package/dest/cmds/l1/deploy_l1_contracts_cmd.d.ts +4 -0
  48. package/dest/cmds/l1/deploy_l1_contracts_cmd.d.ts.map +1 -0
  49. package/dest/cmds/l1/deploy_l1_contracts_cmd.js +81 -0
  50. package/dest/cmds/l1/deploy_new_rollup.d.ts +4 -3
  51. package/dest/cmds/l1/deploy_new_rollup.d.ts.map +1 -1
  52. package/dest/cmds/l1/deploy_new_rollup.js +18 -9
  53. package/dest/cmds/l1/get_l1_addresses.d.ts +2 -2
  54. package/dest/cmds/l1/get_l1_addresses.d.ts.map +1 -1
  55. package/dest/cmds/l1/get_l1_addresses.js +5 -2
  56. package/dest/cmds/l1/get_l1_balance.d.ts +1 -1
  57. package/dest/cmds/l1/get_l1_balance.js +4 -2
  58. package/dest/cmds/l1/governance_utils.d.ts +5 -5
  59. package/dest/cmds/l1/governance_utils.d.ts.map +1 -1
  60. package/dest/cmds/l1/governance_utils.js +19 -17
  61. package/dest/cmds/l1/index.d.ts +1 -1
  62. package/dest/cmds/l1/index.d.ts.map +1 -1
  63. package/dest/cmds/l1/index.js +36 -44
  64. package/dest/cmds/l1/prover_stats.d.ts +1 -1
  65. package/dest/cmds/l1/prover_stats.d.ts.map +1 -1
  66. package/dest/cmds/l1/prover_stats.js +32 -30
  67. package/dest/cmds/l1/trigger_seed_snapshot.d.ts +6 -0
  68. package/dest/cmds/l1/trigger_seed_snapshot.d.ts.map +1 -0
  69. package/dest/cmds/l1/trigger_seed_snapshot.js +20 -0
  70. package/dest/cmds/l1/update_l1_validators.d.ts +21 -6
  71. package/dest/cmds/l1/update_l1_validators.d.ts.map +1 -1
  72. package/dest/cmds/l1/update_l1_validators.js +163 -103
  73. package/dest/cmds/misc/compute_selector.d.ts +1 -1
  74. package/dest/cmds/misc/example_contracts.d.ts +1 -1
  75. package/dest/cmds/misc/generate_bootnode_enr.d.ts +2 -2
  76. package/dest/cmds/misc/generate_bootnode_enr.d.ts.map +1 -1
  77. package/dest/cmds/misc/generate_bootnode_enr.js +2 -2
  78. package/dest/cmds/misc/generate_p2p_private_key.d.ts +1 -1
  79. package/dest/cmds/misc/generate_secret_and_hash.d.ts +2 -2
  80. package/dest/cmds/misc/generate_secret_and_hash.d.ts.map +1 -1
  81. package/dest/cmds/misc/generate_secret_and_hash.js +4 -4
  82. package/dest/cmds/misc/generate_secret_key.d.ts +2 -2
  83. package/dest/cmds/misc/generate_secret_key.d.ts.map +1 -1
  84. package/dest/cmds/misc/generate_secret_key.js +1 -1
  85. package/dest/cmds/misc/get_canonical_sponsored_fpc_address.d.ts +3 -0
  86. package/dest/cmds/misc/get_canonical_sponsored_fpc_address.d.ts.map +1 -0
  87. package/dest/cmds/misc/get_canonical_sponsored_fpc_address.js +4 -0
  88. package/dest/cmds/misc/index.d.ts +1 -1
  89. package/dest/cmds/misc/index.d.ts.map +1 -1
  90. package/dest/cmds/misc/index.js +8 -4
  91. package/dest/cmds/misc/update/common.d.ts +1 -1
  92. package/dest/cmds/misc/update/github.d.ts +1 -2
  93. package/dest/cmds/misc/update/github.d.ts.map +1 -1
  94. package/dest/cmds/misc/update/github.js +0 -1
  95. package/dest/cmds/misc/update/noir.d.ts +1 -1
  96. package/dest/cmds/misc/update/npm.d.ts +1 -1
  97. package/dest/cmds/misc/update/npm.js +1 -1
  98. package/dest/cmds/misc/update/utils.d.ts +1 -1
  99. package/dest/cmds/misc/update.d.ts +1 -1
  100. package/dest/cmds/misc/update.d.ts.map +1 -1
  101. package/dest/cmds/misc/update.js +2 -3
  102. package/dest/cmds/validator_keys/add.d.ts +5 -0
  103. package/dest/cmds/validator_keys/add.d.ts.map +1 -0
  104. package/dest/cmds/validator_keys/add.js +83 -0
  105. package/dest/cmds/validator_keys/generate_bls_keypair.d.ts +12 -0
  106. package/dest/cmds/validator_keys/generate_bls_keypair.d.ts.map +1 -0
  107. package/dest/cmds/validator_keys/generate_bls_keypair.js +27 -0
  108. package/dest/cmds/validator_keys/index.d.ts +4 -0
  109. package/dest/cmds/validator_keys/index.d.ts.map +1 -0
  110. package/dest/cmds/validator_keys/index.js +32 -0
  111. package/dest/cmds/validator_keys/new.d.ts +29 -0
  112. package/dest/cmds/validator_keys/new.d.ts.map +1 -0
  113. package/dest/cmds/validator_keys/new.js +134 -0
  114. package/dest/cmds/validator_keys/shared.d.ts +68 -0
  115. package/dest/cmds/validator_keys/shared.d.ts.map +1 -0
  116. package/dest/cmds/validator_keys/shared.js +274 -0
  117. package/dest/cmds/validator_keys/staker.d.ts +38 -0
  118. package/dest/cmds/validator_keys/staker.d.ts.map +1 -0
  119. package/dest/cmds/validator_keys/staker.js +210 -0
  120. package/dest/cmds/validator_keys/utils.d.ts +25 -0
  121. package/dest/cmds/validator_keys/utils.d.ts.map +1 -0
  122. package/dest/cmds/validator_keys/utils.js +52 -0
  123. package/dest/config/cached_fetch.d.ts +18 -0
  124. package/dest/config/cached_fetch.d.ts.map +1 -0
  125. package/dest/config/cached_fetch.js +54 -0
  126. package/dest/config/chain_l2_config.d.ts +41 -0
  127. package/dest/config/chain_l2_config.d.ts.map +1 -0
  128. package/dest/config/chain_l2_config.js +524 -0
  129. package/dest/config/enrich_env.d.ts +4 -0
  130. package/dest/config/enrich_env.d.ts.map +1 -0
  131. package/dest/config/enrich_env.js +12 -0
  132. package/dest/config/get_l1_config.d.ts +9 -0
  133. package/dest/config/get_l1_config.d.ts.map +1 -0
  134. package/dest/config/get_l1_config.js +24 -0
  135. package/dest/config/index.d.ts +5 -0
  136. package/dest/config/index.d.ts.map +1 -0
  137. package/dest/config/index.js +4 -0
  138. package/dest/config/network_config.d.ts +22 -0
  139. package/dest/config/network_config.d.ts.map +1 -0
  140. package/dest/config/network_config.js +115 -0
  141. package/dest/utils/aztec.d.ts +15 -26
  142. package/dest/utils/aztec.d.ts.map +1 -1
  143. package/dest/utils/aztec.js +56 -72
  144. package/dest/utils/commands.d.ts +22 -13
  145. package/dest/utils/commands.d.ts.map +1 -1
  146. package/dest/utils/commands.js +43 -16
  147. package/dest/utils/encoding.d.ts +1 -1
  148. package/dest/utils/encoding.js +2 -2
  149. package/dest/utils/github.d.ts +1 -2
  150. package/dest/utils/github.d.ts.map +1 -1
  151. package/dest/utils/github.js +0 -1
  152. package/dest/utils/index.d.ts +2 -1
  153. package/dest/utils/index.d.ts.map +1 -1
  154. package/dest/utils/index.js +1 -0
  155. package/dest/utils/inspect.d.ts +5 -11
  156. package/dest/utils/inspect.d.ts.map +1 -1
  157. package/dest/utils/inspect.js +19 -109
  158. package/dest/utils/setup_contracts.d.ts +3 -0
  159. package/dest/utils/setup_contracts.d.ts.map +1 -0
  160. package/dest/utils/setup_contracts.js +16 -0
  161. package/package.json +55 -36
  162. package/public_include_metric_prefixes.json +1 -0
  163. package/src/cmds/aztec_node/block_number.ts +9 -0
  164. package/src/cmds/aztec_node/get_block.ts +11 -0
  165. package/src/cmds/aztec_node/get_current_min_fee.ts +9 -0
  166. package/src/cmds/aztec_node/get_l1_to_l2_message_witness.ts +27 -0
  167. package/src/cmds/{pxe → aztec_node}/get_logs.ts +11 -9
  168. package/src/cmds/{pxe → aztec_node}/get_node_info.ts +15 -23
  169. package/src/cmds/aztec_node/index.ts +87 -0
  170. package/src/cmds/contracts/inspect_contract.ts +20 -17
  171. package/src/cmds/infrastructure/index.ts +8 -11
  172. package/src/cmds/infrastructure/sequencers.ts +41 -22
  173. package/src/cmds/infrastructure/setup_l2_contract.ts +13 -25
  174. package/src/cmds/l1/advance_epoch.ts +7 -5
  175. package/src/cmds/l1/assume_proven_through.ts +11 -7
  176. package/src/cmds/l1/bridge_erc20.ts +8 -4
  177. package/src/cmds/l1/deploy_l1_contracts_cmd.ts +107 -0
  178. package/src/cmds/l1/deploy_new_rollup.ts +24 -15
  179. package/src/cmds/l1/get_l1_addresses.ts +5 -3
  180. package/src/cmds/l1/get_l1_balance.ts +2 -2
  181. package/src/cmds/l1/governance_utils.ts +20 -24
  182. package/src/cmds/l1/index.ts +73 -110
  183. package/src/cmds/l1/prover_stats.ts +42 -31
  184. package/src/cmds/l1/trigger_seed_snapshot.ts +32 -0
  185. package/src/cmds/l1/update_l1_validators.ts +194 -99
  186. package/src/cmds/misc/generate_bootnode_enr.ts +3 -2
  187. package/src/cmds/misc/generate_secret_and_hash.ts +4 -4
  188. package/src/cmds/misc/generate_secret_key.ts +1 -1
  189. package/src/cmds/misc/get_canonical_sponsored_fpc_address.ts +7 -0
  190. package/src/cmds/misc/index.ts +14 -5
  191. package/src/cmds/misc/update/github.ts +0 -1
  192. package/src/cmds/misc/update/npm.ts +1 -1
  193. package/src/cmds/misc/update.ts +1 -7
  194. package/src/cmds/validator_keys/add.ts +123 -0
  195. package/src/cmds/validator_keys/generate_bls_keypair.ts +34 -0
  196. package/src/cmds/validator_keys/index.ts +142 -0
  197. package/src/cmds/validator_keys/new.ts +207 -0
  198. package/src/cmds/validator_keys/shared.ts +326 -0
  199. package/src/cmds/validator_keys/staker.ts +301 -0
  200. package/src/cmds/validator_keys/utils.ts +81 -0
  201. package/src/config/cached_fetch.ts +67 -0
  202. package/src/config/chain_l2_config.ts +694 -0
  203. package/src/config/enrich_env.ts +15 -0
  204. package/src/config/get_l1_config.ts +31 -0
  205. package/src/config/index.ts +4 -0
  206. package/src/config/network_config.ts +147 -0
  207. package/src/utils/aztec.ts +74 -120
  208. package/src/utils/commands.ts +57 -20
  209. package/src/utils/encoding.ts +2 -2
  210. package/src/utils/github.ts +0 -1
  211. package/src/utils/index.ts +1 -0
  212. package/src/utils/inspect.ts +24 -123
  213. package/src/utils/setup_contracts.ts +19 -0
  214. package/dest/cmds/devnet/bootstrap_network.d.ts +0 -3
  215. package/dest/cmds/devnet/bootstrap_network.d.ts.map +0 -1
  216. package/dest/cmds/devnet/bootstrap_network.js +0 -196
  217. package/dest/cmds/devnet/faucet.d.ts +0 -4
  218. package/dest/cmds/devnet/faucet.d.ts.map +0 -1
  219. package/dest/cmds/devnet/faucet.js +0 -26
  220. package/dest/cmds/devnet/index.d.ts +0 -4
  221. package/dest/cmds/devnet/index.d.ts.map +0 -1
  222. package/dest/cmds/devnet/index.js +0 -14
  223. package/dest/cmds/l1/deploy_l1_contracts.d.ts +0 -4
  224. package/dest/cmds/l1/deploy_l1_contracts.d.ts.map +0 -1
  225. package/dest/cmds/l1/deploy_l1_contracts.js +0 -29
  226. package/dest/cmds/l1/deploy_l1_verifier.d.ts +0 -5
  227. package/dest/cmds/l1/deploy_l1_verifier.d.ts.map +0 -1
  228. package/dest/cmds/l1/deploy_l1_verifier.js +0 -54
  229. package/dest/cmds/misc/setup_contracts.d.ts +0 -7
  230. package/dest/cmds/misc/setup_contracts.d.ts.map +0 -1
  231. package/dest/cmds/misc/setup_contracts.js +0 -27
  232. package/dest/cmds/pxe/add_contract.d.ts +0 -5
  233. package/dest/cmds/pxe/add_contract.d.ts.map +0 -1
  234. package/dest/cmds/pxe/add_contract.js +0 -29
  235. package/dest/cmds/pxe/block_number.d.ts +0 -3
  236. package/dest/cmds/pxe/block_number.d.ts.map +0 -1
  237. package/dest/cmds/pxe/block_number.js +0 -10
  238. package/dest/cmds/pxe/get_account.d.ts +0 -4
  239. package/dest/cmds/pxe/get_account.d.ts.map +0 -1
  240. package/dest/cmds/pxe/get_account.js +0 -10
  241. package/dest/cmds/pxe/get_accounts.d.ts +0 -3
  242. package/dest/cmds/pxe/get_accounts.d.ts.map +0 -1
  243. package/dest/cmds/pxe/get_accounts.js +0 -25
  244. package/dest/cmds/pxe/get_block.d.ts +0 -3
  245. package/dest/cmds/pxe/get_block.d.ts.map +0 -1
  246. package/dest/cmds/pxe/get_block.js +0 -9
  247. package/dest/cmds/pxe/get_contract_data.d.ts +0 -4
  248. package/dest/cmds/pxe/get_contract_data.d.ts.map +0 -1
  249. package/dest/cmds/pxe/get_contract_data.js +0 -31
  250. package/dest/cmds/pxe/get_current_base_fee.d.ts +0 -3
  251. package/dest/cmds/pxe/get_current_base_fee.d.ts.map +0 -1
  252. package/dest/cmds/pxe/get_current_base_fee.js +0 -7
  253. package/dest/cmds/pxe/get_l1_to_l2_message_witness.d.ts +0 -4
  254. package/dest/cmds/pxe/get_l1_to_l2_message_witness.d.ts.map +0 -1
  255. package/dest/cmds/pxe/get_l1_to_l2_message_witness.js +0 -11
  256. package/dest/cmds/pxe/get_logs.d.ts +0 -4
  257. package/dest/cmds/pxe/get_logs.d.ts.map +0 -1
  258. package/dest/cmds/pxe/get_node_info.d.ts +0 -3
  259. package/dest/cmds/pxe/get_node_info.d.ts.map +0 -1
  260. package/dest/cmds/pxe/get_pxe_info.d.ts +0 -3
  261. package/dest/cmds/pxe/get_pxe_info.d.ts.map +0 -1
  262. package/dest/cmds/pxe/get_pxe_info.js +0 -11
  263. package/dest/cmds/pxe/index.d.ts +0 -4
  264. package/dest/cmds/pxe/index.d.ts.map +0 -1
  265. package/dest/cmds/pxe/index.js +0 -55
  266. package/src/cmds/devnet/bootstrap_network.ts +0 -318
  267. package/src/cmds/devnet/faucet.ts +0 -33
  268. package/src/cmds/devnet/index.ts +0 -60
  269. package/src/cmds/l1/deploy_l1_contracts.ts +0 -65
  270. package/src/cmds/l1/deploy_l1_verifier.ts +0 -105
  271. package/src/cmds/misc/setup_contracts.ts +0 -40
  272. package/src/cmds/pxe/add_contract.ts +0 -41
  273. package/src/cmds/pxe/block_number.ts +0 -9
  274. package/src/cmds/pxe/get_account.ts +0 -16
  275. package/src/cmds/pxe/get_accounts.ts +0 -35
  276. package/src/cmds/pxe/get_block.ts +0 -10
  277. package/src/cmds/pxe/get_contract_data.ts +0 -51
  278. package/src/cmds/pxe/get_current_base_fee.ts +0 -9
  279. package/src/cmds/pxe/get_l1_to_l2_message_witness.ts +0 -25
  280. package/src/cmds/pxe/get_pxe_info.ts +0 -13
  281. package/src/cmds/pxe/index.ts +0 -170
@@ -0,0 +1,107 @@
1
+ import { getInitialTestAccountsData } from '@aztec/accounts/testing';
2
+ import type { EthAddress } from '@aztec/aztec.js/addresses';
3
+ import { Fr } from '@aztec/aztec.js/fields';
4
+ import { getL1ContractsConfigEnvVars } from '@aztec/ethereum/config';
5
+ import { type Operator, deployAztecL1Contracts } from '@aztec/ethereum/deploy-aztec-l1-contracts';
6
+ import { SecretValue } from '@aztec/foundation/config';
7
+ import type { LogFn, Logger } from '@aztec/foundation/log';
8
+ import { protocolContractsHash } from '@aztec/protocol-contracts';
9
+ import { getGenesisValues } from '@aztec/world-state/testing';
10
+
11
+ import { mnemonicToAccount } from 'viem/accounts';
12
+
13
+ import { addLeadingHex } from '../../utils/aztec.js';
14
+ import { getSponsoredFPCAddress } from '../../utils/setup_contracts.js';
15
+
16
+ export async function deployL1ContractsCmd(
17
+ rpcUrls: string[],
18
+ chainId: number,
19
+ privateKey: string | undefined,
20
+ mnemonic: string,
21
+ mnemonicIndex: number,
22
+ testAccounts: boolean,
23
+ sponsoredFPC: boolean,
24
+ json: boolean,
25
+ initialValidators: EthAddress[],
26
+ realVerifier: boolean,
27
+ existingToken: EthAddress | undefined,
28
+ log: LogFn,
29
+ debugLogger: Logger,
30
+ ) {
31
+ const config = getL1ContractsConfigEnvVars();
32
+
33
+ // Compute initial accounts for genesis (test accounts + sponsored FPC)
34
+ const initialAccounts = testAccounts ? await getInitialTestAccountsData() : [];
35
+ const sponsoredFPCAddress = sponsoredFPC ? await getSponsoredFPCAddress() : [];
36
+ const initialFundedAccounts = initialAccounts.map(a => a.address).concat(sponsoredFPCAddress);
37
+ const { genesisArchiveRoot, fundingNeeded } = await getGenesisValues(initialFundedAccounts);
38
+
39
+ // Get the VK tree root
40
+ const { getVKTreeRoot } = await import('@aztec/noir-protocol-circuits-types/vk-tree');
41
+ const vkTreeRoot = getVKTreeRoot();
42
+
43
+ // Get private key (from direct input or mnemonic)
44
+ let deployerPrivateKey: `0x${string}`;
45
+ if (privateKey) {
46
+ deployerPrivateKey = addLeadingHex(privateKey);
47
+ } else {
48
+ const account = mnemonicToAccount(mnemonic!, { addressIndex: mnemonicIndex });
49
+ deployerPrivateKey = `0x${Buffer.from(account.getHdKey().privateKey!).toString('hex')}`;
50
+ }
51
+
52
+ // Prepare validator operators with bn254 keys
53
+ const initialValidatorOperators: Operator[] = initialValidators.map(a => ({
54
+ attester: a,
55
+ withdrawer: a,
56
+ bn254SecretKey: new SecretValue(Fr.random().toBigInt()),
57
+ }));
58
+
59
+ debugLogger.info('Deploying L1 contracts via Forge...');
60
+
61
+ // Deploy using l1-contracts Forge scripts
62
+ const { l1ContractAddresses, rollupVersion } = await deployAztecL1Contracts(rpcUrls[0], deployerPrivateKey, chainId, {
63
+ // Initial validators to add during deployment
64
+ initialValidators: initialValidatorOperators,
65
+ // Genesis config
66
+ vkTreeRoot,
67
+ protocolContractsHash,
68
+ genesisArchiveRoot,
69
+ // Deployment options
70
+ realVerifier,
71
+ ...config,
72
+ feeJuicePortalInitialBalance: fundingNeeded,
73
+ existingTokenAddress: existingToken,
74
+ });
75
+
76
+ debugLogger.info('Forge deployment complete', { rollupVersion });
77
+
78
+ if (json) {
79
+ log(
80
+ JSON.stringify(
81
+ Object.fromEntries(Object.entries(l1ContractAddresses).map(([k, v]) => [k, v?.toString() ?? 'Not deployed'])),
82
+ null,
83
+ 2,
84
+ ),
85
+ );
86
+ } else {
87
+ log(`Rollup Address: ${l1ContractAddresses.rollupAddress.toString()}`);
88
+ log(`Registry Address: ${l1ContractAddresses.registryAddress.toString()}`);
89
+ log(`GSE Address: ${l1ContractAddresses.gseAddress?.toString()}`);
90
+ log(`L1 -> L2 Inbox Address: ${l1ContractAddresses.inboxAddress.toString()}`);
91
+ log(`L2 -> L1 Outbox Address: ${l1ContractAddresses.outboxAddress.toString()}`);
92
+ log(`Fee Juice Address: ${l1ContractAddresses.feeJuiceAddress.toString()}`);
93
+ log(`Staking Asset Address: ${l1ContractAddresses.stakingAssetAddress.toString()}`);
94
+ log(`Fee Juice Portal Address: ${l1ContractAddresses.feeJuicePortalAddress.toString()}`);
95
+ log(`CoinIssuer Address: ${l1ContractAddresses.coinIssuerAddress.toString()}`);
96
+ log(`RewardDistributor Address: ${l1ContractAddresses.rewardDistributorAddress.toString()}`);
97
+ log(`GovernanceProposer Address: ${l1ContractAddresses.governanceProposerAddress.toString()}`);
98
+ log(`Governance Address: ${l1ContractAddresses.governanceAddress.toString()}`);
99
+ log(`SlashFactory Address: ${l1ContractAddresses.slashFactoryAddress?.toString()}`);
100
+ log(`FeeAssetHandler Address: ${l1ContractAddresses.feeAssetHandlerAddress?.toString()}`);
101
+ log(`StakingAssetHandler Address: ${l1ContractAddresses.stakingAssetHandlerAddress?.toString()}`);
102
+ log(`ZK Passport Verifier Address: ${l1ContractAddresses.zkPassportVerifierAddress?.toString()}`);
103
+ log(`Initial funded accounts: ${initialFundedAccounts.map(a => a.toString()).join(', ')}`);
104
+ log(`Initial validators: ${initialValidators.map(a => a.toString()).join(', ')}`);
105
+ log(`Genesis archive root: ${genesisArchiveRoot.toString()}`);
106
+ }
107
+ }
@@ -1,10 +1,12 @@
1
- import { getInitialTestAccounts } from '@aztec/accounts/testing';
2
- import { getL1ContractsConfigEnvVars } from '@aztec/ethereum';
1
+ import { getInitialTestAccountsData } from '@aztec/accounts/testing';
2
+ import { getL1ContractsConfigEnvVars } from '@aztec/ethereum/config';
3
+ import type { Operator } from '@aztec/ethereum/deploy-aztec-l1-contracts';
3
4
  import type { EthAddress } from '@aztec/foundation/eth-address';
4
- import type { LogFn, Logger } from '@aztec/foundation/log';
5
+ import type { LogFn } from '@aztec/foundation/log';
5
6
  import { getGenesisValues } from '@aztec/world-state/testing';
6
7
 
7
8
  import { deployNewRollupContracts } from '../../utils/aztec.js';
9
+ import { getSponsoredFPCAddress } from '../../utils/setup_contracts.js';
8
10
 
9
11
  export async function deployNewRollup(
10
12
  registryAddress: EthAddress,
@@ -13,46 +15,53 @@ export async function deployNewRollup(
13
15
  privateKey: string | undefined,
14
16
  mnemonic: string,
15
17
  mnemonicIndex: number,
16
- salt: number | undefined,
17
18
  testAccounts: boolean,
19
+ sponsoredFPC: boolean,
18
20
  json: boolean,
19
- initialValidators: EthAddress[],
21
+ initialValidators: Operator[],
22
+ realVerifier: boolean,
20
23
  log: LogFn,
21
- debugLogger: Logger,
22
24
  ) {
23
25
  const config = getL1ContractsConfigEnvVars();
24
26
 
25
- const initialFundedAccounts = testAccounts ? await getInitialTestAccounts() : [];
26
- const { genesisBlockHash, genesisArchiveRoot } = await getGenesisValues(initialFundedAccounts.map(a => a.address));
27
+ const initialAccounts = testAccounts ? await getInitialTestAccountsData() : [];
28
+ const sponsoredFPCAddress = sponsoredFPC ? await getSponsoredFPCAddress() : [];
29
+ const initialFundedAccounts = initialAccounts.map(a => a.address).concat(sponsoredFPCAddress);
30
+ const { genesisArchiveRoot, fundingNeeded } = await getGenesisValues(initialFundedAccounts);
27
31
 
28
- const { payloadAddress, rollup } = await deployNewRollupContracts(
32
+ const { rollup, slashFactoryAddress } = await deployNewRollupContracts(
29
33
  registryAddress,
30
34
  rpcUrls,
31
- chainId,
32
35
  privateKey,
36
+ chainId,
33
37
  mnemonic,
34
38
  mnemonicIndex,
35
- salt,
36
39
  initialValidators,
37
40
  genesisArchiveRoot,
38
- genesisBlockHash,
41
+ fundingNeeded,
39
42
  config,
40
- debugLogger,
43
+ realVerifier,
41
44
  );
42
45
 
43
46
  if (json) {
44
47
  log(
45
48
  JSON.stringify(
46
49
  {
47
- payloadAddress: payloadAddress.toString(),
48
50
  rollupAddress: rollup.address,
51
+ initialFundedAccounts: initialFundedAccounts.map(a => a.toString()),
52
+ initialValidators: initialValidators.map(a => a.attester.toString()),
53
+ genesisArchiveRoot: genesisArchiveRoot.toString(),
54
+ slashFactoryAddress: slashFactoryAddress.toString(),
49
55
  },
50
56
  null,
51
57
  2,
52
58
  ),
53
59
  );
54
60
  } else {
55
- log(`Payload Address: ${payloadAddress.toString()}`);
56
61
  log(`Rollup Address: ${rollup.address}`);
62
+ log(`Initial funded accounts: ${initialFundedAccounts.map(a => a.toString()).join(', ')}`);
63
+ log(`Initial validators: ${initialValidators.map(a => a.attester.toString()).join(', ')}`);
64
+ log(`Genesis archive root: ${genesisArchiveRoot.toString()}`);
65
+ log(`Slash Factory Address: ${slashFactoryAddress.toString()}`);
57
66
  }
58
67
  }
@@ -1,5 +1,7 @@
1
- import { EthAddress } from '@aztec/aztec.js';
2
- import { RegistryContract, type ViemPublicClient, createEthereumChain } from '@aztec/ethereum';
1
+ import { EthAddress } from '@aztec/aztec.js/addresses';
2
+ import { createEthereumChain } from '@aztec/ethereum/chain';
3
+ import { RegistryContract } from '@aztec/ethereum/contracts';
4
+ import type { ViemPublicClient } from '@aztec/ethereum/types';
3
5
  import type { LogFn } from '@aztec/foundation/log';
4
6
 
5
7
  import { createPublicClient, fallback, http } from 'viem';
@@ -15,7 +17,7 @@ export async function getL1Addresses(
15
17
  const chain = createEthereumChain(rpcUrls, chainId);
16
18
  const publicClient: ViemPublicClient = createPublicClient({
17
19
  chain: chain.chainInfo,
18
- transport: fallback(rpcUrls.map(url => http(url))),
20
+ transport: fallback(rpcUrls.map(url => http(url, { batch: false }))),
19
21
  pollingInterval: 100,
20
22
  });
21
23
  const addresses = await RegistryContract.collectAddresses(publicClient, registryAddress.toString(), rollupVersion);
@@ -1,4 +1,4 @@
1
- import { createEthereumChain } from '@aztec/ethereum';
1
+ import { createEthereumChain } from '@aztec/ethereum/chain';
2
2
  import type { EthAddress } from '@aztec/foundation/eth-address';
3
3
  import type { LogFn } from '@aztec/foundation/log';
4
4
  import { TestERC20Abi } from '@aztec/l1-artifacts';
@@ -18,7 +18,7 @@ export async function getL1Balance(
18
18
  const chain = createEthereumChain(l1RpcUrls, chainId);
19
19
  const publicClient = createPublicClient({
20
20
  chain: chain.chainInfo,
21
- transport: fallback(l1RpcUrls.map(url => http(url))),
21
+ transport: fallback(l1RpcUrls.map(url => http(url, { batch: false }))),
22
22
  });
23
23
 
24
24
  let balance = 0n;
@@ -1,11 +1,6 @@
1
- import {
2
- FeeJuiceContract,
3
- GovernanceContract,
4
- ProposalState,
5
- RegistryContract,
6
- createEthereumChain,
7
- createL1Clients,
8
- } from '@aztec/ethereum';
1
+ import { createEthereumChain } from '@aztec/ethereum/chain';
2
+ import { createExtendedL1Client } from '@aztec/ethereum/client';
3
+ import { FeeJuiceContract, GovernanceContract, ProposalState, RegistryContract } from '@aztec/ethereum/contracts';
9
4
  import type { LogFn, Logger } from '@aztec/foundation/log';
10
5
 
11
6
  export async function depositGovernanceTokens({
@@ -33,19 +28,20 @@ export async function depositGovernanceTokens({
33
28
  }) {
34
29
  debugLogger.info(`Depositing ${amount} governance tokens to ${recipient}`);
35
30
  const chain = createEthereumChain(rpcUrls, chainId);
36
- const { publicClient, walletClient } = createL1Clients(
31
+ const extendedClient = createExtendedL1Client(
37
32
  rpcUrls,
38
33
  privateKey ?? mnemonic,
39
34
  chain.chainInfo,
35
+ undefined,
40
36
  mnemonicIndex,
41
37
  );
42
38
 
43
- const addresses = await RegistryContract.collectAddresses(publicClient, registryAddress, 'canonical');
39
+ const addresses = await RegistryContract.collectAddresses(extendedClient, registryAddress, 'canonical');
44
40
  const governanceAddress = addresses.governanceAddress.toString();
45
- const tokenAddress = addresses.feeJuiceAddress.toString();
41
+ const tokenAddress = addresses.stakingAssetAddress.toString();
46
42
 
47
- const feeJuice = new FeeJuiceContract(tokenAddress, publicClient, walletClient);
48
- const governance = new GovernanceContract(governanceAddress, publicClient, walletClient);
43
+ const feeJuice = new FeeJuiceContract(tokenAddress, extendedClient);
44
+ const governance = new GovernanceContract(governanceAddress, extendedClient);
49
45
  if (mint) {
50
46
  await feeJuice.mint(recipient, amount);
51
47
  debugLogger.info(`Minted ${amount} tokens to ${recipient}`);
@@ -83,19 +79,19 @@ export async function proposeWithLock({
83
79
  }) {
84
80
  debugLogger.info(`Proposing with lock from ${payloadAddress} to ${registryAddress}`);
85
81
  const chain = createEthereumChain(rpcUrls, chainId);
86
- const clients = createL1Clients(rpcUrls, privateKey ?? mnemonic, chain.chainInfo, mnemonicIndex);
82
+ const client = createExtendedL1Client(rpcUrls, privateKey ?? mnemonic, chain.chainInfo, undefined, mnemonicIndex);
87
83
 
88
- const addresses = await RegistryContract.collectAddresses(clients.publicClient, registryAddress, 'canonical');
84
+ const addresses = await RegistryContract.collectAddresses(client, registryAddress, 'canonical');
89
85
  const governanceAddress = addresses.governanceAddress.toString();
90
86
 
91
- const governance = new GovernanceContract(governanceAddress, clients.publicClient, clients.walletClient);
87
+ const governance = new GovernanceContract(governanceAddress, client);
92
88
 
93
89
  const proposalId = await governance.proposeWithLock({
94
90
  payloadAddress,
95
- withdrawAddress: clients.walletClient.account.address,
91
+ withdrawAddress: client.account.address,
96
92
  });
97
93
  if (json) {
98
- log(JSON.stringify({ proposalId }, null, 2));
94
+ log(JSON.stringify({ proposalId: Number(proposalId) }, null, 2));
99
95
  } else {
100
96
  log(`Proposed with lock`);
101
97
  log(`Proposal ID: ${proposalId}`);
@@ -131,12 +127,12 @@ export async function voteOnGovernanceProposal({
131
127
  `Voting on proposal ${proposalId} with ${voteAmount ? voteAmount : 'all'} tokens in favor: ${inFavor}`,
132
128
  );
133
129
  const chain = createEthereumChain(rpcUrls, chainId);
134
- const clients = createL1Clients(rpcUrls, privateKey ?? mnemonic, chain.chainInfo, mnemonicIndex);
130
+ const client = createExtendedL1Client(rpcUrls, privateKey ?? mnemonic, chain.chainInfo, undefined, mnemonicIndex);
135
131
 
136
- const addresses = await RegistryContract.collectAddresses(clients.publicClient, registryAddress, 'canonical');
132
+ const addresses = await RegistryContract.collectAddresses(client, registryAddress, 'canonical');
137
133
  const governanceAddress = addresses.governanceAddress.toString();
138
134
 
139
- const governance = new GovernanceContract(governanceAddress, clients.publicClient, clients.walletClient);
135
+ const governance = new GovernanceContract(governanceAddress, client);
140
136
  const state = await governance.getProposalState(proposalId);
141
137
  if (state !== ProposalState.Active && !waitTilActive) {
142
138
  debugLogger.warn(`Proposal is not active, but waitTilActive is false. Not voting.`);
@@ -170,12 +166,12 @@ export async function executeGovernanceProposal({
170
166
  }) {
171
167
  debugLogger.info(`Executing proposal ${proposalId}`);
172
168
  const chain = createEthereumChain(rpcUrls, chainId);
173
- const clients = createL1Clients(rpcUrls, privateKey ?? mnemonic, chain.chainInfo, mnemonicIndex);
169
+ const client = createExtendedL1Client(rpcUrls, privateKey ?? mnemonic, chain.chainInfo, undefined, mnemonicIndex);
174
170
 
175
- const addresses = await RegistryContract.collectAddresses(clients.publicClient, registryAddress, 'canonical');
171
+ const addresses = await RegistryContract.collectAddresses(client, registryAddress, 'canonical');
176
172
  const governanceAddress = addresses.governanceAddress.toString();
177
173
 
178
- const governance = new GovernanceContract(governanceAddress, clients.publicClient, clients.walletClient);
174
+ const governance = new GovernanceContract(governanceAddress, client);
179
175
  const state = await governance.getProposalState(proposalId);
180
176
  if (state !== ProposalState.Executable && !waitTilExecutable) {
181
177
  debugLogger.warn(`Proposal is not executable, but waitTilExecutable is false. Not executing.`);
@@ -5,13 +5,13 @@ import { type Command, Option } from 'commander';
5
5
 
6
6
  import {
7
7
  ETHEREUM_HOSTS,
8
+ MNEMONIC,
8
9
  PRIVATE_KEY,
9
10
  l1ChainIdOption,
10
- makePxeOption,
11
+ nodeOption,
11
12
  parseAztecAddress,
12
13
  parseBigint,
13
14
  parseEthereumAddress,
14
- pxeOption,
15
15
  } from '../../utils/commands.js';
16
16
 
17
17
  const l1RpcUrlsOption = new Option(
@@ -23,9 +23,9 @@ const l1RpcUrlsOption = new Option(
23
23
  .makeOptionMandatory(true)
24
24
  .argParser((arg: string) => arg.split(',').map(url => url.trim()));
25
25
 
26
- export function injectCommands(program: Command, log: LogFn, debugLogger: Logger) {
27
- const { BB_BINARY_PATH, BB_WORKING_DIRECTORY } = process.env;
26
+ const networkOption = new Option('--network <string>', 'Network to execute against').env('NETWORK');
28
27
 
28
+ export function injectCommands(program: Command, log: LogFn, debugLogger: Logger) {
29
29
  program
30
30
  .command('deploy-l1-contracts')
31
31
  .description('Deploys all necessary Ethereum contracts for Aztec.')
@@ -39,26 +39,28 @@ export function injectCommands(program: Command, log: LogFn, debugLogger: Logger
39
39
  )
40
40
  .option('-i, --mnemonic-index <number>', 'The index of the mnemonic to use in deployment', arg => parseInt(arg), 0)
41
41
  .addOption(l1ChainIdOption)
42
- .option('--salt <number>', 'The optional salt to use in deployment', arg => parseInt(arg))
43
42
  .option('--json', 'Output the contract addresses in JSON format')
44
43
  .option('--test-accounts', 'Populate genesis state with initial fee juice for test accounts')
45
- .option('--accelerated-test-deployments', 'Fire and forget deployment transactions, use in testing only', false)
44
+ .option('--sponsored-fpc', 'Populate genesis state with a testing sponsored FPC contract')
45
+ .option('--real-verifier', 'Deploy the real verifier', false)
46
+ .option('--existing-token <address>', 'Use an existing ERC20 for both fee and staking', parseEthereumAddress)
46
47
  .action(async options => {
47
- const { deployL1Contracts } = await import('./deploy_l1_contracts.js');
48
+ const { deployL1ContractsCmd } = await import('./deploy_l1_contracts_cmd.js');
48
49
 
49
50
  const initialValidators =
50
51
  options.validators?.split(',').map((validator: string) => EthAddress.fromString(validator)) || [];
51
- await deployL1Contracts(
52
+ await deployL1ContractsCmd(
52
53
  options.l1RpcUrls,
53
54
  options.l1ChainId,
54
55
  options.privateKey,
55
56
  options.mnemonic,
56
57
  options.mnemonicIndex,
57
- options.salt,
58
58
  options.testAccounts,
59
- options.acceleratedTestDeployments,
59
+ options.sponsoredFpc,
60
60
  options.json,
61
61
  initialValidators,
62
+ options.realVerifier,
63
+ options.existingToken,
62
64
  log,
63
65
  debugLogger,
64
66
  );
@@ -66,7 +68,7 @@ export function injectCommands(program: Command, log: LogFn, debugLogger: Logger
66
68
 
67
69
  program
68
70
  .command('deploy-new-rollup')
69
- .description('Deploys a new rollup contract and a payload to upgrade the registry with it.')
71
+ .description('Deploys a new rollup contract and adds it to the registry (if you are the owner).')
70
72
  .requiredOption('-r, --registry-address <string>', 'The address of the registry contract', parseEthereumAddress)
71
73
  .addOption(l1RpcUrlsOption)
72
74
  .option('-pk, --private-key <string>', 'The private key to use for deployment', PRIVATE_KEY)
@@ -74,13 +76,14 @@ export function injectCommands(program: Command, log: LogFn, debugLogger: Logger
74
76
  .option(
75
77
  '-m, --mnemonic <string>',
76
78
  'The mnemonic to use in deployment',
77
- 'test test test test test test test test test test test junk',
79
+ MNEMONIC ?? 'test test test test test test test test test test test junk',
78
80
  )
79
81
  .option('-i, --mnemonic-index <number>', 'The index of the mnemonic to use in deployment', arg => parseInt(arg), 0)
80
82
  .addOption(l1ChainIdOption)
81
- .option('--salt <number>', 'The optional salt to use in deployment', arg => parseInt(arg))
82
83
  .option('--json', 'Output the contract addresses in JSON format')
83
84
  .option('--test-accounts', 'Populate genesis state with initial fee juice for test accounts')
85
+ .option('--sponsored-fpc', 'Populate genesis state with a testing sponsored FPC contract')
86
+ .option('--real-verifier', 'Deploy the real verifier', false)
84
87
  .action(async options => {
85
88
  const { deployNewRollup } = await import('./deploy_new_rollup.js');
86
89
 
@@ -93,12 +96,12 @@ export function injectCommands(program: Command, log: LogFn, debugLogger: Logger
93
96
  options.privateKey,
94
97
  options.mnemonic,
95
98
  options.mnemonicIndex,
96
- options.salt,
97
99
  options.testAccounts,
100
+ options.sponsoredFpc,
98
101
  options.json,
99
102
  initialValidators,
103
+ options.realVerifier,
100
104
  log,
101
- debugLogger,
102
105
  );
103
106
  });
104
107
 
@@ -274,28 +277,44 @@ export function injectCommands(program: Command, log: LogFn, debugLogger: Logger
274
277
 
275
278
  program
276
279
  .command('add-l1-validator')
277
- .description('Adds a validator to the L1 rollup contract.')
280
+ .description('Adds a validator to the L1 rollup contract via a direct deposit.')
278
281
  .addOption(l1RpcUrlsOption)
279
- .option('-pk, --private-key <string>', 'The private key to use for deployment', PRIVATE_KEY)
282
+ .addOption(networkOption)
283
+ .option('-pk, --private-key <string>', 'The private key to use sending the transaction', PRIVATE_KEY)
280
284
  .option(
281
285
  '-m, --mnemonic <string>',
282
- 'The mnemonic to use in deployment',
286
+ 'The mnemonic to use sending the transaction',
283
287
  'test test test test test test test test test test test junk',
284
288
  )
285
289
  .addOption(l1ChainIdOption)
286
- .option('--validator <address>', 'ethereum address of the validator', parseEthereumAddress)
287
- .option('--rollup <address>', 'ethereum address of the rollup contract', parseEthereumAddress)
290
+ .option('--attester <address>', 'ethereum address of the attester', parseEthereumAddress)
288
291
  .option('--withdrawer <address>', 'ethereum address of the withdrawer', parseEthereumAddress)
292
+ .option(
293
+ '--bls-secret-key <string>',
294
+ 'The BN254 scalar field element used as a secret key for BLS signatures. Will be associated with the attester address.',
295
+ parseBigint,
296
+ )
297
+ .option('--move-with-latest-rollup', 'Whether to move with the latest rollup', true)
298
+ .option('--rollup <string>', 'Rollup contract address', parseEthereumAddress)
289
299
  .action(async options => {
290
- const { addL1Validator } = await import('./update_l1_validators.js');
291
- await addL1Validator({
300
+ const { addL1ValidatorViaRollup } = await import('./update_l1_validators.js');
301
+
302
+ let rollupAddress = options.rollup;
303
+ if (!rollupAddress) {
304
+ const { getL1RollupAddressFromEnv } = await import('../../config/get_l1_config.js');
305
+ rollupAddress = await getL1RollupAddressFromEnv(options.l1RpcUrls, options.l1ChainId);
306
+ }
307
+
308
+ await addL1ValidatorViaRollup({
292
309
  rpcUrls: options.l1RpcUrls,
293
310
  chainId: options.l1ChainId,
294
311
  privateKey: options.privateKey,
295
312
  mnemonic: options.mnemonic,
296
- validatorAddress: options.validator,
297
- rollupAddress: options.rollup,
313
+ attesterAddress: options.attester,
314
+ blsSecretKey: options.blsSecretKey,
298
315
  withdrawerAddress: options.withdrawer,
316
+ rollupAddress,
317
+ moveWithLatestRollup: options.moveWithLatestRollup,
299
318
  log,
300
319
  debugLogger,
301
320
  });
@@ -347,6 +366,30 @@ export function injectCommands(program: Command, log: LogFn, debugLogger: Logger
347
366
  });
348
367
  });
349
368
 
369
+ program
370
+ .command('trigger-seed-snapshot')
371
+ .description('Triggers a seed snapshot for the next epoch.')
372
+ .option('-pk, --private-key <string>', 'The private key to use for deployment', PRIVATE_KEY)
373
+ .option(
374
+ '-m, --mnemonic <string>',
375
+ 'The mnemonic to use in deployment',
376
+ 'test test test test test test test test test test test junk',
377
+ )
378
+ .option('--rollup <address>', 'ethereum address of the rollup contract', parseEthereumAddress)
379
+ .addOption(l1RpcUrlsOption)
380
+ .addOption(l1ChainIdOption)
381
+ .action(async options => {
382
+ const { triggerSeedSnapshot } = await import('./trigger_seed_snapshot.js');
383
+ await triggerSeedSnapshot({
384
+ rollupAddress: options.rollup,
385
+ rpcUrls: options.l1RpcUrls,
386
+ chainId: options.l1ChainId,
387
+ privateKey: options.privateKey,
388
+ mnemonic: options.mnemonic,
389
+ log,
390
+ });
391
+ });
392
+
350
393
  program
351
394
  .command('debug-rollup')
352
395
  .description('Debugs the rollup contract.')
@@ -391,56 +434,6 @@ export function injectCommands(program: Command, log: LogFn, debugLogger: Logger
391
434
  });
392
435
  });
393
436
 
394
- program
395
- .command('deploy-l1-verifier')
396
- .description('Deploys the rollup verifier contract')
397
- .addOption(l1RpcUrlsOption)
398
- .addOption(l1ChainIdOption)
399
- .addOption(makePxeOption(false).conflicts('rollup-address'))
400
- .addOption(
401
- new Option('--rollup-address <string>', 'The address of the rollup contract')
402
- .env('ROLLUP_CONTRACT_ADDRESS')
403
- .argParser(parseEthereumAddress)
404
- .conflicts('rpc-url'),
405
- )
406
- .option('--l1-private-key <string>', 'The L1 private key to use for deployment', PRIVATE_KEY)
407
- .option(
408
- '-m, --mnemonic <string>',
409
- 'The mnemonic to use in deployment',
410
- 'test test test test test test test test test test test junk',
411
- )
412
- .requiredOption('--verifier <verifier>', 'Either mock or real', 'real')
413
- .option('--bb <path>', 'Path to bb binary', BB_BINARY_PATH)
414
- .option('--bb-working-dir <path>', 'Path to bb working directory', BB_WORKING_DIRECTORY)
415
- .action(async options => {
416
- const { deployMockVerifier, deployUltraHonkVerifier } = await import('./deploy_l1_verifier.js');
417
- if (options.verifier === 'mock') {
418
- await deployMockVerifier(
419
- options.rollupAddress?.toString(),
420
- options.l1RpcUrls,
421
- options.l1ChainId,
422
- options.l1PrivateKey,
423
- options.mnemonic,
424
- options.rpcUrl,
425
- log,
426
- debugLogger,
427
- );
428
- } else {
429
- await deployUltraHonkVerifier(
430
- options.rollupAddress?.toString(),
431
- options.l1RpcUrls,
432
- options.l1ChainId,
433
- options.l1PrivateKey,
434
- options.mnemonic,
435
- options.rpcUrl,
436
- options.bb,
437
- options.bbWorkingDir,
438
- log,
439
- debugLogger,
440
- );
441
- }
442
- });
443
-
444
437
  program
445
438
  .command('bridge-erc20')
446
439
  .description('Bridges ERC20 tokens to L2.')
@@ -457,6 +450,7 @@ export function injectCommands(program: Command, log: LogFn, debugLogger: Logger
457
450
  .addOption(l1ChainIdOption)
458
451
  .requiredOption('-t, --token <string>', 'The address of the token to bridge', parseEthereumAddress)
459
452
  .requiredOption('-p, --portal <string>', 'The address of the portal contract', parseEthereumAddress)
453
+ .option('-f, --faucet <string>', 'The address of the faucet contract (only used if minting)', parseEthereumAddress)
460
454
  .option('--l1-private-key <string>', 'The private key to use for deployment', PRIVATE_KEY)
461
455
  .option('--json', 'Output the claim in JSON format')
462
456
  .action(async (amount, recipient, options) => {
@@ -469,6 +463,7 @@ export function injectCommands(program: Command, log: LogFn, debugLogger: Logger
469
463
  options.l1PrivateKey,
470
464
  options.mnemonic,
471
465
  options.token,
466
+ options.faucet,
472
467
  options.portal,
473
468
  options.private,
474
469
  options.mint,
@@ -506,52 +501,20 @@ export function injectCommands(program: Command, log: LogFn, debugLogger: Logger
506
501
  )
507
502
  .argument('[blockNumber]', 'The target block number, defaults to the latest pending block number.', parseBigint)
508
503
  .addOption(l1RpcUrlsOption)
509
- .addOption(pxeOption)
504
+ .addOption(nodeOption)
510
505
  .action(async (blockNumber, options) => {
511
506
  const { assumeProvenThrough } = await import('./assume_proven_through.js');
512
- await assumeProvenThrough(blockNumber, options.l1RpcUrls, options.rpcUrl, log);
507
+ await assumeProvenThrough(blockNumber, options.l1RpcUrls, options.nodeUrl, log);
513
508
  });
514
509
 
515
510
  program
516
511
  .command('advance-epoch')
517
512
  .description('Use L1 cheat codes to warp time until the next epoch.')
518
513
  .addOption(l1RpcUrlsOption)
519
- .addOption(pxeOption)
514
+ .addOption(nodeOption)
520
515
  .action(async options => {
521
516
  const { advanceEpoch } = await import('./advance_epoch.js');
522
- await advanceEpoch(options.l1RpcUrls, options.rpcUrl, log);
523
- });
524
-
525
- program
526
- .command('prover-stats', { hidden: true })
527
- .addOption(l1RpcUrlsOption)
528
- .addOption(l1ChainIdOption)
529
- .option('--start-block <number>', 'The L1 block number to start from', parseBigint, 1n)
530
- .option('--end-block <number>', 'The last L1 block number to query', parseBigint)
531
- .option('--batch-size <number>', 'The number of blocks to query in each batch', parseBigint, 100n)
532
- .option('--proving-timeout <number>', 'Cutoff for proving time to consider a block', parseBigint)
533
- .option('--l1-rollup-address <string>', 'Address of the rollup contract (required if node URL is not set)')
534
- .option(
535
- '--node-url <string>',
536
- 'JSON RPC URL of an Aztec node to retrieve the rollup contract address (required if L1 rollup address is not set)',
537
- )
538
- .option('--raw-logs', 'Output raw logs instead of aggregated stats')
539
- .action(async options => {
540
- const { proverStats } = await import('./prover_stats.js');
541
- const { l1RpcUrls, chainId, l1RollupAddress, startBlock, endBlock, batchSize, nodeUrl, provingTimeout, rawLogs } =
542
- options;
543
- await proverStats({
544
- l1RpcUrls,
545
- chainId,
546
- l1RollupAddress,
547
- startBlock,
548
- endBlock,
549
- batchSize,
550
- nodeUrl,
551
- provingTimeout,
552
- rawLogs,
553
- log,
554
- });
517
+ await advanceEpoch(options.l1RpcUrls, options.nodeUrl, log);
555
518
  });
556
519
 
557
520
  return program;