feat: Add operator set support for ECDSA stake registry #411
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Motivation:
With the slashing release upcoming, the current ECDSAStakeRegistry has not yet been updated to support operator sets. The system currently only supports M2 quorum registration, creating a need for a more flexible and comprehensive registration mechanism while maintaining backward compatibility.
Modifications:
ECDSAStakeRegistry
registerOperatorWithSignature→registerOperatorM2QuorumderegisterOperator→deregisterOperatorM2QuorumonOperatorSetRegistered- handles AllocationManager registrationonOperatorSetDeregistered- handles AllocationManager deregistrationgetCurrentOperatorSetIds- retrieves current operator set IDsgetQuorumWeight- calculates quorum weightgetOperatorSetWeight- calculates operator set weightoperatorRegisteredOnAVSDirectory- checks M2 quorum registrationoperatorRegisteredOnCurrentOperatorSets- checks operator set registrationoperatorRegistered- checks either registration typedisableM2QuorumRegistration- disables new M2 registrationsupdateOperatorSetsConfig- updates operator set strategy parametersECDSAAVSRegistrar
registerOperator- handles operator registrationderegisterOperator- handles operator deregistrationsupportsAVS- checks AVS supportECDSAServiceManagerBase
deregisterOperatorFromOperatorSetsaddPendingAdminremovePendingAdminremoveAdminsetAppointeeremoveAppointeegetOperatorSetStrategies- retrieves strategies for an operator setNew Implementations
ECDSAStakeRegistryRatioWeightwith configurable weight ratiosECDSAStakeRegistryPermissionedwith new ejection logicTest Updates
Updated existing test files:
ECDSAStakeRegistryUnit.t.solECDSAStakeRegistryPermissionedUnit.t.solECDSAStakeRegistryEqualWeightUnit.t.solECDSAServiceManager.t.solAdded new test file:
ECDSAStakeRegistryRatioWeightUnit.t.sol- tests for configurable weight ratios between M2 quorum and operator setsResult:
The refactored ECDSAStakeRegistry now supports both operator sets and legacy M2 quorum registrations, providing a robust dual-registration system. This enables backward compatibility and allows for future deprecation of M2 quorum registration.