@@ -34,6 +34,40 @@ export type L2ChainConfig = L1ContractsConfig &
3434 sentinelEnabled : boolean ;
3535 } ;
3636
37+ const DefaultSlashConfig = {
38+ /** Tally-style slashing */
39+ slasherFlavor : 'tally' ,
40+ /** Allow one round for vetoing */
41+ slashingExecutionDelayInRounds : 1 ,
42+ /** How long for a slash payload to be executed */
43+ slashingLifetimeInRounds : 5 ,
44+ /** Allow 2 rounds to discover faults */
45+ slashingOffsetInRounds : 2 ,
46+ /** No slash vetoer */
47+ slashingVetoer : EthAddress . ZERO ,
48+ /** Use default slash amounts */
49+ slashAmountSmall : DefaultL1ContractsConfig . slashAmountSmall ,
50+ slashAmountMedium : DefaultL1ContractsConfig . slashAmountMedium ,
51+ slashAmountLarge : DefaultL1ContractsConfig . slashAmountLarge ,
52+
53+ // Slashing stuff
54+ slashMinPenaltyPercentage : 0.5 ,
55+ slashMaxPenaltyPercentage : 2.0 ,
56+ slashInactivityTargetPercentage : 0.7 ,
57+ slashInactivityConsecutiveEpochThreshold : 1 ,
58+ slashInactivityPenalty : DefaultL1ContractsConfig . slashAmountSmall ,
59+ slashPrunePenalty : DefaultL1ContractsConfig . slashAmountSmall ,
60+ slashDataWithholdingPenalty : DefaultL1ContractsConfig . slashAmountSmall ,
61+ slashProposeInvalidAttestationsPenalty : DefaultL1ContractsConfig . slashAmountLarge ,
62+ slashAttestDescendantOfInvalidPenalty : DefaultL1ContractsConfig . slashAmountLarge ,
63+ slashUnknownPenalty : DefaultL1ContractsConfig . slashAmountSmall ,
64+ slashBroadcastedInvalidBlockPenalty : DefaultL1ContractsConfig . slashAmountMedium ,
65+ slashMaxPayloadSize : 50 ,
66+ slashGracePeriodL2Slots : 32 * 2 , // Two epochs from genesis
67+ slashOffenseExpirationRounds : 8 ,
68+ sentinelEnabled : true ,
69+ } satisfies Partial < L2ChainConfig > ;
70+
3771export const stagingIgnitionL2ChainConfig : L2ChainConfig = {
3872 l1ChainId : 11155111 ,
3973 testAccounts : true ,
@@ -55,6 +89,7 @@ export const stagingIgnitionL2ChainConfig: L2ChainConfig = {
5589 publicMetricsCollectFrom : [ 'sequencer' ] ,
5690
5791 ...DefaultL1ContractsConfig ,
92+ ...DefaultSlashConfig ,
5893
5994 /** How many seconds an L1 slot lasts. */
6095 ethereumSlotDuration : 12 ,
@@ -70,26 +105,6 @@ export const stagingIgnitionL2ChainConfig: L2ChainConfig = {
70105 manaTarget : 0n ,
71106 /** The proving cost per mana */
72107 provingCostPerMana : 0n ,
73-
74- slasherFlavor : 'none' ,
75- slashAmountSmall : 0n ,
76- slashAmountMedium : 0n ,
77- slashAmountLarge : 0n ,
78- slashMinPenaltyPercentage : 0.5 ,
79- slashMaxPenaltyPercentage : 200 ,
80- slashInactivityTargetPercentage : 0 ,
81- slashInactivityConsecutiveEpochThreshold : 1 ,
82- slashInactivityPenalty : 0n ,
83- slashPrunePenalty : 0n ,
84- slashDataWithholdingPenalty : 0n ,
85- slashProposeInvalidAttestationsPenalty : 0n ,
86- slashAttestDescendantOfInvalidPenalty : 0n ,
87- slashBroadcastedInvalidBlockPenalty : 0n ,
88- slashMaxPayloadSize : 50 ,
89- slashGracePeriodL2Slots : 0 ,
90- slashUnknownPenalty : 0n ,
91- slashOffenseExpirationRounds : 10 ,
92- sentinelEnabled : false ,
93108} ;
94109
95110export const stagingPublicL2ChainConfig : L2ChainConfig = {
@@ -139,37 +154,8 @@ export const stagingPublicL2ChainConfig: L2ChainConfig = {
139154 provingCostPerMana : DefaultL1ContractsConfig . provingCostPerMana ,
140155 /** Exit delay for stakers */
141156 exitDelaySeconds : DefaultL1ContractsConfig . exitDelaySeconds ,
142- /** Tally-style slashing */
143- slasherFlavor : 'tally' ,
144- /** Allow one round for vetoing */
145- slashingExecutionDelayInRounds : 1 ,
146- /** How long for a slash payload to be executed */
147- slashingLifetimeInRounds : 5 ,
148- /** Allow 2 rounds to discover faults */
149- slashingOffsetInRounds : 2 ,
150- /** No slash vetoer */
151- slashingVetoer : EthAddress . ZERO ,
152- /** Use default slash amounts */
153- slashAmountSmall : DefaultL1ContractsConfig . slashAmountSmall ,
154- slashAmountMedium : DefaultL1ContractsConfig . slashAmountMedium ,
155- slashAmountLarge : DefaultL1ContractsConfig . slashAmountLarge ,
156157
157- // Slashing stuff
158- slashMinPenaltyPercentage : 0.5 ,
159- slashMaxPenaltyPercentage : 2.0 ,
160- slashInactivityTargetPercentage : 0.7 ,
161- slashInactivityConsecutiveEpochThreshold : 1 ,
162- slashInactivityPenalty : DefaultL1ContractsConfig . slashAmountSmall ,
163- slashPrunePenalty : DefaultL1ContractsConfig . slashAmountSmall ,
164- slashDataWithholdingPenalty : DefaultL1ContractsConfig . slashAmountSmall ,
165- slashProposeInvalidAttestationsPenalty : DefaultL1ContractsConfig . slashAmountLarge ,
166- slashAttestDescendantOfInvalidPenalty : DefaultL1ContractsConfig . slashAmountLarge ,
167- slashUnknownPenalty : DefaultL1ContractsConfig . slashAmountSmall ,
168- slashBroadcastedInvalidBlockPenalty : DefaultL1ContractsConfig . slashAmountMedium ,
169- slashMaxPayloadSize : 50 ,
170- slashGracePeriodL2Slots : 32 * 2 , // Two epochs from genesis
171- slashOffenseExpirationRounds : 8 ,
172- sentinelEnabled : true ,
158+ ...DefaultSlashConfig ,
173159} ;
174160
175161export const testnetL2ChainConfig : L2ChainConfig = {
@@ -219,37 +205,8 @@ export const testnetL2ChainConfig: L2ChainConfig = {
219205 provingCostPerMana : DefaultL1ContractsConfig . provingCostPerMana ,
220206 /** Exit delay for stakers */
221207 exitDelaySeconds : DefaultL1ContractsConfig . exitDelaySeconds ,
222- /** Tally-style slashing */
223- slasherFlavor : 'tally' ,
224- /** Allow one round for vetoing */
225- slashingExecutionDelayInRounds : 1 ,
226- /** How long for a slash payload to be executed */
227- slashingLifetimeInRounds : 5 ,
228- /** Allow 2 rounds to discover faults */
229- slashingOffsetInRounds : 2 ,
230- /** No slash vetoer */
231- slashingVetoer : EthAddress . ZERO ,
232- /** Use default slash amounts */
233- slashAmountSmall : DefaultL1ContractsConfig . slashAmountSmall ,
234- slashAmountMedium : DefaultL1ContractsConfig . slashAmountMedium ,
235- slashAmountLarge : DefaultL1ContractsConfig . slashAmountLarge ,
236208
237- // Slashing stuff
238- slashMinPenaltyPercentage : 0.5 ,
239- slashMaxPenaltyPercentage : 2.0 ,
240- slashInactivityTargetPercentage : 0.7 ,
241- slashInactivityConsecutiveEpochThreshold : 1 ,
242- slashInactivityPenalty : DefaultL1ContractsConfig . slashAmountSmall ,
243- slashPrunePenalty : DefaultL1ContractsConfig . slashAmountSmall ,
244- slashDataWithholdingPenalty : DefaultL1ContractsConfig . slashAmountSmall ,
245- slashProposeInvalidAttestationsPenalty : DefaultL1ContractsConfig . slashAmountLarge ,
246- slashAttestDescendantOfInvalidPenalty : DefaultL1ContractsConfig . slashAmountLarge ,
247- slashUnknownPenalty : DefaultL1ContractsConfig . slashAmountSmall ,
248- slashBroadcastedInvalidBlockPenalty : DefaultL1ContractsConfig . slashAmountMedium ,
249- slashMaxPayloadSize : 50 ,
250- slashGracePeriodL2Slots : 32 * 2 , // Two epochs from genesis
251- slashOffenseExpirationRounds : 8 ,
252- sentinelEnabled : true ,
209+ ...DefaultSlashConfig ,
253210} ;
254211
255212const BOOTNODE_CACHE_DURATION_MS = 60 * 60 * 1000 ; // 1 hour;
0 commit comments