@aztec/cli 0.0.1-commit.d3ec352c → 0.0.1-commit.f295ac2

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 (105) hide show
  1. package/dest/cmds/aztec_node/get_current_min_fee.d.ts +3 -0
  2. package/dest/cmds/aztec_node/get_current_min_fee.d.ts.map +1 -0
  3. package/dest/cmds/aztec_node/{get_current_base_fee.js → get_current_min_fee.js} +2 -2
  4. package/dest/cmds/aztec_node/index.js +3 -3
  5. package/dest/cmds/contracts/inspect_contract.js +1 -1
  6. package/dest/cmds/infrastructure/sequencers.d.ts +1 -1
  7. package/dest/cmds/infrastructure/sequencers.d.ts.map +1 -1
  8. package/dest/cmds/infrastructure/sequencers.js +11 -4
  9. package/dest/cmds/l1/bridge_erc20.d.ts +1 -1
  10. package/dest/cmds/l1/bridge_erc20.d.ts.map +1 -1
  11. package/dest/cmds/l1/bridge_erc20.js +2 -1
  12. package/dest/cmds/l1/deploy_l1_contracts_cmd.d.ts +4 -0
  13. package/dest/cmds/l1/deploy_l1_contracts_cmd.d.ts.map +1 -0
  14. package/dest/cmds/l1/{deploy_l1_contracts.js → deploy_l1_contracts_cmd.js} +39 -4
  15. package/dest/cmds/l1/deploy_new_rollup.d.ts +4 -4
  16. package/dest/cmds/l1/deploy_new_rollup.d.ts.map +1 -1
  17. package/dest/cmds/l1/deploy_new_rollup.js +3 -3
  18. package/dest/cmds/l1/get_l1_addresses.d.ts +1 -1
  19. package/dest/cmds/l1/get_l1_addresses.d.ts.map +1 -1
  20. package/dest/cmds/l1/get_l1_addresses.js +5 -2
  21. package/dest/cmds/l1/get_l1_balance.js +4 -2
  22. package/dest/cmds/l1/governance_utils.d.ts +1 -1
  23. package/dest/cmds/l1/governance_utils.d.ts.map +1 -1
  24. package/dest/cmds/l1/governance_utils.js +3 -1
  25. package/dest/cmds/l1/index.d.ts +1 -2
  26. package/dest/cmds/l1/index.d.ts.map +1 -1
  27. package/dest/cmds/l1/index.js +10 -8
  28. package/dest/cmds/l1/prover_stats.d.ts +1 -1
  29. package/dest/cmds/l1/prover_stats.d.ts.map +1 -1
  30. package/dest/cmds/l1/prover_stats.js +4 -2
  31. package/dest/cmds/l1/trigger_seed_snapshot.d.ts +1 -1
  32. package/dest/cmds/l1/trigger_seed_snapshot.d.ts.map +1 -1
  33. package/dest/cmds/l1/trigger_seed_snapshot.js +2 -1
  34. package/dest/cmds/l1/update_l1_validators.d.ts +3 -3
  35. package/dest/cmds/l1/update_l1_validators.d.ts.map +1 -1
  36. package/dest/cmds/l1/update_l1_validators.js +52 -13
  37. package/dest/cmds/misc/generate_secret_and_hash.js +1 -1
  38. package/dest/cmds/misc/index.d.ts +1 -1
  39. package/dest/cmds/misc/index.d.ts.map +1 -1
  40. package/dest/cmds/misc/index.js +1 -1
  41. package/dest/cmds/validator_keys/generate_bls_keypair.js +1 -1
  42. package/dest/cmds/validator_keys/new.d.ts +1 -1
  43. package/dest/cmds/validator_keys/new.d.ts.map +1 -1
  44. package/dest/cmds/validator_keys/new.js +5 -2
  45. package/dest/cmds/validator_keys/shared.d.ts +1 -1
  46. package/dest/cmds/validator_keys/shared.d.ts.map +1 -1
  47. package/dest/cmds/validator_keys/shared.js +2 -1
  48. package/dest/cmds/validator_keys/staker.d.ts +2 -2
  49. package/dest/cmds/validator_keys/staker.d.ts.map +1 -1
  50. package/dest/cmds/validator_keys/staker.js +7 -4
  51. package/dest/cmds/validator_keys/utils.d.ts +1 -1
  52. package/dest/cmds/validator_keys/utils.d.ts.map +1 -1
  53. package/dest/cmds/validator_keys/utils.js +1 -1
  54. package/dest/config/chain_l2_config.d.ts +12 -38
  55. package/dest/config/chain_l2_config.d.ts.map +1 -1
  56. package/dest/config/chain_l2_config.js +33 -493
  57. package/dest/config/generated/networks.d.ts +202 -0
  58. package/dest/config/generated/networks.d.ts.map +1 -0
  59. package/dest/config/generated/networks.js +203 -0
  60. package/dest/config/get_l1_config.d.ts +3 -2
  61. package/dest/config/get_l1_config.d.ts.map +1 -1
  62. package/dest/config/get_l1_config.js +3 -1
  63. package/dest/config/network_config.d.ts +2 -2
  64. package/dest/config/network_config.d.ts.map +1 -1
  65. package/dest/config/network_config.js +7 -1
  66. package/dest/utils/aztec.d.ts +7 -13
  67. package/dest/utils/aztec.d.ts.map +1 -1
  68. package/dest/utils/aztec.js +19 -40
  69. package/dest/utils/commands.d.ts +7 -6
  70. package/dest/utils/commands.d.ts.map +1 -1
  71. package/dest/utils/commands.js +6 -5
  72. package/dest/utils/encoding.js +1 -1
  73. package/package.json +39 -31
  74. package/src/cmds/aztec_node/{get_current_base_fee.ts → get_current_min_fee.ts} +2 -2
  75. package/src/cmds/aztec_node/index.ts +3 -3
  76. package/src/cmds/contracts/inspect_contract.ts +1 -1
  77. package/src/cmds/infrastructure/sequencers.ts +7 -4
  78. package/src/cmds/l1/bridge_erc20.ts +2 -1
  79. package/src/cmds/l1/{deploy_l1_contracts.ts → deploy_l1_contracts_cmd.ts} +39 -22
  80. package/src/cmds/l1/deploy_new_rollup.ts +4 -9
  81. package/src/cmds/l1/get_l1_addresses.ts +4 -2
  82. package/src/cmds/l1/get_l1_balance.ts +2 -2
  83. package/src/cmds/l1/governance_utils.ts +3 -8
  84. package/src/cmds/l1/index.ts +7 -17
  85. package/src/cmds/l1/prover_stats.ts +6 -2
  86. package/src/cmds/l1/trigger_seed_snapshot.ts +2 -1
  87. package/src/cmds/l1/update_l1_validators.ts +46 -25
  88. package/src/cmds/misc/generate_secret_and_hash.ts +1 -1
  89. package/src/cmds/misc/index.ts +1 -1
  90. package/src/cmds/validator_keys/generate_bls_keypair.ts +1 -1
  91. package/src/cmds/validator_keys/new.ts +3 -2
  92. package/src/cmds/validator_keys/shared.ts +2 -1
  93. package/src/cmds/validator_keys/staker.ts +5 -4
  94. package/src/cmds/validator_keys/utils.ts +2 -1
  95. package/src/config/chain_l2_config.ts +33 -644
  96. package/src/config/generated/networks.ts +207 -0
  97. package/src/config/get_l1_config.ts +4 -1
  98. package/src/config/network_config.ts +8 -1
  99. package/src/utils/aztec.ts +24 -83
  100. package/src/utils/commands.ts +6 -5
  101. package/src/utils/encoding.ts +1 -1
  102. package/dest/cmds/aztec_node/get_current_base_fee.d.ts +0 -3
  103. package/dest/cmds/aztec_node/get_current_base_fee.d.ts.map +0 -1
  104. package/dest/cmds/l1/deploy_l1_contracts.d.ts +0 -4
  105. package/dest/cmds/l1/deploy_l1_contracts.d.ts.map +0 -1
@@ -1,505 +1,45 @@
1
- import { DefaultL1ContractsConfig } from '@aztec/ethereum';
2
- import { EthAddress } from '@aztec/foundation/eth-address';
3
1
  import path from 'path';
4
- import publicIncludeMetrics from '../../public_include_metric_prefixes.json' with {
5
- type: 'json'
6
- };
7
- import { enrichEthAddressVar, enrichVar } from './enrich_env.js';
8
- const SNAPSHOTS_URL = 'https://aztec-labs-snapshots.com';
9
- const defaultDBMapSizeKb = 128 * 1_024 * 1_024; // 128 GB
10
- const tbMapSizeKb = 1_024 * 1_024 * 1_024; // 1 TB
11
- const DefaultSlashConfig = {
12
- /** Tally-style slashing */ slasherFlavor: 'tally',
13
- /** Allow one round for vetoing */ slashingExecutionDelayInRounds: 1,
14
- /** How long for a slash payload to be executed */ slashingLifetimeInRounds: 5,
15
- /** Allow 2 rounds to discover faults */ slashingOffsetInRounds: 2,
16
- /** No slash vetoer */ slashingVetoer: EthAddress.ZERO,
17
- /** Use default disable duration */ slashingDisableDuration: DefaultL1ContractsConfig.slashingDisableDuration,
18
- /** Use default slash amounts */ slashAmountSmall: DefaultL1ContractsConfig.slashAmountSmall,
19
- slashAmountMedium: DefaultL1ContractsConfig.slashAmountMedium,
20
- slashAmountLarge: DefaultL1ContractsConfig.slashAmountLarge,
21
- // Slashing stuff
22
- slashMinPenaltyPercentage: 0.5,
23
- slashMaxPenaltyPercentage: 2.0,
24
- slashInactivityTargetPercentage: 0.7,
25
- slashInactivityConsecutiveEpochThreshold: 1,
26
- slashInactivityPenalty: DefaultL1ContractsConfig.slashAmountSmall,
27
- slashPrunePenalty: DefaultL1ContractsConfig.slashAmountSmall,
28
- slashDataWithholdingPenalty: DefaultL1ContractsConfig.slashAmountSmall,
29
- slashProposeInvalidAttestationsPenalty: DefaultL1ContractsConfig.slashAmountLarge,
30
- slashAttestDescendantOfInvalidPenalty: DefaultL1ContractsConfig.slashAmountLarge,
31
- slashUnknownPenalty: DefaultL1ContractsConfig.slashAmountSmall,
32
- slashBroadcastedInvalidBlockPenalty: 0n,
33
- slashMaxPayloadSize: 50,
34
- slashGracePeriodL2Slots: 32 * 2,
35
- slashOffenseExpirationRounds: 8,
36
- sentinelEnabled: true,
37
- slashExecuteRoundsLookBack: 4
38
- };
39
- const DefaultNetworkDBMapSizeConfig = {
40
- dataStoreMapSizeKb: defaultDBMapSizeKb,
41
- archiverStoreMapSizeKb: tbMapSizeKb,
42
- noteHashTreeMapSizeKb: tbMapSizeKb,
43
- nullifierTreeMapSizeKb: tbMapSizeKb,
44
- publicDataTreeMapSizeKb: tbMapSizeKb
45
- };
46
- export const stagingIgnitionL2ChainConfig = {
47
- l1ChainId: 11155111,
48
- testAccounts: false,
49
- sponsoredFPC: false,
50
- disableTransactions: true,
51
- p2pEnabled: true,
52
- bootstrapNodes: [],
53
- minTxsPerBlock: 0,
54
- maxTxsPerBlock: 0,
55
- realProofs: true,
56
- snapshotsUrls: [
57
- `${SNAPSHOTS_URL}/staging-ignition/`
58
- ],
59
- autoUpdate: 'config-and-version',
60
- autoUpdateUrl: 'https://storage.googleapis.com/aztec-testnet/auto-update/staging-ignition.json',
61
- maxTxPoolSize: 0,
62
- publicMetricsOptOut: false,
63
- publicIncludeMetrics,
64
- publicMetricsCollectorUrl: 'https://telemetry.alpha-testnet.aztec-labs.com/v1/metrics',
65
- publicMetricsCollectFrom: [
66
- 'sequencer'
67
- ],
68
- txPoolDeleteTxsAfterReorg: false,
69
- blobAllowEmptySources: true,
70
- /** How many seconds an L1 slot lasts. */ ethereumSlotDuration: 12,
71
- /** How many seconds an L2 slots lasts (must be multiple of ethereum slot duration). */ aztecSlotDuration: 72,
72
- /** How many L2 slots an epoch lasts. */ aztecEpochDuration: 32,
73
- /** The target validator committee size. */ aztecTargetCommitteeSize: 24,
74
- /** The number of epochs to lag behind the current epoch for validator selection. */ lagInEpochsForValidatorSet: 2,
75
- /** The number of epochs to lag behind the current epoch for randao selection. */ lagInEpochsForRandao: 2,
76
- /** The number of epochs after an epoch ends that proofs are still accepted. */ aztecProofSubmissionEpochs: 1,
77
- /** How many sequencers must agree with a slash for it to be executed. */ slashingQuorum: 65,
78
- slashingRoundSizeInEpochs: 4,
79
- slashingLifetimeInRounds: 40,
80
- slashingExecutionDelayInRounds: 28,
81
- slashAmountSmall: 2_000n * 10n ** 18n,
82
- slashAmountMedium: 10_000n * 10n ** 18n,
83
- slashAmountLarge: 50_000n * 10n ** 18n,
84
- slashingOffsetInRounds: 2,
85
- slasherFlavor: 'tally',
86
- slashingVetoer: EthAddress.ZERO,
87
- /** The mana target for the rollup */ manaTarget: 0n,
88
- exitDelaySeconds: 5 * 24 * 60 * 60,
89
- /** The proving cost per mana */ provingCostPerMana: 0n,
90
- localEjectionThreshold: 196_000n * 10n ** 18n,
91
- ejectionThreshold: 100_000n * 10n ** 18n,
92
- activationThreshold: 200_000n * 10n ** 18n,
93
- governanceProposerRoundSize: 300,
94
- governanceProposerQuorum: 151,
95
- // Node slashing config
96
- slashMinPenaltyPercentage: 0.5,
97
- slashMaxPenaltyPercentage: 2.0,
98
- slashInactivityTargetPercentage: 0.7,
99
- slashInactivityConsecutiveEpochThreshold: 2,
100
- slashInactivityPenalty: 2_000n * 10n ** 18n,
101
- slashPrunePenalty: 0n,
102
- slashDataWithholdingPenalty: 0n,
103
- slashProposeInvalidAttestationsPenalty: 50_000n * 10n ** 18n,
104
- slashAttestDescendantOfInvalidPenalty: 50_000n * 10n ** 18n,
105
- slashUnknownPenalty: 2_000n * 10n ** 18n,
106
- slashBroadcastedInvalidBlockPenalty: 0n,
107
- slashMaxPayloadSize: 50,
108
- slashGracePeriodL2Slots: 32 * 4,
109
- slashOffenseExpirationRounds: 8,
110
- sentinelEnabled: true,
111
- slashingDisableDuration: 5 * 24 * 60 * 60,
112
- slashExecuteRoundsLookBack: 4,
113
- ...DefaultNetworkDBMapSizeConfig
114
- };
115
- export const stagingPublicL2ChainConfig = {
116
- l1ChainId: 11155111,
117
- testAccounts: false,
118
- sponsoredFPC: true,
119
- disableTransactions: false,
120
- p2pEnabled: true,
121
- bootstrapNodes: [],
122
- minTxsPerBlock: 0,
123
- maxTxsPerBlock: 20,
124
- realProofs: true,
125
- snapshotsUrls: [
126
- `${SNAPSHOTS_URL}/staging-public/`
127
- ],
128
- autoUpdate: 'config-and-version',
129
- autoUpdateUrl: 'https://storage.googleapis.com/aztec-testnet/auto-update/staging-public.json',
130
- publicMetricsOptOut: false,
131
- publicIncludeMetrics,
132
- publicMetricsCollectorUrl: 'https://telemetry.alpha-testnet.aztec-labs.com/v1/metrics',
133
- publicMetricsCollectFrom: [
134
- 'sequencer'
135
- ],
136
- maxTxPoolSize: 100_000_000,
137
- txPoolDeleteTxsAfterReorg: true,
138
- // Deployment stuff
139
- /** How many seconds an L1 slot lasts. */ ethereumSlotDuration: 12,
140
- /** How many seconds an L2 slots lasts (must be multiple of ethereum slot duration). */ aztecSlotDuration: 36,
141
- /** How many L2 slots an epoch lasts. */ aztecEpochDuration: 32,
142
- /** The target validator committee size. */ aztecTargetCommitteeSize: 48,
143
- /** The number of epochs to lag behind the current epoch for validator selection. */ lagInEpochsForValidatorSet: DefaultL1ContractsConfig.lagInEpochsForValidatorSet,
144
- /** The number of epochs to lag behind the current epoch for randao selection. */ lagInEpochsForRandao: DefaultL1ContractsConfig.lagInEpochsForRandao,
145
- /** The local ejection threshold for a validator. Stricter than ejectionThreshold but local to a specific rollup */ localEjectionThreshold: DefaultL1ContractsConfig.localEjectionThreshold,
146
- /** The number of epochs after an epoch ends that proofs are still accepted. */ aztecProofSubmissionEpochs: 1,
147
- /** The deposit amount for a validator */ activationThreshold: DefaultL1ContractsConfig.activationThreshold,
148
- /** The minimum stake for a validator. */ ejectionThreshold: DefaultL1ContractsConfig.ejectionThreshold,
149
- /** The slashing round size */ slashingRoundSizeInEpochs: DefaultL1ContractsConfig.slashingRoundSizeInEpochs,
150
- /** Governance proposing round size */ governanceProposerRoundSize: DefaultL1ContractsConfig.governanceProposerRoundSize,
151
- /** The mana target for the rollup */ manaTarget: DefaultL1ContractsConfig.manaTarget,
152
- /** The proving cost per mana */ provingCostPerMana: DefaultL1ContractsConfig.provingCostPerMana,
153
- /** Exit delay for stakers */ exitDelaySeconds: DefaultL1ContractsConfig.exitDelaySeconds,
154
- ...DefaultSlashConfig,
155
- ...DefaultNetworkDBMapSizeConfig
156
- };
157
- export const nextNetL2ChainConfig = {
158
- l1ChainId: 11155111,
159
- testAccounts: true,
160
- sponsoredFPC: true,
161
- p2pEnabled: true,
162
- disableTransactions: false,
163
- bootstrapNodes: [],
164
- minTxsPerBlock: 0,
165
- maxTxsPerBlock: 8,
166
- realProofs: true,
167
- snapshotsUrls: [],
168
- autoUpdate: 'config-and-version',
169
- autoUpdateUrl: '',
170
- publicMetricsOptOut: true,
171
- publicIncludeMetrics,
172
- publicMetricsCollectorUrl: '',
173
- publicMetricsCollectFrom: [
174
- ''
175
- ],
176
- maxTxPoolSize: 100_000_000,
177
- txPoolDeleteTxsAfterReorg: false,
178
- // Deployment stuff
179
- /** How many seconds an L1 slot lasts. */ ethereumSlotDuration: 12,
180
- /** How many seconds an L2 slots lasts (must be multiple of ethereum slot duration). */ aztecSlotDuration: 36,
181
- /** How many L2 slots an epoch lasts. */ aztecEpochDuration: 32,
182
- /** The target validator committee size. */ aztecTargetCommitteeSize: 48,
183
- /** The number of epochs to lag behind the current epoch for validator selection. */ lagInEpochsForValidatorSet: DefaultL1ContractsConfig.lagInEpochsForValidatorSet,
184
- /** The number of epochs to lag behind the current epoch for randao selection. */ lagInEpochsForRandao: DefaultL1ContractsConfig.lagInEpochsForRandao,
185
- /** The local ejection threshold for a validator. Stricter than ejectionThreshold but local to a specific rollup */ localEjectionThreshold: DefaultL1ContractsConfig.localEjectionThreshold,
186
- /** The number of epochs after an epoch ends that proofs are still accepted. */ aztecProofSubmissionEpochs: 1,
187
- /** The deposit amount for a validator */ activationThreshold: DefaultL1ContractsConfig.activationThreshold,
188
- /** The minimum stake for a validator. */ ejectionThreshold: DefaultL1ContractsConfig.ejectionThreshold,
189
- /** The slashing round size */ slashingRoundSizeInEpochs: DefaultL1ContractsConfig.slashingRoundSizeInEpochs,
190
- /** Governance proposing round size */ governanceProposerRoundSize: DefaultL1ContractsConfig.governanceProposerRoundSize,
191
- /** The mana target for the rollup */ manaTarget: DefaultL1ContractsConfig.manaTarget,
192
- /** The proving cost per mana */ provingCostPerMana: DefaultL1ContractsConfig.provingCostPerMana,
193
- /** Exit delay for stakers */ exitDelaySeconds: DefaultL1ContractsConfig.exitDelaySeconds,
194
- ...DefaultSlashConfig,
195
- ...DefaultNetworkDBMapSizeConfig
196
- };
197
- export const testnetL2ChainConfig = {
198
- l1ChainId: 11155111,
199
- testAccounts: false,
200
- sponsoredFPC: true,
201
- p2pEnabled: true,
202
- disableTransactions: true,
203
- bootstrapNodes: [],
204
- minTxsPerBlock: 0,
205
- maxTxsPerBlock: 0,
206
- realProofs: true,
207
- snapshotsUrls: [
208
- `${SNAPSHOTS_URL}/testnet/`
209
- ],
210
- autoUpdate: 'config-and-version',
211
- autoUpdateUrl: 'https://storage.googleapis.com/aztec-testnet/auto-update/testnet.json',
212
- maxTxPoolSize: 100_000_000,
213
- publicMetricsOptOut: false,
214
- publicIncludeMetrics,
215
- publicMetricsCollectorUrl: 'https://telemetry.alpha-testnet.aztec-labs.com/v1/metrics',
216
- publicMetricsCollectFrom: [
217
- 'sequencer'
218
- ],
219
- txPoolDeleteTxsAfterReorg: true,
220
- skipArchiverInitialSync: true,
221
- blobAllowEmptySources: true,
222
- /** How many seconds an L1 slot lasts. */ ethereumSlotDuration: 12,
223
- /** How many seconds an L2 slots lasts (must be multiple of ethereum slot duration). */ aztecSlotDuration: 72,
224
- /** How many L2 slots an epoch lasts. */ aztecEpochDuration: 32,
225
- /** The target validator committee size. */ aztecTargetCommitteeSize: 24,
226
- /** The number of epochs to lag behind the current epoch for validator selection. */ lagInEpochsForValidatorSet: 2,
227
- /** The number of epochs to lag behind the current epoch for randao selection. */ lagInEpochsForRandao: 2,
228
- /** The number of epochs after an epoch ends that proofs are still accepted. */ aztecProofSubmissionEpochs: 1,
229
- // This is a diff from mainnet: we have 2-strikes you're out, rather than 3 on mainnet.
230
- localEjectionThreshold: 198_000n * 10n ** 18n,
231
- /** How many sequencers must agree with a slash for it to be executed. */ slashingQuorum: 65,
232
- slashingRoundSizeInEpochs: 4,
233
- slashingExecutionDelayInRounds: 28,
234
- slashingLifetimeInRounds: 34,
235
- slashingVetoer: EthAddress.fromString('0xBbB4aF368d02827945748b28CD4b2D42e4A37480'),
236
- slashingOffsetInRounds: 2,
237
- slashingDisableDuration: 259_200,
238
- slasherFlavor: 'tally',
239
- slashAmountSmall: 2_000n * 10n ** 18n,
240
- slashAmountMedium: 2_000n * 10n ** 18n,
241
- slashAmountLarge: 2_000n * 10n ** 18n,
242
- /** The mana target for the rollup */ manaTarget: 0n,
243
- /** The proving cost per mana */ provingCostPerMana: 0n,
244
- exitDelaySeconds: 4 * 24 * 60 * 60,
245
- activationThreshold: 200_000n * 10n ** 18n,
246
- ejectionThreshold: 100_000n * 10n ** 18n,
247
- governanceProposerRoundSize: 300,
248
- governanceProposerQuorum: 151,
249
- // Node slashing config
250
- slashInactivityTargetPercentage: 0.8,
251
- slashInactivityConsecutiveEpochThreshold: 2,
252
- slashInactivityPenalty: 2_000n * 10n ** 18n,
253
- slashPrunePenalty: 0n,
254
- slashDataWithholdingPenalty: 0n,
255
- slashProposeInvalidAttestationsPenalty: 2_000n * 10n ** 18n,
256
- slashAttestDescendantOfInvalidPenalty: 2_000n * 10n ** 18n,
257
- slashUnknownPenalty: 2_000n * 10n ** 18n,
258
- slashBroadcastedInvalidBlockPenalty: 2_000n * 10n ** 18n,
259
- slashGracePeriodL2Slots: 1_200,
260
- slashOffenseExpirationRounds: 8,
261
- slashMinPenaltyPercentage: 0.5,
262
- slashMaxPenaltyPercentage: 2.0,
263
- slashMaxPayloadSize: 50,
264
- slashExecuteRoundsLookBack: 4,
265
- sentinelEnabled: true,
266
- ...DefaultNetworkDBMapSizeConfig
267
- };
268
- export const mainnetL2ChainConfig = {
269
- txPoolDeleteTxsAfterReorg: true,
270
- disableTransactions: true,
271
- l1ChainId: 1,
272
- testAccounts: false,
273
- sponsoredFPC: false,
274
- p2pEnabled: true,
275
- bootstrapNodes: [],
276
- minTxsPerBlock: 0,
277
- maxTxsPerBlock: 0,
278
- realProofs: true,
279
- snapshotsUrls: [
280
- `${SNAPSHOTS_URL}/mainnet/`
281
- ],
282
- autoUpdate: 'notify',
283
- autoUpdateUrl: 'https://storage.googleapis.com/aztec-mainnet/auto-update/mainnet.json',
284
- maxTxPoolSize: 0,
285
- publicMetricsOptOut: true,
286
- publicIncludeMetrics,
287
- publicMetricsCollectorUrl: 'https://telemetry.alpha-testnet.aztec-labs.com/v1/metrics',
288
- publicMetricsCollectFrom: [
289
- 'sequencer'
290
- ],
291
- blobAllowEmptySources: true,
292
- /** How many seconds an L1 slot lasts. */ ethereumSlotDuration: 12,
293
- /** How many seconds an L2 slots lasts (must be multiple of ethereum slot duration). */ aztecSlotDuration: 72,
294
- /** How many L2 slots an epoch lasts. */ aztecEpochDuration: 32,
295
- /** The target validator committee size. */ aztecTargetCommitteeSize: 24,
296
- /** The number of epochs to lag behind the current epoch for validator selection. */ lagInEpochsForValidatorSet: 2,
297
- /** The number of epochs to lag behind the current epoch for randao selection. */ lagInEpochsForRandao: 2,
298
- /** The number of epochs after an epoch ends that proofs are still accepted. */ aztecProofSubmissionEpochs: 1,
299
- localEjectionThreshold: 196_000n * 10n ** 18n,
300
- /** How many sequencers must agree with a slash for it to be executed. */ slashingQuorum: 65,
301
- slashingRoundSizeInEpochs: 4,
302
- slashingExecutionDelayInRounds: 28,
303
- slashingLifetimeInRounds: 34,
304
- slashingVetoer: EthAddress.fromString('0xBbB4aF368d02827945748b28CD4b2D42e4A37480'),
305
- slashingOffsetInRounds: 2,
306
- slashingDisableDuration: 259_200,
307
- slasherFlavor: 'tally',
308
- slashAmountSmall: 2_000n * 10n ** 18n,
309
- slashAmountMedium: 2_000n * 10n ** 18n,
310
- slashAmountLarge: 2_000n * 10n ** 18n,
311
- /** The mana target for the rollup */ manaTarget: 0n,
312
- /** The proving cost per mana */ provingCostPerMana: 0n,
313
- exitDelaySeconds: 4 * 24 * 60 * 60,
314
- activationThreshold: 200_000n * 10n ** 18n,
315
- ejectionThreshold: 100_000n * 10n ** 18n,
316
- governanceProposerRoundSize: 1000,
317
- governanceProposerQuorum: 600,
318
- // Node slashing config
319
- slashInactivityTargetPercentage: 0.8,
320
- slashInactivityConsecutiveEpochThreshold: 2,
321
- slashInactivityPenalty: 2_000n * 10n ** 18n,
322
- slashPrunePenalty: 0n,
323
- slashDataWithholdingPenalty: 0n,
324
- slashProposeInvalidAttestationsPenalty: 2_000n * 10n ** 18n,
325
- slashAttestDescendantOfInvalidPenalty: 2_000n * 10n ** 18n,
326
- slashUnknownPenalty: 2_000n * 10n ** 18n,
327
- slashBroadcastedInvalidBlockPenalty: 2_000n * 10n ** 18n,
328
- slashGracePeriodL2Slots: 1_200,
329
- slashOffenseExpirationRounds: 8,
330
- slashMinPenaltyPercentage: 0.5,
331
- slashMaxPenaltyPercentage: 2.0,
332
- slashMaxPayloadSize: 50,
333
- slashExecuteRoundsLookBack: 4,
334
- sentinelEnabled: true,
335
- ...DefaultNetworkDBMapSizeConfig
336
- };
337
- export const devnetL2ChainConfig = {
338
- l1ChainId: 11155111,
339
- testAccounts: true,
340
- sponsoredFPC: true,
341
- p2pEnabled: true,
342
- disableTransactions: false,
343
- bootstrapNodes: [],
344
- minTxsPerBlock: 0,
345
- maxTxsPerBlock: 8,
346
- realProofs: false,
347
- snapshotsUrls: [],
348
- autoUpdate: 'config-and-version',
349
- autoUpdateUrl: '',
350
- publicMetricsOptOut: true,
351
- publicIncludeMetrics,
352
- publicMetricsCollectorUrl: '',
353
- publicMetricsCollectFrom: [
354
- ''
355
- ],
356
- maxTxPoolSize: 100_000_000,
357
- txPoolDeleteTxsAfterReorg: true,
358
- // Deployment stuff
359
- /** How many seconds an L1 slot lasts. */ ethereumSlotDuration: 12,
360
- /** How many seconds an L2 slots lasts (must be multiple of ethereum slot duration). */ aztecSlotDuration: 36,
361
- /** How many L2 slots an epoch lasts. */ aztecEpochDuration: 8,
362
- /** The target validator committee size. */ aztecTargetCommitteeSize: 1,
363
- /** The number of epochs to lag behind the current epoch for validator selection. */ lagInEpochsForValidatorSet: 1,
364
- /** The number of epochs to lag behind the current epoch for randao selection. */ lagInEpochsForRandao: 1,
365
- /** The local ejection threshold for a validator. Stricter than ejectionThreshold but local to a specific rollup */ localEjectionThreshold: DefaultL1ContractsConfig.localEjectionThreshold,
366
- /** The number of epochs after an epoch ends that proofs are still accepted. */ aztecProofSubmissionEpochs: 1,
367
- /** The deposit amount for a validator */ activationThreshold: DefaultL1ContractsConfig.activationThreshold,
368
- /** The minimum stake for a validator. */ ejectionThreshold: DefaultL1ContractsConfig.ejectionThreshold,
369
- /** The slashing round size */ slashingRoundSizeInEpochs: DefaultL1ContractsConfig.slashingRoundSizeInEpochs,
370
- /** Governance proposing round size */ governanceProposerRoundSize: DefaultL1ContractsConfig.governanceProposerRoundSize,
371
- /** The mana target for the rollup */ manaTarget: DefaultL1ContractsConfig.manaTarget,
372
- /** The proving cost per mana */ provingCostPerMana: DefaultL1ContractsConfig.provingCostPerMana,
373
- /** Exit delay for stakers */ exitDelaySeconds: DefaultL1ContractsConfig.exitDelaySeconds,
374
- ...DefaultSlashConfig,
375
- ...DefaultNetworkDBMapSizeConfig
376
- };
377
- export function getL2ChainConfig(networkName) {
378
- let config;
379
- if (networkName === 'staging-public') {
380
- config = {
381
- ...stagingPublicL2ChainConfig
382
- };
383
- } else if (networkName === 'testnet') {
384
- config = {
385
- ...testnetL2ChainConfig
386
- };
387
- } else if (networkName === 'staging-ignition') {
388
- config = {
389
- ...stagingIgnitionL2ChainConfig
390
- };
391
- } else if (networkName === 'mainnet') {
392
- config = {
393
- ...mainnetL2ChainConfig
394
- };
395
- } else if (networkName === 'next-net') {
396
- config = {
397
- ...nextNetL2ChainConfig
398
- };
399
- } else if (networkName === 'devnet') {
400
- config = {
401
- ...devnetL2ChainConfig
402
- };
2
+ import { devnetConfig, mainnetConfig, testnetConfig } from './generated/networks.js';
3
+ const NetworkConfigs = {
4
+ devnet: devnetConfig,
5
+ testnet: testnetConfig,
6
+ mainnet: mainnetConfig
7
+ };
8
+ function enrichEnvironmentWithNetworkConfig(config) {
9
+ for (const [key, value] of Object.entries(config)){
10
+ if (process.env[key] === undefined && value !== undefined) {
11
+ process.env[key] = String(value);
12
+ }
403
13
  }
404
- return config;
405
14
  }
406
15
  function getDefaultDataDir(networkName) {
407
16
  return path.join(process.env.HOME || '~', '.aztec', networkName, 'data');
408
17
  }
409
- export function enrichEnvironmentWithChainName(networkName) {
18
+ /**
19
+ * Sets up environment for the given network.
20
+ *
21
+ * For 'local' network: returns early, using hardcoded defaults from DefaultL1ContractsConfig
22
+ * and DefaultSlasherConfig (which match the 'defaults' section of defaults.yml).
23
+ *
24
+ * For deployed networks: applies network configuration from generated defaults.yml,
25
+ * merging base defaults with network-specific overrides.
26
+ *
27
+ * @param networkName - The network name
28
+ */ export function enrichEnvironmentWithChainName(networkName) {
29
+ // For 'local', we don't inject any env vars - use hardcoded TypeScript/Solidity defaults
30
+ // These defaults are defined in defaults.yml 'defaults' section and match:
31
+ // - DefaultL1ContractsConfig (yarn-project/ethereum/src/config.ts)
32
+ // - Solidity vm.envOr defaults (l1-contracts/script/deploy/RollupConfiguration.sol)
410
33
  if (networkName === 'local') {
411
34
  return;
412
35
  }
413
- enrichVar('DATA_DIRECTORY', getDefaultDataDir(networkName));
414
- const config = getL2ChainConfig(networkName);
415
- if (!config) {
416
- throw new Error(`Unknown network name: ${networkName}`);
417
- }
418
- enrichEnvironmentWithChainConfig(config);
419
- }
420
- export function enrichEnvironmentWithChainConfig(config) {
421
- enrichVar('BOOTSTRAP_NODES', config.bootstrapNodes.join(','));
422
- enrichVar('TEST_ACCOUNTS', config.testAccounts.toString());
423
- enrichVar('SPONSORED_FPC', config.sponsoredFPC.toString());
424
- enrichVar('P2P_ENABLED', config.p2pEnabled.toString());
425
- enrichVar('L1_CHAIN_ID', config.l1ChainId.toString());
426
- enrichVar('SEQ_MIN_TX_PER_BLOCK', config.minTxsPerBlock.toString());
427
- enrichVar('SEQ_MAX_TX_PER_BLOCK', config.maxTxsPerBlock.toString());
428
- enrichVar('PROVER_REAL_PROOFS', config.realProofs.toString());
429
- enrichVar('PXE_PROVER_ENABLED', config.realProofs.toString());
430
- enrichVar('SYNC_SNAPSHOTS_URLS', config.snapshotsUrls.join(','));
431
- enrichVar('P2P_MAX_TX_POOL_SIZE', config.maxTxPoolSize.toString());
432
- enrichVar('P2P_TX_POOL_DELETE_TXS_AFTER_REORG', config.txPoolDeleteTxsAfterReorg.toString());
433
- enrichVar('DATA_STORE_MAP_SIZE_KB', config.dataStoreMapSizeKb.toString());
434
- enrichVar('ARCHIVER_STORE_MAP_SIZE_KB', config.archiverStoreMapSizeKb.toString());
435
- enrichVar('NOTE_HASH_TREE_MAP_SIZE_KB', config.noteHashTreeMapSizeKb.toString());
436
- enrichVar('NULLIFIER_TREE_MAP_SIZE_KB', config.nullifierTreeMapSizeKb.toString());
437
- enrichVar('PUBLIC_DATA_TREE_MAP_SIZE_KB', config.publicDataTreeMapSizeKb.toString());
438
- if (config.skipArchiverInitialSync !== undefined) {
439
- enrichVar('SKIP_ARCHIVER_INITIAL_SYNC', config.skipArchiverInitialSync.toString());
440
- }
441
- if (config.blobAllowEmptySources !== undefined) {
442
- enrichVar('BLOB_ALLOW_EMPTY_SOURCES', config.blobAllowEmptySources.toString());
443
- }
444
- if (config.autoUpdate) {
445
- enrichVar('AUTO_UPDATE', config.autoUpdate?.toString());
446
- }
447
- if (config.autoUpdateUrl) {
448
- enrichVar('AUTO_UPDATE_URL', config.autoUpdateUrl);
449
- }
450
- if (config.publicIncludeMetrics) {
451
- enrichVar('PUBLIC_OTEL_INCLUDE_METRICS', config.publicIncludeMetrics.join(','));
452
- }
453
- if (config.publicMetricsCollectorUrl) {
454
- enrichVar('PUBLIC_OTEL_EXPORTER_OTLP_METRICS_ENDPOINT', config.publicMetricsCollectorUrl);
36
+ // Apply generated network config from defaults.yml
37
+ const generatedConfig = NetworkConfigs[networkName];
38
+ if (generatedConfig) {
39
+ enrichEnvironmentWithNetworkConfig(generatedConfig);
455
40
  }
456
- if (config.publicMetricsCollectFrom) {
457
- enrichVar('PUBLIC_OTEL_COLLECT_FROM', config.publicMetricsCollectFrom.join(','));
41
+ // Set DATA_DIRECTORY if not already set
42
+ if (process.env['DATA_DIRECTORY'] === undefined) {
43
+ process.env['DATA_DIRECTORY'] = getDefaultDataDir(networkName);
458
44
  }
459
- enrichVar('PUBLIC_OTEL_OPT_OUT', config.publicMetricsOptOut.toString());
460
- // Deployment stuff
461
- enrichVar('ETHEREUM_SLOT_DURATION', config.ethereumSlotDuration.toString());
462
- enrichVar('AZTEC_SLOT_DURATION', config.aztecSlotDuration.toString());
463
- enrichVar('AZTEC_EPOCH_DURATION', config.aztecEpochDuration.toString());
464
- enrichVar('AZTEC_TARGET_COMMITTEE_SIZE', config.aztecTargetCommitteeSize.toString());
465
- enrichVar('AZTEC_LAG_IN_EPOCHS_FOR_VALIDATOR_SET', config.lagInEpochsForValidatorSet.toString());
466
- enrichVar('AZTEC_LAG_IN_EPOCHS_FOR_RANDAO', config.lagInEpochsForRandao.toString());
467
- enrichVar('AZTEC_PROOF_SUBMISSION_EPOCHS', config.aztecProofSubmissionEpochs.toString());
468
- enrichVar('AZTEC_ACTIVATION_THRESHOLD', config.activationThreshold.toString());
469
- enrichVar('AZTEC_EJECTION_THRESHOLD', config.ejectionThreshold.toString());
470
- enrichVar('AZTEC_LOCAL_EJECTION_THRESHOLD', config.localEjectionThreshold.toString());
471
- enrichVar('AZTEC_SLASHING_QUORUM', config.slashingQuorum?.toString());
472
- enrichVar('AZTEC_SLASHING_ROUND_SIZE_IN_EPOCHS', config.slashingRoundSizeInEpochs.toString());
473
- enrichVar('AZTEC_GOVERNANCE_PROPOSER_QUORUM', config.governanceProposerQuorum?.toString());
474
- enrichVar('AZTEC_GOVERNANCE_PROPOSER_ROUND_SIZE', config.governanceProposerRoundSize.toString());
475
- enrichVar('AZTEC_MANA_TARGET', config.manaTarget.toString());
476
- enrichVar('AZTEC_PROVING_COST_PER_MANA', config.provingCostPerMana.toString());
477
- enrichVar('AZTEC_SLASH_AMOUNT_SMALL', config.slashAmountSmall.toString());
478
- enrichVar('AZTEC_SLASH_AMOUNT_MEDIUM', config.slashAmountMedium.toString());
479
- enrichVar('AZTEC_SLASH_AMOUNT_LARGE', config.slashAmountLarge.toString());
480
- enrichVar('AZTEC_SLASHING_LIFETIME_IN_ROUNDS', config.slashingLifetimeInRounds.toString());
481
- enrichVar('AZTEC_SLASHING_EXECUTION_DELAY_IN_ROUNDS', config.slashingExecutionDelayInRounds.toString());
482
- enrichVar('AZTEC_SLASHING_OFFSET_IN_ROUNDS', config.slashingOffsetInRounds.toString());
483
- enrichVar('AZTEC_SLASHER_FLAVOR', config.slasherFlavor);
484
- enrichVar('AZTEC_SLASHING_DISABLE_DURATION', config.slashingDisableDuration.toString());
485
- enrichVar('AZTEC_EXIT_DELAY_SECONDS', config.exitDelaySeconds.toString());
486
- enrichEthAddressVar('AZTEC_SLASHING_VETOER', config.slashingVetoer.toString());
487
- // Slashing
488
- enrichVar('SLASH_MIN_PENALTY_PERCENTAGE', config.slashMinPenaltyPercentage.toString());
489
- enrichVar('SLASH_MAX_PENALTY_PERCENTAGE', config.slashMaxPenaltyPercentage.toString());
490
- enrichVar('SLASH_PRUNE_PENALTY', config.slashPrunePenalty.toString());
491
- enrichVar('SLASH_DATA_WITHHOLDING_PENALTY', config.slashDataWithholdingPenalty.toString());
492
- enrichVar('SLASH_INACTIVITY_TARGET_PERCENTAGE', config.slashInactivityTargetPercentage.toString());
493
- enrichVar('SLASH_INACTIVITY_CONSECUTIVE_EPOCH_THRESHOLD', config.slashInactivityConsecutiveEpochThreshold.toString());
494
- enrichVar('SLASH_INACTIVITY_PENALTY', config.slashInactivityPenalty.toString());
495
- enrichVar('SLASH_PROPOSE_INVALID_ATTESTATIONS_PENALTY', config.slashProposeInvalidAttestationsPenalty.toString());
496
- enrichVar('SLASH_ATTEST_DESCENDANT_OF_INVALID_PENALTY', config.slashAttestDescendantOfInvalidPenalty.toString());
497
- enrichVar('SLASH_UNKNOWN_PENALTY', config.slashUnknownPenalty.toString());
498
- enrichVar('SLASH_INVALID_BLOCK_PENALTY', config.slashBroadcastedInvalidBlockPenalty.toString());
499
- enrichVar('SLASH_OFFENSE_EXPIRATION_ROUNDS', config.slashOffenseExpirationRounds.toString());
500
- enrichVar('SLASH_MAX_PAYLOAD_SIZE', config.slashMaxPayloadSize.toString());
501
- enrichVar('SLASH_GRACE_PERIOD_L2_SLOTS', config.slashGracePeriodL2Slots.toString());
502
- enrichVar('SLASH_EXECUTE_ROUNDS_LOOK_BACK', config.slashExecuteRoundsLookBack.toString());
503
- enrichVar('SENTINEL_ENABLED', config.sentinelEnabled.toString());
504
- enrichVar('TRANSACTIONS_DISABLED', config.disableTransactions.toString());
505
45
  }