Skip to content

Conversation

@8sunyuan
Copy link
Contributor

Motivation:

Currently there is no way for an AVS implementing these callback functions of the IAVSRegistrar.sol to verify that the operatorSetIds belong to their operatorSets. This is because AVSRegistrar configuration does not have uniqueness and implementing uniqueness in the AllocationManager is not feasible due to frontrunning DOS vectors for existing AVSs.

Modifications:

IAVSRegistrar.sol interface

Result:

  • Allowing AVSs to verify the correct operatorSet is being passed into their register/deregister callback functions and whether or not to proceed with the Operator action.
  • Downstream breaking interface changes for AVSs

@8sunyuan 8sunyuan changed the base branch from dev to slashing-magnitudes-fixes February 11, 2025 23:01
@ypatil12
Copy link
Collaborator

ypatil12 commented Feb 12, 2025

LGTM - needs to pass CI + tests though. Is there a MW PR too?

@ypatil12 ypatil12 changed the title Fix/avs registrar interface fix: avs registrar interface Feb 12, 2025
@8sunyuan
Copy link
Contributor Author

LGTM - needs to pass CI + tests though. Is there a MW PR too?

Layr-Labs/eigenlayer-middleware#398

@ypatil12 ypatil12 added the ⚖️ Audit Fix Audit-related fixes. label Feb 13, 2025
@ypatil12
Copy link
Collaborator

Seems like we're going with this one now?

@8sunyuan
Copy link
Contributor Author

hotfix to dev here #1102

@8sunyuan 8sunyuan deleted the fix/avs-registrar-interface branch February 14, 2025 14:44
8sunyuan added a commit that referenced this pull request Feb 14, 2025
**Motivation:**

Currently there is no way for an AVS implementing these callback
functions of the IAVSRegistrar.sol to verify that the operatorSetIds
belong to their operatorSets. The register/deregister callback functions
are updated to include the address field.
This PR is combining
#1092 and
#1085

Additionally, the try/catch design for deregistering from operatorSets
was impacting state between AVS and core contracts due to not having
proper gas estimates when submitting transactions. Solutions exploring
passing some suitable gas paramter were explored but eventually removing
it entirely was deemed the best solution.

**Modifications:**

- Added `avs()` view function that is checked upon `setAVSRegistrar`
- added `address avsIdentifier` field in the callbacks, this should
match the `avs()` view function on the AVSRegistrar
- Removed try catch on `deregisterForOperatorSets`

**Result:**

AVSRegistrars cannot be used for multiple operatorSets and AVSRegistrars
can doublecheck to verify that a register/deregister callback is
correctly called for their contracts.
Registration state between AVS and Eigenlayer core contracts for
OperatorSets are now done in atomic transactions (if entrypoint is
always through the AllocationManager)
ypatil12 pushed a commit that referenced this pull request Feb 19, 2025
**Motivation:**

Currently there is no way for an AVS implementing these callback
functions of the IAVSRegistrar.sol to verify that the operatorSetIds
belong to their operatorSets. The register/deregister callback functions
are updated to include the address field.
This PR is combining
#1092 and
#1085

Additionally, the try/catch design for deregistering from operatorSets
was impacting state between AVS and core contracts due to not having
proper gas estimates when submitting transactions. Solutions exploring
passing some suitable gas paramter were explored but eventually removing
it entirely was deemed the best solution.

**Modifications:**

- Added `avs()` view function that is checked upon `setAVSRegistrar`
- added `address avsIdentifier` field in the callbacks, this should
match the `avs()` view function on the AVSRegistrar
- Removed try catch on `deregisterForOperatorSets`

**Result:**

AVSRegistrars cannot be used for multiple operatorSets and AVSRegistrars
can doublecheck to verify that a register/deregister callback is
correctly called for their contracts.
Registration state between AVS and Eigenlayer core contracts for
OperatorSets are now done in atomic transactions (if entrypoint is
always through the AllocationManager)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

⚖️ Audit Fix Audit-related fixes.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants