Skip to content

feat: redistribution upgrade script #1396

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

ypatil12
Copy link
Collaborator

@ypatil12 ypatil12 commented May 23, 2025

Motivation:

Redistribution upgrade script.

Modifications:

Deployment Process:

  1. SlashingEscrowFactory and SlashEscrow are two new deployed contracts
    a. We deploy a new proxyAdmin to upgrade the SlashingEscrowFactory. The owner of this proxyAdmin is the community multisig
  2. Upgrades the following contracts:
    a. DelegationManager
    b. AllocationManager
    c. Strategymanager
    d. EigenPodManager
    e. EigenStrategy
    f. StrategyBeacon
    g. StrategyBaseTVLLimits (pre-longtail strats)

Zeus Config Updates:
In Zeus config, we add a GLOBAL_SLASH_DELAY value. On all testnets (preprod, testnet, testnet-hoodi, tesnet-sepolia) this value is 5 blocks (1 min). On mainnet this value is 28,800 (4 days in blocks)

Run zeus env show <environment> to double check.

Important Checks:

  1. Ensure the _globalBurnOrRedistributionDelay is properly set
  2. Upgradability of the SlashEscrowFactory is controlled by a new SlashEscrowProxyAdmin. The owner of this contract is the CommunityMultisig.

Result:

Updated deploy scripts.

@ypatil12 ypatil12 force-pushed the yash/redistribution-upgrade-script branch from bb4b8eb to e1108eb Compare May 24, 2025 16:36
@ypatil12 ypatil12 force-pushed the yash/redistribution-upgrade-script branch 3 times, most recently from 5b5e7b7 to df9a5ad Compare May 24, 2025 20:28
@ypatil12 ypatil12 requested a review from nadir-akhtar May 25, 2025 18:40
@0xClandestine 0xClandestine force-pushed the release-dev/redistribution branch from 7e82d53 to d88ee4f Compare May 27, 2025 21:57
@ypatil12 ypatil12 force-pushed the yash/redistribution-upgrade-script branch 3 times, most recently from 94b4c37 to 99f0022 Compare May 29, 2025 17:40
Copy link
Contributor

@nadir-akhtar nadir-akhtar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Only one tiny nit

0xClandestine and others added 7 commits May 30, 2025 16:29
**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.

feat: redistribution upgrade scripts

chore: remove added code

fix: epm paused status for sepolia

chore: format

fix: typo

Co-authored-by: bowenli86 <[email protected]>
@ypatil12 ypatil12 force-pushed the yash/redistribution-upgrade-script branch from a656897 to 65f8f65 Compare May 30, 2025 20:29
@ypatil12 ypatil12 merged commit d456af1 into release-dev/redistribution May 30, 2025
14 checks passed
@ypatil12 ypatil12 deleted the yash/redistribution-upgrade-script branch May 30, 2025 20:30
0xClandestine added a commit that referenced this pull request May 30, 2025
**Motivation:**

Redistribution upgrade script.

**Modifications:**

**Deployment Process:**
1. `SlashingEscrowFactory` and `SlashEscrow` are two _new_ deployed
contracts
a. We deploy a new proxyAdmin to upgrade the `SlashingEscrowFactory`.
The owner of this proxyAdmin is the community multisig
3. Upgrades the following contracts:
a. DelegationManager
b. AllocationManager
c. Strategymanager
d. EigenPodManager
e. EigenStrategy
f. StrategyBeacon
g. StrategyBaseTVLLimits (pre-longtail strats)

**Zeus Config Updates:** 
In Zeus config, we add a `GLOBAL_SLASH_DELAY` value. On all testnets
(preprod, testnet, testnet-hoodi, tesnet-sepolia) this value is 5 blocks
(1 min). On mainnet this value is 28,800 (4 days in blocks)

Run `zeus env show <environment>` to double check. 

**Important Checks:**
1. Ensure the `_globalBurnOrRedistributionDelay` is properly set
2. Upgradability of the `SlashEscrowFactory` is controlled by a new
`SlashEscrowProxyAdmin`. The owner of this contract is the
`CommunityMultisig`.

**Result:**

Updated deploy scripts.

---------

Co-authored-by: clandestine.eth <[email protected]>
Co-authored-by: bowenli86 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants