Skip to content

Commit

Permalink
sqaush
Browse files Browse the repository at this point in the history
  • Loading branch information
gpsanant committed Sep 25, 2024
1 parent 13f06b9 commit 299066e
Show file tree
Hide file tree
Showing 86 changed files with 14,460 additions and 7,864 deletions.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -47,3 +47,7 @@ InheritanceGraph.png
surya_report.md

.idea

*state.json
deployed_strategies.json
populate_src*
4 changes: 2 additions & 2 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ This document provides an overview of system components, contracts, and user rol
* [Depositing Into EigenLayer](#depositing-into-eigenlayer)
* [Delegating to an Operator](#delegating-to-an-operator)
* [Undelegating or Queueing a Withdrawal](#undelegating-or-queueing-a-withdrawal)
* [Completing a Withdrawal as Shares](#completing-a-withdrawal-as-shares)
* [Completing a Withdrawal as OwnedShares](#completing-a-withdrawal-as-shares)
* [Completing a Withdrawal as Tokens](#completing-a-withdrawal-as-tokens)
* [Withdrawal Processing: Validator Exits](#withdrawal-processing-validator-exits)
* [Withdrawal Processing: Partial Beacon Chain Withdrawals](#withdrawal-processing-partial-beacon-chain-withdrawals)
Expand Down Expand Up @@ -156,7 +156,7 @@ Undelegating from an Operator automatically queues a withdrawal that needs to go

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

##### Completing a Withdrawal as Shares
##### Completing a Withdrawal as OwnedShares

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":

Expand Down
10 changes: 5 additions & 5 deletions docs/core/DelegationManager.md
Original file line number Diff line number Diff line change
Expand Up @@ -275,9 +275,9 @@ For each strategy/share pair in the `Withdrawal`:

`Withdrawals` concerning `EigenPodManager` shares have some additional nuance depending on whether a withdrawal is specified to be received as tokens vs shares (read more about "why" in [`EigenPodManager.md`](./EigenPodManager.md)):
* `EigenPodManager` withdrawals received as shares:
* Shares ALWAYS go back to the originator of the withdrawal (rather than the `withdrawer` address).
* Shares are also delegated to the originator's Operator, rather than the `withdrawer's` Operator.
* Shares received by the originator may be lower than the shares originally withdrawn if the originator has debt.
* OwnedShares ALWAYS go back to the originator of the withdrawal (rather than the `withdrawer` address).
* OwnedShares are also delegated to the originator's Operator, rather than the `withdrawer's` Operator.
* OwnedShares received by the originator may be lower than the shares originally withdrawn if the originator has debt.
* `EigenPodManager` withdrawals received as tokens:
* Before the withdrawal can be completed, the originator needs to prove that a withdrawal occurred on the beacon chain (see [`EigenPod.verifyAndProcessWithdrawals`](./EigenPodManager.md#eigenpodverifyandprocesswithdrawals)).

Expand All @@ -288,10 +288,10 @@ For each strategy/share pair in the `Withdrawal`:
* See [`EigenPodManager.withdrawSharesAsTokens`](./EigenPodManager.md#eigenpodmanagerwithdrawsharesastokens)
* If `!receiveAsTokens`:
* For `StrategyManager` strategies:
* Shares are awarded to the `withdrawer` and delegated to the `withdrawer's` Operator
* OwnedShares are awarded to the `withdrawer` and delegated to the `withdrawer's` Operator
* See [`StrategyManager.addShares`](./StrategyManager.md#addshares)
* For the native beacon chain ETH strategy (`EigenPodManager`):
* Shares are awarded to `withdrawal.staker`, and delegated to the Staker's Operator
* OwnedShares are awarded to `withdrawal.staker`, and delegated to the Staker's Operator
* See [`EigenPodManager.addShares`](./EigenPodManager.md#eigenpodmanageraddshares)

*Requirements*:
Expand Down
2 changes: 1 addition & 1 deletion docs/core/EigenPod.md
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ Checkpoint proofs comprise the bulk of proofs submitted to an `EigenPod`. Comple
* when the pod has accumulated fees / partial withdrawals from validators
* whether any validators on the beacon chain have increased/decreased in balance

When a checkpoint is completed, shares are updated accordingly for each of these events. Shares can be withdrawn via the `DelegationManager` withdrawal queue (see [DelegationManager: Undelegating and Withdrawing](./DelegationManager.md#undelegating-and-withdrawing)), which means an `EigenPod's` checkpoint proofs also play an important role in allowing Pod Owners to exit funds from the system.
When a checkpoint is completed, shares are updated accordingly for each of these events. OwnedShares can be withdrawn via the `DelegationManager` withdrawal queue (see [DelegationManager: Undelegating and Withdrawing](./DelegationManager.md#undelegating-and-withdrawing)), which means an `EigenPod's` checkpoint proofs also play an important role in allowing Pod Owners to exit funds from the system.

_Important Notes:_
* `EigenPods` can only have **one active checkpoint** at a given time, and once started, checkpoints **cannot be cancelled** (only completed)
Expand Down
37 changes: 21 additions & 16 deletions docs/storage-report/AVSDirectory.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,21 @@
| Name | Type | Slot | Offset | Bytes | Contract |
|---------------------|------------------------------------------------------------------------------------------|------|--------|-------|--------------------------------------------------|
| _initialized | uint8 | 0 | 0 | 1 | src/contracts/core/AVSDirectory.sol:AVSDirectory |
| _initializing | bool | 0 | 1 | 1 | src/contracts/core/AVSDirectory.sol:AVSDirectory |
| __gap | uint256[50] | 1 | 0 | 1600 | src/contracts/core/AVSDirectory.sol:AVSDirectory |
| _owner | address | 51 | 0 | 20 | src/contracts/core/AVSDirectory.sol:AVSDirectory |
| __gap | uint256[49] | 52 | 0 | 1568 | src/contracts/core/AVSDirectory.sol:AVSDirectory |
| pauserRegistry | contract IPauserRegistry | 101 | 0 | 20 | src/contracts/core/AVSDirectory.sol:AVSDirectory |
| _paused | uint256 | 102 | 0 | 32 | src/contracts/core/AVSDirectory.sol:AVSDirectory |
| __gap | uint256[48] | 103 | 0 | 1536 | src/contracts/core/AVSDirectory.sol:AVSDirectory |
| _DOMAIN_SEPARATOR | bytes32 | 151 | 0 | 32 | src/contracts/core/AVSDirectory.sol:AVSDirectory |
| avsOperatorStatus | mapping(address => mapping(address => enum IAVSDirectory.OperatorAVSRegistrationStatus)) | 152 | 0 | 32 | src/contracts/core/AVSDirectory.sol:AVSDirectory |
| operatorSaltIsSpent | mapping(address => mapping(bytes32 => bool)) | 153 | 0 | 32 | src/contracts/core/AVSDirectory.sol:AVSDirectory |
| __gap | uint256[47] | 154 | 0 | 1504 | src/contracts/core/AVSDirectory.sol:AVSDirectory |
| _status | uint256 | 201 | 0 | 32 | src/contracts/core/AVSDirectory.sol:AVSDirectory |
| __gap | uint256[49] | 202 | 0 | 1568 | src/contracts/core/AVSDirectory.sol:AVSDirectory |
| Name | Type | Slot | Offset | Bytes | Contract |
|-----------------------|---------------------------------------------------------------------------------------------------------------|------|--------|-------|--------------------------------------------------|
| _initialized | uint8 | 0 | 0 | 1 | src/contracts/core/AVSDirectory.sol:AVSDirectory |
| _initializing | bool | 0 | 1 | 1 | src/contracts/core/AVSDirectory.sol:AVSDirectory |
| __gap | uint256[50] | 1 | 0 | 1600 | src/contracts/core/AVSDirectory.sol:AVSDirectory |
| _owner | address | 51 | 0 | 20 | src/contracts/core/AVSDirectory.sol:AVSDirectory |
| __gap | uint256[49] | 52 | 0 | 1568 | src/contracts/core/AVSDirectory.sol:AVSDirectory |
| pauserRegistry | contract IPauserRegistry | 101 | 0 | 20 | src/contracts/core/AVSDirectory.sol:AVSDirectory |
| _paused | uint256 | 102 | 0 | 32 | src/contracts/core/AVSDirectory.sol:AVSDirectory |
| __gap | uint256[48] | 103 | 0 | 1536 | src/contracts/core/AVSDirectory.sol:AVSDirectory |
| _DOMAIN_SEPARATOR | bytes32 | 151 | 0 | 32 | src/contracts/core/AVSDirectory.sol:AVSDirectory |
| avsOperatorStatus | mapping(address => mapping(address => enum IAVSDirectory.OperatorAVSRegistrationStatus)) | 152 | 0 | 32 | src/contracts/core/AVSDirectory.sol:AVSDirectory |
| operatorSaltIsSpent | mapping(address => mapping(bytes32 => bool)) | 153 | 0 | 32 | src/contracts/core/AVSDirectory.sol:AVSDirectory |
| isOperatorSetAVS | mapping(address => bool) | 154 | 0 | 32 | src/contracts/core/AVSDirectory.sol:AVSDirectory |
| isOperatorSet | mapping(address => mapping(uint32 => bool)) | 155 | 0 | 32 | src/contracts/core/AVSDirectory.sol:AVSDirectory |
| _operatorSetsMemberOf | mapping(address => struct EnumerableSet.Bytes32Set) | 156 | 0 | 32 | src/contracts/core/AVSDirectory.sol:AVSDirectory |
| _operatorSetMembers | mapping(bytes32 => struct EnumerableSet.AddressSet) | 157 | 0 | 32 | src/contracts/core/AVSDirectory.sol:AVSDirectory |
| operatorSetStatus | mapping(address => mapping(address => mapping(uint32 => struct IAVSDirectory.OperatorSetRegistrationStatus))) | 158 | 0 | 32 | src/contracts/core/AVSDirectory.sol:AVSDirectory |
| __gap | uint256[42] | 159 | 0 | 1344 | src/contracts/core/AVSDirectory.sol:AVSDirectory |
| _status | uint256 | 201 | 0 | 32 | src/contracts/core/AVSDirectory.sol:AVSDirectory |
| __gap | uint256[49] | 202 | 0 | 1568 | src/contracts/core/AVSDirectory.sol:AVSDirectory |
17 changes: 11 additions & 6 deletions docs/storage-report/AVSDirectoryStorage.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
| Name | Type | Slot | Offset | Bytes | Contract |
|---------------------|------------------------------------------------------------------------------------------|------|--------|-------|----------------------------------------------------------------|
| _DOMAIN_SEPARATOR | bytes32 | 0 | 0 | 32 | src/contracts/core/AVSDirectoryStorage.sol:AVSDirectoryStorage |
| avsOperatorStatus | mapping(address => mapping(address => enum IAVSDirectory.OperatorAVSRegistrationStatus)) | 1 | 0 | 32 | src/contracts/core/AVSDirectoryStorage.sol:AVSDirectoryStorage |
| operatorSaltIsSpent | mapping(address => mapping(bytes32 => bool)) | 2 | 0 | 32 | src/contracts/core/AVSDirectoryStorage.sol:AVSDirectoryStorage |
| __gap | uint256[47] | 3 | 0 | 1504 | src/contracts/core/AVSDirectoryStorage.sol:AVSDirectoryStorage |
| Name | Type | Slot | Offset | Bytes | Contract |
|-----------------------|---------------------------------------------------------------------------------------------------------------|------|--------|-------|----------------------------------------------------------------|
| _DOMAIN_SEPARATOR | bytes32 | 0 | 0 | 32 | src/contracts/core/AVSDirectoryStorage.sol:AVSDirectoryStorage |
| avsOperatorStatus | mapping(address => mapping(address => enum IAVSDirectory.OperatorAVSRegistrationStatus)) | 1 | 0 | 32 | src/contracts/core/AVSDirectoryStorage.sol:AVSDirectoryStorage |
| operatorSaltIsSpent | mapping(address => mapping(bytes32 => bool)) | 2 | 0 | 32 | src/contracts/core/AVSDirectoryStorage.sol:AVSDirectoryStorage |
| isOperatorSetAVS | mapping(address => bool) | 3 | 0 | 32 | src/contracts/core/AVSDirectoryStorage.sol:AVSDirectoryStorage |
| isOperatorSet | mapping(address => mapping(uint32 => bool)) | 4 | 0 | 32 | src/contracts/core/AVSDirectoryStorage.sol:AVSDirectoryStorage |
| _operatorSetsMemberOf | mapping(address => struct EnumerableSet.Bytes32Set) | 5 | 0 | 32 | src/contracts/core/AVSDirectoryStorage.sol:AVSDirectoryStorage |
| _operatorSetMembers | mapping(bytes32 => struct EnumerableSet.AddressSet) | 6 | 0 | 32 | src/contracts/core/AVSDirectoryStorage.sol:AVSDirectoryStorage |
| operatorSetStatus | mapping(address => mapping(address => mapping(uint32 => struct IAVSDirectory.OperatorSetRegistrationStatus))) | 7 | 0 | 32 | src/contracts/core/AVSDirectoryStorage.sol:AVSDirectoryStorage |
| __gap | uint256[42] | 8 | 0 | 1344 | src/contracts/core/AVSDirectoryStorage.sol:AVSDirectoryStorage |
Loading

0 comments on commit 299066e

Please sign in to comment.