@@ -3,12 +3,12 @@ pragma solidity ^0.8.12;
33
44import {IPauserRegistry} from "eigenlayer-contracts/src/contracts/interfaces/IPauserRegistry.sol " ;
55import {ISignatureUtils} from "eigenlayer-contracts/src/contracts/interfaces/ISignatureUtils.sol " ;
6- import {ISocketUpdater} from "./interfaces/ISocketUpdater.sol " ;
76import {IBLSApkRegistry} from "./interfaces/IBLSApkRegistry.sol " ;
87import {IStakeRegistry} from "./interfaces/IStakeRegistry.sol " ;
98import {IIndexRegistry} from "./interfaces/IIndexRegistry.sol " ;
109import {IServiceManager} from "./interfaces/IServiceManager.sol " ;
1110import {IRegistryCoordinator} from "./interfaces/IRegistryCoordinator.sol " ;
11+ import {ISocketRegistry} from "./interfaces/ISocketRegistry.sol " ;
1212
1313import {EIP1271SignatureUtils} from "eigenlayer-contracts/src/contracts/libraries/EIP1271SignatureUtils.sol " ;
1414import {BitmapUtils} from "./libraries/BitmapUtils.sol " ;
@@ -35,7 +35,6 @@ contract RegistryCoordinator is
3535 Pausable ,
3636 OwnableUpgradeable ,
3737 RegistryCoordinatorStorage ,
38- ISocketUpdater ,
3938 ISignatureUtils
4039{
4140 using BitmapUtils for * ;
@@ -57,9 +56,10 @@ contract RegistryCoordinator is
5756 IServiceManager _serviceManager ,
5857 IStakeRegistry _stakeRegistry ,
5958 IBLSApkRegistry _blsApkRegistry ,
60- IIndexRegistry _indexRegistry
59+ IIndexRegistry _indexRegistry ,
60+ ISocketRegistry _socketRegistry
6161 )
62- RegistryCoordinatorStorage (_serviceManager, _stakeRegistry, _blsApkRegistry, _indexRegistry)
62+ RegistryCoordinatorStorage (_serviceManager, _stakeRegistry, _blsApkRegistry, _indexRegistry, _socketRegistry )
6363 EIP712 ("AVSRegistryCoordinator " , "v0.0.1 " )
6464 {
6565 _disableInitializers ();
@@ -88,7 +88,7 @@ contract RegistryCoordinator is
8888 ) external initializer {
8989 require (
9090 _operatorSetParams.length == _minimumStakes.length && _minimumStakes.length == _strategyParams.length ,
91- "RegistryCoordinator .initialize: input length mismatch "
91+ "RegCoord .initialize: input length mismatch "
9292 );
9393
9494 // Initialize roles
@@ -154,7 +154,7 @@ contract RegistryCoordinator is
154154
155155 require (
156156 numOperatorsPerQuorum[i] <= _quorumParams[quorumNumber].maxOperatorCount,
157- "RegistryCoordinator .registerOperator: operator count exceeds maximum "
157+ "RegCoord .registerOperator: operator count exceeds maximum "
158158 );
159159 }
160160 }
@@ -179,7 +179,7 @@ contract RegistryCoordinator is
179179 SignatureWithSaltAndExpiry memory churnApproverSignature ,
180180 SignatureWithSaltAndExpiry memory operatorSignature
181181 ) external onlyWhenNotPaused (PAUSED_REGISTER_OPERATOR) {
182- require (operatorKickParams.length == quorumNumbers.length , "RegistryCoordinator .registerOperatorWithChurn: input length mismatch " );
182+ require (operatorKickParams.length == quorumNumbers.length , "RegCoord .registerOperatorWithChurn: input length mismatch " );
183183
184184 /**
185185 * If the operator has NEVER registered a pubkey before, use `params` to register
@@ -289,7 +289,7 @@ contract RegistryCoordinator is
289289 uint192 quorumBitmap = uint192 (BitmapUtils.orderedBytesArrayToBitmap (quorumNumbers, quorumCount));
290290 require (
291291 operatorsPerQuorum.length == quorumNumbers.length ,
292- "RegistryCoordinator .updateOperatorsForQuorum: input length mismatch "
292+ "RegCoord .updateOperatorsForQuorum: input length mismatch "
293293 );
294294
295295 // For each quorum, update ALL registered operators
@@ -300,7 +300,7 @@ contract RegistryCoordinator is
300300 address [] calldata currQuorumOperators = operatorsPerQuorum[i];
301301 require (
302302 currQuorumOperators.length == indexRegistry.totalOperatorsForQuorum (quorumNumber),
303- "RegistryCoordinator .updateOperatorsForQuorum: number of updated operators does not match quorum total "
303+ "RegCoord .updateOperatorsForQuorum: number of updated operators does not match quorum total "
304304 );
305305
306306 address prevOperatorAddress = address (0 );
@@ -319,12 +319,12 @@ contract RegistryCoordinator is
319319 // Check that the operator is registered
320320 require (
321321 BitmapUtils.isSet (currentBitmap, quorumNumber),
322- "RegistryCoordinator .updateOperatorsForQuorum: operator not in quorum "
322+ "RegCoord .updateOperatorsForQuorum: operator not in quorum "
323323 );
324324 // Prevent duplicate operators
325325 require (
326326 operator > prevOperatorAddress,
327- "RegistryCoordinator .updateOperatorsForQuorum: operators array must be sorted in ascending address order "
327+ "RegCoord .updateOperatorsForQuorum: operators array must be sorted in ascending address order "
328328 );
329329 }
330330
@@ -344,8 +344,8 @@ contract RegistryCoordinator is
344344 * @param socket is the new socket of the operator
345345 */
346346 function updateSocket (string memory socket ) external {
347- require (_operatorInfo[msg .sender ].status == OperatorStatus.REGISTERED, "RegistryCoordinator .updateSocket: operator is not registered " );
348- emit OperatorSocketUpdate (_operatorInfo[msg .sender ].operatorId, socket);
347+ require (_operatorInfo[msg .sender ].status == OperatorStatus.REGISTERED, "RegCoord .updateSocket: operator not registered " );
348+ _setOperatorSocket (_operatorInfo[msg .sender ].operatorId, socket);
349349 }
350350
351351 /*******************************************************************************
@@ -473,12 +473,12 @@ contract RegistryCoordinator is
473473 */
474474 uint192 quorumsToAdd = uint192 (BitmapUtils.orderedBytesArrayToBitmap (quorumNumbers, quorumCount));
475475 uint192 currentBitmap = _currentOperatorBitmap (operatorId);
476- require (! quorumsToAdd.isEmpty (), "RegistryCoordinator ._registerOperator: bitmap cannot be 0 " );
477- require (quorumsToAdd.noBitsInCommon (currentBitmap), "RegistryCoordinator ._registerOperator: operator already registered for some quorums being registered for " );
476+ require (! quorumsToAdd.isEmpty (), "RegCoord ._registerOperator: bitmap cannot be 0 " );
477+ require (quorumsToAdd.noBitsInCommon (currentBitmap), "RegCoord ._registerOperator: operator already registered for some quorums " );
478478 uint192 newBitmap = uint192 (currentBitmap.plus (quorumsToAdd));
479479
480480 // Check that the operator can reregister if ejected
481- require (lastEjectionTimestamp[operator] + ejectionCooldown < block .timestamp , "RegistryCoordinator ._registerOperator: operator cannot reregister yet " );
481+ require (lastEjectionTimestamp[operator] + ejectionCooldown < block .timestamp , "RegCoord ._registerOperator: operator cannot reregister yet " );
482482
483483 /**
484484 * Update operator's bitmap, socket, and status. Only update operatorInfo if needed:
@@ -489,8 +489,6 @@ contract RegistryCoordinator is
489489 newBitmap: newBitmap
490490 });
491491
492- emit OperatorSocketUpdate (operatorId, socket);
493-
494492 // If the operator wasn't registered for any quorums, update their status
495493 // and register them with this AVS in EigenLayer core (DelegationManager)
496494 if (_operatorInfo[operator].status != OperatorStatus.REGISTERED) {
@@ -502,6 +500,8 @@ contract RegistryCoordinator is
502500 // Register the operator with the EigenLayer core contracts via this AVS's ServiceManager
503501 serviceManager.registerOperatorToAVS (operator, operatorSignature);
504502
503+ _setOperatorSocket (operatorId, socket);
504+
505505 emit OperatorRegistered (operator, operatorId);
506506 }
507507
@@ -519,7 +519,7 @@ contract RegistryCoordinator is
519519 * @dev Reverts if the caller is not the ejector
520520 */
521521 function _checkEjector () internal view {
522- require (msg .sender == ejector, "RegistryCoordinator .onlyEjector: caller is not the ejector " );
522+ require (msg .sender == ejector, "RegCoord .onlyEjector: caller is not the ejector " );
523523 }
524524
525525 /**
@@ -530,7 +530,7 @@ contract RegistryCoordinator is
530530 function _checkQuorumExists (uint8 quorumNumber ) internal view {
531531 require (
532532 quorumNumber < quorumCount,
533- "RegistryCoordinator .quorumExists: quorum does not exist "
533+ "RegCoord .quorumExists: quorum does not exist "
534534 );
535535 }
536536
@@ -581,18 +581,18 @@ contract RegistryCoordinator is
581581 ) internal view {
582582 address operatorToKick = kickParams.operator;
583583 bytes32 idToKick = _operatorInfo[operatorToKick].operatorId;
584- require (newOperator != operatorToKick, "RegistryCoordinator ._validateChurn: cannot churn self " );
585- require (kickParams.quorumNumber == quorumNumber, "RegistryCoordinator ._validateChurn: quorumNumber not the same as signed " );
584+ require (newOperator != operatorToKick, "RegCoord ._validateChurn: cannot churn self " );
585+ require (kickParams.quorumNumber == quorumNumber, "RegCoord ._validateChurn: quorumNumber not the same as signed " );
586586
587587 // Get the target operator's stake and check that it is below the kick thresholds
588588 uint96 operatorToKickStake = stakeRegistry.getCurrentStake (idToKick, quorumNumber);
589589 require (
590590 newOperatorStake > _individualKickThreshold (operatorToKickStake, setParams),
591- "RegistryCoordinator ._validateChurn: incoming operator has insufficient stake for churn "
591+ "RegCoord ._validateChurn: incoming operator has insufficient stake for churn "
592592 );
593593 require (
594594 operatorToKickStake < _totalKickThreshold (totalQuorumStake, setParams),
595- "RegistryCoordinator ._validateChurn: cannot kick operator with more than kickBIPsOfTotalStake "
595+ "RegCoord ._validateChurn: cannot kick operator with more than kickBIPsOfTotalStake "
596596 );
597597 }
598598
@@ -608,7 +608,7 @@ contract RegistryCoordinator is
608608 // Fetch the operator's info and ensure they are registered
609609 OperatorInfo storage operatorInfo = _operatorInfo[operator];
610610 bytes32 operatorId = operatorInfo.operatorId;
611- require (operatorInfo.status == OperatorStatus.REGISTERED, "RegistryCoordinator ._deregisterOperator: operator is not registered " );
611+ require (operatorInfo.status == OperatorStatus.REGISTERED, "RegCoord ._deregisterOperator: operator is not registered " );
612612
613613 /**
614614 * Get bitmap of quorums to deregister from and operator's current bitmap. Validate that:
@@ -619,8 +619,8 @@ contract RegistryCoordinator is
619619 */
620620 uint192 quorumsToRemove = uint192 (BitmapUtils.orderedBytesArrayToBitmap (quorumNumbers, quorumCount));
621621 uint192 currentBitmap = _currentOperatorBitmap (operatorId);
622- require (! quorumsToRemove.isEmpty (), "RegistryCoordinator ._deregisterOperator: bitmap cannot be 0 " );
623- require (quorumsToRemove.isSubsetOf (currentBitmap), "RegistryCoordinator ._deregisterOperator: operator is not registered for specified quorums " );
622+ require (! quorumsToRemove.isEmpty (), "RegCoord ._deregisterOperator: bitmap cannot be 0 " );
623+ require (quorumsToRemove.isSubsetOf (currentBitmap), "RegCoord ._deregisterOperator: operator is not registered for quorums " );
624624 uint192 newBitmap = uint192 (currentBitmap.minus (quorumsToRemove));
625625
626626 // Update operator's bitmap and status
@@ -692,8 +692,8 @@ contract RegistryCoordinator is
692692 SignatureWithSaltAndExpiry memory churnApproverSignature
693693 ) internal {
694694 // make sure the salt hasn't been used already
695- require (! isChurnApproverSaltUsed[churnApproverSignature.salt], "RegistryCoordinator ._verifyChurnApproverSignature: churnApprover salt already used " );
696- require (churnApproverSignature.expiry >= block .timestamp , "RegistryCoordinator ._verifyChurnApproverSignature: churnApprover signature expired " );
695+ require (! isChurnApproverSaltUsed[churnApproverSignature.salt], "RegCoord ._verifyChurnApproverSignature: churnApprover salt already used " );
696+ require (churnApproverSignature.expiry >= block .timestamp , "RegCoord ._verifyChurnApproverSignature: churnApprover signature expired " );
697697
698698 // set salt used to true
699699 isChurnApproverSaltUsed[churnApproverSignature.salt] = true ;
@@ -721,7 +721,7 @@ contract RegistryCoordinator is
721721 ) internal {
722722 // Increment the total quorum count. Fails if we're already at the max
723723 uint8 prevQuorumCount = quorumCount;
724- require (prevQuorumCount < MAX_QUORUM_COUNT, "RegistryCoordinator .createQuorum: max quorums reached " );
724+ require (prevQuorumCount < MAX_QUORUM_COUNT, "RegCoord .createQuorum: max quorums reached " );
725725 quorumCount = prevQuorumCount + 1 ;
726726
727727 // The previous count is the new quorum's number
@@ -803,7 +803,7 @@ contract RegistryCoordinator is
803803 }
804804
805805 revert (
806- "RegistryCoordinator .getQuorumBitmapIndexAtBlockNumber: no bitmap update found for operatorId at block number "
806+ "RegCoord .getQuorumBitmapIndexAtBlockNumber: no bitmap update found for operator at blockNumber "
807807 );
808808 }
809809
@@ -822,6 +822,11 @@ contract RegistryCoordinator is
822822 ejector = newEjector;
823823 }
824824
825+ function _setOperatorSocket (bytes32 operatorId , string memory socket ) internal {
826+ socketRegistry.setOperatorSocket (operatorId, socket);
827+ emit OperatorSocketUpdate (operatorId, socket);
828+ }
829+
825830 /*******************************************************************************
826831 VIEW FUNCTIONS
827832 *******************************************************************************/
@@ -887,11 +892,11 @@ contract RegistryCoordinator is
887892 */
888893 require (
889894 blockNumber >= quorumBitmapUpdate.updateBlockNumber,
890- "RegistryCoordinator .getQuorumBitmapAtBlockNumberByIndex: quorumBitmapUpdate is from after blockNumber "
895+ "RegCoord .getQuorumBitmapAtBlockNumberByIndex: quorumBitmapUpdate is from after blockNumber "
891896 );
892897 require (
893898 quorumBitmapUpdate.nextUpdateBlockNumber == 0 || blockNumber < quorumBitmapUpdate.nextUpdateBlockNumber,
894- "RegistryCoordinator .getQuorumBitmapAtBlockNumberByIndex: quorumBitmapUpdate is from before blockNumber "
899+ "RegCoord .getQuorumBitmapAtBlockNumberByIndex: quorumBitmapUpdate is from before blockNumber "
895900 );
896901
897902 return quorumBitmapUpdate.quorumBitmap;
0 commit comments