Skip to content

Commit 15e481e

Browse files
PhilWindlealexghr
authored andcommitted
chore: Mainnet configuration
1 parent 912e08f commit 15e481e

File tree

2 files changed

+70
-29
lines changed

2 files changed

+70
-29
lines changed

yarn-project/cli/src/config/chain_l2_config.ts

Lines changed: 29 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -291,11 +291,13 @@ export const testnetL2ChainConfig: L2ChainConfig = {
291291
};
292292

293293
export const mainnetL2ChainConfig: L2ChainConfig = {
294+
txPoolDeleteTxsAfterReorg: true,
295+
disableTransactions: true,
296+
294297
l1ChainId: 1,
295298
testAccounts: false,
296299
sponsoredFPC: false,
297300
p2pEnabled: true,
298-
disableTransactions: true,
299301
p2pBootstrapNodes: [],
300302
seqMinTxsPerBlock: 0,
301303
seqMaxTxsPerBlock: 0,
@@ -307,7 +309,6 @@ export const mainnetL2ChainConfig: L2ChainConfig = {
307309
publicIncludeMetrics,
308310
publicMetricsCollectorUrl: 'https://telemetry.alpha-testnet.aztec-labs.com/v1/metrics',
309311
publicMetricsCollectFrom: ['sequencer'],
310-
txPoolDeleteTxsAfterReorg: false,
311312

312313
/** How many seconds an L1 slot lasts. */
313314
ethereumSlotDuration: 12,
@@ -321,54 +322,58 @@ export const mainnetL2ChainConfig: L2ChainConfig = {
321322
lagInEpochs: 2,
322323
/** The number of epochs after an epoch ends that proofs are still accepted. */
323324
aztecProofSubmissionEpochs: 1,
325+
326+
localEjectionThreshold: 196_000n * 10n ** 18n,
324327
/** How many sequencers must agree with a slash for it to be executed. */
325328
slashingQuorum: 65,
326-
327329
slashingRoundSizeInEpochs: 4,
328-
slashingLifetimeInRounds: 40,
329330
slashingExecutionDelayInRounds: 28,
330-
slashingDisableDuration: 5 * 24 * 60 * 60, // 5 days in seconds
331-
slashAmountSmall: 2_000n * 10n ** 18n,
332-
slashAmountMedium: 10_000n * 10n ** 18n,
333-
slashAmountLarge: 50_000n * 10n ** 18n,
331+
slashingLifetimeInRounds: 34,
332+
slashingVetoer: EthAddress.ZERO, // TODO TMNT-329
334333
slashingOffsetInRounds: 2,
334+
335+
slashingDisableDuration: 259_200, // 3 days
335336
slasherFlavor: 'tally',
336-
slashingVetoer: EthAddress.ZERO, // TODO TMNT-329
337+
338+
slashAmountSmall: 2_000n * 10n ** 18n,
339+
slashAmountMedium: 2_000n * 10n ** 18n,
340+
slashAmountLarge: 2_000n * 10n ** 18n,
337341

338342
/** The mana target for the rollup */
339343
manaTarget: 0n,
340344

341-
exitDelaySeconds: 5 * 24 * 60 * 60,
342-
343345
/** The proving cost per mana */
344346
provingCostPerMana: 0n,
345347

346-
ejectionThreshold: 100_000n * 10n ** 18n,
348+
exitDelaySeconds: 4 * 24 * 60 * 60, // 4 days
349+
347350
activationThreshold: 200_000n * 10n ** 18n,
348-
localEjectionThreshold: 196_000n * 10n ** 18n,
351+
ejectionThreshold: 100_000n * 10n ** 18n,
349352

350-
governanceProposerRoundSize: 300, // TODO TMNT-322
351-
governanceProposerQuorum: 151, // TODO TMNT-322
353+
governanceProposerRoundSize: 1000,
354+
governanceProposerQuorum: 600,
352355

353356
// Node slashing config
354357
// TODO TMNT-330
355-
slashMinPenaltyPercentage: 0.5,
356-
slashMaxPenaltyPercentage: 2.0,
357-
slashInactivityTargetPercentage: 0.7,
358+
slashInactivityTargetPercentage: 0.8,
358359
slashInactivityConsecutiveEpochThreshold: 2,
359360
slashInactivityPenalty: 2_000n * 10n ** 18n,
360361
slashPrunePenalty: 0n, // 2_000n * 10n ** 18n, We disable slashing for prune offenses right now
361362
slashDataWithholdingPenalty: 0n, // 2_000n * 10n ** 18n, We disable slashing for data withholding offenses right now
362-
slashProposeInvalidAttestationsPenalty: 50_000n * 10n ** 18n,
363-
slashAttestDescendantOfInvalidPenalty: 50_000n * 10n ** 18n,
363+
slashProposeInvalidAttestationsPenalty: 2_000n * 10n ** 18n,
364+
slashAttestDescendantOfInvalidPenalty: 2_000n * 10n ** 18n,
364365
slashUnknownPenalty: 2_000n * 10n ** 18n,
365-
slashBroadcastedInvalidBlockPenalty: 0n, // 10_000n * 10n ** 18n, Disabled for now until further testing
366-
slashMaxPayloadSize: 50,
367-
slashGracePeriodL2Slots: 32 * 4, // One round from genesis
366+
slashBroadcastedInvalidBlockPenalty: 2_000n * 10n ** 18n, // 10_000n * 10n ** 18n, Disabled for now until further testing
367+
slashGracePeriodL2Slots: 1_200, // One day from deployment
368368
slashOffenseExpirationRounds: 8,
369-
sentinelEnabled: true,
369+
370+
slashMinPenaltyPercentage: 0.5,
371+
slashMaxPenaltyPercentage: 2.0,
372+
slashMaxPayloadSize: 50,
370373
slashExecuteRoundsLookBack: 4,
371374

375+
sentinelEnabled: true,
376+
372377
...DefaultNetworkDBMapSizeConfig,
373378
};
374379

yarn-project/ethereum/src/config.ts

Lines changed: 41 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,21 @@ const StagingIgnitionGovernanceConfiguration = {
156156
minimumVotes: 1250n * 200_000n * 10n ** 18n,
157157
};
158158

159+
const MainnetGovernanceConfiguration = {
160+
proposeConfig: {
161+
lockDelay: 90n * 24n * 60n * 60n,
162+
lockAmount: 258_750_000n * 10n ** 18n,
163+
},
164+
165+
votingDelay: 3n * 24n * 60n * 60n,
166+
votingDuration: 7n * 24n * 60n * 60n,
167+
executionDelay: 7n * 24n * 60n * 60n,
168+
gracePeriod: 7n * 24n * 60n * 60n,
169+
quorum: 2n * 10n ** 17n, // 20%
170+
requiredYeaMargin: 33n * 10n ** 16n, // 33%
171+
minimumVotes: 1000n * 200_000n * 10n ** 18n,
172+
};
173+
159174
export const getGovernanceConfiguration = (networkName: NetworkNames) => {
160175
switch (networkName) {
161176
case 'local':
@@ -166,6 +181,8 @@ export const getGovernanceConfiguration = (networkName: NetworkNames) => {
166181
return TestnetGovernanceConfiguration;
167182
case 'staging-ignition':
168183
return StagingIgnitionGovernanceConfiguration;
184+
case 'mainnet':
185+
return MainnetGovernanceConfiguration;
169186
default:
170187
throw new Error(`Unrecognized network name: ${networkName}`);
171188
}
@@ -182,13 +199,22 @@ const DefaultRewardConfig = {
182199
blockReward: 500n * 10n ** 18n,
183200
};
184201

202+
const MainnetRewardConfig = {
203+
sequencerBps: 7_000,
204+
rewardDistributor: EthAddress.ZERO.toString(),
205+
booster: EthAddress.ZERO.toString(),
206+
blockReward: 400n * 10n ** 18n,
207+
};
208+
185209
export const getRewardConfig = (networkName: NetworkNames) => {
186210
switch (networkName) {
187211
case 'local':
188212
case 'staging-public':
189213
case 'testnet':
190214
case 'staging-ignition':
191215
return DefaultRewardConfig;
216+
case 'mainnet':
217+
return MainnetRewardConfig;
192218
default:
193219
throw new Error(`Unrecognized network name: ${networkName}`);
194220
}
@@ -198,11 +224,11 @@ export const getRewardBoostConfig = () => {
198224
// The reward configuration is specified with a precision of 1e5, and we use the same across
199225
// all networks.
200226
return {
201-
increment: 125000, // 1.25
202-
maxScore: 15000000, // 150
203-
a: 1000, // 0.01
204-
k: 1000000, // 10
205-
minimum: 100000, // 1
227+
increment: 125_000, // 1.25
228+
maxScore: 15_000_000, // 150
229+
a: 1_000, // 0.01
230+
k: 1_000_000, // 10
231+
minimum: 100_000, // 1
206232
};
207233
};
208234

@@ -239,6 +265,14 @@ const StagingIgnitionEntryQueueConfig = {
239265
maxQueueFlushSize: 24n,
240266
};
241267

268+
const MainnetEntryQueueConfig = {
269+
bootstrapValidatorSetSize: 1_000n,
270+
bootstrapFlushSize: 1_000n,
271+
normalFlushSizeMin: 1n,
272+
normalFlushSizeQuotient: 2_048n,
273+
maxQueueFlushSize: 8n,
274+
};
275+
242276
export const getEntryQueueConfig = (networkName: NetworkNames) => {
243277
switch (networkName) {
244278
case 'local':
@@ -249,6 +283,8 @@ export const getEntryQueueConfig = (networkName: NetworkNames) => {
249283
return TestnetEntryQueueConfig;
250284
case 'staging-ignition':
251285
return StagingIgnitionEntryQueueConfig;
286+
case 'mainnet':
287+
return MainnetEntryQueueConfig;
252288
default:
253289
throw new Error(`Unrecognized network name: ${networkName}`);
254290
}

0 commit comments

Comments
 (0)