Skip to content

Commit cb98405

Browse files
authored
fix: dealloc delay inquality on quorum creation (#468)
**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
1 parent 3419d2a commit cb98405

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

src/SlashingRegistryCoordinator.sol

+2-1
Original file line numberDiff line numberDiff line change
@@ -838,7 +838,8 @@ contract SlashingRegistryCoordinator is
838838
} else if (stakeType == IStakeRegistryTypes.StakeType.TOTAL_SLASHABLE) {
839839
// For slashable stake quorums, ensure lookAheadPeriod is less than DEALLOCATION_DELAY
840840
require(
841-
AllocationManager(address(allocationManager)).DEALLOCATION_DELAY() > lookAheadPeriod,
841+
lookAheadPeriod
842+
<= AllocationManager(address(allocationManager)).DEALLOCATION_DELAY(),
842843
LookAheadPeriodTooLong()
843844
);
844845
stakeRegistry.initializeSlashableStakeQuorum(

test/unit/SlashingRegistryCoordinatorUnit.t.sol

+1-1
Original file line numberDiff line numberDiff line change
@@ -735,7 +735,7 @@ contract SlashingRegistryCoordinator_CreateSlashableStakeQuorum is
735735
uint32 deallocationDelay =
736736
AllocationManager(address(coreDeployment.allocationManager)).DEALLOCATION_DELAY();
737737

738-
uint32 tooLongLookAheadPeriod = deallocationDelay;
738+
uint32 tooLongLookAheadPeriod = deallocationDelay + 1;
739739

740740
vm.prank(proxyAdminOwner);
741741
vm.expectRevert(LookAheadPeriodTooLong.selector);

0 commit comments

Comments
 (0)