@@ -232,27 +232,6 @@ contract SlashingRegistryCoordinator is
232232 _deregisterOperator (operator, quorumNumbers);
233233 }
234234
235- /**
236- * @notice Updates the StakeRegistry's view of one or more operators' stakes. If any operator
237- * is found to be below the minimum stake for the quorum, they are deregistered.
238- * @dev stakes are queried from the Eigenlayer core DelegationManager contract
239- * @param operators a list of operator addresses to update
240- */
241- function updateOperators (
242- address [] memory operators
243- ) external onlyWhenNotPaused (PAUSED_UPDATE_OPERATOR) {
244- for (uint256 i = 0 ; i < operators.length ; i++ ) {
245- address operator = operators[i];
246- OperatorInfo memory operatorInfo = _operatorInfo[operator];
247- bytes32 operatorId = operatorInfo.operatorId;
248-
249- // Update the operator's stake for their active quorums
250- uint192 currentBitmap = _currentOperatorBitmap (operatorId);
251- bytes memory quorumsToUpdate = BitmapUtils.bitmapToBytesArray (currentBitmap);
252- _updateOperator (operator, operatorInfo, quorumsToUpdate);
253- }
254- }
255-
256235 /**
257236 * @notice For each quorum in `quorumNumbers`, updates the StakeRegistry's view of ALL its registered operators' stakes.
258237 * Each quorum's `quorumUpdateBlockNumber` is also updated, which tracks the most recent block number when ALL registered
@@ -289,6 +268,7 @@ contract SlashingRegistryCoordinator is
289268 QuorumOperatorCountMismatch ()
290269 );
291270
271+ bytes32 [] memory operatorIds = new bytes32 [](currQuorumOperators.length );
292272 address prevOperatorAddress = address (0 );
293273 // For each operator:
294274 // - check that they are registered for this quorum
@@ -297,11 +277,9 @@ contract SlashingRegistryCoordinator is
297277 for (uint256 j = 0 ; j < currQuorumOperators.length ; ++ j) {
298278 address operator = currQuorumOperators[j];
299279
300- OperatorInfo memory operatorInfo = _operatorInfo[operator];
301- bytes32 operatorId = operatorInfo.operatorId;
302-
280+ operatorIds[j] = _operatorInfo[operator].operatorId;
303281 {
304- uint192 currentBitmap = _currentOperatorBitmap (operatorId );
282+ uint192 currentBitmap = _currentOperatorBitmap (operatorIds[j] );
305283 // Check that the operator is registered
306284 require (
307285 BitmapUtils.isSet (currentBitmap, quorumNumber), NotRegisteredForQuorum ()
@@ -310,10 +288,17 @@ contract SlashingRegistryCoordinator is
310288 require (operator > prevOperatorAddress, NotSorted ());
311289 }
312290
313- // Update the operator
314- _updateOperator (operator, operatorInfo, quorumNumbers[i:i + 1 ]);
315291 prevOperatorAddress = operator;
316292 }
293+ bytes memory quorumNumberBytes = new bytes (1 );
294+ quorumNumberBytes[0 ] = bytes1 (quorumNumber);
295+ bool [] memory shouldBeDeregistered =
296+ stakeRegistry.updateOperatorsStake (currQuorumOperators, operatorIds, quorumNumber);
297+ for (uint256 j = 0 ; j < currQuorumOperators.length ; ++ j) {
298+ if (shouldBeDeregistered[j]) {
299+ _deregisterOperator (currQuorumOperators[j], quorumNumberBytes);
300+ }
301+ }
317302
318303 // Update timestamp that all operators in quorum have been updated all at once
319304 quorumUpdateBlockNumber[quorumNumber] = block .number ;
@@ -491,7 +476,10 @@ contract SlashingRegistryCoordinator is
491476 if (checkMaxOperatorCount) {
492477 for (uint256 i = 0 ; i < quorumNumbers.length ; i++ ) {
493478 OperatorSetParam memory operatorSetParams = _quorumParams[uint8 (quorumNumbers[i])];
494- require (results.numOperatorsPerQuorum[i] <= operatorSetParams.maxOperatorCount, MaxQuorumsReached ());
479+ require (
480+ results.numOperatorsPerQuorum[i] <= operatorSetParams.maxOperatorCount,
481+ MaxQuorumsReached ()
482+ );
495483 }
496484 }
497485
@@ -521,14 +509,13 @@ contract SlashingRegistryCoordinator is
521509
522510 // Register the operator in each of the registry contracts and update the operator's
523511 // quorum bitmap and registration status
524- RegisterResults memory results =
525- _registerOperator ({
526- operator: operator,
527- operatorId: operatorId,
528- quorumNumbers: quorumNumbers,
529- socket: socket,
530- checkMaxOperatorCount: false
531- });
512+ RegisterResults memory results = _registerOperator ({
513+ operator: operator,
514+ operatorId: operatorId,
515+ quorumNumbers: quorumNumbers,
516+ socket: socket,
517+ checkMaxOperatorCount: false
518+ });
532519
533520 // Check that each quorum's operator count is below the configured maximum. If the max
534521 // is exceeded, use `operatorKickParams` to deregister an existing operator to make space
@@ -615,7 +602,10 @@ contract SlashingRegistryCoordinator is
615602 * @param operator The operator to deregister
616603 * @param quorumNumbers The quorum numbers the operator is force-deregistered from
617604 */
618- function _forceDeregisterOperator (address operator , bytes memory quorumNumbers ) internal virtual {
605+ function _forceDeregisterOperator (
606+ address operator ,
607+ bytes memory quorumNumbers
608+ ) internal virtual {
619609 allocationManager.deregisterFromOperatorSets (
620610 IAllocationManagerTypes.DeregisterParams ({
621611 operator: operator,
@@ -712,32 +702,6 @@ contract SlashingRegistryCoordinator is
712702 );
713703 }
714704
715- /**
716- * @notice Updates the StakeRegistry's view of the operator's stake in one or more quorums.
717- * For any quorums where the StakeRegistry finds the operator is under the configured minimum
718- * stake, `quorumsToRemove` is returned and used to deregister the operator from those quorums
719- * @dev does nothing if operator is not registered for any quorums.
720- */
721- function _updateOperator (
722- address operator ,
723- OperatorInfo memory operatorInfo ,
724- bytes memory quorumsToUpdate
725- ) internal {
726- if (operatorInfo.status != OperatorStatus.REGISTERED) {
727- return ;
728- }
729- bytes32 operatorId = operatorInfo.operatorId;
730- uint192 quorumsToRemove =
731- stakeRegistry.updateOperatorStake (operator, operatorId, quorumsToUpdate);
732-
733- if (! quorumsToRemove.isEmpty ()) {
734- _deregisterOperator ({
735- operator: operator,
736- quorumNumbers: BitmapUtils.bitmapToBytesArray (quorumsToRemove)
737- });
738- }
739- }
740-
741705 /**
742706 * @notice Returns the stake threshold required for an incoming operator to replace an existing operator
743707 * The incoming operator must have more stake than the return value.
@@ -950,7 +914,7 @@ contract SlashingRegistryCoordinator is
950914 function _afterCreateQuorum (
951915 uint8 quorumNumber
952916 ) internal virtual {}
953-
917+
954918 /// @dev Hook to allow for any pre-register logic in `_registerOperator`
955919 function _beforeRegisterOperator (
956920 address operator ,
0 commit comments