@aztec/cli 0.0.0-test.0 → 0.0.1-commit.001888fc

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 (289) 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 +12 -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 +3 -2
  41. package/dest/cmds/l1/assume_proven_through.d.ts.map +1 -1
  42. package/dest/cmds/l1/assume_proven_through.js +10 -10
  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/compute_genesis_values.d.ts +4 -0
  47. package/dest/cmds/l1/compute_genesis_values.d.ts.map +1 -0
  48. package/dest/cmds/l1/compute_genesis_values.js +17 -0
  49. package/dest/cmds/l1/create_l1_account.d.ts +1 -1
  50. package/dest/cmds/l1/deploy_l1_contracts_cmd.d.ts +4 -0
  51. package/dest/cmds/l1/deploy_l1_contracts_cmd.d.ts.map +1 -0
  52. package/dest/cmds/l1/deploy_l1_contracts_cmd.js +81 -0
  53. package/dest/cmds/l1/deploy_new_rollup.d.ts +4 -3
  54. package/dest/cmds/l1/deploy_new_rollup.d.ts.map +1 -1
  55. package/dest/cmds/l1/deploy_new_rollup.js +18 -9
  56. package/dest/cmds/l1/get_l1_addresses.d.ts +2 -2
  57. package/dest/cmds/l1/get_l1_addresses.d.ts.map +1 -1
  58. package/dest/cmds/l1/get_l1_addresses.js +5 -2
  59. package/dest/cmds/l1/get_l1_balance.d.ts +1 -1
  60. package/dest/cmds/l1/get_l1_balance.js +4 -2
  61. package/dest/cmds/l1/governance_utils.d.ts +5 -5
  62. package/dest/cmds/l1/governance_utils.d.ts.map +1 -1
  63. package/dest/cmds/l1/governance_utils.js +19 -17
  64. package/dest/cmds/l1/index.d.ts +1 -1
  65. package/dest/cmds/l1/index.d.ts.map +1 -1
  66. package/dest/cmds/l1/index.js +41 -44
  67. package/dest/cmds/l1/prover_stats.d.ts +1 -1
  68. package/dest/cmds/l1/prover_stats.d.ts.map +1 -1
  69. package/dest/cmds/l1/prover_stats.js +32 -30
  70. package/dest/cmds/l1/trigger_seed_snapshot.d.ts +6 -0
  71. package/dest/cmds/l1/trigger_seed_snapshot.d.ts.map +1 -0
  72. package/dest/cmds/l1/trigger_seed_snapshot.js +20 -0
  73. package/dest/cmds/l1/update_l1_validators.d.ts +21 -6
  74. package/dest/cmds/l1/update_l1_validators.d.ts.map +1 -1
  75. package/dest/cmds/l1/update_l1_validators.js +198 -103
  76. package/dest/cmds/misc/compute_selector.d.ts +1 -1
  77. package/dest/cmds/misc/example_contracts.d.ts +1 -1
  78. package/dest/cmds/misc/generate_bootnode_enr.d.ts +2 -2
  79. package/dest/cmds/misc/generate_bootnode_enr.d.ts.map +1 -1
  80. package/dest/cmds/misc/generate_bootnode_enr.js +2 -2
  81. package/dest/cmds/misc/generate_p2p_private_key.d.ts +1 -1
  82. package/dest/cmds/misc/generate_secret_and_hash.d.ts +2 -2
  83. package/dest/cmds/misc/generate_secret_and_hash.d.ts.map +1 -1
  84. package/dest/cmds/misc/generate_secret_and_hash.js +4 -4
  85. package/dest/cmds/misc/generate_secret_key.d.ts +2 -2
  86. package/dest/cmds/misc/generate_secret_key.d.ts.map +1 -1
  87. package/dest/cmds/misc/generate_secret_key.js +1 -1
  88. package/dest/cmds/misc/get_canonical_sponsored_fpc_address.d.ts +3 -0
  89. package/dest/cmds/misc/get_canonical_sponsored_fpc_address.d.ts.map +1 -0
  90. package/dest/cmds/misc/get_canonical_sponsored_fpc_address.js +4 -0
  91. package/dest/cmds/misc/index.d.ts +1 -1
  92. package/dest/cmds/misc/index.d.ts.map +1 -1
  93. package/dest/cmds/misc/index.js +8 -4
  94. package/dest/cmds/misc/update/common.d.ts +1 -1
  95. package/dest/cmds/misc/update/github.d.ts +1 -2
  96. package/dest/cmds/misc/update/github.d.ts.map +1 -1
  97. package/dest/cmds/misc/update/github.js +0 -1
  98. package/dest/cmds/misc/update/noir.d.ts +1 -1
  99. package/dest/cmds/misc/update/npm.d.ts +1 -1
  100. package/dest/cmds/misc/update/npm.js +1 -1
  101. package/dest/cmds/misc/update/utils.d.ts +1 -1
  102. package/dest/cmds/misc/update.d.ts +1 -1
  103. package/dest/cmds/misc/update.d.ts.map +1 -1
  104. package/dest/cmds/misc/update.js +2 -3
  105. package/dest/cmds/validator_keys/add.d.ts +5 -0
  106. package/dest/cmds/validator_keys/add.d.ts.map +1 -0
  107. package/dest/cmds/validator_keys/add.js +83 -0
  108. package/dest/cmds/validator_keys/generate_bls_keypair.d.ts +12 -0
  109. package/dest/cmds/validator_keys/generate_bls_keypair.d.ts.map +1 -0
  110. package/dest/cmds/validator_keys/generate_bls_keypair.js +27 -0
  111. package/dest/cmds/validator_keys/index.d.ts +4 -0
  112. package/dest/cmds/validator_keys/index.d.ts.map +1 -0
  113. package/dest/cmds/validator_keys/index.js +32 -0
  114. package/dest/cmds/validator_keys/new.d.ts +29 -0
  115. package/dest/cmds/validator_keys/new.d.ts.map +1 -0
  116. package/dest/cmds/validator_keys/new.js +134 -0
  117. package/dest/cmds/validator_keys/shared.d.ts +68 -0
  118. package/dest/cmds/validator_keys/shared.d.ts.map +1 -0
  119. package/dest/cmds/validator_keys/shared.js +274 -0
  120. package/dest/cmds/validator_keys/staker.d.ts +38 -0
  121. package/dest/cmds/validator_keys/staker.d.ts.map +1 -0
  122. package/dest/cmds/validator_keys/staker.js +210 -0
  123. package/dest/cmds/validator_keys/utils.d.ts +25 -0
  124. package/dest/cmds/validator_keys/utils.d.ts.map +1 -0
  125. package/dest/cmds/validator_keys/utils.js +52 -0
  126. package/dest/config/cached_fetch.d.ts +27 -0
  127. package/dest/config/cached_fetch.d.ts.map +1 -0
  128. package/dest/config/cached_fetch.js +132 -0
  129. package/dest/config/chain_l2_config.d.ts +14 -0
  130. package/dest/config/chain_l2_config.d.ts.map +1 -0
  131. package/dest/config/chain_l2_config.js +47 -0
  132. package/dest/config/enrich_env.d.ts +4 -0
  133. package/dest/config/enrich_env.d.ts.map +1 -0
  134. package/dest/config/enrich_env.js +12 -0
  135. package/dest/config/generated/networks.d.ts +221 -0
  136. package/dest/config/generated/networks.d.ts.map +1 -0
  137. package/dest/config/generated/networks.js +222 -0
  138. package/dest/config/get_l1_config.d.ts +9 -0
  139. package/dest/config/get_l1_config.d.ts.map +1 -0
  140. package/dest/config/get_l1_config.js +24 -0
  141. package/dest/config/index.d.ts +5 -0
  142. package/dest/config/index.d.ts.map +1 -0
  143. package/dest/config/index.js +4 -0
  144. package/dest/config/network_config.d.ts +22 -0
  145. package/dest/config/network_config.d.ts.map +1 -0
  146. package/dest/config/network_config.js +119 -0
  147. package/dest/utils/aztec.d.ts +15 -26
  148. package/dest/utils/aztec.d.ts.map +1 -1
  149. package/dest/utils/aztec.js +56 -72
  150. package/dest/utils/commands.d.ts +22 -13
  151. package/dest/utils/commands.d.ts.map +1 -1
  152. package/dest/utils/commands.js +43 -16
  153. package/dest/utils/encoding.d.ts +1 -1
  154. package/dest/utils/encoding.js +2 -2
  155. package/dest/utils/github.d.ts +1 -2
  156. package/dest/utils/github.d.ts.map +1 -1
  157. package/dest/utils/github.js +0 -1
  158. package/dest/utils/index.d.ts +2 -1
  159. package/dest/utils/index.d.ts.map +1 -1
  160. package/dest/utils/index.js +1 -0
  161. package/dest/utils/inspect.d.ts +5 -11
  162. package/dest/utils/inspect.d.ts.map +1 -1
  163. package/dest/utils/inspect.js +23 -110
  164. package/dest/utils/setup_contracts.d.ts +3 -0
  165. package/dest/utils/setup_contracts.d.ts.map +1 -0
  166. package/dest/utils/setup_contracts.js +16 -0
  167. package/package.json +61 -37
  168. package/public_include_metric_prefixes.json +1 -0
  169. package/src/cmds/aztec_node/block_number.ts +9 -0
  170. package/src/cmds/aztec_node/get_block.ts +11 -0
  171. package/src/cmds/aztec_node/get_current_min_fee.ts +9 -0
  172. package/src/cmds/aztec_node/get_l1_to_l2_message_witness.ts +27 -0
  173. package/src/cmds/{pxe → aztec_node}/get_logs.ts +11 -9
  174. package/src/cmds/{pxe → aztec_node}/get_node_info.ts +15 -23
  175. package/src/cmds/aztec_node/index.ts +87 -0
  176. package/src/cmds/contracts/inspect_contract.ts +20 -17
  177. package/src/cmds/infrastructure/index.ts +8 -11
  178. package/src/cmds/infrastructure/sequencers.ts +41 -22
  179. package/src/cmds/infrastructure/setup_l2_contract.ts +14 -25
  180. package/src/cmds/l1/advance_epoch.ts +7 -5
  181. package/src/cmds/l1/assume_proven_through.ts +11 -10
  182. package/src/cmds/l1/bridge_erc20.ts +8 -4
  183. package/src/cmds/l1/compute_genesis_values.ts +29 -0
  184. package/src/cmds/l1/deploy_l1_contracts_cmd.ts +107 -0
  185. package/src/cmds/l1/deploy_new_rollup.ts +24 -15
  186. package/src/cmds/l1/get_l1_addresses.ts +5 -3
  187. package/src/cmds/l1/get_l1_balance.ts +2 -2
  188. package/src/cmds/l1/governance_utils.ts +20 -24
  189. package/src/cmds/l1/index.ts +95 -113
  190. package/src/cmds/l1/prover_stats.ts +42 -31
  191. package/src/cmds/l1/trigger_seed_snapshot.ts +32 -0
  192. package/src/cmds/l1/update_l1_validators.ts +218 -97
  193. package/src/cmds/misc/generate_bootnode_enr.ts +3 -2
  194. package/src/cmds/misc/generate_secret_and_hash.ts +4 -4
  195. package/src/cmds/misc/generate_secret_key.ts +1 -1
  196. package/src/cmds/misc/get_canonical_sponsored_fpc_address.ts +7 -0
  197. package/src/cmds/misc/index.ts +14 -5
  198. package/src/cmds/misc/update/github.ts +0 -1
  199. package/src/cmds/misc/update/npm.ts +1 -1
  200. package/src/cmds/misc/update.ts +1 -7
  201. package/src/cmds/validator_keys/add.ts +123 -0
  202. package/src/cmds/validator_keys/generate_bls_keypair.ts +34 -0
  203. package/src/cmds/validator_keys/index.ts +142 -0
  204. package/src/cmds/validator_keys/new.ts +207 -0
  205. package/src/cmds/validator_keys/shared.ts +326 -0
  206. package/src/cmds/validator_keys/staker.ts +301 -0
  207. package/src/cmds/validator_keys/utils.ts +81 -0
  208. package/src/config/cached_fetch.ts +155 -0
  209. package/src/config/chain_l2_config.ts +59 -0
  210. package/src/config/enrich_env.ts +15 -0
  211. package/src/config/generated/networks.ts +226 -0
  212. package/src/config/get_l1_config.ts +31 -0
  213. package/src/config/index.ts +4 -0
  214. package/src/config/network_config.ts +151 -0
  215. package/src/utils/aztec.ts +74 -120
  216. package/src/utils/commands.ts +57 -20
  217. package/src/utils/encoding.ts +2 -2
  218. package/src/utils/github.ts +0 -1
  219. package/src/utils/index.ts +1 -0
  220. package/src/utils/inspect.ts +28 -124
  221. package/src/utils/setup_contracts.ts +19 -0
  222. package/dest/cmds/devnet/bootstrap_network.d.ts +0 -3
  223. package/dest/cmds/devnet/bootstrap_network.d.ts.map +0 -1
  224. package/dest/cmds/devnet/bootstrap_network.js +0 -196
  225. package/dest/cmds/devnet/faucet.d.ts +0 -4
  226. package/dest/cmds/devnet/faucet.d.ts.map +0 -1
  227. package/dest/cmds/devnet/faucet.js +0 -26
  228. package/dest/cmds/devnet/index.d.ts +0 -4
  229. package/dest/cmds/devnet/index.d.ts.map +0 -1
  230. package/dest/cmds/devnet/index.js +0 -14
  231. package/dest/cmds/l1/deploy_l1_contracts.d.ts +0 -4
  232. package/dest/cmds/l1/deploy_l1_contracts.d.ts.map +0 -1
  233. package/dest/cmds/l1/deploy_l1_contracts.js +0 -29
  234. package/dest/cmds/l1/deploy_l1_verifier.d.ts +0 -5
  235. package/dest/cmds/l1/deploy_l1_verifier.d.ts.map +0 -1
  236. package/dest/cmds/l1/deploy_l1_verifier.js +0 -54
  237. package/dest/cmds/misc/setup_contracts.d.ts +0 -7
  238. package/dest/cmds/misc/setup_contracts.d.ts.map +0 -1
  239. package/dest/cmds/misc/setup_contracts.js +0 -27
  240. package/dest/cmds/pxe/add_contract.d.ts +0 -5
  241. package/dest/cmds/pxe/add_contract.d.ts.map +0 -1
  242. package/dest/cmds/pxe/add_contract.js +0 -29
  243. package/dest/cmds/pxe/block_number.d.ts +0 -3
  244. package/dest/cmds/pxe/block_number.d.ts.map +0 -1
  245. package/dest/cmds/pxe/block_number.js +0 -10
  246. package/dest/cmds/pxe/get_account.d.ts +0 -4
  247. package/dest/cmds/pxe/get_account.d.ts.map +0 -1
  248. package/dest/cmds/pxe/get_account.js +0 -10
  249. package/dest/cmds/pxe/get_accounts.d.ts +0 -3
  250. package/dest/cmds/pxe/get_accounts.d.ts.map +0 -1
  251. package/dest/cmds/pxe/get_accounts.js +0 -25
  252. package/dest/cmds/pxe/get_block.d.ts +0 -3
  253. package/dest/cmds/pxe/get_block.d.ts.map +0 -1
  254. package/dest/cmds/pxe/get_block.js +0 -9
  255. package/dest/cmds/pxe/get_contract_data.d.ts +0 -4
  256. package/dest/cmds/pxe/get_contract_data.d.ts.map +0 -1
  257. package/dest/cmds/pxe/get_contract_data.js +0 -31
  258. package/dest/cmds/pxe/get_current_base_fee.d.ts +0 -3
  259. package/dest/cmds/pxe/get_current_base_fee.d.ts.map +0 -1
  260. package/dest/cmds/pxe/get_current_base_fee.js +0 -7
  261. package/dest/cmds/pxe/get_l1_to_l2_message_witness.d.ts +0 -4
  262. package/dest/cmds/pxe/get_l1_to_l2_message_witness.d.ts.map +0 -1
  263. package/dest/cmds/pxe/get_l1_to_l2_message_witness.js +0 -11
  264. package/dest/cmds/pxe/get_logs.d.ts +0 -4
  265. package/dest/cmds/pxe/get_logs.d.ts.map +0 -1
  266. package/dest/cmds/pxe/get_node_info.d.ts +0 -3
  267. package/dest/cmds/pxe/get_node_info.d.ts.map +0 -1
  268. package/dest/cmds/pxe/get_pxe_info.d.ts +0 -3
  269. package/dest/cmds/pxe/get_pxe_info.d.ts.map +0 -1
  270. package/dest/cmds/pxe/get_pxe_info.js +0 -11
  271. package/dest/cmds/pxe/index.d.ts +0 -4
  272. package/dest/cmds/pxe/index.d.ts.map +0 -1
  273. package/dest/cmds/pxe/index.js +0 -55
  274. package/src/cmds/devnet/bootstrap_network.ts +0 -318
  275. package/src/cmds/devnet/faucet.ts +0 -33
  276. package/src/cmds/devnet/index.ts +0 -60
  277. package/src/cmds/l1/deploy_l1_contracts.ts +0 -65
  278. package/src/cmds/l1/deploy_l1_verifier.ts +0 -105
  279. package/src/cmds/misc/setup_contracts.ts +0 -40
  280. package/src/cmds/pxe/add_contract.ts +0 -41
  281. package/src/cmds/pxe/block_number.ts +0 -9
  282. package/src/cmds/pxe/get_account.ts +0 -16
  283. package/src/cmds/pxe/get_accounts.ts +0 -35
  284. package/src/cmds/pxe/get_block.ts +0 -10
  285. package/src/cmds/pxe/get_contract_data.ts +0 -51
  286. package/src/cmds/pxe/get_current_base_fee.ts +0 -9
  287. package/src/cmds/pxe/get_l1_to_l2_message_witness.ts +0 -25
  288. package/src/cmds/pxe/get_pxe_info.ts +0 -13
  289. package/src/cmds/pxe/index.ts +0 -170
@@ -1,10 +1,11 @@
1
- import { sha256 } from '@aztec/foundation/crypto';
1
+ import { sha256 } from '@aztec/foundation/crypto/sha256';
2
2
  import type { LogFn, Logger } from '@aztec/foundation/log';
3
3
  import {
4
4
  type FunctionArtifact,
5
5
  FunctionSelector,
6
6
  decodeFunctionSignature,
7
7
  decodeFunctionSignatureWithParameterNames,
8
+ retainBytecode,
8
9
  } from '@aztec/stdlib/abi';
9
10
  import { getContractClassFromArtifact } from '@aztec/stdlib/contract';
10
11
 
@@ -12,7 +13,9 @@ import { getContractArtifact } from '../../utils/aztec.js';
12
13
 
13
14
  export async function inspectContract(contractArtifactFile: string, debugLogger: Logger, log: LogFn) {
14
15
  const contractArtifact = await getContractArtifact(contractArtifactFile, log);
15
- const contractFns = contractArtifact.functions;
16
+ const contractFns = contractArtifact.functions.concat(
17
+ contractArtifact.nonDispatchPublicFunctions.map(f => f as FunctionArtifact),
18
+ );
16
19
  if (contractFns.length === 0) {
17
20
  log(`No functions found for contract ${contractArtifact.name}`);
18
21
  }
@@ -26,16 +29,9 @@ export async function inspectContract(contractArtifactFile: string, debugLogger:
26
29
  log(`\tpublic bytecode commitment: ${contractClass.publicBytecodeCommitment.toString()}`);
27
30
  log(`\tpublic bytecode length: ${contractClass.packedBytecode.length} bytes (${bytecodeLengthInFields} fields)`);
28
31
 
29
- const externalFunctions = contractFns.filter(f => !f.isInternal);
30
- if (externalFunctions.length > 0) {
31
- log(`\nExternal functions:`);
32
- await Promise.all(externalFunctions.map(f => logFunction(f, log)));
33
- }
34
-
35
- const internalFunctions = contractFns.filter(f => f.isInternal);
36
- if (internalFunctions.length > 0) {
37
- log(`\nInternal functions:`);
38
- await Promise.all(internalFunctions.map(f => logFunction(f, log)));
32
+ if (contractFns.length > 0) {
33
+ log(`\nExternal contract functions:`);
34
+ await Promise.all(contractFns.map(f => logFunction(f, log)));
39
35
  }
40
36
  }
41
37
 
@@ -43,9 +39,16 @@ async function logFunction(fn: FunctionArtifact, log: LogFn) {
43
39
  const signatureWithParameterNames = decodeFunctionSignatureWithParameterNames(fn.name, fn.parameters);
44
40
  const signature = decodeFunctionSignature(fn.name, fn.parameters);
45
41
  const selector = await FunctionSelector.fromSignature(signature);
46
- const bytecodeSize = fn.bytecode.length;
47
- const bytecodeHash = sha256(fn.bytecode).toString('hex');
48
- log(
49
- `${fn.functionType} ${signatureWithParameterNames} \n\tfunction signature: ${signature}\n\tselector: ${selector}\n\tbytecode: ${bytecodeSize} bytes (sha256 ${bytecodeHash})`,
50
- );
42
+
43
+ if (retainBytecode(fn)) {
44
+ const bytecodeSize = fn.bytecode.length;
45
+ const bytecodeHash = sha256(fn.bytecode).toString('hex');
46
+ log(
47
+ `${fn.functionType} ${signatureWithParameterNames} \n\tfunction signature: ${signature}\n\tselector: ${selector}\n\tbytecode: ${bytecodeSize} bytes (sha256 ${bytecodeHash})`,
48
+ );
49
+ } else {
50
+ log(
51
+ `${fn.functionType} ${signatureWithParameterNames} \n\tfunction signature: ${signature}\n\tselector: ${selector}`,
52
+ );
53
+ }
51
54
  }
@@ -1,20 +1,19 @@
1
- import type { LogFn, Logger } from '@aztec/foundation/log';
1
+ import type { LogFn } from '@aztec/foundation/log';
2
2
 
3
3
  import type { Command } from 'commander';
4
4
 
5
- import { ETHEREUM_HOSTS, l1ChainIdOption, parseOptionalInteger, pxeOption } from '../../utils/commands.js';
5
+ import { ETHEREUM_HOSTS, l1ChainIdOption, nodeOption, parseOptionalInteger } from '../../utils/commands.js';
6
6
 
7
- export function injectCommands(program: Command, log: LogFn, debugLogger: Logger) {
7
+ export function injectCommands(program: Command, log: LogFn) {
8
8
  program
9
9
  .command('setup-protocol-contracts')
10
10
  .description('Bootstrap the blockchain by initializing all the protocol contracts')
11
- .addOption(pxeOption)
11
+ .addOption(nodeOption)
12
12
  .option('--testAccounts', 'Deploy funded test accounts.')
13
13
  .option('--json', 'Output the contract addresses in JSON format')
14
- .option('--skipProofWait', "Don't wait for proofs to land.")
15
14
  .action(async options => {
16
15
  const { setupL2Contracts } = await import('./setup_l2_contract.js');
17
- await setupL2Contracts(options.rpcUrl, options.testAccounts, options.json, options.skipProofWait, log);
16
+ await setupL2Contracts(options.nodeUrl, options.testAccounts, options.json, log);
18
17
  });
19
18
 
20
19
  program
@@ -34,7 +33,7 @@ export function injectCommands(program: Command, log: LogFn, debugLogger: Logger
34
33
  'test test test test test test test test test test test junk',
35
34
  )
36
35
  .option('--block-number <number>', 'Block number to query next sequencer for', parseOptionalInteger)
37
- .addOption(pxeOption)
36
+ .addOption(nodeOption)
38
37
  .addOption(l1ChainIdOption)
39
38
  .action(async (command, who, options) => {
40
39
  const { sequencers } = await import('./sequencers.js');
@@ -42,12 +41,10 @@ export function injectCommands(program: Command, log: LogFn, debugLogger: Logger
42
41
  command: command,
43
42
  who,
44
43
  mnemonic: options.mnemonic,
45
- rpcUrl: options.rpcUrl,
46
- l1RpcUrls: options.l1RpcUrls.split(','),
44
+ nodeUrl: options.nodeUrl,
45
+ l1RpcUrls: options.l1RpcUrls,
47
46
  chainId: options.l1ChainId,
48
- blockNumber: options.blockNumber,
49
47
  log,
50
- debugLogger,
51
48
  });
52
49
  });
53
50
 
@@ -1,45 +1,43 @@
1
- import { createCompatibleClient } from '@aztec/aztec.js';
2
- import { createEthereumChain, getL1ContractsConfigEnvVars } from '@aztec/ethereum';
3
- import type { LogFn, Logger } from '@aztec/foundation/log';
1
+ import { Fr } from '@aztec/aztec.js/fields';
2
+ import { createAztecNodeClient } from '@aztec/aztec.js/node';
3
+ import { createEthereumChain } from '@aztec/ethereum/chain';
4
+ import { getL1ContractsConfigEnvVars } from '@aztec/ethereum/config';
5
+ import { GSEContract, RollupContract } from '@aztec/ethereum/contracts';
6
+ import type { LogFn } from '@aztec/foundation/log';
4
7
  import { RollupAbi, TestERC20Abi } from '@aztec/l1-artifacts';
5
8
 
6
9
  import { createPublicClient, createWalletClient, fallback, getContract, http } from 'viem';
7
10
  import { mnemonicToAccount } from 'viem/accounts';
8
11
 
9
12
  export async function sequencers(opts: {
10
- command: 'list' | 'add' | 'remove' | 'who-next';
13
+ command: 'list' | 'add' | 'remove' | 'who-next' | 'flush';
11
14
  who?: string;
12
15
  mnemonic?: string;
13
- rpcUrl: string;
16
+ bn254SecretKey?: bigint;
17
+ nodeUrl: string;
14
18
  l1RpcUrls: string[];
15
19
  chainId: number;
16
- blockNumber?: number;
17
20
  log: LogFn;
18
- debugLogger: Logger;
19
21
  }) {
20
- const { command, who: maybeWho, mnemonic, rpcUrl, l1RpcUrls, chainId, log, debugLogger } = opts;
21
- const client = await createCompatibleClient(rpcUrl, debugLogger);
22
+ const { command, who: maybeWho, mnemonic, bn254SecretKey, nodeUrl, l1RpcUrls, chainId, log } = opts;
23
+ const client = createAztecNodeClient(nodeUrl);
22
24
  const { l1ContractAddresses } = await client.getNodeInfo();
23
25
 
24
26
  const chain = createEthereumChain(l1RpcUrls, chainId);
25
27
  const publicClient = createPublicClient({
26
28
  chain: chain.chainInfo,
27
- transport: fallback(l1RpcUrls.map(url => http(url))),
29
+ transport: fallback(l1RpcUrls.map(url => http(url, { batch: false }))),
28
30
  });
29
31
 
30
32
  const walletClient = mnemonic
31
33
  ? createWalletClient({
32
34
  account: mnemonicToAccount(mnemonic),
33
35
  chain: chain.chainInfo,
34
- transport: fallback(l1RpcUrls.map(url => http(url))),
36
+ transport: fallback(l1RpcUrls.map(url => http(url, { batch: false }))),
35
37
  })
36
38
  : undefined;
37
39
 
38
- const rollup = getContract({
39
- address: l1ContractAddresses.rollupAddress.toString(),
40
- abi: RollupAbi,
41
- client: publicClient,
42
- });
40
+ const rollup = new RollupContract(publicClient, l1ContractAddresses.rollupAddress);
43
41
 
44
42
  const writeableRollup = walletClient
45
43
  ? getContract({
@@ -52,7 +50,7 @@ export async function sequencers(opts: {
52
50
  const who = (maybeWho as `0x{string}`) ?? walletClient?.account.address.toString();
53
51
 
54
52
  if (command === 'list') {
55
- const sequencers = await rollup.read.getAttesters();
53
+ const sequencers = await rollup.getAttesters();
56
54
  if (sequencers.length === 0) {
57
55
  log(`No sequencers registered on rollup`);
58
56
  } else {
@@ -68,24 +66,45 @@ export async function sequencers(opts: {
68
66
 
69
67
  log(`Adding ${who} as sequencer`);
70
68
 
69
+ const stakingAssetAddress = await rollup.getStakingAsset();
71
70
  const stakingAsset = getContract({
72
- address: await rollup.read.getStakingAsset(),
71
+ address: stakingAssetAddress.toString(),
73
72
  abi: TestERC20Abi,
74
73
  client: walletClient,
75
74
  });
76
75
 
77
76
  const config = getL1ContractsConfigEnvVars();
78
77
 
78
+ const bn254SecretKeyFieldElement = bn254SecretKey ? new Fr(bn254SecretKey) : Fr.random();
79
+ const gseAddress = await rollup.getGSE();
80
+ const gseContract = new GSEContract(publicClient, gseAddress);
81
+ const registrationTuple = await gseContract.makeRegistrationTuple(bn254SecretKeyFieldElement.toBigInt());
82
+
79
83
  await Promise.all(
80
84
  [
81
- await stakingAsset.write.mint([walletClient.account.address, config.minimumStake], {} as any),
82
- await stakingAsset.write.approve([rollup.address, config.minimumStake], {} as any),
85
+ await stakingAsset.write.mint([walletClient.account.address, config.activationThreshold], {} as any),
86
+ await stakingAsset.write.approve([rollup.address, config.activationThreshold], {} as any),
83
87
  ].map(txHash => publicClient.waitForTransactionReceipt({ hash: txHash })),
84
88
  );
85
89
 
86
- const hash = await writeableRollup.write.deposit([who, who, who, config.minimumStake]);
90
+ const hash = await writeableRollup.write.deposit([
91
+ who,
92
+ who,
93
+ registrationTuple.publicKeyInG1,
94
+ registrationTuple.publicKeyInG2,
95
+ registrationTuple.proofOfPossession,
96
+ true,
97
+ ]);
87
98
  await publicClient.waitForTransactionReceipt({ hash });
88
99
  log(`Added in tx ${hash}`);
100
+ } else if (command === 'flush') {
101
+ if (!writeableRollup) {
102
+ throw new Error(`Missing sequencer address`);
103
+ }
104
+ log(`Flushing staking entry queue`);
105
+ const hash = await writeableRollup.write.flushEntryQueue();
106
+ await publicClient.waitForTransactionReceipt({ hash });
107
+ log(`Flushed staking entry queue in tx ${hash}`);
89
108
  } else if (command === 'remove') {
90
109
  if (!who || !writeableRollup) {
91
110
  throw new Error(`Missing sequencer address`);
@@ -95,7 +114,7 @@ export async function sequencers(opts: {
95
114
  await publicClient.waitForTransactionReceipt({ hash });
96
115
  log(`Removed in tx ${hash}`);
97
116
  } else if (command === 'who-next') {
98
- const next = await rollup.read.getCurrentProposer();
117
+ const next = await rollup.getCurrentProposer();
99
118
  log(`Sequencer expected to build is ${next}`);
100
119
  } else {
101
120
  throw new Error(`Unknown command ${command}`);
@@ -1,45 +1,34 @@
1
- import { type InitialAccountData, deployFundedSchnorrAccounts, getInitialTestAccounts } from '@aztec/accounts/testing';
2
- import { type AztecAddress, SignerlessWallet, type WaitOpts, createPXEClient, makeFetch } from '@aztec/aztec.js';
1
+ import { getInitialTestAccountsData } from '@aztec/accounts/testing';
2
+ import { AztecAddress } from '@aztec/aztec.js/addresses';
3
+ import type { WaitOpts } from '@aztec/aztec.js/contracts';
4
+ import { createAztecNodeClient } from '@aztec/aztec.js/node';
5
+ import { AccountManager } from '@aztec/aztec.js/wallet';
3
6
  import { jsonStringify } from '@aztec/foundation/json-rpc';
4
7
  import type { LogFn } from '@aztec/foundation/log';
5
8
  import { ProtocolContractAddress } from '@aztec/protocol-contracts';
9
+ import { EmbeddedWallet } from '@aztec/wallets/embedded';
10
+ import { deployFundedSchnorrAccounts } from '@aztec/wallets/testing';
6
11
 
7
- import { setupCanonicalL2FeeJuice } from '../misc/setup_contracts.js';
8
-
9
- export async function setupL2Contracts(
10
- rpcUrl: string,
11
- testAccounts: boolean,
12
- json: boolean,
13
- skipProofWait: boolean,
14
- log: LogFn,
15
- ) {
12
+ export async function setupL2Contracts(nodeUrl: string, testAccounts: boolean, json: boolean, log: LogFn) {
16
13
  const waitOpts: WaitOpts = {
17
14
  timeout: 180,
18
15
  interval: 1,
19
- proven: !skipProofWait,
20
- provenTimeout: 600,
21
16
  };
22
17
  log('setupL2Contracts: Wait options' + jsonStringify(waitOpts));
23
18
  log('setupL2Contracts: Creating PXE client...');
24
- const pxe = createPXEClient(rpcUrl, {}, makeFetch([1, 1, 1, 1, 1], false));
25
- const wallet = new SignerlessWallet(pxe);
26
-
27
- log('setupL2Contracts: Getting fee juice portal address...');
28
- // Deploy Fee Juice
29
- const feeJuicePortalAddress = (await wallet.getNodeInfo()).l1ContractAddresses.feeJuicePortalAddress;
30
- log('setupL2Contracts: Setting up fee juice portal...');
31
- await setupCanonicalL2FeeJuice(wallet, feeJuicePortalAddress, waitOpts, log);
19
+ const node = createAztecNodeClient(nodeUrl);
20
+ const wallet = await EmbeddedWallet.create(node);
32
21
 
33
- let deployedAccounts: InitialAccountData[] = [];
22
+ let deployedAccountManagers: AccountManager[] = [];
34
23
  if (testAccounts) {
35
24
  log('setupL2Contracts: Deploying test accounts...');
36
- deployedAccounts = await getInitialTestAccounts();
37
- await deployFundedSchnorrAccounts(pxe, deployedAccounts, waitOpts);
25
+ const initialAccountsData = await getInitialTestAccountsData();
26
+ deployedAccountManagers = await deployFundedSchnorrAccounts(wallet, initialAccountsData, waitOpts);
38
27
  }
39
28
 
40
29
  if (json) {
41
30
  const toPrint: Record<string, AztecAddress> = { ...ProtocolContractAddress };
42
- deployedAccounts.forEach((a, i) => {
31
+ deployedAccountManagers.forEach((a, i) => {
43
32
  toPrint[`testAccount${i}`] = a.address;
44
33
  });
45
34
  log(JSON.stringify(toPrint, null, 2));
@@ -1,11 +1,13 @@
1
- import { CheatCodes, createPXEClient, makeFetch } from '@aztec/aztec.js';
1
+ import { createAztecNodeClient } from '@aztec/aztec.js/node';
2
+ import { RollupCheatCodes } from '@aztec/ethereum/test';
2
3
  import type { LogFn } from '@aztec/foundation/log';
4
+ import { DateProvider } from '@aztec/foundation/timer';
3
5
 
4
- export async function advanceEpoch(l1RpcUrls: string[], rpcUrl: string, log: LogFn) {
5
- const pxe = createPXEClient(rpcUrl, {}, makeFetch([], true));
6
- const rollupAddress = await pxe.getNodeInfo().then(i => i.l1ContractAddresses.rollupAddress);
6
+ export async function advanceEpoch(l1RpcUrls: string[], nodeUrl: string, log: LogFn) {
7
+ const aztecNode = createAztecNodeClient(nodeUrl);
8
+ const rollupAddress = await aztecNode.getNodeInfo().then(i => i.l1ContractAddresses.rollupAddress);
7
9
 
8
- const cheat = CheatCodes.createRollup(l1RpcUrls, { rollupAddress });
10
+ const cheat = RollupCheatCodes.create(l1RpcUrls, { rollupAddress }, new DateProvider());
9
11
 
10
12
  await cheat.advanceToNextEpoch();
11
13
  log(`Warped time to advance to next epoch`);
@@ -1,19 +1,20 @@
1
- import { EthCheatCodes, RollupCheatCodes, createPXEClient, makeFetch } from '@aztec/aztec.js';
1
+ import { createAztecNodeClient } from '@aztec/aztec.js/node';
2
+ import { RollupCheatCodes } from '@aztec/ethereum/test';
3
+ import { CheckpointNumber } from '@aztec/foundation/branded-types';
2
4
  import type { LogFn } from '@aztec/foundation/log';
5
+ import { DateProvider } from '@aztec/foundation/timer';
3
6
 
4
7
  export async function assumeProvenThrough(
5
- blockNumberOrLatest: number | undefined,
8
+ checkpointOrLatest: CheckpointNumber | undefined,
6
9
  l1RpcUrls: string[],
7
- rpcUrl: string,
10
+ nodeUrl: string,
8
11
  log: LogFn,
9
12
  ) {
10
- const pxe = createPXEClient(rpcUrl, {}, makeFetch([], true));
11
- const rollupAddress = await pxe.getNodeInfo().then(i => i.l1ContractAddresses.rollupAddress);
12
- const blockNumber = blockNumberOrLatest ?? (await pxe.getBlockNumber());
13
+ const aztecNode = createAztecNodeClient(nodeUrl);
14
+ const rollupAddress = await aztecNode.getNodeInfo().then(i => i.l1ContractAddresses.rollupAddress);
13
15
 
14
- const ethCheatCode = new EthCheatCodes(l1RpcUrls);
15
- const rollupCheatCodes = new RollupCheatCodes(ethCheatCode, { rollupAddress });
16
+ const rollupCheatCodes = RollupCheatCodes.create(l1RpcUrls, { rollupAddress }, new DateProvider());
16
17
 
17
- await rollupCheatCodes.markAsProven(blockNumber);
18
- log(`Assumed proven through block ${blockNumber}`);
18
+ await rollupCheatCodes.markAsProven(checkpointOrLatest);
19
+ log(`Assumed proven through checkpoint ${checkpointOrLatest ?? 'latest'}`);
19
20
  }
@@ -1,5 +1,8 @@
1
- import { type AztecAddress, type EthAddress, type Fr, L1ToL2TokenPortalManager } from '@aztec/aztec.js';
2
- import { createEthereumChain, createL1Clients } from '@aztec/ethereum';
1
+ import type { AztecAddress, EthAddress } from '@aztec/aztec.js/addresses';
2
+ import { L1ToL2TokenPortalManager } from '@aztec/aztec.js/ethereum';
3
+ import type { Fr } from '@aztec/aztec.js/fields';
4
+ import { createEthereumChain } from '@aztec/ethereum/chain';
5
+ import { createExtendedL1Client } from '@aztec/ethereum/client';
3
6
  import type { LogFn, Logger } from '@aztec/foundation/log';
4
7
 
5
8
  import { prettyPrintJSON } from '../../utils/commands.js';
@@ -12,6 +15,7 @@ export async function bridgeERC20(
12
15
  privateKey: string | undefined,
13
16
  mnemonic: string,
14
17
  tokenAddress: EthAddress,
18
+ handlerAddress: EthAddress | undefined,
15
19
  portalAddress: EthAddress,
16
20
  privateTransfer: boolean,
17
21
  mint: boolean,
@@ -21,10 +25,10 @@ export async function bridgeERC20(
21
25
  ) {
22
26
  // Prepare L1 client
23
27
  const chain = createEthereumChain(l1RpcUrls, chainId);
24
- const { publicClient, walletClient } = createL1Clients(chain.rpcUrls, privateKey ?? mnemonic, chain.chainInfo);
28
+ const l1Client = createExtendedL1Client(chain.rpcUrls, privateKey ?? mnemonic, chain.chainInfo);
25
29
 
26
30
  // Setup portal manager
27
- const manager = new L1ToL2TokenPortalManager(portalAddress, tokenAddress, publicClient, walletClient, debugLogger);
31
+ const manager = new L1ToL2TokenPortalManager(portalAddress, tokenAddress, handlerAddress, l1Client, debugLogger);
28
32
  let claimSecret: Fr;
29
33
  let messageHash: `0x${string}`;
30
34
  if (privateTransfer) {
@@ -0,0 +1,29 @@
1
+ import { getInitialTestAccountsData } from '@aztec/accounts/testing';
2
+ import type { LogFn } from '@aztec/foundation/log';
3
+ import { protocolContractsHash } from '@aztec/protocol-contracts';
4
+ import { getGenesisValues } from '@aztec/world-state/testing';
5
+
6
+ import { getSponsoredFPCAddress } from '../../utils/setup_contracts.js';
7
+
8
+ /** Computes and prints genesis values needed for L1 contract deployment. */
9
+ export async function computeGenesisValuesCmd(testAccounts: boolean, sponsoredFPC: boolean, log: LogFn) {
10
+ const initialAccounts = testAccounts ? await getInitialTestAccountsData() : [];
11
+ const sponsoredFPCAddresses = sponsoredFPC ? await getSponsoredFPCAddress() : [];
12
+ const initialFundedAccounts = initialAccounts.map(a => a.address).concat(sponsoredFPCAddresses);
13
+ const { genesisArchiveRoot } = await getGenesisValues(initialFundedAccounts);
14
+
15
+ const { getVKTreeRoot } = await import('@aztec/noir-protocol-circuits-types/vk-tree');
16
+ const vkTreeRoot = getVKTreeRoot();
17
+
18
+ log(
19
+ JSON.stringify(
20
+ {
21
+ vkTreeRoot: vkTreeRoot.toString(),
22
+ protocolContractsHash: protocolContractsHash.toString(),
23
+ genesisArchiveRoot: genesisArchiveRoot.toString(),
24
+ },
25
+ null,
26
+ 2,
27
+ ),
28
+ );
29
+ }
@@ -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;