Skip to content

refactor: slashing #379

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

Merged
merged 16 commits into from
Feb 5, 2025
Merged

refactor: slashing #379

merged 16 commits into from
Feb 5, 2025

Conversation

gpsanant
Copy link
Contributor

@gpsanant gpsanant commented Feb 1, 2025

main changes

  • slashing registry coordinator doesn't know about m2
  • slashing registry coordinator added before/after quorum hooks
  • added a checkMaxOperatorCount to registration so less duplicated logic in registry coordinator
  • removed owner from slashing registry coordinator interface, now just cast and use
  • stake registry cleanup
  • refactor AVS sync to make a single call to the core contracts
  • lazy migration to operator sets upon the next created quorum, removal of enableOperatorSets interface

@gpsanant gpsanant requested a review from 8sunyuan February 3, 2025 18:03
@0xClandestine 0xClandestine changed the title Refactor/slashing refactor: slashing Feb 5, 2025
@@ -218,6 +221,17 @@ contract RegistryCoordinator is RegistryCoordinatorStorage {
*
*/

/// @dev Returns a bitmap with all bits set up to `quorumCount`. Used for bit-masking quorum numbers
/// and differentiating between operator sets and M2 quorums
function m2QuorumBitmap() public view returns (uint256) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"avsDirectoryQuorum"?

@@ -18,7 +20,10 @@ contract BLSSignatureChecker is BLSSignatureCheckerStorage {
/// MODIFIERS

modifier onlyCoordinatorOwner() {
require(msg.sender == registryCoordinator.owner(), OnlyRegistryCoordinatorOwner());
require(
msg.sender == Ownable(address(registryCoordinator)).owner(),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is RC interface inheriting IOwnable?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just the owner() interface is needed here but the SlashingRegistryCoordinator does inherit OwnableUpgradeable

@@ -107,11 +111,13 @@ interface IRegistryCoordinator is
) external;

/**
* @notice Enables operator sets mode for the AVS. Once enabled, this cannot be disabled.
* @dev When enabled, all existing quorums are marked as M2 quorums and future quorums must be explicitly
* created as either M2 or operator set quorums.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

inherit doc, i think?

@8sunyuan 8sunyuan merged commit 9994210 into test/slashing-release Feb 5, 2025
6 checks passed
@8sunyuan 8sunyuan deleted the refactor/slashing branch February 5, 2025 22:36
0xClandestine pushed a commit that referenced this pull request Feb 6, 2025
* chore: start refactor

* fix: quorum creation

* fix: bug in registration

* feat: refactor avs sync

* chore: respond to review

* Update src/SlashingRegistryCoordinator.sol

Co-authored-by: Michael Sun <[email protected]>

* fix: m2 registration validity

* feat: lazy migration

* test: fixes and refactor of weightOfOperators

* feat: add updateOperators

* fix: tests and `_afterDeregisterOperator` hook

* refactor: remove operatorSetEnabled as require

* chore: fmt

* chore: fmt test files

* fix: failing ci test

* chore: test fmt

---------

Co-authored-by: Michael Sun <[email protected]>
Co-authored-by: Michael Sun <[email protected]>
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.

4 participants