You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/core/AllocationManager.md
+99-43Lines changed: 99 additions & 43 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,31 +6,26 @@
6
6
7
7
## Prerequisites
8
8
9
-
-[The Mechanics of Allocating and Slashing Unique Stake](https://forum.eigenlayer.xyz/t/the-mechanics-of-allocating-and-slashing-unique-stake/13870)
9
+
*[The Mechanics of Allocating and Slashing Unique Stake](https://forum.eigenlayer.xyz/t/the-mechanics-of-allocating-and-slashing-unique-stake/13870)
10
10
11
11
## Overview
12
12
13
13
The AllocationManager contract manages the allocation and slashing of operators' slashable stake across various strategies and operator sets. It also enforces allocation and deallocation delays and handles the slashing process initiated by AVSs.
14
14
15
-
## Parameterization
16
-
17
-
-`ALLOCATION_CONFIGURATION_DELAY`: The delay in blocks (estimated) before allocations take effect.
18
-
<!-- TODO: remove these "Very TBD" etc statements and get clarity here -->
19
-
- Mainnet: `21 days`. Very TBD
20
-
- Testnet: `1 hours`. Very TBD
21
-
- Public Devnet: `10 minutes`
22
-
-`DEALLOCATION_DELAY`: The delay in blocks (estimated) before deallocations take effect.
23
-
- Mainnet: `17.5 days`. Slightly TBD
24
-
- Testnet: `3 days`. Very TBD
25
-
- Public Devnet: `1 days`
26
-
27
-
## Roles
28
-
29
15
Two types of users interact directly with the AllocationManager:
30
16
*[Operators](#operators)
31
17
*[AVSs](#avss)
32
18
33
-
---
19
+
## Parameterization
20
+
21
+
*`ALLOCATION_CONFIGURATION_DELAY`: The delay in blocks (estimated) before allocations take effect.
22
+
* Mainnet: `126000 blocks` (17.5 days).
23
+
* Testnet: `90 blocks` (15 minutes).
24
+
* Public Devnet: `90 blocks` (15 minutes).
25
+
*`DEALLOCATION_DELAY`: The delay in blocks (estimated) before deallocations take effect.
26
+
* Mainnet: `100800 blocks` (14 days).
27
+
* Testnet: `60 blocks` (10 minutes).
28
+
* Public Devnet: `60 blocks` (10 minutes).
34
29
35
30
## Operators
36
31
@@ -41,31 +36,40 @@ Operators interact with the AllocationManager to join operator sets, modify thei
41
36
An operator set is defined as below:
42
37
43
38
```solidity
39
+
/**
40
+
* @notice An operator set identified by the AVS address and an identifier
41
+
* @param avs The address of the AVS this operator set belongs to
42
+
* @param id The unique identifier for the operator set
43
+
*/
44
44
struct OperatorSet {
45
45
address avs;
46
46
uint32 id;
47
47
}
48
48
```
49
49
50
-
Every `operatorSet` corresponds to a single AVS, as indicated by the `avs` parameter. Each `operatorSet` is then given a specific `id` upon creation, which must be unique per `avs`. Together, the `avs` and `id` form the `key` that uniquely identifies a given `operatorSet`.
50
+
Every `OperatorSet` corresponds to a single AVS, as indicated by the `avs` parameter. Each `OperatorSet` is then given a specific `id` upon creation, which must be unique per `avs`. Together, the `avs` and `id` form the `key` that uniquely identifies a given `OperatorSet`.
51
51
52
-
Operator registrations are tracked with the struct defined below:
52
+
All members of an operator set are stored in the below mapping:
53
53
54
54
```solidity
55
-
/**
56
-
* @notice Parameters used to register for an AVS's operator sets
57
-
* @param avs the AVS being registered for
58
-
* @param operatorSetIds the operator sets within the AVS to register for
59
-
* @param data extra data to be passed to the AVS to complete registration
60
-
*/
61
-
struct RegisterParams {
62
-
address avs;
63
-
uint32[] operatorSetIds;
64
-
bytes data;
65
-
}
55
+
/// @dev Lists the members of an AVS's operator set
The `Bytes32Set` value saves a list of `key` values from `OperatorSet` instances. Each operator [registration](#registerforoperatorsets) and [deregistration](#deregisterfromoperatorsets) respectively adds and removes the relevant `key` for a given operator.
71
+
72
+
The below struct captures the registration status for an operator regarding a given operator set:
69
73
70
74
```solidity
71
75
/**
@@ -80,14 +84,17 @@ struct RegistrationStatus {
80
84
}
81
85
```
82
86
83
-
This data is split across two different mappings:
87
+
Note that the `RegistrationStatus` for an operator of an operator set is expected to be in one of three states:
88
+
*`registered: false` and `registeredUntil: 0`
89
+
* Before any registrations or deregistrations.
90
+
*`registered: true` and `registeredUntil: 0`
91
+
* After an operator has successfully registered for an operator set.
92
+
*`registered: false` and `registeredUntil: block.number + DEALLOCATION_DELAY`
93
+
* A deregistered operator. Operators may be slashed for any slashable behavior until the delay has passed.
84
94
85
-
```solidity
86
-
/// @dev Lists the operator sets the operator is registered for. Note that an operator
87
-
/// can be registered without allocated stake. Likewise, an operator can allocate
An operator may call this function to register for any number of operator sets of a given AVS at once. Operator registrations are provided in the form of the struct defined below:
115
+
116
+
```solidity
117
+
/**
118
+
* @notice Parameters used to register for an AVS's operator sets
119
+
* @param avs the AVS being registered for
120
+
* @param operatorSetIds the operator sets within the AVS to register for
121
+
* @param data extra data to be passed to the AVS to complete registration
122
+
*/
123
+
struct RegisterParams {
124
+
address avs;
125
+
uint32[] operatorSetIds;
126
+
bytes data;
127
+
}
128
+
```
129
+
130
+
The `data` is arbitrary information passed onto the AVS's specific `AVSRegistrar` for the AVS's particular considerations for acceptance. If the AVS reverts, registration will fail.
131
+
107
132
*Effects*:
108
-
* The proposed operator sets are added to the operator's list of registered sets
109
-
* The operator is marked as registered for the given operator sets
133
+
* The proposed operator sets are added to the operator's list of registered sets (`registeredSets`)
134
+
* The operator is added to `_operatorSetMembers` for each operator set
135
+
* The operator is marked as registered for the given operator sets (in `registrationStatus`)
136
+
* The `params` for registration are passed to the AVS's `AVSRegistrar`, which can arbitrarily handle the registration request
110
137
111
138
*Requirements*:
139
+
* Operator registration/deregistration MUST NOT be paused
112
140
* Address MUST be registered as an operator
113
141
* Caller MUST be the operator
114
142
* An admin and/or appointee for the account can also call this function (see the [PermissionController](../permissions/PermissionController.md))
115
-
* Function MUST NOT be paused
116
-
* Proposed operator sets MUST be registered for a given AVS
117
-
* Operator MUST NOT be registered for any given operator sets
143
+
* Each operator set ID MUST exist for the given AVS
144
+
* Operator MUST NOT already be registered for any proposed operator sets
145
+
* The AVS's `AVSRegistrar` MUST NOT revert
146
+
<!-- There is no explict check that the AVS exists -- presumably captured by checking that the opeartor set ID exists for the AVS? -->
Operators may desire to deregister from operator sets; this function generally inverts the effects of `registerForOperatorSets` with some specific exceptions.
159
+
160
+
*Effects*:
161
+
* The proposed operator sets are removed from the operator's list of registered sets (`registeredSets`)
162
+
* The operator is removed from `_operatorSetMembers` for each operator set
163
+
* The operator is marked as deregistered for the given operator sets (in `registrationStatus`)
164
+
* The operator's `registeredUntil` value is set to `uint32(block.number) + DEALLOCATION_DELAY`
165
+
* As mentioned above, this allows for AVSs to slash deregistered operators that performed slashable behavior, until the delay expires
166
+
* The `params` for registration are passed to the AVS's `AVSRegistrar`, which can arbitrarily handle the registration request
167
+
168
+
*Requirements*:
169
+
<!-- * Address MUST be registered as an operator -->
170
+
* Operator registration/deregistration MUST NOT be paused
171
+
* Caller MUST be the operator OR the AVS
172
+
* An admin and/or appointee for either can also call this function (see the [PermissionController](../permissions/PermissionController.md))
173
+
* Each operator set ID MUST exist for the given AVS
174
+
* Operator MUST be registered for the given operator sets
175
+
* Note that, unlike `registerForOperatorSets`, the AVS's `AVSRegistrar` MAY revert and the deregistration will still succeed
176
+
177
+
### Allocation Modifications
122
178
123
179
#### `modifyAllocations`
124
180
@@ -182,7 +238,7 @@ This function is used to complete pending deallocations for a list of strategies
182
238
183
239
Completing a deallocation decreases the encumbered magnitude for the strategy, allowing them to make allocations with that magnitude. Encumbered magnitude must be decreased only upon completion because pending deallocations can be slashed before they are completable.
0 commit comments