@@ -97,25 +97,31 @@ contract OperatorStateRetriever {
9797
9898 /**
9999 * @notice This function is intended to to be called by AVS operators every time a new task is created (i.e.)
100- * the AVS coordinator makes a request to AVS operators. Since all of the crucial information is kept onchain,
100+ * the AVS coordinator makes a request to AVS operators. Since all of the crucial information is kept onchain,
101101 * operators don't need to run indexers to fetch the data.
102102 * @param registryCoordinator is the registry coordinator to fetch the AVS registry information from
103- * @param operatorId the id of the operator to fetch the quorums lists
103+ * @param operatorId the id of the operator to fetch the quorums lists
104104 * @param blockNumber is the block number to get the operator state for
105105 * @return quorumBitmap the quorumBitmap of the operator at the given blockNumber
106106 * @return operators a 2d array of Operators. For each quorum, an ordered list of Operators
107107 * @return sockets a 2d array of sockets. For each quorum, an ordered list of sockets
108108 */
109109 function getOperatorStateWithSocket (
110- ISlashingRegistryCoordinator registryCoordinator ,
111- bytes32 operatorId ,
110+ ISlashingRegistryCoordinator registryCoordinator ,
111+ bytes32 operatorId ,
112112 uint32 blockNumber
113- ) external view returns (uint256 quorumBitmap , Operator[][] memory operators , string [][] memory sockets ) {
113+ )
114+ external
115+ view
116+ returns (uint256 quorumBitmap , Operator[][] memory operators , string [][] memory sockets )
117+ {
114118 bytes32 [] memory operatorIds = new bytes32 [](1 );
115119 operatorIds[0 ] = operatorId;
116- uint256 index = registryCoordinator.getQuorumBitmapIndicesAtBlockNumber (blockNumber, operatorIds)[0 ];
117-
118- quorumBitmap = registryCoordinator.getQuorumBitmapAtBlockNumberByIndex (operatorId, blockNumber, index);
120+ uint256 index =
121+ registryCoordinator.getQuorumBitmapIndicesAtBlockNumber (blockNumber, operatorIds)[0 ];
122+
123+ quorumBitmap =
124+ registryCoordinator.getQuorumBitmapAtBlockNumberByIndex (operatorId, blockNumber, index);
119125
120126 bytes memory quorumNumbers = BitmapUtils.bitmapToBytesArray (quorumBitmap);
121127
@@ -132,15 +138,15 @@ contract OperatorStateRetriever {
132138 }
133139
134140 /**
135- * @notice returns the ordered list of operators (id, stake, socket) for each quorum. The AVS coordinator
141+ * @notice returns the ordered list of operators (id, stake, socket) for each quorum. The AVS coordinator
136142 * may call this function directly to get the operator state for a given block number
137143 * @param registryCoordinator is the registry coordinator to fetch the AVS registry information from
138144 * @param quorumNumbers are the ids of the quorums to get the operator state for
139145 * @param blockNumber is the block number to get the operator state for
140146 * @return operators a 2d array of Operators. For each quorum, an ordered list of Operators
141147 * @return sockets a 2d array of sockets. For each quorum, an ordered list of sockets
142148 */
143- function getOperatorStateWithSocket (
149+ function getOperatorStateWithSocket (
144150 ISlashingRegistryCoordinator registryCoordinator ,
145151 bytes memory quorumNumbers ,
146152 uint32 blockNumber
@@ -156,14 +162,17 @@ contract OperatorStateRetriever {
156162 sockets = new string [][](quorumNumbers.length );
157163 for (uint256 i = 0 ; i < quorumNumbers.length ; i++ ) {
158164 uint8 quorumNumber = uint8 (quorumNumbers[i]);
159- bytes32 [] memory operatorIds = registries.indexRegistry.getOperatorListAtBlockNumber (quorumNumber, blockNumber);
165+ bytes32 [] memory operatorIds =
166+ registries.indexRegistry.getOperatorListAtBlockNumber (quorumNumber, blockNumber);
160167 operators[i] = new Operator [](operatorIds.length );
161168 sockets[i] = new string [](operatorIds.length );
162169 for (uint256 j = 0 ; j < operatorIds.length ; j++ ) {
163170 operators[i][j] = Operator ({
164171 operator: registries.blsApkRegistry.getOperatorFromPubkeyHash (operatorIds[j]),
165172 operatorId: bytes32 (operatorIds[j]),
166- stake: registries.stakeRegistry.getStakeAtBlockNumber (bytes32 (operatorIds[j]), quorumNumber, blockNumber)
173+ stake: registries.stakeRegistry.getStakeAtBlockNumber (
174+ bytes32 (operatorIds[j]), quorumNumber, blockNumber
175+ )
167176 });
168177 sockets[i][j] = registries.socketRegistry.getOperatorSocket (bytes32 (operatorIds[j]));
169178 }
0 commit comments