@aztec/cli 0.0.0-test.0 → 0.0.1-commit.03f7ef2

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_base_fee.d.ts +3 -0
  9. package/dest/cmds/aztec_node/get_current_base_fee.d.ts.map +1 -0
  10. package/dest/cmds/aztec_node/get_current_base_fee.js +7 -0
  11. package/dest/cmds/aztec_node/get_l1_to_l2_message_witness.d.ts +5 -0
  12. package/dest/cmds/aztec_node/get_l1_to_l2_message_witness.d.ts.map +1 -0
  13. package/dest/cmds/aztec_node/get_l1_to_l2_message_witness.js +12 -0
  14. package/dest/cmds/aztec_node/get_logs.d.ts +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 +37 -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 +517 -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_base_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 +40 -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 +681 -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,681 @@
1
+ import { DefaultL1ContractsConfig, type L1ContractsConfig } from '@aztec/ethereum/config';
2
+ import type { L1TxUtilsConfig } from '@aztec/ethereum/l1-tx-utils/config';
3
+ import type { NetworkNames } from '@aztec/foundation/config';
4
+ import { EthAddress } from '@aztec/foundation/eth-address';
5
+ import type { SharedNodeConfig } from '@aztec/node-lib/config';
6
+ import type { P2PConfig } from '@aztec/p2p/config';
7
+ import type { SequencerConfig, SlasherConfig } from '@aztec/stdlib/interfaces/server';
8
+
9
+ import path from 'path';
10
+
11
+ import publicIncludeMetrics from '../../public_include_metric_prefixes.json' with { type: 'json' };
12
+ import { enrichEthAddressVar, enrichVar } from './enrich_env.js';
13
+
14
+ const SNAPSHOTS_URL = 'https://aztec-labs-snapshots.com';
15
+
16
+ const defaultDBMapSizeKb = 128 * 1_024 * 1_024; // 128 GB
17
+ const tbMapSizeKb = 1_024 * 1_024 * 1_024; // 1 TB
18
+
19
+ export type L2ChainConfig = Omit<L1ContractsConfig, keyof L1TxUtilsConfig> &
20
+ Omit<SlasherConfig, 'slashValidatorsNever' | 'slashValidatorsAlways' | 'slashOverridePayload' | 'slashSelfAllowed'> &
21
+ Pick<P2PConfig, 'bootstrapNodes' | 'p2pEnabled' | 'txPoolDeleteTxsAfterReorg'> &
22
+ Pick<SequencerConfig, 'buildCheckpointIfEmpty' | 'minTxsPerBlock' | 'maxTxsPerBlock' | 'blockDurationMs'> & {
23
+ l1ChainId: number;
24
+ testAccounts: boolean;
25
+ sponsoredFPC: boolean;
26
+ minTxsPerBlock: number;
27
+ maxTxsPerBlock: number;
28
+ realProofs: boolean;
29
+ snapshotsUrls: string[];
30
+ autoUpdate: SharedNodeConfig['autoUpdate'];
31
+ autoUpdateUrl?: string;
32
+ maxTxPoolSize: number;
33
+ publicMetricsOptOut: boolean;
34
+ publicIncludeMetrics?: string[];
35
+ publicMetricsCollectorUrl?: string;
36
+ publicMetricsCollectFrom?: string[];
37
+ skipArchiverInitialSync?: boolean;
38
+ blobAllowEmptySources?: boolean;
39
+
40
+ // Setting the dataStoreMapSize provides the default for every DB in the node.
41
+ // Then we explicitly override the sizes for the archiver and the larger trees.
42
+ dataStoreMapSizeKb: number;
43
+ archiverStoreMapSizeKb: number;
44
+ noteHashTreeMapSizeKb: number;
45
+ nullifierTreeMapSizeKb: number;
46
+ publicDataTreeMapSizeKb: number;
47
+
48
+ // Control whether sentinel is enabled or not. Needed for slashing
49
+ sentinelEnabled: boolean;
50
+ disableTransactions: boolean;
51
+ };
52
+
53
+ const DefaultSlashConfig = {
54
+ /** Tally-style slashing */
55
+ slasherFlavor: 'tally',
56
+ /** Allow one round for vetoing */
57
+ slashingExecutionDelayInRounds: 1,
58
+ /** How long for a slash payload to be executed */
59
+ slashingLifetimeInRounds: 5,
60
+ /** Allow 2 rounds to discover faults */
61
+ slashingOffsetInRounds: 2,
62
+ /** No slash vetoer */
63
+ slashingVetoer: EthAddress.ZERO,
64
+ /** Use default disable duration */
65
+ slashingDisableDuration: DefaultL1ContractsConfig.slashingDisableDuration,
66
+ /** Use default slash amounts */
67
+ slashAmountSmall: DefaultL1ContractsConfig.slashAmountSmall,
68
+ slashAmountMedium: DefaultL1ContractsConfig.slashAmountMedium,
69
+ slashAmountLarge: DefaultL1ContractsConfig.slashAmountLarge,
70
+
71
+ // Slashing stuff
72
+ slashMinPenaltyPercentage: 0.5,
73
+ slashMaxPenaltyPercentage: 2.0,
74
+ slashInactivityTargetPercentage: 0.7,
75
+ slashInactivityConsecutiveEpochThreshold: 1,
76
+ slashInactivityPenalty: DefaultL1ContractsConfig.slashAmountSmall,
77
+ slashPrunePenalty: DefaultL1ContractsConfig.slashAmountSmall,
78
+ slashDataWithholdingPenalty: DefaultL1ContractsConfig.slashAmountSmall,
79
+ slashProposeInvalidAttestationsPenalty: DefaultL1ContractsConfig.slashAmountLarge,
80
+ slashAttestDescendantOfInvalidPenalty: DefaultL1ContractsConfig.slashAmountLarge,
81
+ slashUnknownPenalty: DefaultL1ContractsConfig.slashAmountSmall,
82
+ slashBroadcastedInvalidBlockPenalty: 0n, // DefaultL1ContractsConfig.slashAmountSmall // Disabled until further testing
83
+ slashMaxPayloadSize: 50,
84
+ slashGracePeriodL2Slots: 32 * 2, // Two epochs from genesis
85
+ slashOffenseExpirationRounds: 8,
86
+ sentinelEnabled: true,
87
+ slashExecuteRoundsLookBack: 4,
88
+ } satisfies Partial<L2ChainConfig>;
89
+
90
+ const DefaultNetworkDBMapSizeConfig = {
91
+ dataStoreMapSizeKb: defaultDBMapSizeKb,
92
+ archiverStoreMapSizeKb: tbMapSizeKb,
93
+ noteHashTreeMapSizeKb: tbMapSizeKb,
94
+ nullifierTreeMapSizeKb: tbMapSizeKb,
95
+ publicDataTreeMapSizeKb: tbMapSizeKb,
96
+ } satisfies Partial<L2ChainConfig>;
97
+
98
+ export const stagingIgnitionL2ChainConfig: L2ChainConfig = {
99
+ l1ChainId: 11155111,
100
+ testAccounts: false,
101
+ sponsoredFPC: false,
102
+ disableTransactions: true,
103
+ p2pEnabled: true,
104
+ bootstrapNodes: [],
105
+ minTxsPerBlock: 0,
106
+ maxTxsPerBlock: 0,
107
+ buildCheckpointIfEmpty: true,
108
+ realProofs: true,
109
+ snapshotsUrls: [`${SNAPSHOTS_URL}/staging-ignition/`],
110
+ autoUpdate: 'config-and-version',
111
+ autoUpdateUrl: 'https://storage.googleapis.com/aztec-testnet/auto-update/staging-ignition.json',
112
+ maxTxPoolSize: 0,
113
+ publicMetricsOptOut: false,
114
+ publicIncludeMetrics,
115
+ publicMetricsCollectorUrl: 'https://telemetry.alpha-testnet.aztec-labs.com/v1/metrics',
116
+ publicMetricsCollectFrom: ['sequencer'],
117
+ txPoolDeleteTxsAfterReorg: false,
118
+ blobAllowEmptySources: true,
119
+
120
+ /** How many seconds an L1 slot lasts. */
121
+ ethereumSlotDuration: 12,
122
+ /** How many seconds an L2 slots lasts (must be multiple of ethereum slot duration). */
123
+ aztecSlotDuration: 72,
124
+ /** How many L2 slots an epoch lasts. */
125
+ aztecEpochDuration: 32,
126
+ /** The target validator committee size. */
127
+ aztecTargetCommitteeSize: 24,
128
+ /** The number of epochs to lag behind the current epoch for validator selection. */
129
+ lagInEpochsForValidatorSet: 2,
130
+ /** The number of epochs to lag behind the current epoch for randao selection. */
131
+ lagInEpochsForRandao: 2,
132
+ /** The number of epochs after an epoch ends that proofs are still accepted. */
133
+ aztecProofSubmissionEpochs: 1,
134
+ /** How many sequencers must agree with a slash for it to be executed. */
135
+ slashingQuorum: 65,
136
+
137
+ slashingRoundSizeInEpochs: 4,
138
+ slashingLifetimeInRounds: 40,
139
+ slashingExecutionDelayInRounds: 28,
140
+ slashAmountSmall: 2_000n * 10n ** 18n,
141
+ slashAmountMedium: 10_000n * 10n ** 18n,
142
+ slashAmountLarge: 50_000n * 10n ** 18n,
143
+ slashingOffsetInRounds: 2,
144
+ slasherFlavor: 'tally',
145
+ slashingVetoer: EthAddress.ZERO,
146
+
147
+ /** The mana target for the rollup */
148
+ manaTarget: 0n,
149
+
150
+ exitDelaySeconds: 5 * 24 * 60 * 60,
151
+
152
+ /** The proving cost per mana */
153
+ provingCostPerMana: 0n,
154
+ localEjectionThreshold: 196_000n * 10n ** 18n,
155
+
156
+ ejectionThreshold: 100_000n * 10n ** 18n,
157
+ activationThreshold: 200_000n * 10n ** 18n,
158
+
159
+ governanceProposerRoundSize: 300,
160
+ governanceProposerQuorum: 151,
161
+
162
+ // Node slashing config
163
+ slashMinPenaltyPercentage: 0.5,
164
+ slashMaxPenaltyPercentage: 2.0,
165
+ slashInactivityTargetPercentage: 0.7,
166
+ slashInactivityConsecutiveEpochThreshold: 2,
167
+ slashInactivityPenalty: 2_000n * 10n ** 18n,
168
+ slashPrunePenalty: 0n, // 2_000n * 10n ** 18n, We disable slashing for prune offenses right now
169
+ slashDataWithholdingPenalty: 0n, // 2_000n * 10n ** 18n, We disable slashing for data withholding offenses right now
170
+ slashProposeInvalidAttestationsPenalty: 50_000n * 10n ** 18n,
171
+ slashAttestDescendantOfInvalidPenalty: 50_000n * 10n ** 18n,
172
+ slashUnknownPenalty: 2_000n * 10n ** 18n,
173
+ slashBroadcastedInvalidBlockPenalty: 0n, // 10_000n * 10n ** 18n, Disabled for now until further testing
174
+ slashMaxPayloadSize: 50,
175
+ slashGracePeriodL2Slots: 32 * 4, // One round from genesis
176
+ slashOffenseExpirationRounds: 8,
177
+ sentinelEnabled: true,
178
+ slashingDisableDuration: 5 * 24 * 60 * 60,
179
+ slashExecuteRoundsLookBack: 4,
180
+
181
+ ...DefaultNetworkDBMapSizeConfig,
182
+ };
183
+
184
+ export const stagingPublicL2ChainConfig: L2ChainConfig = {
185
+ l1ChainId: 11155111,
186
+ testAccounts: false,
187
+ sponsoredFPC: true,
188
+ disableTransactions: false,
189
+ p2pEnabled: true,
190
+ bootstrapNodes: [],
191
+ minTxsPerBlock: 0,
192
+ maxTxsPerBlock: 20,
193
+ buildCheckpointIfEmpty: true,
194
+ realProofs: true,
195
+ snapshotsUrls: [`${SNAPSHOTS_URL}/staging-public/`],
196
+ autoUpdate: 'config-and-version',
197
+ autoUpdateUrl: 'https://storage.googleapis.com/aztec-testnet/auto-update/staging-public.json',
198
+ publicMetricsOptOut: false,
199
+ publicIncludeMetrics,
200
+ publicMetricsCollectorUrl: 'https://telemetry.alpha-testnet.aztec-labs.com/v1/metrics',
201
+ publicMetricsCollectFrom: ['sequencer'],
202
+ maxTxPoolSize: 100_000_000, // 100MB
203
+ txPoolDeleteTxsAfterReorg: true,
204
+
205
+ // Deployment stuff
206
+ /** How many seconds an L1 slot lasts. */
207
+ ethereumSlotDuration: 12,
208
+ /** How many seconds an L2 slots lasts (must be multiple of ethereum slot duration). */
209
+ aztecSlotDuration: 36,
210
+ /** How many L2 slots an epoch lasts. */
211
+ aztecEpochDuration: 32,
212
+ /** The target validator committee size. */
213
+ aztecTargetCommitteeSize: 48,
214
+ /** The number of epochs to lag behind the current epoch for validator selection. */
215
+ lagInEpochsForValidatorSet: DefaultL1ContractsConfig.lagInEpochsForValidatorSet,
216
+ /** The number of epochs to lag behind the current epoch for randao selection. */
217
+ lagInEpochsForRandao: DefaultL1ContractsConfig.lagInEpochsForRandao,
218
+ /** The local ejection threshold for a validator. Stricter than ejectionThreshold but local to a specific rollup */
219
+ localEjectionThreshold: DefaultL1ContractsConfig.localEjectionThreshold,
220
+ /** The number of epochs after an epoch ends that proofs are still accepted. */
221
+ aztecProofSubmissionEpochs: 1,
222
+ /** The deposit amount for a validator */
223
+ activationThreshold: DefaultL1ContractsConfig.activationThreshold,
224
+ /** The minimum stake for a validator. */
225
+ ejectionThreshold: DefaultL1ContractsConfig.ejectionThreshold,
226
+ /** The slashing round size */
227
+ slashingRoundSizeInEpochs: DefaultL1ContractsConfig.slashingRoundSizeInEpochs,
228
+ /** Governance proposing round size */
229
+ governanceProposerRoundSize: DefaultL1ContractsConfig.governanceProposerRoundSize,
230
+ /** The mana target for the rollup */
231
+ manaTarget: DefaultL1ContractsConfig.manaTarget,
232
+ /** The proving cost per mana */
233
+ provingCostPerMana: DefaultL1ContractsConfig.provingCostPerMana,
234
+ /** Exit delay for stakers */
235
+ exitDelaySeconds: DefaultL1ContractsConfig.exitDelaySeconds,
236
+
237
+ ...DefaultSlashConfig,
238
+
239
+ ...DefaultNetworkDBMapSizeConfig,
240
+ };
241
+
242
+ export const nextNetL2ChainConfig: L2ChainConfig = {
243
+ l1ChainId: 11155111,
244
+ testAccounts: true,
245
+ sponsoredFPC: true,
246
+ p2pEnabled: true,
247
+ disableTransactions: false,
248
+ bootstrapNodes: [],
249
+ minTxsPerBlock: 0,
250
+ maxTxsPerBlock: 8,
251
+ buildCheckpointIfEmpty: true,
252
+ realProofs: true,
253
+ snapshotsUrls: [],
254
+ autoUpdate: 'config-and-version',
255
+ autoUpdateUrl: '',
256
+ publicMetricsOptOut: true,
257
+ publicIncludeMetrics,
258
+ publicMetricsCollectorUrl: '',
259
+ publicMetricsCollectFrom: [''],
260
+ maxTxPoolSize: 100_000_000, // 100MB
261
+ txPoolDeleteTxsAfterReorg: false,
262
+
263
+ // Deployment stuff
264
+ /** How many seconds an L1 slot lasts. */
265
+ ethereumSlotDuration: 12,
266
+ /** How many seconds an L2 slots lasts (must be multiple of ethereum slot duration). */
267
+ aztecSlotDuration: 36,
268
+ /** How many L2 slots an epoch lasts. */
269
+ aztecEpochDuration: 32,
270
+ /** The target validator committee size. */
271
+ aztecTargetCommitteeSize: 48,
272
+ /** The number of epochs to lag behind the current epoch for validator selection. */
273
+ lagInEpochsForValidatorSet: DefaultL1ContractsConfig.lagInEpochsForValidatorSet,
274
+ /** The number of epochs to lag behind the current epoch for randao selection. */
275
+ lagInEpochsForRandao: DefaultL1ContractsConfig.lagInEpochsForRandao,
276
+ /** The local ejection threshold for a validator. Stricter than ejectionThreshold but local to a specific rollup */
277
+ localEjectionThreshold: DefaultL1ContractsConfig.localEjectionThreshold,
278
+ /** The number of epochs after an epoch ends that proofs are still accepted. */
279
+ aztecProofSubmissionEpochs: 1,
280
+ /** The deposit amount for a validator */
281
+ activationThreshold: DefaultL1ContractsConfig.activationThreshold,
282
+ /** The minimum stake for a validator. */
283
+ ejectionThreshold: DefaultL1ContractsConfig.ejectionThreshold,
284
+ /** The slashing round size */
285
+ slashingRoundSizeInEpochs: DefaultL1ContractsConfig.slashingRoundSizeInEpochs,
286
+ /** Governance proposing round size */
287
+ governanceProposerRoundSize: DefaultL1ContractsConfig.governanceProposerRoundSize,
288
+ /** The mana target for the rollup */
289
+ manaTarget: DefaultL1ContractsConfig.manaTarget,
290
+ /** The proving cost per mana */
291
+ provingCostPerMana: DefaultL1ContractsConfig.provingCostPerMana,
292
+ /** Exit delay for stakers */
293
+ exitDelaySeconds: DefaultL1ContractsConfig.exitDelaySeconds,
294
+
295
+ ...DefaultSlashConfig,
296
+
297
+ ...DefaultNetworkDBMapSizeConfig,
298
+ };
299
+
300
+ export const testnetL2ChainConfig: L2ChainConfig = {
301
+ l1ChainId: 11155111,
302
+ testAccounts: false,
303
+ sponsoredFPC: true,
304
+ p2pEnabled: true,
305
+ disableTransactions: true,
306
+ bootstrapNodes: [],
307
+ minTxsPerBlock: 0,
308
+ maxTxsPerBlock: 20,
309
+ buildCheckpointIfEmpty: true,
310
+ realProofs: true,
311
+ snapshotsUrls: [`${SNAPSHOTS_URL}/testnet/`],
312
+ autoUpdate: 'config-and-version',
313
+ autoUpdateUrl: 'https://storage.googleapis.com/aztec-testnet/auto-update/testnet.json',
314
+ maxTxPoolSize: 100_000_000, // 100MB
315
+ publicMetricsOptOut: false,
316
+ publicIncludeMetrics,
317
+ publicMetricsCollectorUrl: 'https://telemetry.alpha-testnet.aztec-labs.com/v1/metrics',
318
+ publicMetricsCollectFrom: ['sequencer'],
319
+ txPoolDeleteTxsAfterReorg: true,
320
+ skipArchiverInitialSync: true,
321
+ blobAllowEmptySources: true,
322
+
323
+ /** How many seconds an L1 slot lasts. */
324
+ ethereumSlotDuration: 12,
325
+ /** How many seconds an L2 slots lasts (must be multiple of ethereum slot duration). */
326
+ aztecSlotDuration: 72,
327
+ /** How many L2 slots an epoch lasts. */
328
+ aztecEpochDuration: 32,
329
+ /** The target validator committee size. */
330
+ aztecTargetCommitteeSize: 48,
331
+ /** The number of epochs to lag behind the current epoch for validator selection. */
332
+ lagInEpochsForValidatorSet: 2,
333
+ /** The number of epochs to lag behind the current epoch for randao selection. */
334
+ lagInEpochsForRandao: 2,
335
+ /** The number of epochs after an epoch ends that proofs are still accepted. */
336
+ aztecProofSubmissionEpochs: 1,
337
+
338
+ // This is a diff from mainnet: we have 1-strike you're out, rather than 3 on mainnet.
339
+ localEjectionThreshold: 199_000n * 10n ** 18n,
340
+ /** How many sequencers must agree with a slash for it to be executed. */
341
+ slashingQuorum: 33,
342
+ slashingRoundSizeInEpochs: 2,
343
+ slashingExecutionDelayInRounds: 2,
344
+ slashingLifetimeInRounds: 5,
345
+ slashingVetoer: EthAddress.fromString('0xdfe19Da6a717b7088621d8bBB66be59F2d78e924'),
346
+ slashingOffsetInRounds: 2,
347
+
348
+ slashingDisableDuration: 5 * 24 * 60 * 60, // 5 days
349
+ slasherFlavor: 'tally',
350
+
351
+ slashAmountSmall: 10_000n * 10n ** 18n,
352
+ slashAmountMedium: 50_000n * 10n ** 18n,
353
+ slashAmountLarge: 200_000n * 10n ** 18n,
354
+
355
+ /** The mana target for the rollup */
356
+ manaTarget: 150_000_000n,
357
+
358
+ /** The proving cost per mana */
359
+ provingCostPerMana: 100n,
360
+
361
+ exitDelaySeconds: 4 * 24 * 60 * 60, // 4 days
362
+
363
+ activationThreshold: 200_000n * 10n ** 18n,
364
+ ejectionThreshold: 100_000n * 10n ** 18n,
365
+
366
+ governanceProposerRoundSize: 100,
367
+ governanceProposerQuorum: 60,
368
+
369
+ // Node slashing config
370
+ slashInactivityTargetPercentage: 0.8,
371
+ slashInactivityConsecutiveEpochThreshold: 2,
372
+ slashInactivityPenalty: 10_000n * 10n ** 18n,
373
+ slashPrunePenalty: 0n, // 2_000n * 10n ** 18n, We disable slashing for prune offenses right now
374
+ slashDataWithholdingPenalty: 0n, // 2_000n * 10n ** 18n, We disable slashing for data withholding offenses right now
375
+ slashProposeInvalidAttestationsPenalty: 10_000n * 10n ** 18n,
376
+ slashAttestDescendantOfInvalidPenalty: 10_000n * 10n ** 18n,
377
+ slashUnknownPenalty: 10_000n * 10n ** 18n,
378
+ slashBroadcastedInvalidBlockPenalty: 10_000n * 10n ** 18n, // 10_000n * 10n ** 18n, Disabled for now until further testing
379
+ slashGracePeriodL2Slots: 1_200, // One day from deployment
380
+ slashOffenseExpirationRounds: 8,
381
+
382
+ slashMinPenaltyPercentage: 0.5,
383
+ slashMaxPenaltyPercentage: 2.0,
384
+ slashMaxPayloadSize: 50,
385
+ slashExecuteRoundsLookBack: 4,
386
+
387
+ sentinelEnabled: true,
388
+
389
+ ...DefaultNetworkDBMapSizeConfig,
390
+ };
391
+
392
+ export const mainnetL2ChainConfig: L2ChainConfig = {
393
+ txPoolDeleteTxsAfterReorg: true,
394
+ disableTransactions: true,
395
+
396
+ l1ChainId: 1,
397
+ testAccounts: false,
398
+ sponsoredFPC: false,
399
+ p2pEnabled: true,
400
+ bootstrapNodes: [],
401
+ minTxsPerBlock: 0,
402
+ maxTxsPerBlock: 0,
403
+ buildCheckpointIfEmpty: true,
404
+ realProofs: true,
405
+ snapshotsUrls: [`${SNAPSHOTS_URL}/mainnet/`],
406
+ autoUpdate: 'notify',
407
+ autoUpdateUrl: 'https://storage.googleapis.com/aztec-mainnet/auto-update/mainnet.json',
408
+ maxTxPoolSize: 0,
409
+ publicMetricsOptOut: true,
410
+ publicIncludeMetrics,
411
+ publicMetricsCollectorUrl: 'https://telemetry.alpha-testnet.aztec-labs.com/v1/metrics',
412
+ publicMetricsCollectFrom: ['sequencer'],
413
+ blobAllowEmptySources: true,
414
+
415
+ /** How many seconds an L1 slot lasts. */
416
+ ethereumSlotDuration: 12,
417
+ /** How many seconds an L2 slots lasts (must be multiple of ethereum slot duration). */
418
+ aztecSlotDuration: 72,
419
+ /** How many L2 slots an epoch lasts. */
420
+ aztecEpochDuration: 32,
421
+ /** The target validator committee size. */
422
+ aztecTargetCommitteeSize: 24,
423
+ /** The number of epochs to lag behind the current epoch for validator selection. */
424
+ lagInEpochsForValidatorSet: 2,
425
+ /** The number of epochs to lag behind the current epoch for randao selection. */
426
+ lagInEpochsForRandao: 2,
427
+ /** The number of epochs after an epoch ends that proofs are still accepted. */
428
+ aztecProofSubmissionEpochs: 1,
429
+
430
+ localEjectionThreshold: 196_000n * 10n ** 18n,
431
+ /** How many sequencers must agree with a slash for it to be executed. */
432
+ slashingQuorum: 65,
433
+ slashingRoundSizeInEpochs: 4,
434
+ slashingExecutionDelayInRounds: 28,
435
+ slashingLifetimeInRounds: 34,
436
+ slashingVetoer: EthAddress.fromString('0xBbB4aF368d02827945748b28CD4b2D42e4A37480'),
437
+ slashingOffsetInRounds: 2,
438
+
439
+ slashingDisableDuration: 259_200, // 3 days
440
+ slasherFlavor: 'tally',
441
+
442
+ slashAmountSmall: 2_000n * 10n ** 18n,
443
+ slashAmountMedium: 2_000n * 10n ** 18n,
444
+ slashAmountLarge: 2_000n * 10n ** 18n,
445
+
446
+ /** The mana target for the rollup */
447
+ manaTarget: 0n,
448
+
449
+ /** The proving cost per mana */
450
+ provingCostPerMana: 0n,
451
+
452
+ exitDelaySeconds: 4 * 24 * 60 * 60, // 4 days
453
+
454
+ activationThreshold: 200_000n * 10n ** 18n,
455
+ ejectionThreshold: 100_000n * 10n ** 18n,
456
+
457
+ governanceProposerRoundSize: 1000,
458
+ governanceProposerQuorum: 600,
459
+
460
+ // Node slashing config
461
+ slashInactivityTargetPercentage: 0.8,
462
+ slashInactivityConsecutiveEpochThreshold: 2,
463
+ slashInactivityPenalty: 2_000n * 10n ** 18n,
464
+ slashPrunePenalty: 0n, // 2_000n * 10n ** 18n, We disable slashing for prune offenses right now
465
+ slashDataWithholdingPenalty: 0n, // 2_000n * 10n ** 18n, We disable slashing for data withholding offenses right now
466
+ slashProposeInvalidAttestationsPenalty: 2_000n * 10n ** 18n,
467
+ slashAttestDescendantOfInvalidPenalty: 2_000n * 10n ** 18n,
468
+ slashUnknownPenalty: 2_000n * 10n ** 18n,
469
+ slashBroadcastedInvalidBlockPenalty: 2_000n * 10n ** 18n, // 10_000n * 10n ** 18n, Disabled for now until further testing
470
+ slashGracePeriodL2Slots: 1_200, // One day from deployment
471
+ slashOffenseExpirationRounds: 8,
472
+
473
+ slashMinPenaltyPercentage: 0.5,
474
+ slashMaxPenaltyPercentage: 2.0,
475
+ slashMaxPayloadSize: 50,
476
+ slashExecuteRoundsLookBack: 4,
477
+
478
+ sentinelEnabled: true,
479
+
480
+ ...DefaultNetworkDBMapSizeConfig,
481
+ };
482
+
483
+ export const devnetL2ChainConfig: L2ChainConfig = {
484
+ l1ChainId: 11155111,
485
+ testAccounts: true,
486
+ sponsoredFPC: true,
487
+ p2pEnabled: true,
488
+ disableTransactions: false,
489
+ bootstrapNodes: [],
490
+ minTxsPerBlock: 0,
491
+ maxTxsPerBlock: 8,
492
+ buildCheckpointIfEmpty: true,
493
+ realProofs: false,
494
+ snapshotsUrls: [],
495
+ autoUpdate: 'config-and-version',
496
+ autoUpdateUrl: '',
497
+ publicMetricsOptOut: true,
498
+ publicIncludeMetrics,
499
+ publicMetricsCollectorUrl: '',
500
+ publicMetricsCollectFrom: [''],
501
+ maxTxPoolSize: 100_000_000, // 100MB
502
+ txPoolDeleteTxsAfterReorg: true,
503
+
504
+ // Deployment stuff
505
+ /** How many seconds an L1 slot lasts. */
506
+ ethereumSlotDuration: 12,
507
+ /** How many seconds an L2 slots lasts (must be multiple of ethereum slot duration). */
508
+ aztecSlotDuration: 36,
509
+ /** How many L2 slots an epoch lasts. */
510
+ aztecEpochDuration: 8,
511
+ /** The target validator committee size. */
512
+ aztecTargetCommitteeSize: 1,
513
+ /** The number of epochs to lag behind the current epoch for validator selection. */
514
+ lagInEpochsForValidatorSet: 1,
515
+ /** The number of epochs to lag behind the current epoch for randao selection. */
516
+ lagInEpochsForRandao: 1,
517
+ /** The local ejection threshold for a validator. Stricter than ejectionThreshold but local to a specific rollup */
518
+ localEjectionThreshold: DefaultL1ContractsConfig.localEjectionThreshold,
519
+ /** The number of epochs after an epoch ends that proofs are still accepted. */
520
+ aztecProofSubmissionEpochs: 1,
521
+ /** The deposit amount for a validator */
522
+ activationThreshold: DefaultL1ContractsConfig.activationThreshold,
523
+ /** The minimum stake for a validator. */
524
+ ejectionThreshold: DefaultL1ContractsConfig.ejectionThreshold,
525
+ /** The slashing round size */
526
+ slashingRoundSizeInEpochs: DefaultL1ContractsConfig.slashingRoundSizeInEpochs,
527
+ /** Governance proposing round size */
528
+ governanceProposerRoundSize: DefaultL1ContractsConfig.governanceProposerRoundSize,
529
+ /** The mana target for the rollup */
530
+ manaTarget: DefaultL1ContractsConfig.manaTarget,
531
+ /** The proving cost per mana */
532
+ provingCostPerMana: DefaultL1ContractsConfig.provingCostPerMana,
533
+ /** Exit delay for stakers */
534
+ exitDelaySeconds: DefaultL1ContractsConfig.exitDelaySeconds,
535
+
536
+ ...DefaultSlashConfig,
537
+
538
+ ...DefaultNetworkDBMapSizeConfig,
539
+ };
540
+
541
+ export function getL2ChainConfig(networkName: NetworkNames): L2ChainConfig | undefined {
542
+ let config: L2ChainConfig | undefined;
543
+ if (networkName === 'staging-public') {
544
+ config = { ...stagingPublicL2ChainConfig };
545
+ } else if (networkName === 'testnet') {
546
+ config = { ...testnetL2ChainConfig };
547
+ } else if (networkName === 'staging-ignition') {
548
+ config = { ...stagingIgnitionL2ChainConfig };
549
+ } else if (networkName === 'mainnet') {
550
+ config = { ...mainnetL2ChainConfig };
551
+ } else if (networkName === 'next-net') {
552
+ config = { ...nextNetL2ChainConfig };
553
+ } else if (networkName === 'devnet') {
554
+ config = { ...devnetL2ChainConfig };
555
+ }
556
+ return config;
557
+ }
558
+
559
+ function getDefaultDataDir(networkName: NetworkNames): string {
560
+ return path.join(process.env.HOME || '~', '.aztec', networkName, 'data');
561
+ }
562
+
563
+ export function enrichEnvironmentWithChainName(networkName: NetworkNames) {
564
+ if (networkName === 'local') {
565
+ return;
566
+ }
567
+
568
+ enrichVar('DATA_DIRECTORY', getDefaultDataDir(networkName));
569
+ const config = getL2ChainConfig(networkName);
570
+
571
+ if (!config) {
572
+ throw new Error(`Unknown network name: ${networkName}`);
573
+ }
574
+
575
+ enrichEnvironmentWithChainConfig(config);
576
+ }
577
+
578
+ export function enrichEnvironmentWithChainConfig(config: L2ChainConfig) {
579
+ enrichVar('BOOTSTRAP_NODES', config.bootstrapNodes.join(','));
580
+ enrichVar('TEST_ACCOUNTS', config.testAccounts.toString());
581
+ enrichVar('SPONSORED_FPC', config.sponsoredFPC.toString());
582
+ enrichVar('P2P_ENABLED', config.p2pEnabled.toString());
583
+ enrichVar('L1_CHAIN_ID', config.l1ChainId.toString());
584
+ enrichVar('SEQ_MIN_TX_PER_BLOCK', config.minTxsPerBlock.toString());
585
+ enrichVar('SEQ_MAX_TX_PER_BLOCK', config.maxTxsPerBlock.toString());
586
+ if (config.blockDurationMs !== undefined) {
587
+ enrichVar('SEQ_BLOCK_DURATION_MS', config.blockDurationMs.toString());
588
+ }
589
+ if (config.buildCheckpointIfEmpty !== undefined) {
590
+ enrichVar('SEQ_BUILD_CHECKPOINT_IF_EMPTY', config.buildCheckpointIfEmpty.toString());
591
+ }
592
+ enrichVar('PROVER_REAL_PROOFS', config.realProofs.toString());
593
+ enrichVar('PXE_PROVER_ENABLED', config.realProofs.toString());
594
+ enrichVar('SYNC_SNAPSHOTS_URLS', config.snapshotsUrls.join(','));
595
+ enrichVar('P2P_MAX_TX_POOL_SIZE', config.maxTxPoolSize.toString());
596
+ enrichVar('P2P_TX_POOL_DELETE_TXS_AFTER_REORG', config.txPoolDeleteTxsAfterReorg.toString());
597
+
598
+ enrichVar('DATA_STORE_MAP_SIZE_KB', config.dataStoreMapSizeKb.toString());
599
+ enrichVar('ARCHIVER_STORE_MAP_SIZE_KB', config.archiverStoreMapSizeKb.toString());
600
+ enrichVar('NOTE_HASH_TREE_MAP_SIZE_KB', config.noteHashTreeMapSizeKb.toString());
601
+ enrichVar('NULLIFIER_TREE_MAP_SIZE_KB', config.nullifierTreeMapSizeKb.toString());
602
+ enrichVar('PUBLIC_DATA_TREE_MAP_SIZE_KB', config.publicDataTreeMapSizeKb.toString());
603
+
604
+ if (config.skipArchiverInitialSync !== undefined) {
605
+ enrichVar('SKIP_ARCHIVER_INITIAL_SYNC', config.skipArchiverInitialSync.toString());
606
+ }
607
+
608
+ if (config.blobAllowEmptySources !== undefined) {
609
+ enrichVar('BLOB_ALLOW_EMPTY_SOURCES', config.blobAllowEmptySources.toString());
610
+ }
611
+
612
+ if (config.autoUpdate) {
613
+ enrichVar('AUTO_UPDATE', config.autoUpdate?.toString());
614
+ }
615
+
616
+ if (config.autoUpdateUrl) {
617
+ enrichVar('AUTO_UPDATE_URL', config.autoUpdateUrl);
618
+ }
619
+
620
+ if (config.publicIncludeMetrics) {
621
+ enrichVar('PUBLIC_OTEL_INCLUDE_METRICS', config.publicIncludeMetrics.join(','));
622
+ }
623
+
624
+ if (config.publicMetricsCollectorUrl) {
625
+ enrichVar('PUBLIC_OTEL_EXPORTER_OTLP_METRICS_ENDPOINT', config.publicMetricsCollectorUrl);
626
+ }
627
+
628
+ if (config.publicMetricsCollectFrom) {
629
+ enrichVar('PUBLIC_OTEL_COLLECT_FROM', config.publicMetricsCollectFrom.join(','));
630
+ }
631
+
632
+ enrichVar('PUBLIC_OTEL_OPT_OUT', config.publicMetricsOptOut.toString());
633
+
634
+ // Deployment stuff
635
+ enrichVar('ETHEREUM_SLOT_DURATION', config.ethereumSlotDuration.toString());
636
+ enrichVar('AZTEC_SLOT_DURATION', config.aztecSlotDuration.toString());
637
+ enrichVar('AZTEC_EPOCH_DURATION', config.aztecEpochDuration.toString());
638
+ enrichVar('AZTEC_TARGET_COMMITTEE_SIZE', config.aztecTargetCommitteeSize.toString());
639
+ enrichVar('AZTEC_LAG_IN_EPOCHS_FOR_VALIDATOR_SET', config.lagInEpochsForValidatorSet.toString());
640
+ enrichVar('AZTEC_LAG_IN_EPOCHS_FOR_RANDAO', config.lagInEpochsForRandao.toString());
641
+ enrichVar('AZTEC_PROOF_SUBMISSION_EPOCHS', config.aztecProofSubmissionEpochs.toString());
642
+ enrichVar('AZTEC_ACTIVATION_THRESHOLD', config.activationThreshold.toString());
643
+ enrichVar('AZTEC_EJECTION_THRESHOLD', config.ejectionThreshold.toString());
644
+ enrichVar('AZTEC_LOCAL_EJECTION_THRESHOLD', config.localEjectionThreshold.toString());
645
+ enrichVar('AZTEC_SLASHING_QUORUM', config.slashingQuorum?.toString());
646
+ enrichVar('AZTEC_SLASHING_ROUND_SIZE_IN_EPOCHS', config.slashingRoundSizeInEpochs.toString());
647
+ enrichVar('AZTEC_GOVERNANCE_PROPOSER_QUORUM', config.governanceProposerQuorum?.toString());
648
+ enrichVar('AZTEC_GOVERNANCE_PROPOSER_ROUND_SIZE', config.governanceProposerRoundSize.toString());
649
+ enrichVar('AZTEC_MANA_TARGET', config.manaTarget.toString());
650
+ enrichVar('AZTEC_PROVING_COST_PER_MANA', config.provingCostPerMana.toString());
651
+ enrichVar('AZTEC_SLASH_AMOUNT_SMALL', config.slashAmountSmall.toString());
652
+ enrichVar('AZTEC_SLASH_AMOUNT_MEDIUM', config.slashAmountMedium.toString());
653
+ enrichVar('AZTEC_SLASH_AMOUNT_LARGE', config.slashAmountLarge.toString());
654
+ enrichVar('AZTEC_SLASHING_LIFETIME_IN_ROUNDS', config.slashingLifetimeInRounds.toString());
655
+ enrichVar('AZTEC_SLASHING_EXECUTION_DELAY_IN_ROUNDS', config.slashingExecutionDelayInRounds.toString());
656
+ enrichVar('AZTEC_SLASHING_OFFSET_IN_ROUNDS', config.slashingOffsetInRounds.toString());
657
+ enrichVar('AZTEC_SLASHER_FLAVOR', config.slasherFlavor);
658
+ enrichVar('AZTEC_SLASHING_DISABLE_DURATION', config.slashingDisableDuration.toString());
659
+ enrichVar('AZTEC_EXIT_DELAY_SECONDS', config.exitDelaySeconds.toString());
660
+ enrichEthAddressVar('AZTEC_SLASHING_VETOER', config.slashingVetoer.toString());
661
+
662
+ // Slashing
663
+ enrichVar('SLASH_MIN_PENALTY_PERCENTAGE', config.slashMinPenaltyPercentage.toString());
664
+ enrichVar('SLASH_MAX_PENALTY_PERCENTAGE', config.slashMaxPenaltyPercentage.toString());
665
+ enrichVar('SLASH_PRUNE_PENALTY', config.slashPrunePenalty.toString());
666
+ enrichVar('SLASH_DATA_WITHHOLDING_PENALTY', config.slashDataWithholdingPenalty.toString());
667
+ enrichVar('SLASH_INACTIVITY_TARGET_PERCENTAGE', config.slashInactivityTargetPercentage.toString());
668
+ enrichVar('SLASH_INACTIVITY_CONSECUTIVE_EPOCH_THRESHOLD', config.slashInactivityConsecutiveEpochThreshold.toString());
669
+ enrichVar('SLASH_INACTIVITY_PENALTY', config.slashInactivityPenalty.toString());
670
+ enrichVar('SLASH_PROPOSE_INVALID_ATTESTATIONS_PENALTY', config.slashProposeInvalidAttestationsPenalty.toString());
671
+ enrichVar('SLASH_ATTEST_DESCENDANT_OF_INVALID_PENALTY', config.slashAttestDescendantOfInvalidPenalty.toString());
672
+ enrichVar('SLASH_UNKNOWN_PENALTY', config.slashUnknownPenalty.toString());
673
+ enrichVar('SLASH_INVALID_BLOCK_PENALTY', config.slashBroadcastedInvalidBlockPenalty.toString());
674
+ enrichVar('SLASH_OFFENSE_EXPIRATION_ROUNDS', config.slashOffenseExpirationRounds.toString());
675
+ enrichVar('SLASH_MAX_PAYLOAD_SIZE', config.slashMaxPayloadSize.toString());
676
+ enrichVar('SLASH_GRACE_PERIOD_L2_SLOTS', config.slashGracePeriodL2Slots.toString());
677
+ enrichVar('SLASH_EXECUTE_ROUNDS_LOOK_BACK', config.slashExecuteRoundsLookBack.toString());
678
+
679
+ enrichVar('SENTINEL_ENABLED', config.sentinelEnabled.toString());
680
+ enrichVar('TRANSACTIONS_DISABLED', config.disableTransactions.toString());
681
+ }