@@ -6,6 +6,7 @@ import {ISignatureUtils} from "eigenlayer-contracts/src/contracts/interfaces/ISi
66import {IAVSDirectory } from "eigenlayer-contracts/src/contracts/interfaces/IAVSDirectory.sol " ;
77import {IStrategy } from "eigenlayer-contracts/src/contracts/interfaces/IStrategy.sol " ;
88import { IAllocationManager, OperatorSet, IAllocationManagerTypes} from "eigenlayer-contracts/src/contracts/interfaces/IAllocationManager.sol " ;
9+ import { AllocationManager } from "eigenlayer-contracts/src/contracts/core/AllocationManager.sol " ;
910import {ISocketUpdater} from "./interfaces/ISocketUpdater.sol " ;
1011import {IBLSApkRegistry} from "./interfaces/IBLSApkRegistry.sol " ;
1112import {IStakeRegistry, StakeType} from "./interfaces/IStakeRegistry.sol " ;
@@ -479,6 +480,40 @@ contract RegistryCoordinator is
479480 operatorInfo.status == OperatorStatus.REGISTERED && ! quorumsToRemove.isEmpty ()
480481 && quorumsToRemove.isSubsetOf (currentBitmap)
481482 ) {
483+ // If using operator sets, call out to AllocationManager to eject operator
484+ if (isUsingOperatorSets ()) {
485+ // Count non-M2 quorums to size array
486+ uint256 operatorSetIdCount;
487+ for (uint256 i = 0 ; i < quorumNumbers.length ; i++ ) {
488+ if (! isM2Quorum[uint8 (quorumNumbers[i])]) {
489+ operatorSetIdCount++ ;
490+ }
491+ }
492+
493+ // Get operator sets for quorums being removed
494+ uint32 [] memory operatorSetIds = new uint32 [](quorumNumbers.length );
495+ uint256 operatorSetIndex = 0 ;
496+ for (uint256 i = 0 ; i < quorumNumbers.length ; i++ ) {
497+ if (! isM2Quorum[uint8 (quorumNumbers[i])]) {
498+ operatorSetIds[operatorSetIndex] = uint8 (quorumNumbers[i]);
499+ operatorSetIndex++ ;
500+ }
501+ }
502+
503+ assembly {
504+ mstore (operatorSetIds, operatorSetIdCount)
505+ }
506+
507+ // Call AllocationManager to deregister operator from sets
508+ AllocationManager (serviceManager.allocationManager ()).deregisterFromOperatorSets (
509+ IAllocationManagerTypes.DeregisterParams ({
510+ operator: operator,
511+ avs: address (serviceManager),
512+ operatorSetIds: operatorSetIds
513+ })
514+ );
515+ }
516+
482517 _deregisterOperator ({operator: operator, quorumNumbers: quorumNumbers});
483518 }
484519 }
0 commit comments