@aztec/cli 0.0.0-test.1 → 0.0.1-commit.5476d83

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