You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Adds some missing features to slashing:
- Adds support for the slashValidatorNever and slashValidatorAlways
config settings (now EthAddress lists) so that validators in those
lists are never/always slashed. All validators in the local keystore are
automatically added to the "never" list.
- Checks if a slash payload is vetoed before trying to execute it, to
avoid running an unnecessary simulation. This is handled on the
slasher client directly.
- Adds expiration for offenses and payloads to avoid cluttering the
local stores. Removes unused slashPayloadTtl setting.
- Avoids posting committee addresses during executeRound for committees
that are not slashed, in order to save calldata gas.
Copy file name to clipboardExpand all lines: yarn-project/slasher/README.md
+31-8Lines changed: 31 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -32,6 +32,7 @@ Key characteristics:
32
32
- Requires quorum to execute slashing
33
33
- L1 contract determines which offenses reach consensus
34
34
- Execution happens after a delay period for review
35
+
- Slash payloads can be vetoed during the execution delay period
35
36
36
37
### Empire Model
37
38
@@ -56,13 +57,14 @@ Common interface implemented by both tally and empire clients. Provides methods
56
57
#### SlashOffensesCollector
57
58
Collects slashable offenses from watchers and stores them in the offenses store. Features:
58
59
- Subscribes to `WANT_TO_SLASH_EVENT` from watchers
59
-
- Manages offense lifecycle and expiration
60
+
- Manages offense lifecycle and automatic expiration
60
61
61
62
#### SlasherOffensesStore
62
63
Persistent storage for offenses. Tracks:
63
64
- Pending offenses awaiting slashing
64
65
- Executed offenses to prevent double slashing
65
66
- Round-based offense organization
67
+
- Automatic expiration of old offenses based on configurable rounds
66
68
67
69
#### SlashRoundMonitor
68
70
Monitors slashing rounds and triggers actions on round transitions:
@@ -85,6 +87,15 @@ Actions returned by the slasher client to the SequencerPublisher:
85
87
4.**Action Execution**: SequencerPublisher receives actions and executes them on L1
86
88
5.**Round Monitoring**: SlashRoundMonitor tracks rounds and triggers execution when conditions are met
87
89
90
+
## Vetoing
91
+
92
+
The slashing system includes a veto mechanism that allows designated vetoers to block slash payloads during the execution delay period. When a slash payload is ready for execution, the system first checks if it has been vetoed before proceeding.
93
+
94
+
Key features:
95
+
- Slash payloads can be vetoed by authorized addresses on the L1 slasher contract
96
+
- Veto checks are performed automatically before execution attempts
97
+
- The veto mechanism provides a safety valve for incorrectly proposed slashes
98
+
88
99
## Slashable Offenses
89
100
90
101
### DATA_WITHHOLDING
@@ -132,15 +143,27 @@ Actions returned by the slasher client to the SequencerPublisher:
132
143
133
144
## Configuration
134
145
135
-
### Slasher Configuration
136
-
-`slashGracePeriodL2Slots`: Number of initial L2 slots where slashing is disabled
137
-
-`slashMaxPayloadSize`: Maximum size of slash payloads (empire model)
138
-
-`slashingRoundSize`: Number of slots per slashing round
146
+
### L1 System Settings (L1ContractsConfig)
147
+
These settings are deployed with the L1 contracts and apply system-wide to the protocol:
148
+
149
+
-`slashingRoundSize`: Number of slots per slashing round (default: 192, must be multiple of epochs)
139
150
-`slashingQuorumSize`: Votes required to slash (tally model)
140
151
-`slashingOffsetInRounds`: How many rounds to look back for offenses (tally model)
141
152
-`slashingExecutionDelayInRounds`: Rounds to wait before execution
142
153
-`slashingLifetimeInRounds`: Maximum age of executable rounds
143
-
-`slashingUnit`: Base slashing amount per unit
154
+
-`slashingAmounts`: Valid values for each individual slash (tally model)
155
+
156
+
### Local Node Configuration (SlasherConfig)
157
+
These settings are configured locally on each validator node:
144
158
145
-
### Environment Variables
146
-
-`SLASHER_CLIENT_TYPE`: Select between 'tally' or 'empire' (default: 'tally')
159
+
-`slashGracePeriodL2Slots`: Number of initial L2 slots where slashing is disabled
160
+
-`slashMaxPayloadSize`: Maximum size of slash payloads (empire model)
161
+
-`slashOffenseExpirationRounds`: Number of rounds after which pending offenses expire
162
+
-`slashValidatorsAlways`: Array of validator addresses that should always be slashed
163
+
-`slashValidatorsNever`: Array of validator addresses that should never be slashed (own validator addresses are automatically added to this list)
164
+
-`slashPrunePenalty`: Penalty for DATA_WITHHOLDING and VALID_EPOCH_PRUNED offenses
165
+
-`slashInactivityPenalty`: Penalty for INACTIVITY offenses
166
+
-`slashBroadcastedInvalidBlockPenalty`: Penalty for broadcasting invalid blocks
167
+
-`slashProposeInvalidAttestationsPenalty`: Penalty for proposing with insufficient/incorrect attestations
168
+
-`slashAttestDescendantOfInvalidPenalty`: Penalty for attesting to descendants of invalid blocks
169
+
-`slashUnknownPenalty`: Default penalty for unknown offense types
0 commit comments