@@ -8,6 +8,12 @@ import {
8
8
ISlashingRegistryCoordinatorErrors
9
9
} from "../../src/interfaces/ISlashingRegistryCoordinator.sol " ;
10
10
11
+ import {
12
+ IRegistryCoordinator,
13
+ IRegistryCoordinatorTypes,
14
+ IRegistryCoordinatorErrors
15
+ } from "../../src/interfaces/IRegistryCoordinator.sol " ;
16
+
11
17
import {IBLSApkRegistryTypes} from "../../src/interfaces/IBLSApkRegistry.sol " ;
12
18
import {QuorumBitmapHistoryLib} from "../../src/libraries/QuorumBitmapHistoryLib.sol " ;
13
19
import {BitmapUtils} from "../../src/libraries/BitmapUtils.sol " ;
@@ -302,7 +308,7 @@ contract RegistryCoordinatorUnitTests_RegisterOperator is RegistryCoordinatorUni
302
308
303
309
quorumNumbersTooLarge[0 ] = 0xC0 ;
304
310
305
- cheats.expectRevert (BitmapUtils.BitmapValueTooLarge .selector );
311
+ cheats.expectRevert (IRegistryCoordinatorErrors.OnlyM2QuorumsAllowed .selector );
306
312
cheats.prank (defaultOperator);
307
313
registryCoordinator.registerOperator (
308
314
quorumNumbersTooLarge, defaultSocket, pubkeyRegistrationParams, emptySig
@@ -317,7 +323,7 @@ contract RegistryCoordinatorUnitTests_RegisterOperator is RegistryCoordinatorUni
317
323
quorumNumbersNotCreated[0 ] = 0x0B ;
318
324
319
325
cheats.prank (defaultOperator);
320
- cheats.expectRevert (BitmapUtils.BitmapValueTooLarge .selector );
326
+ cheats.expectRevert (IRegistryCoordinatorErrors.OnlyM2QuorumsAllowed .selector );
321
327
registryCoordinator.registerOperator (
322
328
quorumNumbersNotCreated, defaultSocket, pubkeyRegistrationParams, emptySig
323
329
);
@@ -395,6 +401,8 @@ contract RegistryCoordinatorUnitTests_RegisterOperator is RegistryCoordinatorUni
395
401
396
402
cheats.expectEmit (true , true , true , true , address (registryCoordinator));
397
403
emit OperatorSocketUpdate (defaultOperatorId, defaultSocket);
404
+ cheats.expectEmit (true , true , true , true , address (registryCoordinator));
405
+ emit OperatorRegistered (defaultOperator, defaultOperatorId);
398
406
cheats.expectEmit (true , true , true , true , address (blsApkRegistry));
399
407
emit OperatorAddedToQuorums (defaultOperator, defaultOperatorId, quorumNumbers);
400
408
for (uint256 i = 0 ; i < quorumNumbers.length ; i++ ) {
@@ -405,8 +413,6 @@ contract RegistryCoordinatorUnitTests_RegisterOperator is RegistryCoordinatorUni
405
413
cheats.expectEmit (true , true , true , true , address (indexRegistry));
406
414
emit QuorumIndexUpdate (defaultOperatorId, uint8 (quorumNumbers[i]), 0 );
407
415
}
408
- cheats.expectEmit (true , true , true , true , address (registryCoordinator));
409
- emit OperatorRegistered (defaultOperator, defaultOperatorId);
410
416
411
417
uint256 gasBefore = gasleft ();
412
418
cheats.prank (defaultOperator);
@@ -636,6 +642,8 @@ contract RegistryCoordinatorUnitTests_RegisterOperator is RegistryCoordinatorUni
636
642
637
643
cheats.expectEmit (true , true , true , true , address (registryCoordinator));
638
644
emit OperatorSocketUpdate (defaultOperatorId, defaultSocket);
645
+ cheats.expectEmit (true , true , true , true , address (registryCoordinator));
646
+ emit OperatorRegistered (defaultOperator, defaultOperatorId);
639
647
cheats.expectEmit (true , true , true , true , address (blsApkRegistry));
640
648
emit OperatorAddedToQuorums (defaultOperator, defaultOperatorId, quorumNumbers);
641
649
cheats.expectEmit (true , true , true , true , address (stakeRegistry));
@@ -1707,6 +1715,9 @@ contract RegistryCoordinatorUnitTests_RegisterOperatorWithChurn is RegistryCoord
1707
1715
cheats.expectEmit (true , true , true , true , address (registryCoordinator));
1708
1716
emit OperatorSocketUpdate (operatorToRegisterId, defaultSocket);
1709
1717
1718
+ cheats.expectEmit (true , true , true , true , address (registryCoordinator));
1719
+ emit OperatorRegistered (operatorToRegister, operatorToRegisterId);
1720
+
1710
1721
cheats.expectEmit (true , true , true , true , address (blsApkRegistry));
1711
1722
emit OperatorAddedToQuorums (operatorToRegister, operatorToRegisterId, quorumNumbers);
1712
1723
cheats.expectEmit (true , true , true , false , address (stakeRegistry));
@@ -1725,8 +1736,6 @@ contract RegistryCoordinatorUnitTests_RegisterOperatorWithChurn is RegistryCoord
1725
1736
emit OperatorStakeUpdate (operatorToKickId, defaultQuorumNumber, 0 );
1726
1737
cheats.expectEmit (true , true , true , true , address (indexRegistry));
1727
1738
emit QuorumIndexUpdate (operatorToRegisterId, defaultQuorumNumber, numOperators - 1 );
1728
- cheats.expectEmit (true , true , true , true , address (registryCoordinator));
1729
- emit OperatorRegistered (operatorToRegister, operatorToRegisterId);
1730
1739
1731
1740
{
1732
1741
ISignatureUtils.SignatureWithSaltAndExpiry memory emptyAVSRegSig;
@@ -2394,12 +2403,26 @@ contract RegistryCoordinatorUnitTests_BeforeMigration is RegistryCoordinatorUnit
2394
2403
});
2395
2404
uint32 lookAheadPeriod = 100 ;
2396
2405
2406
+ assertEq (
2407
+ registryCoordinator.quorumCount (),
2408
+ 0 ,
2409
+ "No quorums should exist before "
2410
+ );
2411
+
2397
2412
// Attempt to create quorum with slashable stake type before enabling operator sets
2398
2413
cheats.prank (registryCoordinatorOwner);
2399
- cheats.expectRevert ();
2400
2414
registryCoordinator.createSlashableStakeQuorum (
2401
2415
operatorSetParams, minimumStake, strategyParams, lookAheadPeriod
2402
2416
);
2417
+ assertEq (
2418
+ registryCoordinator.quorumCount (),
2419
+ 1 ,
2420
+ "New quorum 0 should be created "
2421
+ );
2422
+ assertFalse (
2423
+ registryCoordinator.isM2Quorum (0 ),
2424
+ "Quorum created should not be an M2 quorum "
2425
+ );
2403
2426
}
2404
2427
}
2405
2428
@@ -2744,8 +2767,6 @@ contract RegistryCoordinatorUnitTests_AfterMigration is RegistryCoordinatorUnitT
2744
2767
function test_deregisterHook_Reverts_WhenNotALM () public {
2745
2768
_deployMockEigenLayerAndAVS (0 );
2746
2769
2747
- assertTrue (registryCoordinator.operatorSetsEnabled (), "operatorSetsEnabled should be true " );
2748
-
2749
2770
// Create quorum params
2750
2771
ISlashingRegistryCoordinatorTypes.OperatorSetParam memory operatorSetParams =
2751
2772
ISlashingRegistryCoordinatorTypes.OperatorSetParam ({
@@ -2764,6 +2785,9 @@ contract RegistryCoordinatorUnitTests_AfterMigration is RegistryCoordinatorUnitT
2764
2785
cheats.prank (registryCoordinatorOwner);
2765
2786
registryCoordinator.createTotalDelegatedStakeQuorum (operatorSetParams, 0 , strategyParams);
2766
2787
2788
+ // operator sets should be enabled after creating a new quorum
2789
+ assertTrue (registryCoordinator.operatorSetsEnabled (), "operatorSetsEnabled should be true " );
2790
+
2767
2791
// Prank as allocation manager and call register hook
2768
2792
uint32 [] memory operatorSetIds = new uint32 [](1 );
2769
2793
operatorSetIds[0 ] = 0 ;
0 commit comments