@aztec/cli 3.0.0-canary.a9708bd → 3.0.0-manual.20251030

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