Skip to content

Commit 66ace9b

Browse files
authored
docs: add docs for AVSDirectory (#408)
1 parent 2376405 commit 66ace9b

File tree

3 files changed

+84
-52
lines changed

3 files changed

+84
-52
lines changed

docs/README.md

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,11 @@ This document provides an overview of system components, contracts, and user rol
1111
#### Contents
1212

1313
* [System Components](#system-components)
14+
* [`EigenPodManager`](#eigenpodmanager)
15+
* [`StrategyManager`](#strategymanager)
16+
* [`DelegationManager`](#delegationmanager)
17+
* [`AVSDirectory`](#avsdirectory)
18+
* [`Slasher`](#slasher)
1419
* [Roles and Actors](#roles-and-actors)
1520

1621
### System Components
@@ -40,7 +45,7 @@ See full documentation in [`/core/EigenPodManager.md`](./core/EigenPodManager.md
4045
| [`StrategyBaseTVLLimits.sol`](../src/contracts/strategies/StrategyBaseTVLLimits.sol) | One instance per supported LST | Transparent proxy |
4146

4247
These contracts work together to enable restaking for LSTs:
43-
* The `StrategyManager` acts as the entry and exit point for LSTs in EigenLayer. It handles deposits into each of the 3 LST-specific strategies, and manages accounting+interactions between users with restaked LSTs and the `DelegationManager`.
48+
* The `StrategyManager` acts as the entry and exit point for LSTs in EigenLayer. It handles deposits into LST-specific strategies, and manages accounting+interactions between users with restaked LSTs and the `DelegationManager`.
4449
* `StrategyBaseTVLLimits` is deployed as multiple separate instances, one for each supported LST. When a user deposits into a strategy through the `StrategyManager`, this contract receives the tokens and awards the user with a proportional quantity of shares in the strategy. When a user withdraws, the strategy contract sends the LSTs back to the user.
4550

4651
See full documentation in [`/core/StrategyManager.md`](./core/StrategyManager.md).
@@ -55,6 +60,18 @@ The `DelegationManager` sits between the `EigenPodManager` and `StrategyManager`
5560

5661
See full documentation in [`/core/DelegationManager.md`](./core/DelegationManager.md).
5762

63+
#### AVSDirectory
64+
65+
| File | Type | Proxy |
66+
| -------- | -------- | -------- |
67+
| [`AVSDirectory.sol`](../src/contracts/core/AVSDirectory.sol) | Singleton | Transparent proxy |
68+
69+
The `AVSDirectory` handles interactions between AVSs and the EigenLayer core contracts. Once registered as an Operator in EigenLayer core (via the `DelegationManager`), Operators can register with one or more AVSs (via the AVS's contracts) to begin providing services to them offchain. As a part of registering with an AVS, the AVS will record this registration in the core contracts by calling into the `AVSDirectory`.
70+
71+
See full documentation in [`/core/AVSDirectory.md`](./core/AVSDirectory.md).
72+
73+
For more information on AVS contracts, see the [middleware repo][middleware-repo].
74+
5875
#### Slasher
5976

6077
| File | Type | Proxy |

docs/core/AVSDirectory.md

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
[middleware-repo]: https://github.com/Layr-Labs/eigenlayer-middleware/
2+
3+
## AVSDirectory
4+
5+
| File | Type | Proxy |
6+
| -------- | -------- | -------- |
7+
| [`AVSDirectory.sol`](../src/contracts/core/AVSDirectory.sol) | Singleton | Transparent proxy |
8+
9+
The `AVSDirectory` handles interactions between AVSs and the EigenLayer core contracts. Once registered as an Operator in EigenLayer core (via the `DelegationManager`), Operators can register with one or more AVSs (via the AVS's contracts) to begin providing services to them offchain. As a part of registering with an AVS, the AVS will record this registration in the core contracts by calling into the `AVSDirectory`.
10+
11+
For more information on AVS contracts, see the [middleware repo][middleware-repo].
12+
13+
Currently, the only interactions between AVSs and the core contracts is to track whether Operators are currently registered for the AVS. This is handled by two methods:
14+
* [`AVSDirectory.registerOperatorToAVS`](#registeroperatortoavs)
15+
* [`AVSDirectory.deregisterOperatorFromAVS`](#deregisteroperatorfromavs)
16+
17+
In a future release, this contract will implement additional interactions that relate to (i) paying Operators for the services they provide and (ii) slashing Operators that misbehave. Currently, these features are not implemented.
18+
19+
---
20+
21+
#### `registerOperatorToAVS`
22+
23+
```solidity
24+
function registerOperatorToAVS(
25+
address operator,
26+
ISignatureUtils.SignatureWithSaltAndExpiry memory operatorSignature
27+
)
28+
external
29+
onlyWhenNotPaused(PAUSED_OPERATOR_REGISTER_DEREGISTER_TO_AVS)
30+
```
31+
32+
Allows the caller (an AVS) to register an `operator` with itself, given the provided signature is valid.
33+
34+
*Effects*:
35+
* Sets the `operator's` status to `REGISTERED` for the AVS
36+
37+
*Requirements*:
38+
* Pause status MUST NOT be set: `PAUSED_OPERATOR_REGISTER_DEREGISTER_TO_AVS`
39+
* `operator` MUST already be a registered Operator (via the `DelegationManager`)
40+
* `operator` MUST NOT already be registered with the AVS
41+
* `operatorSignature` must be a valid, unused, unexpired signature from the `operator`. The signature is an ECDSA signature by the operator over the [`OPERATOR_AVS_REGISTRATION_TYPEHASH`](../../src/contracts/core/DelegationManagerStorage.sol). Expiry is a utc timestamp in seconds. Salt is used only once per signature to prevent replay attacks.
42+
43+
*As of M2*:
44+
* Operator registration/deregistration does not have any sort of consequences for the Operator or its shares. Eventually, this will tie into payments for services and slashing for misbehavior.
45+
46+
#### `deregisterOperatorFromAVS`
47+
48+
```solidity
49+
function deregisterOperatorFromAVS(
50+
address operator
51+
)
52+
external
53+
onlyWhenNotPaused(PAUSED_OPERATOR_REGISTER_DEREGISTER_TO_AVS)
54+
```
55+
56+
Allows the caller (an AVS) to deregister an `operator` with itself
57+
58+
*Effects*:
59+
* Sets the `operator's` status to `UNREGISTERED` for the AVS
60+
61+
*Requirements*:
62+
* Pause status MUST NOT be set: `PAUSED_OPERATOR_REGISTER_DEREGISTER_TO_AVS`
63+
* `operator` MUST already be registered with the AVS
64+
65+
*As of M2*:
66+
* Operator registration/deregistration does not have any sort of consequences for the Operator or its shares. Eventually, this will tie into payments for services and slashing for misbehavior.

docs/core/DelegationManager.md

Lines changed: 0 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -56,10 +56,6 @@ Operators interact with the following functions to become an Operator:
5656
* [`DelegationManager.modifyOperatorDetails`](#modifyoperatordetails)
5757
* [`DelegationManager.updateOperatorMetadataURI`](#updateoperatormetadatauri)
5858

59-
Once registered as an Operator, Operators can use an AVS's contracts to register with a specific AVS. The AVS will call these functions on the Operator's behalf:
60-
* [`DelegationManager.registerOperatorToAVS`](#registeroperatortoavs)
61-
* [`DelegationManager.deregisterOperatorFromAVS`](#deregisteroperatorfromavs)
62-
6359
#### `registerAsOperator`
6460

6561
```solidity
@@ -111,53 +107,6 @@ Allows an Operator to emit an `OperatorMetadataURIUpdated` event. No other state
111107
*Requirements*:
112108
* Caller MUST already be an Operator
113109

114-
#### `registerOperatorToAVS`
115-
116-
```solidity
117-
function registerOperatorToAVS(
118-
address operator,
119-
ISignatureUtils.SignatureWithSaltAndExpiry memory operatorSignature
120-
)
121-
external
122-
onlyWhenNotPaused(PAUSED_OPERATOR_REGISTER_DEREGISTER_TO_AVS)
123-
```
124-
125-
Allows the caller (an AVS) to register an `operator` with itself, given the provided signature is valid.
126-
127-
*Effects*:
128-
* Sets the `operator's` status to `REGISTERED` for the AVS
129-
130-
*Requirements*:
131-
* Pause status MUST NOT be set: `PAUSED_OPERATOR_REGISTER_DEREGISTER_TO_AVS`
132-
* `operator` MUST already be a registered Operator
133-
* `operator` MUST NOT already be registered with the AVS
134-
* `operatorSignature` must be a valid, unused, unexpired signature from the `operator`. The signature is an ECDSA signature by the operator over the [`OPERATOR_AVS_REGISTRATION_TYPEHASH`](../../src/contracts/core/DelegationManagerStorage.sol). Expiry is a utc timestamp in seconds. Salt is used only once per signature to prevent replay attacks.
135-
136-
*As of M2*:
137-
* Operator registration/deregistration does not have any sort of consequences for the Operator or its shares. Eventually, this will tie into payments for services and slashing for misbehavior.
138-
139-
#### `deregisterOperatorFromAVS`
140-
141-
```solidity
142-
function deregisterOperatorFromAVS(
143-
address operator
144-
)
145-
external
146-
onlyWhenNotPaused(PAUSED_OPERATOR_REGISTER_DEREGISTER_TO_AVS)
147-
```
148-
149-
Allows the caller (an AVS) to deregister an `operator` with itself
150-
151-
*Effects*:
152-
* Sets the `operator's` status to `UNREGISTERED` for the AVS
153-
154-
*Requirements*:
155-
* Pause status MUST NOT be set: `PAUSED_OPERATOR_REGISTER_DEREGISTER_TO_AVS`
156-
* `operator` MUST already be registered with the AVS
157-
158-
*As of M2*:
159-
* Operator registration/deregistration does not have any sort of consequences for the Operator or its shares. Eventually, this will tie into payments for services and slashing for misbehavior.
160-
161110
---
162111

163112
### Delegating to an Operator

0 commit comments

Comments
 (0)