-
Notifications
You must be signed in to change notification settings - Fork 110
feat: slashing audit fixes #475
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
**Motivation:** Per Hexens Eigen2-2, The current rate limit logic allows ejection beyond the allowed limit. **Modifications:** Modify the ejection logic such that when the caller is the ejector, do not automatically eject the first operator regardless of limit. **Result:** Proper rate limit assertions.
**Motivation:** The `StakeRegistry` is missing a constraint check for modification of lookahead time of slashable quorum. This results in the Lookahead period potentially being invalid. **Modifications:** Update `_setLookAheadPeriod` to revert if the `_lookaheadBlocks` is greater than the `DEALLOCATION_DELAY`. Note that we'll also have to update this check in `_createQuorum` since it does a `>=` check. Operators are slashable for the entire delay, inclusive of the last block. **Result:** Proper constraints.
NOTE: #464 was merged to wrong target **Motivation:** It is possible to break the `maxOperatorCount` invariant by doing the following: Let's assume there are two quorums, 1 and 2, with a `maxOperatorCount` of 2. 1. Alice & Bob register for quorum 1 2. Bob registers for quorum 2 3. Bob deregisters from quorum 1, Charlie enters 4. Quorum 1 Members: Alice/Charlie. Quorum 2 members: Bob 5. Eve creates a churn registration that exits Bob. Quorum 1 has 3 members. This works just fine since we allow a churn to occur if the `operatorToKick` is registered to the AVS (not the quorum): https://github.com/Layr-Labs/eigenlayer-middleware/blob/f5adbcac55d9336cd646ce71bc467aa7e20f1a12/src/SlashingRegistryCoordinator.sol#L405-L408 Although this assumes that the `churnApprover` is buggy, we should still be enforcing that you are churning a user if they are registered for the quorum. **Modifications:** Require that the `operatorToKick` is registered for the quorum. **Result:** Stricter churn guarantees.
**Motivation:** An operator is slashable for at least `DEALLOCATION_DELAY`. The check for the lookahead period should be exactly this amount, not less. **Modifications:** Update check for `lookAheadPeriod` to be `<=DEALLOCATION_DELAY`. **Result:** Symmetric checks with #463
**Motivation:** In `registerOperator` for the `NORMAL` registration type, we validate the quorums' operator count twice, once within `_registerOperator` (since we pass in `checkMaxOperatorCount: true`) and once after. This is redundant. **Modifications:** Remove redundant check **Result:** Gas savings + cleaner code
**Motivation:** `ServiceManagerBase` imported `LibMergeSort` **Modifications:** Remove unused import. **Result:** Only used imports.
**Motivation:** The stale stakes flag is buggy since it doesn't properly get the `quorumUpdateBlockNumber` in the given range. The fix is to add checkpointed storage for the latest quorum update block number. Since we are moving towards a cert-verifier world, it's simpler to remove this feature rather than ship checkpointed storage OR broken code. **Modifications:** Removed `staleStakesForbidden`. **Result:** Cleaner code
chore: fix naming
e43b6a9
to
bdc6eea
Compare
pakim249CAL
approved these changes
May 7, 2025
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Motivation:
Middleware slashing audit fixes from Hexens and Dedaub.
Modifications:
Medium Sev
Low Sev
BLSSignatureChecker
Informational/Docs
Result:
Audit fixes applied to slashing.