-
Notifications
You must be signed in to change notification settings - Fork 112
feat: avs registrar #484
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: avs registrar #484
Conversation
ee780a5
to
5bb905e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Have we considered at all about upgrading OZ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not yet, are you suggesting for unstructured storage?
* | ||
*/ | ||
|
||
/// @notice The AVS that this registar is for |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: registar
-> registrar
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
import {Allowlist} from "../modules/Allowlist.sol"; | ||
import {OperatorSet} from "eigenlayer-contracts/src/contracts/libraries/OperatorSetLib.sol"; | ||
|
||
contract AVSRegistrarWithAllowlist is AVSRegistrar, Allowlist { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
contract name doesn't match file name
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks very clean. Left a couple comments and DMed you on a few things.
Also, where's the stake evaluation happening? There should be a minimum stake to join and below which ejection is permissionless.
Stake evaluation done via |
import {Initializable} from "@openzeppelin-upgrades/contracts/proxy/utils/Initializable.sol"; | ||
|
||
/// @notice A minimal AVSRegistrar contract that is used to register/deregister operators for an AVS | ||
contract AVSRegistrar is Initializable, AVSRegistrarStorage { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If I needed to make this upgradeable, I'm assuming I would need to inherit and make the child contract upgradeable?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also should this be abstract
or is it intended to be deployed as such if you want the bare functionality?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yup, see what we do with the presets. Intended to be deployed as such if you want the bare functionality
_beforeDeregisterOperator(operator, operatorSetIds); | ||
|
||
_afterDeregisterOperator(operator, operatorSetIds); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't we just need 1 hook here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Leaving it maximally flexible for now, can change later on. One idea rn is that you may want to preempt some gas-heavy optimizations in the before hook
|
||
/// @inheritdoc ISocketRegistry | ||
function updateSocket(address operator, string memory socket) external { | ||
require(msg.sender == operator, CallerNotOperator()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should there be a check to see if the operator is registerd to atleast one operatorSet of the AVS?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Doesn't matter since the value will be useless until operator is registered
* @param socket The socket (any arbitrary string as deemed useful by an AVS) to set. | ||
* @dev This function sets a single socket per operator, regardless of operatorSet. | ||
*/ | ||
function _setOperatorSocket(address operator, string memory socket) internal { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would this also mean that an operator has the same socket for all operator sets of an AVS?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Correct
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Haven't seen a compelling reason for it to be different given HG and EigenDA
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But we set the keys per operator set in Layr-Labs/eigenlayer-contracts#1421 right? Shouldn't we be uniform in implementation?
**Motivation:** We want to update the AVS registrar to be minimal & modular. **Modifications:** Add a new `AVSRegistrar` with first class support with the `KeyRegistrar`. We also have the following modules: 1. `SocketRegistry` 2. `AllowList` The above modules are _abstract_ and are inherited by `AVSRegistrars` in the `presets` folder: `AVSRegistrarWithAllowlist` and `AVSRegistrarWithSocket`. **Result:** Simple AVSRegistrar. Note that we are still pending on the `KeyRegistrar` interface update: Layr-Labs/eigenlayer-contracts#1421
Motivation:
We want to update the AVS registrar to be minimal & modular.
Modifications:
Add a new
AVSRegistrar
with first class support with theKeyRegistrar
. We also have the following modules:SocketRegistry
AllowList
The above modules are abstract and are inherited by
AVSRegistrars
in thepresets
folder:AVSRegistrarWithAllowlist
andAVSRegistrarWithSocket
.Result:
Simple AVSRegistrar. Note that we are still pending on the
KeyRegistrar
interface update: Layr-Labs/eigenlayer-contracts#1421