Skip to content

Commit 55db48b

Browse files
authored
Merge branch 'mike/slashing-invariants' into slashing-integration-tests
2 parents b2b3f7f + 184a361 commit 55db48b

File tree

186 files changed

+11139
-9799
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

186 files changed

+11139
-9799
lines changed

.github/workflows/certora-prover.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ jobs:
3232
- name: Install Foundry
3333
uses: foundry-rs/foundry-toolchain@v1
3434
with:
35-
version: nightly
35+
version: stable
3636
- name: Install forge dependencies
3737
run: forge install
3838
- name: Install python

.github/workflows/coverage.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ jobs:
5050
- name: Install Foundry
5151
uses: foundry-rs/foundry-toolchain@v1
5252
with:
53-
version: nightly
53+
version: stable
5454
- name: Run coverage
5555
run: forge coverage --report lcov
5656
env:

.github/workflows/deploy-local.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ jobs:
3030
- name: Install Foundry
3131
uses: foundry-rs/foundry-toolchain@v1
3232
with:
33-
version: nightly
33+
version: stable
3434
- name: Run forge install
3535
run: forge install
3636
- name: Start anvil and deploy

.github/workflows/format.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
- name: Install Foundry
1919
uses: foundry-rs/foundry-toolchain@v1
2020
with:
21-
version: nightly
21+
version: stable
2222
- name: Run forge fmt
2323
run: |
2424
forge fmt --check src/contracts

.github/workflows/storage-report.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
- name: Install Foundry
1717
uses: foundry-rs/foundry-toolchain@v1
1818
with:
19-
version: nightly
19+
version: stable
2020

2121
- name: "Generate and prepare the storage reports for current branch"
2222
run: |

.github/workflows/testinparallel.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ jobs:
3434
- name: Install Foundry
3535
uses: foundry-rs/foundry-toolchain@v1
3636
with:
37-
version: nightly
37+
version: stable
3838

3939
- name: Run Forge build
4040
run: |

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,4 +45,4 @@ gha-docker:
4545
docker run -v $(PWD):/build -w /build --rm -i ${CONTAINER_NAME}:latest bash -c "make gha"
4646

4747
storage-report:
48-
bash "bin/storage-report.sh" "docs/storage-report/"
48+
bash "bin/storage-report.sh" "docs/storage-report/"

docs/README.md

Lines changed: 42 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ This document provides an overview of system components, contracts, and user rol
1616
* [`RewardsCoordinator`](#rewardscoordinator)
1717
* [`AVSDirectory`](#avsdirectory)
1818
* [`AllocationManager`](#allocationmanager)
19+
* [`PermissionController`](#permissioncontroller)
1920
* [Roles and Actors](#roles-and-actors)
2021
* [Common User Flows](#common-user-flows)
2122
* [Depositing Into EigenLayer](#depositing-into-eigenlayer)
@@ -64,10 +65,13 @@ See full documentation in [`/core/StrategyManager.md`](./core/StrategyManager.md
6465
| -------- | -------- | -------- |
6566
| [`DelegationManager.sol`](../src/contracts/core/DelegationManager.sol) | Singleton | Transparent proxy |
6667

67-
The `DelegationManager` sits between the `EigenPodManager` and `StrategyManager` to manage delegation and undelegation of Stakers to Operators. Its primary features are to allow Operators to register as Operators (`registerAsOperator`), to keep track of delegated shares to Operators across different strategies, and to manage withdrawals on behalf of the `EigenPodManager` and `StrategyManager`.
68-
The `DelegationManager` is tightly coupled with the `AllocationManager` as withdrawable shares for a Staker is dependent on reading state from the `AllocationManager`. That is, a staker's withdrawable shares is decreased in the event their delegated Operator was slashed by an AVS (more specifically an operatorSet but more on this later).
68+
The `DelegationManager` sits between the `EigenPodManager` and `StrategyManager` to manage delegation and undelegation of stakers to operators. Its primary features are to allow users to become operators, to keep track of delegated shares to operators across different strategies, and to manage withdrawals on behalf of stakers via the `EigenPodManager` and `StrategyManager`.
6969

70-
See full documentation in [`/core/DelegationManager.md`](./core/DelegationManager.md).
70+
The `DelegationManager` is tightly coupled with the `AllocationManager`. The `DelegationManager` ingests information about slashing as part of managing share accounting for stakers whose operators have been slashed. It also receives directives to slash/burn operator shares when an AVS slashes an operator.
71+
72+
See:
73+
* full documentation in [`/core/DelegationManager.md`](./core/DelegationManager.md)
74+
* share accounting documentation in [`/core/accounting/SharesAccounting.md`](./core/accounting/SharesAccounting.md)
7175

7276
#### RewardsCoordinator
7377

@@ -76,9 +80,9 @@ See full documentation in [`/core/DelegationManager.md`](./core/DelegationManage
7680
| [`RewardsCoordinator.sol`](../src/contracts/core/RewardsCoordinator.sol) | Singleton | Transparent proxy |
7781

7882
The `RewardsCoordinator` is the main entry point of submission and claiming of ERC20 rewards in EigenLayer. It carries out three basic functions:
79-
* AVSs (via the AVS's contracts) submit "rewards submissions" to their registered Operators and Stakers over a specific time period
80-
* *Off-chain*, the rewards updater will use each RewardsSubmission time period to apply reward amounts to historical Staker/Operator stake weights. This is consolidated into a merkle root that is posted *on-chain* to the `RewardsCoordinator`, allowing Stakers/Operators to claim their allocated rewards.
81-
* Stakers/Operators can claim rewards posted by the rewards updater.
83+
* AVSs (via the AVS's contracts) submit "rewards submissions" to their registered operators and stakers over a specific time period
84+
* *Off-chain*, the rewards updater will use each RewardsSubmission time period to apply reward amounts to historical staker/operator stake weights. This is consolidated into a merkle root that is posted *on-chain* to the `RewardsCoordinator`, allowing stakers/operators to claim their allocated rewards.
85+
* Stakers/operators can claim rewards posted by the rewards updater.
8286

8387
See full documentation in [`/core/RewardsCoordinator.md`](./core/RewardsCoordinator.md).
8488

@@ -88,9 +92,9 @@ See full documentation in [`/core/RewardsCoordinator.md`](./core/RewardsCoordina
8892
| -------- | -------- | -------- |
8993
| [`AVSDirectory.sol`](../src/contracts/core/AVSDirectory.sol) | Singleton | Transparent proxy |
9094

91-
##### Note: This contract is left unchanged for backwards compatability. Operator<>AVS Registrations are to be replaced entirely with the `AllocationManager` and this contract will be deprecated(no longer indexed) in a future release.
95+
##### Note: This contract is left unchanged for backwards compatability. Operator<>AVS Registrations are to be replaced entirely with the `AllocationManager` and this contract will be deprecated in a future release.
9296

93-
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`.
97+
Previously, the `AVSDirectory` handled interactions between AVSs and the EigenLayer core contracts. Once registered as an operator in EigenLayer core (via the `DelegationManager`), operators could 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 would record this registration in the core contracts by calling into the `AVSDirectory`. As of the slashing release, this process is now managed by the [`AllocationManager`](#allocationmanager).
9498

9599
See full documentation in [`/core/AVSDirectory.md`](./core/AVSDirectory.md).
96100

@@ -102,19 +106,28 @@ For more information on AVS contracts, see the [middleware repo][middleware-repo
102106
| -------- | -------- | -------- |
103107
| [`AllocationManager.sol`](../src/contracts/core/AllocationManager.sol) | Singleton | Transparent proxy |
104108

105-
The `AllocationManager` is meant to replace the AVSDirectory with the introduction of OperatorSets as well as introduce the core functionality of Slashing. It handles several use cases:
106-
* AVSs can create OperatorSets and can define the EigenLayer Strategies within them
107-
* Operators can register/deregister with AVS operatorSets
108-
* Operators can make slashable security commitments to an operatorSet by allocating a proportion of their total delegated stake for a Strategy to be slashable. Ex. As an operator, I can allocate 50% of my stETH to be slashable by a specific OperatorSet
109-
* AVSs can slash an operator (without being objectively attributable) who has slashable allocations to the AVS's corresponding OperatorSet.
109+
The `AllocationManager` is replaces the AVSDirectory with the introduction of _operator sets_ and slashing. It handles several use cases:
110+
* AVSs can create operator sets and can define the EigenLayer Strategies within them
111+
* Operators can register to or deregister from an AVS's operator sets
112+
* Operators can make slashable security commitments to an operator set by allocating a proportion of their total delegated stake for a Strategy to be slashable. Ex. As an operator, I can allocate 50% of my delegated stETH to be slashable by a specific operator set
113+
* AVSs can slash an operator who has allocated to and is registered for one of the AVS's operator sets
110114

111115
See full documentation in [`/core/AllocationManager.md`](./core/AllocationManager.md).
112116

113-
---
117+
#### PermissionController
118+
119+
| File | Type | Proxy |
120+
| -------- | -------- | -------- |
121+
| [`PermissionController.sol`](../src/contracts/permissions/PermissionController.sol) | Singleton | Transparent proxy |
122+
123+
The `PermissionController` allows AVSs and operators to delegate the ability to call certain core contract functions to other addresses. This delegation ability is not available to stakers, and is not available in ALL core contract functions.
114124

115-
#### Shares Accounting
125+
The following core contracts use the `PermissionController` in certain methods:
126+
* `DelegationManager`
127+
* `AllocationManager`
128+
* `RewardsCoordinator`
116129

117-
TODO
130+
See full documentation in [`/permissions/PermissionController.md`](./permissions/PermissionController.md).
118131

119132
---
120133

@@ -124,39 +137,33 @@ To see an example of the user flows described in this section, check out our int
124137

125138
##### Staker
126139

127-
A Staker is any party who has assets deposited (or "restaked") into EigenLayer. Currently, these assets can be:
140+
A staker is any party who has assets deposited (or "restaked") into EigenLayer. Currently, these assets can be:
128141
* Native beacon chain ETH (via the EigenPodManager)
129-
* Liquid staking tokens (via the StrategyManager): cbETH, rETH, stETH, ankrETH, OETH, osETH, swETH, wBETH
142+
* Arbitrary ERC20s (via the StrategyManager)
130143

131-
Stakers can restake any combination of these: a Staker may hold ALL of these assets, or only one of them.
144+
Stakers can restake any combination of these: a staker may hold ALL of these assets, or only one of them.
132145

133146
*Flows:*
134-
* Stakers **deposit** assets into EigenLayer via either the StrategyManager (for LSTs) or EigenPodManager (for beacon chain ETH)
147+
* Stakers **deposit** assets into EigenLayer via either the StrategyManager (for ERC20s) or the EigenPodManager (for beacon chain ETH)
135148
* Stakers **withdraw** assets via the DelegationManager, *no matter what assets they're withdrawing*
136-
* Stakers **delegate** to an Operator via the DelegationManager
137-
138-
*Unimplemented as of v0.4.0:*
139-
* Stakers are at risk of being slashed if the Operator misbehaves
149+
* Stakers **delegate** to an operator via the DelegationManager
140150

141151
##### Operator
142152

143-
An Operator is a user who helps run the software built on top of EigenLayer (AVSs). Operators register in EigenLayer and allow Stakers to delegate to them, then opt in to provide various services built on top of EigenLayer. Operators may themselves be Stakers; these are not mutually exclusive.
153+
An operator is a user who helps run the software built on top of EigenLayer (AVSs). operators register in EigenLayer and allow stakers to delegate to them, then opt in to provide various services built on top of EigenLayer. operators may themselves be stakers; these are not mutually exclusive.
144154

145155
*Flows:*
146-
* User can **register** as an Operator via the DelegationManager
147-
* Operators can **deposit** and **withdraw** assets just like Stakers can
156+
* Users can **register** as an operator via the DelegationManager
157+
* Operators can **deposit** and **withdraw** assets just like stakers can
148158
* Operators can opt in to providing services for an AVS using that AVS's middleware contracts. See the [EigenLayer middleware][middleware-repo] repo for more details.
149159

150-
*Unimplemented as of v0.4.0:*
151-
* Operators may be slashed by the services they register with (if they misbehave)
152-
153160
---
154161

155162
#### Common User Flows
156163

157164
##### Depositing Into EigenLayer
158165

159-
Depositing into EigenLayer varies depending on whether the Staker is depositing Native ETH or LSTs:
166+
Depositing into EigenLayer varies depending on whether the staker is depositing Native ETH or LSTs:
160167

161168
![.](./images/Staker%20Flow%20Diagrams/Depositing.png)
162169

@@ -166,13 +173,13 @@ Depositing into EigenLayer varies depending on whether the Staker is depositing
166173

167174
##### Undelegating or Queueing a Withdrawal
168175

169-
Undelegating from an Operator automatically queues a withdrawal that needs to go through the `DelegationManager's` withdrawal delay. Stakers that want to withdraw can choose to `undelegate`, or can simply call `queueWithdrawals` directly.
176+
Undelegating from an operator automatically queues a withdrawal that needs to go through the `DelegationManager's` withdrawal delay. Stakers that want to withdraw can choose to `undelegate`, or can simply call `queueWithdrawals` directly.
170177

171178
![.](./images/Staker%20Flow%20Diagrams/Queue%20Withdrawal.png)
172179

173180
##### Completing a Withdrawal as Shares
174181

175-
This flow is mostly useful if a Staker wants to change which Operator they are delegated to. The Staker first needs to undelegate (see above). At this point, they can delegate to a different Operator. However, the new Operator will only be awarded shares once the Staker completes their queued withdrawal "as shares":
182+
This flow is mostly useful if a staker wants to change which operator they are delegated to. The staker first needs to undelegate (see above). At this point, they can delegate to a different operator. However, the new operator will only be awarded shares once the staker completes their queued withdrawal "as shares":
176183

177184
![.](./images/Staker%20Flow%20Diagrams/Complete%20Withdrawal%20as%20Shares.png)
178185

@@ -186,12 +193,12 @@ However, note that *before* a withdrawal can be completed, native ETH stakers wi
186193

187194
##### `EigenPods`: Processing Validator Exits
188195

189-
If a Staker wants to fully withdraw from the beacon chain, they need to perform these additional steps before their withdrawal is completable:
196+
If a staker wants to fully withdraw from the beacon chain, they need to perform these additional steps before their withdrawal is completable:
190197

191198
![.](./images/Staker%20Flow%20Diagrams/Validator%20Exits.png)
192199

193200
##### `EigenPods`: Processing Validator Yield
194201

195-
As the Staker's `EigenPod` accumulates consensus layer or execution layer yield, the `EigenPod's` balance will increase. The Staker can Checkpoint their validator to claim this yield as shares, which can either remain staked in EigenLayer or be withdrawn via the `DelegationManager` withdrawal queue:
202+
As the staker's `EigenPod` accumulates consensus layer or execution layer yield, the `EigenPod's` balance will increase. The staker can Checkpoint their validator to claim this yield as shares, which can either remain staked in EigenLayer or be withdrawn via the `DelegationManager` withdrawal queue:
196203

197204
![.](./images/Staker%20Flow%20Diagrams/Validator%20Yield.png)

0 commit comments

Comments
 (0)