Skip to content

Commit ca7082a

Browse files
authored
chore: Mainnet configuration (#17946)
Fix A-28
2 parents 3e449e2 + f4ed8a8 commit ca7082a

File tree

2 files changed

+69
-31
lines changed

2 files changed

+69
-31
lines changed

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

Lines changed: 28 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -362,60 +362,62 @@ export const mainnetL2ChainConfig: L2ChainConfig = {
362362
aztecEpochDuration: 32,
363363
/** The target validator committee size. */
364364
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-
370365
/** The number of epochs to lag behind the current epoch for validator selection. */
371366
lagInEpochs: 2,
367+
/** The number of epochs after an epoch ends that proofs are still accepted. */
368+
aztecProofSubmissionEpochs: 1,
372369

373370
localEjectionThreshold: 196_000n * 10n ** 18n,
374-
slashingDisableDuration: 5 * 24 * 60 * 60,
375-
371+
/** How many sequencers must agree with a slash for it to be executed. */
372+
slashingQuorum: 65,
376373
slashingRoundSizeInEpochs: 4,
377-
slashingLifetimeInRounds: 40,
378374
slashingExecutionDelayInRounds: 28,
379-
slashAmountSmall: 2_000n * 10n ** 18n,
380-
slashAmountMedium: 10_000n * 10n ** 18n,
381-
slashAmountLarge: 50_000n * 10n ** 18n,
375+
slashingLifetimeInRounds: 34,
376+
slashingVetoer: EthAddress.ZERO, // TODO TMNT-329
382377
slashingOffsetInRounds: 2,
378+
379+
slashingDisableDuration: 259_200, // 3 days
383380
slasherFlavor: 'tally',
384-
slashingVetoer: EthAddress.ZERO, // TODO TMNT-329
381+
382+
slashAmountSmall: 2_000n * 10n ** 18n,
383+
slashAmountMedium: 2_000n * 10n ** 18n,
384+
slashAmountLarge: 2_000n * 10n ** 18n,
385385

386386
/** The mana target for the rollup */
387387
manaTarget: 0n,
388388

389-
exitDelaySeconds: 5 * 24 * 60 * 60,
390-
391389
/** The proving cost per mana */
392390
provingCostPerMana: 0n,
393391

394-
ejectionThreshold: 100_000n * 10n ** 18n,
392+
exitDelaySeconds: 4 * 24 * 60 * 60, // 4 days
393+
395394
activationThreshold: 200_000n * 10n ** 18n,
395+
ejectionThreshold: 100_000n * 10n ** 18n,
396396

397-
governanceProposerRoundSize: 300, // TODO TMNT-322
398-
governanceProposerQuorum: 151, // TODO TMNT-322
397+
governanceProposerRoundSize: 1000,
398+
governanceProposerQuorum: 600,
399399

400400
// Node slashing config
401401
// TODO TMNT-330
402-
slashMinPenaltyPercentage: 0.5,
403-
slashMaxPenaltyPercentage: 2.0,
404-
slashInactivityTargetPercentage: 0.7,
402+
slashInactivityTargetPercentage: 0.8,
405403
slashInactivityConsecutiveEpochThreshold: 2,
406404
slashInactivityPenalty: 2_000n * 10n ** 18n,
407405
slashPrunePenalty: 0n, // 2_000n * 10n ** 18n, We disable slashing for prune offenses right now
408406
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,
407+
slashProposeInvalidAttestationsPenalty: 2_000n * 10n ** 18n,
408+
slashAttestDescendantOfInvalidPenalty: 2_000n * 10n ** 18n,
411409
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
410+
slashBroadcastedInvalidBlockPenalty: 2_000n * 10n ** 18n, // 10_000n * 10n ** 18n, Disabled for now until further testing
411+
slashGracePeriodL2Slots: 1_200, // One day from deployment
415412
slashOffenseExpirationRounds: 8,
416-
sentinelEnabled: true,
413+
414+
slashMinPenaltyPercentage: 0.5,
415+
slashMaxPenaltyPercentage: 2.0,
416+
slashMaxPayloadSize: 50,
417417
slashExecuteRoundsLookBack: 4,
418418

419+
sentinelEnabled: true,
420+
419421
...DefaultNetworkDBMapSizeConfig,
420422
};
421423

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':
@@ -170,6 +185,8 @@ export const getGovernanceConfiguration = (networkName: NetworkNames) => {
170185
return TestnetGovernanceConfiguration;
171186
case 'staging-ignition':
172187
return StagingIgnitionGovernanceConfiguration;
188+
case 'mainnet':
189+
return MainnetGovernanceConfiguration;
173190
default:
174191
throw new Error(`Unrecognized network name: ${networkName}`);
175192
}
@@ -186,6 +203,13 @@ const DefaultRewardConfig = {
186203
blockReward: 500n * 10n ** 18n,
187204
};
188205

206+
const MainnetRewardConfig = {
207+
sequencerBps: 7_000,
208+
rewardDistributor: EthAddress.ZERO.toString(),
209+
booster: EthAddress.ZERO.toString(),
210+
blockReward: 400n * 10n ** 18n,
211+
};
212+
189213
export const getRewardConfig = (networkName: NetworkNames) => {
190214
switch (networkName) {
191215
case 'local':
@@ -195,6 +219,8 @@ export const getRewardConfig = (networkName: NetworkNames) => {
195219
case 'testnet':
196220
case 'staging-ignition':
197221
return DefaultRewardConfig;
222+
case 'mainnet':
223+
return MainnetRewardConfig;
198224
default:
199225
throw new Error(`Unrecognized network name: ${networkName}`);
200226
}
@@ -204,11 +230,11 @@ export const getRewardBoostConfig = () => {
204230
// The reward configuration is specified with a precision of 1e5, and we use the same across
205231
// all networks.
206232
return {
207-
increment: 125000, // 1.25
208-
maxScore: 15000000, // 150
209-
a: 1000, // 0.01
210-
k: 1000000, // 10
211-
minimum: 100000, // 1
233+
increment: 125_000, // 1.25
234+
maxScore: 15_000_000, // 150
235+
a: 1_000, // 0.01
236+
k: 1_000_000, // 10
237+
minimum: 100_000, // 1
212238
};
213239
};
214240

@@ -245,6 +271,14 @@ const StagingIgnitionEntryQueueConfig = {
245271
maxQueueFlushSize: 24n,
246272
};
247273

274+
const MainnetEntryQueueConfig = {
275+
bootstrapValidatorSetSize: 1_000n,
276+
bootstrapFlushSize: 1_000n,
277+
normalFlushSizeMin: 1n,
278+
normalFlushSizeQuotient: 2_048n,
279+
maxQueueFlushSize: 8n,
280+
};
281+
248282
export const getEntryQueueConfig = (networkName: NetworkNames) => {
249283
switch (networkName) {
250284
case 'local':
@@ -259,6 +293,8 @@ export const getEntryQueueConfig = (networkName: NetworkNames) => {
259293
return TestnetEntryQueueConfig;
260294
case 'staging-ignition':
261295
return StagingIgnitionEntryQueueConfig;
296+
case 'mainnet':
297+
return MainnetEntryQueueConfig;
262298
default:
263299
throw new Error(`Unrecognized network name: ${networkName}`);
264300
}

0 commit comments

Comments
 (0)