@@ -3,12 +3,12 @@ pragma solidity ^0.8.12;
3
3
4
4
import {IPauserRegistry} from "eigenlayer-contracts/src/contracts/interfaces/IPauserRegistry.sol " ;
5
5
import {ISignatureUtils} from "eigenlayer-contracts/src/contracts/interfaces/ISignatureUtils.sol " ;
6
- import {ISocketUpdater} from "./interfaces/ISocketUpdater.sol " ;
7
6
import {IBLSApkRegistry} from "./interfaces/IBLSApkRegistry.sol " ;
8
7
import {IStakeRegistry} from "./interfaces/IStakeRegistry.sol " ;
9
8
import {IIndexRegistry} from "./interfaces/IIndexRegistry.sol " ;
10
9
import {IServiceManager} from "./interfaces/IServiceManager.sol " ;
11
10
import {IRegistryCoordinator} from "./interfaces/IRegistryCoordinator.sol " ;
11
+ import {ISocketRegistry} from "./interfaces/ISocketRegistry.sol " ;
12
12
13
13
import {EIP1271SignatureUtils} from "eigenlayer-contracts/src/contracts/libraries/EIP1271SignatureUtils.sol " ;
14
14
import {BitmapUtils} from "./libraries/BitmapUtils.sol " ;
@@ -35,7 +35,6 @@ contract RegistryCoordinator is
35
35
Pausable ,
36
36
OwnableUpgradeable ,
37
37
RegistryCoordinatorStorage ,
38
- ISocketUpdater ,
39
38
ISignatureUtils
40
39
{
41
40
using BitmapUtils for * ;
@@ -57,9 +56,10 @@ contract RegistryCoordinator is
57
56
IServiceManager _serviceManager ,
58
57
IStakeRegistry _stakeRegistry ,
59
58
IBLSApkRegistry _blsApkRegistry ,
60
- IIndexRegistry _indexRegistry
59
+ IIndexRegistry _indexRegistry ,
60
+ ISocketRegistry _socketRegistry
61
61
)
62
- RegistryCoordinatorStorage (_serviceManager, _stakeRegistry, _blsApkRegistry, _indexRegistry)
62
+ RegistryCoordinatorStorage (_serviceManager, _stakeRegistry, _blsApkRegistry, _indexRegistry, _socketRegistry )
63
63
EIP712 ("AVSRegistryCoordinator " , "v0.0.1 " )
64
64
{
65
65
_disableInitializers ();
@@ -88,7 +88,7 @@ contract RegistryCoordinator is
88
88
) external initializer {
89
89
require (
90
90
_operatorSetParams.length == _minimumStakes.length && _minimumStakes.length == _strategyParams.length ,
91
- "RegistryCoordinator .initialize: input length mismatch "
91
+ "RegCoord .initialize: input length mismatch "
92
92
);
93
93
94
94
// Initialize roles
@@ -154,7 +154,7 @@ contract RegistryCoordinator is
154
154
155
155
require (
156
156
numOperatorsPerQuorum[i] <= _quorumParams[quorumNumber].maxOperatorCount,
157
- "RegistryCoordinator .registerOperator: operator count exceeds maximum "
157
+ "RegCoord .registerOperator: operator count exceeds maximum "
158
158
);
159
159
}
160
160
}
@@ -179,7 +179,7 @@ contract RegistryCoordinator is
179
179
SignatureWithSaltAndExpiry memory churnApproverSignature ,
180
180
SignatureWithSaltAndExpiry memory operatorSignature
181
181
) 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 " );
183
183
184
184
/**
185
185
* If the operator has NEVER registered a pubkey before, use `params` to register
@@ -289,7 +289,7 @@ contract RegistryCoordinator is
289
289
uint192 quorumBitmap = uint192 (BitmapUtils.orderedBytesArrayToBitmap (quorumNumbers, quorumCount));
290
290
require (
291
291
operatorsPerQuorum.length == quorumNumbers.length ,
292
- "RegistryCoordinator .updateOperatorsForQuorum: input length mismatch "
292
+ "RegCoord .updateOperatorsForQuorum: input length mismatch "
293
293
);
294
294
295
295
// For each quorum, update ALL registered operators
@@ -300,7 +300,7 @@ contract RegistryCoordinator is
300
300
address [] calldata currQuorumOperators = operatorsPerQuorum[i];
301
301
require (
302
302
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 "
304
304
);
305
305
306
306
address prevOperatorAddress = address (0 );
@@ -319,12 +319,12 @@ contract RegistryCoordinator is
319
319
// Check that the operator is registered
320
320
require (
321
321
BitmapUtils.isSet (currentBitmap, quorumNumber),
322
- "RegistryCoordinator .updateOperatorsForQuorum: operator not in quorum "
322
+ "RegCoord .updateOperatorsForQuorum: operator not in quorum "
323
323
);
324
324
// Prevent duplicate operators
325
325
require (
326
326
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 "
328
328
);
329
329
}
330
330
@@ -344,8 +344,8 @@ contract RegistryCoordinator is
344
344
* @param socket is the new socket of the operator
345
345
*/
346
346
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);
349
349
}
350
350
351
351
/*******************************************************************************
@@ -473,12 +473,12 @@ contract RegistryCoordinator is
473
473
*/
474
474
uint192 quorumsToAdd = uint192 (BitmapUtils.orderedBytesArrayToBitmap (quorumNumbers, quorumCount));
475
475
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 " );
478
478
uint192 newBitmap = uint192 (currentBitmap.plus (quorumsToAdd));
479
479
480
480
// 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 " );
482
482
483
483
/**
484
484
* Update operator's bitmap, socket, and status. Only update operatorInfo if needed:
@@ -489,8 +489,6 @@ contract RegistryCoordinator is
489
489
newBitmap: newBitmap
490
490
});
491
491
492
- emit OperatorSocketUpdate (operatorId, socket);
493
-
494
492
// If the operator wasn't registered for any quorums, update their status
495
493
// and register them with this AVS in EigenLayer core (DelegationManager)
496
494
if (_operatorInfo[operator].status != OperatorStatus.REGISTERED) {
@@ -502,6 +500,8 @@ contract RegistryCoordinator is
502
500
// Register the operator with the EigenLayer core contracts via this AVS's ServiceManager
503
501
serviceManager.registerOperatorToAVS (operator, operatorSignature);
504
502
503
+ _setOperatorSocket (operatorId, socket);
504
+
505
505
emit OperatorRegistered (operator, operatorId);
506
506
}
507
507
@@ -519,7 +519,7 @@ contract RegistryCoordinator is
519
519
* @dev Reverts if the caller is not the ejector
520
520
*/
521
521
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 " );
523
523
}
524
524
525
525
/**
@@ -530,7 +530,7 @@ contract RegistryCoordinator is
530
530
function _checkQuorumExists (uint8 quorumNumber ) internal view {
531
531
require (
532
532
quorumNumber < quorumCount,
533
- "RegistryCoordinator .quorumExists: quorum does not exist "
533
+ "RegCoord .quorumExists: quorum does not exist "
534
534
);
535
535
}
536
536
@@ -581,18 +581,18 @@ contract RegistryCoordinator is
581
581
) internal view {
582
582
address operatorToKick = kickParams.operator;
583
583
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 " );
586
586
587
587
// Get the target operator's stake and check that it is below the kick thresholds
588
588
uint96 operatorToKickStake = stakeRegistry.getCurrentStake (idToKick, quorumNumber);
589
589
require (
590
590
newOperatorStake > _individualKickThreshold (operatorToKickStake, setParams),
591
- "RegistryCoordinator ._validateChurn: incoming operator has insufficient stake for churn "
591
+ "RegCoord ._validateChurn: incoming operator has insufficient stake for churn "
592
592
);
593
593
require (
594
594
operatorToKickStake < _totalKickThreshold (totalQuorumStake, setParams),
595
- "RegistryCoordinator ._validateChurn: cannot kick operator with more than kickBIPsOfTotalStake "
595
+ "RegCoord ._validateChurn: cannot kick operator with more than kickBIPsOfTotalStake "
596
596
);
597
597
}
598
598
@@ -608,7 +608,7 @@ contract RegistryCoordinator is
608
608
// Fetch the operator's info and ensure they are registered
609
609
OperatorInfo storage operatorInfo = _operatorInfo[operator];
610
610
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 " );
612
612
613
613
/**
614
614
* Get bitmap of quorums to deregister from and operator's current bitmap. Validate that:
@@ -619,8 +619,8 @@ contract RegistryCoordinator is
619
619
*/
620
620
uint192 quorumsToRemove = uint192 (BitmapUtils.orderedBytesArrayToBitmap (quorumNumbers, quorumCount));
621
621
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 " );
624
624
uint192 newBitmap = uint192 (currentBitmap.minus (quorumsToRemove));
625
625
626
626
// Update operator's bitmap and status
@@ -692,8 +692,8 @@ contract RegistryCoordinator is
692
692
SignatureWithSaltAndExpiry memory churnApproverSignature
693
693
) internal {
694
694
// 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 " );
697
697
698
698
// set salt used to true
699
699
isChurnApproverSaltUsed[churnApproverSignature.salt] = true ;
@@ -721,7 +721,7 @@ contract RegistryCoordinator is
721
721
) internal {
722
722
// Increment the total quorum count. Fails if we're already at the max
723
723
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 " );
725
725
quorumCount = prevQuorumCount + 1 ;
726
726
727
727
// The previous count is the new quorum's number
@@ -803,7 +803,7 @@ contract RegistryCoordinator is
803
803
}
804
804
805
805
revert (
806
- "RegistryCoordinator .getQuorumBitmapIndexAtBlockNumber: no bitmap update found for operatorId at block number "
806
+ "RegCoord .getQuorumBitmapIndexAtBlockNumber: no bitmap update found for operator at blockNumber "
807
807
);
808
808
}
809
809
@@ -822,6 +822,11 @@ contract RegistryCoordinator is
822
822
ejector = newEjector;
823
823
}
824
824
825
+ function _setOperatorSocket (bytes32 operatorId , string memory socket ) internal {
826
+ socketRegistry.setOperatorSocket (operatorId, socket);
827
+ emit OperatorSocketUpdate (operatorId, socket);
828
+ }
829
+
825
830
/*******************************************************************************
826
831
VIEW FUNCTIONS
827
832
*******************************************************************************/
@@ -887,11 +892,11 @@ contract RegistryCoordinator is
887
892
*/
888
893
require (
889
894
blockNumber >= quorumBitmapUpdate.updateBlockNumber,
890
- "RegistryCoordinator .getQuorumBitmapAtBlockNumberByIndex: quorumBitmapUpdate is from after blockNumber "
895
+ "RegCoord .getQuorumBitmapAtBlockNumberByIndex: quorumBitmapUpdate is from after blockNumber "
891
896
);
892
897
require (
893
898
quorumBitmapUpdate.nextUpdateBlockNumber == 0 || blockNumber < quorumBitmapUpdate.nextUpdateBlockNumber,
894
- "RegistryCoordinator .getQuorumBitmapAtBlockNumberByIndex: quorumBitmapUpdate is from before blockNumber "
899
+ "RegCoord .getQuorumBitmapAtBlockNumberByIndex: quorumBitmapUpdate is from before blockNumber "
895
900
);
896
901
897
902
return quorumBitmapUpdate.quorumBitmap;
0 commit comments