Conversation
ff851d1 to
066c679
Compare
|
Can you retarget the PR against |
src/VoteWeigherBaseStorage.sol
Outdated
| uint16 public quorumCount; | ||
|
|
||
| /// @notice Bitmap of quorums that are being used by the middleware. | ||
| uint192 public quorumBitmap; |
There was a problem hiding this comment.
would prefer to just use quorum count here?
| bytes memory quorumNumbers = BitmapUtils.bitmapToBytesArray(quorumBitmap); | ||
| IStrategy[] memory strategies = new IStrategy[](_getNumStrategiesInBitmap(quorumNumbers)); | ||
| uint256 index = 0; | ||
| for(uint256 i = 0; i < quorumNumbers.length; i++){ |
There was a problem hiding this comment.
use quourmCount across the board
src/StakeRegistry.sol
Outdated
| for(uint256 i = 0; i < quorumNumbers.length; i++){ | ||
| StrategyAndWeightingMultiplier[] memory strategiesAndMultipliers = strategiesConsideredAndMultipliers[uint8(quorumNumbers[i])]; | ||
| for(uint256 j = 0; j < strategiesAndMultipliers.length; j++){ | ||
| strategies[index] = strategiesAndMultipliers[j].strategy; |
There was a problem hiding this comment.
this might end up having a lot of duplicates. lets try to avoid that
|
|
||
| /** | ||
| * @notice Return a list of all strategies and corresponding share amounts for which the operator has restaked | ||
| * @dev There may strategies for which the operator has restaked on the quorum but has no shares. In this case, |
| } | ||
| } | ||
|
|
||
| return (strategies, shares); |
There was a problem hiding this comment.
i don't think it makes sense to return shares? let's just assume all stake of the strategy is staked until slashing is live
There was a problem hiding this comment.
Yup, discussed with Bowen and we have a pipeline in the backend for getting operator shares so will remove
1fd2a54 to
3e28473
Compare
3e28473 to
b70b2be
Compare
|
|
||
| quorumBitmap = uint192(quorumBitmap.plus(uint192(1) << quorumNumber)); |
There was a problem hiding this comment.
Would prefer we add a helper for this, because it's easy to fuck up. I'm using this in another branch:
eigenlayer-middleware/src/libraries/BitmapUtils.sol
Lines 303 to 311 in a6baa25
|
|
||
| // If no strategies exist in quorum, turn bit off | ||
| if (_strategyParams.length == 0) { | ||
| quorumBitmap = uint192(quorumBitmap.minus(uint192(1) << quorumNumber)); |
There was a problem hiding this comment.
Would prefer a helper for this. Could use something similar to the setBit method I linked, but with a bool on/off switch?
wadealexc
left a comment
There was a problem hiding this comment.
Can we remove the StakeRegistry changes in favor of exposing similar methods in the registry coordinator?
Specifically, I like how currently only one contract keeps track of the current set of initialized quorums, and I want to keep that logic there.
I think if you expose the for loops you're doing in both view StakeRegistry methods, the registry coordinator is a better place to keep this logic.
ChaoticWalrus
left a comment
There was a problem hiding this comment.
PR seems very reasonable, but would like to get the other PR this relies on just a bit more finalized first.
The new 'view' functions being added to the StakeRegistry seem ~inefficient, but AFAICT these are designed to only ever be called off-chain, and thus seem OK as-is.
|
IIUC, we don't need this PR anymore in middle repo right? @ypatil12 |
We'd still need the parts that integrate with the new changes to the 'core' contracts, but we can delete the added functions in the StakeRegistry + associated interface from this PR. |
ok, will work on a new pr for it |
| */ | ||
| contract StakeRegistry is StakeRegistryStorage { | ||
|
|
||
| using BitmapUtils for *; |
There was a problem hiding this comment.
doesn't make a difference to the bytecode 🤷
|
Closing this PR as functionality is out of scope. |
| * @notice Registers msg.sender as an operator with the middleware | ||
| * @param quorumNumbers are the bytes representing the quorum numbers that the operator is registering for | ||
| * @param registrationData is the data that is decoded to get the operator's registration information | ||
| * @param signatureWithSaltAndExpiry is the signature of the operator used by the avs to register the operator in the delegation manager | ||
| */ | ||
| function registerOperatorWithCoordinator(bytes memory quorumNumbers, bytes calldata registrationData, SignatureWithSaltAndExpiry memory signatureWithSaltAndExpiry) external; | ||
|
|
||
| /** | ||
| * @notice Deregisters the msg.sender as an operator from the middleware | ||
| * @param quorumNumbers are the bytes representing the quorum numbers that the operator is registered for | ||
| * @param deregistrationData is the the data that is decoded to get the operator's deregistration information | ||
| */ | ||
| function deregisterOperatorWithCoordinator(bytes calldata quorumNumbers, bytes calldata deregistrationData) external; |
There was a problem hiding this comment.
QQ: why these 2 api are not implemented? @ypatil12
There was a problem hiding this comment.
Old methods that were not removed correctly on rebase
There was a problem hiding this comment.
they're implemented, just renamed registerOperator and deregisterOperator
|
i really wanna do the middleware pr, but looking at my calendar - i'll be OOO on 14th, and hv a pile of backend work need to finish before then, realistically i won't be able to finish middleware pr then will be great if @ypatil12 can continue the middleware pr |
This draft PR adds functionality to support off-chain indexing for avs and operator info. Specifically, the funcationality enables support for the 5 use cases defined here.
Summary of Changes:
UpdateAVSMetadataURIfunction in RegistryCoordinatorgetOperatorRestakedStrategiesandgetRestakeableStrategies. These functions utilize quorum bitmaps of the AVS (new functionality) and operator respectively.