Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add operator set support for ECDSA stake registry #411

Open
wants to merge 16 commits into
base: dev
Choose a base branch
from

Conversation

jaxxjj
Copy link

@jaxxjj jaxxjj commented Mar 1, 2025

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

  • Renamed registration functions:
    • registerOperatorWithSignatureregisterOperatorM2Quorum
    • deregisterOperatorderegisterOperatorM2Quorum
  • Added operator set callbacks:
    • onOperatorSetRegistered - handles AllocationManager registration
    • onOperatorSetDeregistered - handles AllocationManager deregistration
  • Added operator set management:
    • getCurrentOperatorSetIds - retrieves current operator set IDs
    • getQuorumWeight - calculates quorum weight
    • getOperatorSetWeight - calculates operator set weight
    • operatorRegisteredOnAVSDirectory - checks M2 quorum registration
    • operatorRegisteredOnCurrentOperatorSets - checks operator set registration
    • operatorRegistered - checks either registration type
    • disableM2QuorumRegistration - disables new M2 registrations
    • updateOperatorSetsConfig - updates operator set strategy parameters

ECDSAAVSRegistrar

  • Added AllocationManager integration:
    • registerOperator - handles operator registration
    • deregisterOperator - handles operator deregistration
    • supportsAVS - checks AVS support

ECDSAServiceManagerBase

  • Added IServiceManager implementations:
    • deregisterOperatorFromOperatorSets
    • addPendingAdmin
    • removePendingAdmin
    • removeAdmin
    • setAppointee
    • removeAppointee
  • Added operator set support:
    • getOperatorSetStrategies - retrieves strategies for an operator set

New Implementations

  • Added ECDSAStakeRegistryRatioWeight with configurable weight ratios
  • Updated ECDSAStakeRegistryPermissioned with new ejection logic

Test Updates

  • Updated existing test files:

    • ECDSAStakeRegistryUnit.t.sol
    • ECDSAStakeRegistryPermissionedUnit.t.sol
    • ECDSAStakeRegistryEqualWeightUnit.t.sol
    • ECDSAServiceManager.t.sol
  • Added new test file:

    • ECDSAStakeRegistryRatioWeightUnit.t.sol - tests for configurable weight ratios between M2 quorum and operator sets

Result:

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.

@jaxxjj
Copy link
Author

jaxxjj commented Mar 4, 2025

gm @stevennevins I've already updated the tests - could you please review them when you have a chance?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant