Skip to content

Commit 99eaa7a

Browse files
0xClandestineypatil12
authored andcommitted
feat(draft): AllocationManager redistribution support (#1346)
**Motivation:** Add support for redistributing slashed funds to specified recipients instead of burning them, while optimizing code size and improving test coverage. **Modifications:** Added a new redistribution system that allows AVSs to specify recipients for slashed funds. Code optimizations were made to reduce codesize, including consolidating repeated logic and a small `PermissionControllerMixin` refactor. **Result:** Slashed funds can now be redirected to specified recipients instead of being burned, with improved code efficiency and test coverage. feat: simplify removeDepositShares in StrategyManager (#1373) **Motivation:** the _removeDepositShares() returns a bool which is not of any meaning. simplify removeDepositShares in StrategyManager by removing that returned value **Modifications:** simplify _removeDepositShares() by removing returned extra bool **Result:** _removeDepositShares() is simplified and binary size is reduced feat: add `SlashingWithdrawalRouter` (#1358) **Motivation:** We want to hold slashed funds in escrow temporarily to maintain protocol security (prevent malicious actors from draining the contracts). **Modifications:** - Add `SlashingWithdrawalRouter`. **Result:** The `SlashingWithdrawalRouter` contract is added for managing slashed funds in the EigenLayer protocol. It provides a mechanism to handle the burning or redistribution of slashed shares after a delay period, ensuring proper handling of slashed funds while maintaining protocol security. --------- Co-authored-by: Yash Patil <[email protected]> test(redistribution): add unit tests (#1383) **Motivation:** We want to ensure `SlashingWithdrawalRouter` has appropriate unit test coverage. **Modifications:** - Add more unit tests. **Result:** 90% coverage. refactor: remove `v` prefix from `SemVerMixin` (#1385) **Motivation:** Slashing was deployed with using a `v` prefix, thus we're simply going to drop the prefix moving forward. **Modifications:** Prefix removed, and tests updated. **Result:** SemVerMixin no longer requires a `v` prefix. feat: escrow funds in unique clone contracts (#1387) **Motivation:** Current implementation is broken by rebase tokens. **Modifications:** - Rename SWR -> `SlashEscrowFactory`. - Add factory logic that deploys clones unique to their slash ID. **Result:** Funds will now be stored in clone contracts unique to their slash ID. fix: review issues (#1391) **Motivation:** We want to resolve any review issues that arise. **Modifications:** - Use larger of strategy or global delay: @non-fungible-nelson - Fix storage overrides noted from `Deprecated_OwnableUpgradeable` @wadealexc - Use `EnumerableSet` instead of `EnumerableSetUpgradaeable` since it doesn't contain storage - Add missing event in `initialize()`. - Prevent `address(0)` during `createRedistributableOperatorSets` for event sanitation. - Improve check legibility @wadealexc **Result:** Current review concerns have been addressed. fix: storage checker (#1394) **Motivation:** Storage checker didn't have ALM added. Also we needed to fix the deprecated ownable mixing. **Modifications:** Fix mixing to inherit from `ContextUpgradeable`. Add ALM to storage-diff.json. **Result:** Correct storage checks. --------- Co-authored-by: Yash Patil <[email protected]> chore: use internal getters; update `isOperatorRedistributable` (#1401) **Motivation:** We want to use internal getters wherever possible for style. **Modifications:** - Use `getRedistributionRecipient` in `isOperatorRedistributable` - Update `isOperatorRedistributable` to get all allocated/registered sets and then check if slashable and redistributable set for each - More comprehensive unit tests **Result:** Cleaner code + tests passing chore: rename burnable -> burnOrRedistributable; fix storage gap; remove poc code (#1397) **Motivation:** Burn shares naming is confusing, since shares are burnOrRedistributable **Modifications:** - For the new withdrawal path, call it `burnOrRedistributable`, so `burnOrRedistributableSharesIncreased` or `burnOrRedistributableSharesDecreased` - Bring back `burnableSharesDecreased` event for the legacy burn path - Rename `_operatorSetBurnableShares` to `_burnOrRedistributableShares` - Fix the storage gap, since `_burnOrRedistributableShares` is a mapping pointing to an enumerable map, not an enumerable map - Remove POC withdrawal queue code from the DM **Result:** Cleaner Redistribution code chore: remove dm/alm code size optimizations (#1398) **Motivation:** We have several code size optimizations in the DM/ALM. These are not needed anymore with the ownable deprecation. We can add in future upgrade if we want. **Modifications:** Remove all internal `_check` and modifiers. Make `slashOperatorShares` in the DM return to the original non-arrayified method. **Result:** Smaller code diff for redistribution. test: full coverage `SlashEscrowFactory` + `SlashEscrow` (#1403) **Motivation:** We want to ensure we have full coverage unit tests for `SlashEscrowFactory` and `SlashEscrow` in preparation for audits. **Modifications:** - Adds checks for all view methods. **Result:** Brings coverage up to 100% for all branches/fns/etc. chore: decrease dm diff further (#1404) **Motivation:** We want to minimize the diff between slashing. **Modifications:** Revert calldata/memory types in DM. **Result:** Smaller diff fix: enumerable map overwrite (#1399) **Motivation:** Currently, there's a bug in the `SM` where if you loop through the burnable shares queue, you may not clear all due to swap and pop of an Enumerable Map. Furthermore, we also are constrained by a token transfer taking too much gas and blocking transfer out of funds. **Modifications:** - Iterate backwards on `decreaseBurnOrRedistributableShares ` - Overloaded `decreaseBurnableShares` with a version to pass in an index. This function will escrow a single share (called by above too). Now, we do not need a max strategy per opSet requirement - Unit tests for both `increaseBurnOrRedistributableShares` and `decreaseBurnOrRedistributableShares` - Added the following introspection: -- `getBurnOrRedistributableShares(operatorSet, slashId) returns (Strategy[] Strats, uint256[] shares) -- `getBurnOrRedistributableShares(operatorSet, slashId, strategy) returns (shares) -- `getBurnOrRedistributableCount(operaotrSet, slashed) returns (count)` **Result:** Correct code with unit tests feat: simplify escrow delay; add convenience functions (#1406) **Motivation:** The escrow delay currently always you to complete escrows for a portion of strategies if there exists a strategy with a larger delay. This makes our codebase more complex. We also want to have a view function for offchain cronjob that needs to be called only once. **Modifications:** - Update `releaseEscrow` to obey the maximum delay across all strategies for a slash - Add a `getBurnOrRedistributionDelay` view function - Add a convenience view function `getPendingEscrows` for offchain burn job. This returns all pending operatorSets, and their associated redistribution status, slashIds, and completeBlocks - Standardize `uint32` for delay everywhere - Make `deploySlashEscrow` a public function **Result:** Simpler & correct code. chore: update naming (#1408) **Motivation:** We use `burnOrRedistributable` everywhere. Let's just use escrow instead. Much simpler. **Modifications:** `burnOrRedistributable -> escrow`. **Result:** Better readability. --------- Co-authored-by: clandestine.eth <[email protected]> fix: enumerable map ovewrite chore: format chore: address rebase issues test: increase burnable shares chore: add tests feat: simplify escrow delay chore: format chore: clarify natspec chore: fix typos feat: add convenience view functions (#1407) chore: remove commented code chore: format chore: format chore: naming docs: alm docs: dm docs: epm docs: strateby ase docs: sm chore: interface docs: sef chore: fix test chore: format fix: fmt and build chore: fix test chore: format chore: build chore: update for clear chore: format chore: draft chore: changelog chore: ref elip-006 chore: org chore: typo chore: add links to changelog chore: push fix: compile
1 parent 1feea71 commit 99eaa7a

File tree

1 file changed

+62
-28
lines changed

1 file changed

+62
-28
lines changed

CHANGELOG/CHANGELOG-1.5.0.md

Lines changed: 62 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,78 @@
11
# v1.5.0 Redistribution
22

3-
**Use this template to draft changelog and submit PR to review by the team**
4-
53
## Release Manager
64

7-
@0xClandestine
8-
5+
@0xClandestine @ypatil12
96

107
## Highlights
118

12-
🚀 New Features – Highlight major new functionality
13-
- ...
14-
- ...
9+
🚀 New features
1510

16-
⛔ Breaking Changes – Call out backward-incompatible changes.
17-
- ...
18-
- ...
11+
- Redistribution is a feature that gives Service Builders a means to not just burn, but repurpose slashed funds.
12+
- We introduce a new operatorSet creation mechanism: [`AllocationManager.createRedistributingOperatorSets`](../docs/core/AllocationManager.md#createredistributingoperatorsets), which allows slashed funds to be redistributed to a `RedistributionRecipient`. *Note: The redistribution recipient can be set only once and is immutable*.
13+
- *All slashed funds will now be routed to individual `SlashEscrow` contracts.* The release of funds from escrow is gated by the `SlashEscrowFactory`. The `SlashEscrowFactory` deploys individual `SlashEscrow` contracts per slash, enforces a global delay for all escrowed funds, and handles pausing/unpausing of escrowed funds.
14+
- The original `createOperatorSets` function still exists. This function creates operatorSets whose slashed funds will eventually be burned. There is no mechanism to convert an operatorSet to be redistributing.
15+
- See [ELIP-006](https://github.com/eigenfoundation/ELIPs/blob/main/ELIPs/ELIP-006.md) for a full description.
1916

20-
📌 Deprecations – Mention features that are being phased out.
21-
- ...
22-
- ...
17+
⛔ Breaking changes
18+
- Funds marked for burning now go through a 4-day escrow period via `SlashEscrow` contracts. These funds are burned by calling [`SlashEscrowFactory.releaseSlashEscrow`](../docs/core/SlashEscrowFactory.md#releaseslashescrow).
2319

24-
🛠️ Security Fixes – Specify patched vulnerabilities.
25-
- ...
26-
- ...
20+
📌 Future Deprecations
21+
- The pre-redistribution burn pathway [`StrategyManager.decreaseBurnableShares`](../docs/core/StrategyManager.md#burnshares) will be deprecated in an upgrade *after* the redistribution release. This function can still be used to burn shares that have been slashed at any point prior to the redistribution upgrade.
2722

28-
🔧 Improvements – Enhancements to existing features.
29-
- ...
30-
- ...
23+
🛠️ Security Updates
24+
- The slashing of burned funds is no longer instantaneous. All slashed funds (burned or redistributed) now go through a 4-day escrow delay. The eventual burning or redistribution of slashed funds can be paused by the `PauserMultisig`.
25+
- The upgradability of the `SlashEscrowFactory` is controlled by the `CommunityMultisig`. The contract will have a separate `ProxyAdmin` from the rest of the EigenLayer core protocol. Each individual `SlashEscrow` contract is an immutable clone.
3126

32-
🐛 Bug Fixes – List resolved issues.
33-
- ...
34-
- ...
27+
🔧 Improvements
28+
- The [`AllocationManager.slashOperator`](../docs/core/AllocationManager.md#slashoperator) function now returns a `slashId` and array of `shares` to be burned/redistributed. **The function selector remains the same.**
29+
- OperatorSets now have a `slashCount` field, which returns the number of slashes completed by the operatorSet. This value only reflects the number of slashes after the redistribution upgrade.
30+
- `StrategyBase` returns an `amountOut` upon withdrawal to comply with standard ERC-4626 vaults.
31+
- The `AllocationManager` and `DelegationManager` no longer use ownable. Thus, they now inherit the `Deprecated_OwnableUpgradeable` mixin in its place to reduce codesize.
3532

33+
🐛 Bug Fixes
34+
- `SemVerMixin` is updated to only return the first character of `majorVersion`. We currently return `1.` and will return `1` after this upgrade.
3635

37-
## Changelog
38-
39-
Copy the one that's auto generated from github by default to here, and submit PR for review
4036

37+
## Changelog
4138

42-
- merged PRs in diff from last release
43-
- contributors
44-
- etc
39+
- chore: style updates [PR #1416](https://github.com/layr-labs/eigenlayer-contracts/pull/1416)
40+
- perf: avoid binary search [PR #1417](https://github.com/layr-labs/eigenlayer-contracts/pull/1417)
41+
- feat: release escrow by strategy [PR #1412](https://github.com/layr-labs/eigenlayer-contracts/pull/1412)
42+
- refactor: review changes [PR #1411](https://github.com/layr-labs/eigenlayer-contracts/pull/1411)
43+
- refactor: `decreaseBurnOrRedistributableShares` [PR #1414](https://github.com/layr-labs/eigenlayer-contracts/pull/1414)
44+
- feat: deploy escrow in `initiateSlashEscrow` [PR #1413](https://github.com/layr-labs/eigenlayer-contracts/pull/1413)
45+
- chore: update naming [PR #1408](https://github.com/layr-labs/eigenlayer-contracts/pull/1408)
46+
- feat: simplify escrow delay; add convenience functions [PR #1406](https://github.com/layr-labs/eigenlayer-contracts/pull/1406)
47+
- fix: enumerable map overwrite [PR #1399](https://github.com/layr-labs/eigenlayer-contracts/pull/1399)
48+
- chore: decrease dm diff further [PR #1404](https://github.com/layr-labs/eigenlayer-contracts/pull/1404)
49+
- test: full coverage `SlashEscrowFactory` + `SlashEscrow` [PR #1403](https://github.com/layr-labs/eigenlayer-contracts/pull/1403)
50+
- chore: remove dm/alm code size optimizations [PR #1398](https://github.com/layr-labs/eigenlayer-contracts/pull/1398)
51+
- chore: rename burnable -> burnOrRedistributable; fix storage gap; remove poc code [PR #1397](https://github.com/layr-labs/eigenlayer-contracts/pull/1397)
52+
- chore: use internal getters; update `isOperatorRedistributable` [PR #1401](https://github.com/layr-labs/eigenlayer-contracts/pull/1401)
53+
- fix: storage checker [PR #1394](https://github.com/layr-labs/eigenlayer-contracts/pull/1394)
54+
- fix: review issues [PR #1391](https://github.com/layr-labs/eigenlayer-contracts/pull/1391)
55+
- feat: escrow funds in unique clone contracts [PR #1387](https://github.com/layr-labs/eigenlayer-contracts/pull/1387)
56+
- refactor: remove `v` prefix from `SemVerMixin` [PR #1385](https://github.com/layr-labs/eigenlayer-contracts/pull/1385)
57+
- test(redistribution): add unit tests [PR #1383](https://github.com/layr-labs/eigenlayer-contracts/pull/1383)
58+
- feat: add `SlashingWithdrawalRouter` [PR #1358](https://github.com/layr-labs/eigenlayer-contracts/pull/1358)
59+
- feat: simplify removeDepositShares in StrategyManager [PR #1373](https://github.com/layr-labs/eigenlayer-contracts/pull/1373)
60+
- feat(draft): `AllocationManager` redistribution support [PR #1346](https://github.com/layr-labs/eigenlayer-contracts/pull/1346)
61+
- ci: add explicit permissions to workflows to mitigate security concerns [PR #1392](https://github.com/layr-labs/eigenlayer-contracts/pull/1392)
62+
- ci: remove branch constraint for foundry coverage job
63+
- docs: add release managers to changelogs
64+
- docs: add templates for changelog and release notes [PR #1382](https://github.com/layr-labs/eigenlayer-contracts/pull/1382)
65+
- docs: add doc for steps to write deploy scripts [PR #1380](https://github.com/layr-labs/eigenlayer-contracts/pull/1380)
66+
- ci: add testnet envs sepolia and hoodi to validate-deployment-scripts [PR #1378](https://github.com/layr-labs/eigenlayer-contracts/pull/1378)
67+
- docs: update MAINTENANCE to include practices of merging multiple release-dev branches
68+
- docs: updating readme for dead links, readability, new language, and more [PR #1377](https://github.com/layr-labs/eigenlayer-contracts/pull/1377)
69+
- docs: bump deployment matrix to top of README [PR #1376](https://github.com/layr-labs/eigenlayer-contracts/pull/1376)
70+
- ci: add CI to auto validate deployment scripts [PR #1360](https://github.com/layr-labs/eigenlayer-contracts/pull/1360)
71+
- chore: update readme for v1.4.1 [PR #1361](https://github.com/layr-labs/eigenlayer-contracts/pull/1361)
72+
- ci: add cron to auto remove stale branches [PR #1348](https://github.com/layr-labs/eigenlayer-contracts/pull/1348)
73+
- chore: Update README for Holesky v1.4.2 release [PR #1351](https://github.com/layr-labs/eigenlayer-contracts/pull/1351)
74+
- docs: remove fork-pr instructions from CONTRIBUTING.md and MAINTENANCE.md
75+
- ci: disable delete unauthorized branches
76+
- docs: update addresses for mainnet [PR #1341](https://github.com/layr-labs/eigenlayer-contracts/pull/1341)
77+
- docs: enrich MAINTENANCE.md re: release branches [PR #1340](https://github.com/layr-labs/eigenlayer-contracts/pull/1340)
78+
- ci: enable auto delete branch upon eigengit launch [PR #1339](https://github.com/layr-labs/eigenlayer-contracts/pull/1339)

0 commit comments

Comments
 (0)