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
@@ -342,29 +342,26 @@ contract Registry is IRegistry {
342
342
);
343
343
}
344
344
345
-
/**
346
-
* @notice Slashes an operator for breaking a commitment in a protocol they opted into via the optInToSlasher() function. The operator must have already opted into the protocol.
347
-
* @dev The function verifies the commitment was signed by the registered committer from the optInToSlasher() function before calling into the Slasher contract.
348
-
* @dev If the slash amount equals the operator's collateral, the operator will be implicitly unregistered (collateral becomes zero).
349
-
* @dev Reverts if:
350
-
* @dev - The operator has already been deleted (OperatorDeleted)
351
-
* @dev - The fraud proof window has not passed (FraudProofWindowNotMet)
352
-
* @dev - The operator has already unregistered and delay passed (OperatorAlreadyUnregistered)
353
-
* @dev - The slash window has expired (SlashWindowExpired)
354
-
* @dev - The operator has not opted into the slasher (NotOptedIn)
355
-
* @dev - The commitment was not signed by registered committer (UnauthorizedCommitment)
356
-
* @dev - The slash amount exceeds operator's collateral (SlashAmountExceedsCollateral)
357
-
* @param registrationRoot The merkle root generated and stored from the register() function
358
-
* @param commitment The SignedCommitment signed by the delegate's ECDSA key
359
-
* @param evidence Arbitrary evidence to slash the operator, required by the Slasher contract
360
-
* @return slashAmountWei The amount of WEI slashed
361
-
*/
345
+
/// @notice Slashes an operator for breaking a commitment in a protocol they opted into via the optInToSlasher() function. The operator must have already opted into the protocol.
346
+
/// @dev The function verifies the commitment was signed by the registered committer from the optInToSlasher() function before calling into the Slasher contract.
347
+
/// @dev Reverts if:
348
+
/// @dev - The operator has already been deleted (OperatorDeleted)
349
+
/// @dev - The fraud proof window has not passed (FraudProofWindowNotMet)
350
+
/// @dev - The operator has already unregistered and delay passed (OperatorAlreadyUnregistered)
351
+
/// @dev - The slash window has expired (SlashWindowExpired)
352
+
/// @dev - The operator has not opted into the slasher (NotOptedIn)
353
+
/// @dev - The commitment was not signed by registered committer (UnauthorizedCommitment)
354
+
/// @dev - The slash amount exceeds operator's collateral (SlashAmountExceedsCollateral)
355
+
/// @param registrationRoot The merkle root generated and stored from the register() function
356
+
/// @param commitment The SignedCommitment signed by the delegate's ECDSA key
357
+
/// @param evidence Arbitrary evidence to slash the operator, required by the Slasher contract
358
+
/// @return slashAmountWei The amount of WEI slashed
@@ -549,31 +546,33 @@ contract Registry is IRegistry {
549
546
return slashAmountWei;
550
547
}
551
548
552
-
/**
553
-
* @notice Slashes an operator for fraudulently registering a BLS key
554
-
* @dev The function verifies `proof` to first ensure the operator's BLS key is in the registry,
555
-
* then verifies the `registrationSignature` was signed by the same key. If the fraud proof window
556
-
* has passed, the operator's collateral is burned and the challenger is rewarded.
557
-
* @dev If the slash amount equals the operator's collateral, the operator will be implicitly unregistered (collateral becomes zero).
558
-
* @dev The function will revert if:
559
-
* @dev - The operator has already been deleted (OperatorDeleted)
560
-
* @dev - The fraud proof window has not passed (FraudProofWindowNotMet)
561
-
* @dev - The operator has already unregistered (OperatorAlreadyUnregistered)
562
-
* @dev - The proof is invalid (NotRegisteredKey)
563
-
* @dev - The registration signature is invalid (DelegationSignatureInvalid)
564
-
* @param registrationRoot The merkle root generated and stored from the register() function
565
-
* @param reg The registration to verify
566
-
* @param proof The merkle proof to verify the operator's key is in the registry
567
-
* @param leafIndex The index of the leaf in the merkle tree
568
-
* @return collateralWei The amount of WEI slashed
549
+
/**
550
+
*
551
+
* Slashing Functions *
552
+
*
569
553
*/
554
+
555
+
/// @notice Slash an operator for submitting a fraudulent `Registration` in the register() function
556
+
/// @dev To save BLS verification gas costs, the URC optimistically accepts registration signatures. This function allows a challenger to slash the operator by executing the BLS verification to prove the registration is fraudulent.
557
+
/// @dev A successful challenge will transfer `MIN_COLLATERAL / 2` to the challenger, burn `MIN_COLLATERAL / 2`, and then allow the operator to claim their remaining collateral after `SLASH_WINDOW` blocks have elapsed from the `claimSlashedCollateral()` function.
558
+
/// @dev The function will revert if:
559
+
/// @dev - The operator has already been deleted (OperatorDeleted)
560
+
/// @dev - The fraud proof window has expired (FraudProofWindowExpired)
561
+
/// @dev - The operator has not registered (NotRegisteredKey)
562
+
/// @dev - The proof is invalid (FraudProofChallengeInvalid)
563
+
/// @dev - ETH transfer to challenger fails (EthTransferFailed)
564
+
/// @param registrationRoot The merkle root generated and stored from the register() function
565
+
/// @param reg The fraudulent Registration
566
+
/// @param proof The merkle proof to verify the operator's key is in the registry
567
+
/// @param leafIndex The index of the leaf in the merkle tree
568
+
/// @return slashedCollateralWei The amount of GWEI slashed
0 commit comments