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: batch operator id conversions #248

Merged
merged 2 commits into from
Apr 29, 2024
Merged

feat: batch operator id conversions #248

merged 2 commits into from
Apr 29, 2024

Conversation

0x0aa0
Copy link
Contributor

@0x0aa0 0x0aa0 commented Apr 29, 2024

Adds two view functions to OperatorStateRetriever:

  • getBatchOperatorId: batch conversion of operator address to operator id
  • getBatchOperatorFromId: batch conversion of operator id to operator address

Copy link
Contributor

@jianoaix jianoaix left a comment

Choose a reason for hiding this comment

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

LG

@@ -178,4 +178,25 @@ contract OperatorStateRetriever {
}
return quorumBitmaps;
}

function getBatchOperatorId(
Copy link
Contributor

Choose a reason for hiding this comment

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

These two methods will revert if any of the ID/address doesn't exist?

Copy link
Contributor

Choose a reason for hiding this comment

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

as written, these methods currently will not revert, but instead return bytes32(0) as the ID of any operator who has never registered, or address(0) for any operatorID that has never been used.

relevant code:
https://github.com/Layr-Labs/eigenlayer-middleware/blob/feat/batch-operatorid-view/src/BLSApkRegistry.sol#L275-L276
https://github.com/Layr-Labs/eigenlayer-middleware/blob/feat/batch-operatorid-view/src/RegistryCoordinator.sol#L796-L804

@jianoaix what would your preferred behavior here be?

Copy link
Contributor

Choose a reason for hiding this comment

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

Yep, that's more desirable! Could we put this in the comment of the function?

Copy link
Contributor

@ChaoticWalrus ChaoticWalrus left a comment

Choose a reason for hiding this comment

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

Looks fine. Would be good to resolve the thread around reversions + add some documentation, prior to merging.

Copy link
Contributor

@jianoaix jianoaix left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Contributor

@ChaoticWalrus ChaoticWalrus left a comment

Choose a reason for hiding this comment

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

LGTM.
FYI, the 2 automated test failures are unreleated to this PR and are getting fixed in a separate PR.

@0x0aa0 0x0aa0 merged commit 1feb6ae into dev Apr 29, 2024
2 of 3 checks passed
@0x0aa0 0x0aa0 deleted the feat/batch-operatorid-view branch April 29, 2024 20:12
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.

3 participants