Skip to content
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

fix: delegate shares #1045

Merged
merged 51 commits into from
Feb 13, 2025
Merged

Conversation

eigenmikem
Copy link
Contributor

@eigenmikem eigenmikem commented Jan 22, 2025

Motivation:

Fixes an issue where stakers delegating Beacon Chain ETH from slashed Eigen Pods were able to delegate more shares than they should. Specifically, operators now are delegated a staker's withdrawableShares rather than their depositShares.

Modifications:

  • Changed accounting logic on delegation in DelegationManger.sol
  • DepositScalingFactor now resets when a staker withdraws all their shares, whether through undelegation, redelegation, or a simple withdrawal
  • Changes in StrategyManager.sol, IShareManager.sol, SlashingLib.sol, and EigenPodManager.sol to accommodate new accounting
  • New test files and changes to others to reflect new accounting and invariants
  • Updated docs/SharesAccounting.md

Result:

System is now robust to stakers with arbitrary EigenPod states

@eigenmikem eigenmikem changed the base branch from dev to slashing-magnitudes-fixes January 22, 2025 22:12
wadealexc

This comment was marked as outdated.

Copy link
Collaborator

@wadealexc wadealexc left a comment

Choose a reason for hiding this comment

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

Nice work. There's test cleanup to be done in followup PRs, but this looks great otherwise.

@0xClandestine
Copy link
Member

0xClandestine commented Feb 13, 2025

flaky ci fixed upstream

NOTE: commented out here

@0xClandestine 0xClandestine merged commit f7413d9 into slashing-magnitudes-fixes Feb 13, 2025
11 checks passed
@0xClandestine 0xClandestine deleted the delegate-shares-fix branch February 13, 2025 22:45
ypatil12 added a commit that referenced this pull request Feb 19, 2025
**Motivation:**

Fixes an issue where stakers delegating Beacon Chain ETH from slashed
Eigen Pods were able to delegate more shares than they should.
Specifically, operators now are delegated a staker's
`withdrawableShares` rather than their `depositShares`.

**Modifications:**

- Changed accounting logic on delegation in `DelegationManger.sol`
- `DepositScalingFactor` now resets when a staker withdraws all their
shares, whether through undelegation, redelegation, or a simple
withdrawal
- Changes in `StrategyManager.sol`, `IShareManager.sol`,
`SlashingLib.sol`, and `EigenPodManager.sol` to accommodate new
accounting
- New test files and changes to others to reflect new accounting and
invariants
- Updated `docs/SharesAccounting.md`

**Result:**

System is now robust to stakers with arbitrary EigenPod states

---------

Co-authored-by: Michael <michael@Michaels-MacBook-Pro.local>
Co-authored-by: Michael Sun <michaelsun97@gmail.com>
Co-authored-by: wadealexc <pragma-services@proton.me>
Co-authored-by: Yash Patil <40046473+ypatil12@users.noreply.github.com>
Co-authored-by: clandestine.eth <96172957+0xClandestine@users.noreply.github.com>
ypatil12 added a commit that referenced this pull request Feb 20, 2025
**Motivation:**

Fixes an issue where stakers delegating Beacon Chain ETH from slashed
Eigen Pods were able to delegate more shares than they should.
Specifically, operators now are delegated a staker's
`withdrawableShares` rather than their `depositShares`.

**Modifications:**

- Changed accounting logic on delegation in `DelegationManger.sol`
- `DepositScalingFactor` now resets when a staker withdraws all their
shares, whether through undelegation, redelegation, or a simple
withdrawal
- Changes in `StrategyManager.sol`, `IShareManager.sol`,
`SlashingLib.sol`, and `EigenPodManager.sol` to accommodate new
accounting
- New test files and changes to others to reflect new accounting and
invariants
- Updated `docs/SharesAccounting.md`

**Result:**

System is now robust to stakers with arbitrary EigenPod states

---------

Co-authored-by: Michael <michael@Michaels-MacBook-Pro.local>
Co-authored-by: Michael Sun <michaelsun97@gmail.com>
Co-authored-by: wadealexc <pragma-services@proton.me>
Co-authored-by: Yash Patil <40046473+ypatil12@users.noreply.github.com>
Co-authored-by: clandestine.eth <96172957+0xClandestine@users.noreply.github.com>
ypatil12 added a commit that referenced this pull request Feb 20, 2025
**Motivation:**

Fixes an issue where stakers delegating Beacon Chain ETH from slashed
Eigen Pods were able to delegate more shares than they should.
Specifically, operators now are delegated a staker's
`withdrawableShares` rather than their `depositShares`.

**Modifications:**

- Changed accounting logic on delegation in `DelegationManger.sol`
- `DepositScalingFactor` now resets when a staker withdraws all their
shares, whether through undelegation, redelegation, or a simple
withdrawal
- Changes in `StrategyManager.sol`, `IShareManager.sol`,
`SlashingLib.sol`, and `EigenPodManager.sol` to accommodate new
accounting
- New test files and changes to others to reflect new accounting and
invariants
- Updated `docs/SharesAccounting.md`

**Result:**

System is now robust to stakers with arbitrary EigenPod states

---------

Co-authored-by: Michael <michael@Michaels-MacBook-Pro.local>
Co-authored-by: Michael Sun <michaelsun97@gmail.com>
Co-authored-by: wadealexc <pragma-services@proton.me>
Co-authored-by: Yash Patil <40046473+ypatil12@users.noreply.github.com>
Co-authored-by: clandestine.eth <96172957+0xClandestine@users.noreply.github.com>
ypatil12 added a commit that referenced this pull request Feb 20, 2025
**Motivation:**

Fixes an issue where stakers delegating Beacon Chain ETH from slashed
Eigen Pods were able to delegate more shares than they should.
Specifically, operators now are delegated a staker's
`withdrawableShares` rather than their `depositShares`.

**Modifications:**

- Changed accounting logic on delegation in `DelegationManger.sol`
- `DepositScalingFactor` now resets when a staker withdraws all their
shares, whether through undelegation, redelegation, or a simple
withdrawal
- Changes in `StrategyManager.sol`, `IShareManager.sol`,
`SlashingLib.sol`, and `EigenPodManager.sol` to accommodate new
accounting
- New test files and changes to others to reflect new accounting and
invariants
- Updated `docs/SharesAccounting.md`

**Result:**

System is now robust to stakers with arbitrary EigenPod states

---------

Co-authored-by: Michael <michael@Michaels-MacBook-Pro.local>
Co-authored-by: Michael Sun <michaelsun97@gmail.com>
Co-authored-by: wadealexc <pragma-services@proton.me>
Co-authored-by: Yash Patil <40046473+ypatil12@users.noreply.github.com>
Co-authored-by: clandestine.eth <96172957+0xClandestine@users.noreply.github.com>
ypatil12 added a commit that referenced this pull request Feb 20, 2025
**Motivation:**

Fixes an issue where stakers delegating Beacon Chain ETH from slashed
Eigen Pods were able to delegate more shares than they should.
Specifically, operators now are delegated a staker's
`withdrawableShares` rather than their `depositShares`.

**Modifications:**

- Changed accounting logic on delegation in `DelegationManger.sol`
- `DepositScalingFactor` now resets when a staker withdraws all their
shares, whether through undelegation, redelegation, or a simple
withdrawal
- Changes in `StrategyManager.sol`, `IShareManager.sol`,
`SlashingLib.sol`, and `EigenPodManager.sol` to accommodate new
accounting
- New test files and changes to others to reflect new accounting and
invariants
- Updated `docs/SharesAccounting.md`

**Result:**

System is now robust to stakers with arbitrary EigenPod states

---------

Co-authored-by: Michael <michael@Michaels-MacBook-Pro.local>
Co-authored-by: Michael Sun <michaelsun97@gmail.com>
Co-authored-by: wadealexc <pragma-services@proton.me>
Co-authored-by: Yash Patil <40046473+ypatil12@users.noreply.github.com>
Co-authored-by: clandestine.eth <96172957+0xClandestine@users.noreply.github.com>
ypatil12 added a commit that referenced this pull request Feb 20, 2025
**Motivation:**

Fixes an issue where stakers delegating Beacon Chain ETH from slashed
Eigen Pods were able to delegate more shares than they should.
Specifically, operators now are delegated a staker's
`withdrawableShares` rather than their `depositShares`.

**Modifications:**

- Changed accounting logic on delegation in `DelegationManger.sol`
- `DepositScalingFactor` now resets when a staker withdraws all their
shares, whether through undelegation, redelegation, or a simple
withdrawal
- Changes in `StrategyManager.sol`, `IShareManager.sol`,
`SlashingLib.sol`, and `EigenPodManager.sol` to accommodate new
accounting
- New test files and changes to others to reflect new accounting and
invariants
- Updated `docs/SharesAccounting.md`

**Result:**

System is now robust to stakers with arbitrary EigenPod states

---------

Co-authored-by: Michael <michael@Michaels-MacBook-Pro.local>
Co-authored-by: Michael Sun <michaelsun97@gmail.com>
Co-authored-by: wadealexc <pragma-services@proton.me>
Co-authored-by: Yash Patil <40046473+ypatil12@users.noreply.github.com>
Co-authored-by: clandestine.eth <96172957+0xClandestine@users.noreply.github.com>
ypatil12 added a commit that referenced this pull request Feb 20, 2025
**Motivation:**

Fixes an issue where stakers delegating Beacon Chain ETH from slashed
Eigen Pods were able to delegate more shares than they should.
Specifically, operators now are delegated a staker's
`withdrawableShares` rather than their `depositShares`.

**Modifications:**

- Changed accounting logic on delegation in `DelegationManger.sol`
- `DepositScalingFactor` now resets when a staker withdraws all their
shares, whether through undelegation, redelegation, or a simple
withdrawal
- Changes in `StrategyManager.sol`, `IShareManager.sol`,
`SlashingLib.sol`, and `EigenPodManager.sol` to accommodate new
accounting
- New test files and changes to others to reflect new accounting and
invariants
- Updated `docs/SharesAccounting.md`

**Result:**

System is now robust to stakers with arbitrary EigenPod states

---------

Co-authored-by: Michael <michael@Michaels-MacBook-Pro.local>
Co-authored-by: Michael Sun <michaelsun97@gmail.com>
Co-authored-by: wadealexc <pragma-services@proton.me>
Co-authored-by: Yash Patil <40046473+ypatil12@users.noreply.github.com>
Co-authored-by: clandestine.eth <96172957+0xClandestine@users.noreply.github.com>
ypatil12 added a commit that referenced this pull request Feb 20, 2025
**Motivation:**

Fixes an issue where stakers delegating Beacon Chain ETH from slashed
Eigen Pods were able to delegate more shares than they should.
Specifically, operators now are delegated a staker's
`withdrawableShares` rather than their `depositShares`.

**Modifications:**

- Changed accounting logic on delegation in `DelegationManger.sol`
- `DepositScalingFactor` now resets when a staker withdraws all their
shares, whether through undelegation, redelegation, or a simple
withdrawal
- Changes in `StrategyManager.sol`, `IShareManager.sol`,
`SlashingLib.sol`, and `EigenPodManager.sol` to accommodate new
accounting
- New test files and changes to others to reflect new accounting and
invariants
- Updated `docs/SharesAccounting.md`

**Result:**

System is now robust to stakers with arbitrary EigenPod states

---------

Co-authored-by: Michael <michael@Michaels-MacBook-Pro.local>
Co-authored-by: Michael Sun <michaelsun97@gmail.com>
Co-authored-by: wadealexc <pragma-services@proton.me>
Co-authored-by: Yash Patil <40046473+ypatil12@users.noreply.github.com>
Co-authored-by: clandestine.eth <96172957+0xClandestine@users.noreply.github.com>
ypatil12 added a commit that referenced this pull request Feb 20, 2025
**Motivation:**

Fixes an issue where stakers delegating Beacon Chain ETH from slashed
Eigen Pods were able to delegate more shares than they should.
Specifically, operators now are delegated a staker's
`withdrawableShares` rather than their `depositShares`.

**Modifications:**

- Changed accounting logic on delegation in `DelegationManger.sol`
- `DepositScalingFactor` now resets when a staker withdraws all their
shares, whether through undelegation, redelegation, or a simple
withdrawal
- Changes in `StrategyManager.sol`, `IShareManager.sol`,
`SlashingLib.sol`, and `EigenPodManager.sol` to accommodate new
accounting
- New test files and changes to others to reflect new accounting and
invariants
- Updated `docs/SharesAccounting.md`

**Result:**

System is now robust to stakers with arbitrary EigenPod states

---------

Co-authored-by: Michael <michael@Michaels-MacBook-Pro.local>
Co-authored-by: Michael Sun <michaelsun97@gmail.com>
Co-authored-by: wadealexc <pragma-services@proton.me>
Co-authored-by: Yash Patil <40046473+ypatil12@users.noreply.github.com>
Co-authored-by: clandestine.eth <96172957+0xClandestine@users.noreply.github.com>
ypatil12 added a commit that referenced this pull request Feb 20, 2025
**Motivation:**

Fixes an issue where stakers delegating Beacon Chain ETH from slashed
Eigen Pods were able to delegate more shares than they should.
Specifically, operators now are delegated a staker's
`withdrawableShares` rather than their `depositShares`.

**Modifications:**

- Changed accounting logic on delegation in `DelegationManger.sol`
- `DepositScalingFactor` now resets when a staker withdraws all their
shares, whether through undelegation, redelegation, or a simple
withdrawal
- Changes in `StrategyManager.sol`, `IShareManager.sol`,
`SlashingLib.sol`, and `EigenPodManager.sol` to accommodate new
accounting
- New test files and changes to others to reflect new accounting and
invariants
- Updated `docs/SharesAccounting.md`

**Result:**

System is now robust to stakers with arbitrary EigenPod states

---------

Co-authored-by: Michael <michael@Michaels-MacBook-Pro.local>
Co-authored-by: Michael Sun <michaelsun97@gmail.com>
Co-authored-by: wadealexc <pragma-services@proton.me>
Co-authored-by: Yash Patil <40046473+ypatil12@users.noreply.github.com>
Co-authored-by: clandestine.eth <96172957+0xClandestine@users.noreply.github.com>
ypatil12 added a commit that referenced this pull request Feb 20, 2025
**Motivation:**

Fixes an issue where stakers delegating Beacon Chain ETH from slashed
Eigen Pods were able to delegate more shares than they should.
Specifically, operators now are delegated a staker's
`withdrawableShares` rather than their `depositShares`.

**Modifications:**

- Changed accounting logic on delegation in `DelegationManger.sol`
- `DepositScalingFactor` now resets when a staker withdraws all their
shares, whether through undelegation, redelegation, or a simple
withdrawal
- Changes in `StrategyManager.sol`, `IShareManager.sol`,
`SlashingLib.sol`, and `EigenPodManager.sol` to accommodate new
accounting
- New test files and changes to others to reflect new accounting and
invariants
- Updated `docs/SharesAccounting.md`

**Result:**

System is now robust to stakers with arbitrary EigenPod states

---------

Co-authored-by: Michael <michael@Michaels-MacBook-Pro.local>
Co-authored-by: Michael Sun <michaelsun97@gmail.com>
Co-authored-by: wadealexc <pragma-services@proton.me>
Co-authored-by: Yash Patil <40046473+ypatil12@users.noreply.github.com>
Co-authored-by: clandestine.eth <96172957+0xClandestine@users.noreply.github.com>
ypatil12 added a commit that referenced this pull request Feb 20, 2025
**Motivation:**

Fixes an issue where stakers delegating Beacon Chain ETH from slashed
Eigen Pods were able to delegate more shares than they should.
Specifically, operators now are delegated a staker's
`withdrawableShares` rather than their `depositShares`.

**Modifications:**

- Changed accounting logic on delegation in `DelegationManger.sol`
- `DepositScalingFactor` now resets when a staker withdraws all their
shares, whether through undelegation, redelegation, or a simple
withdrawal
- Changes in `StrategyManager.sol`, `IShareManager.sol`,
`SlashingLib.sol`, and `EigenPodManager.sol` to accommodate new
accounting
- New test files and changes to others to reflect new accounting and
invariants
- Updated `docs/SharesAccounting.md`

**Result:**

System is now robust to stakers with arbitrary EigenPod states

---------

Co-authored-by: Michael <michael@Michaels-MacBook-Pro.local>
Co-authored-by: Michael Sun <michaelsun97@gmail.com>
Co-authored-by: wadealexc <pragma-services@proton.me>
Co-authored-by: Yash Patil <40046473+ypatil12@users.noreply.github.com>
Co-authored-by: clandestine.eth <96172957+0xClandestine@users.noreply.github.com>
ypatil12 added a commit that referenced this pull request Feb 20, 2025
**Motivation:**

Fixes an issue where stakers delegating Beacon Chain ETH from slashed
Eigen Pods were able to delegate more shares than they should.
Specifically, operators now are delegated a staker's
`withdrawableShares` rather than their `depositShares`.

**Modifications:**

- Changed accounting logic on delegation in `DelegationManger.sol`
- `DepositScalingFactor` now resets when a staker withdraws all their
shares, whether through undelegation, redelegation, or a simple
withdrawal
- Changes in `StrategyManager.sol`, `IShareManager.sol`,
`SlashingLib.sol`, and `EigenPodManager.sol` to accommodate new
accounting
- New test files and changes to others to reflect new accounting and
invariants
- Updated `docs/SharesAccounting.md`

**Result:**

System is now robust to stakers with arbitrary EigenPod states

---------

Co-authored-by: Michael <michael@Michaels-MacBook-Pro.local>
Co-authored-by: Michael Sun <michaelsun97@gmail.com>
Co-authored-by: wadealexc <pragma-services@proton.me>
Co-authored-by: Yash Patil <40046473+ypatil12@users.noreply.github.com>
Co-authored-by: clandestine.eth <96172957+0xClandestine@users.noreply.github.com>
ypatil12 added a commit that referenced this pull request Feb 20, 2025
**Motivation:**

Fixes an issue where stakers delegating Beacon Chain ETH from slashed
Eigen Pods were able to delegate more shares than they should.
Specifically, operators now are delegated a staker's
`withdrawableShares` rather than their `depositShares`.

**Modifications:**

- Changed accounting logic on delegation in `DelegationManger.sol`
- `DepositScalingFactor` now resets when a staker withdraws all their
shares, whether through undelegation, redelegation, or a simple
withdrawal
- Changes in `StrategyManager.sol`, `IShareManager.sol`,
`SlashingLib.sol`, and `EigenPodManager.sol` to accommodate new
accounting
- New test files and changes to others to reflect new accounting and
invariants
- Updated `docs/SharesAccounting.md`

**Result:**

System is now robust to stakers with arbitrary EigenPod states

---------

Co-authored-by: Michael <michael@Michaels-MacBook-Pro.local>
Co-authored-by: Michael Sun <michaelsun97@gmail.com>
Co-authored-by: wadealexc <pragma-services@proton.me>
Co-authored-by: Yash Patil <40046473+ypatil12@users.noreply.github.com>
Co-authored-by: clandestine.eth <96172957+0xClandestine@users.noreply.github.com>
ypatil12 added a commit that referenced this pull request Feb 27, 2025
**Motivation:**

Fixes an issue where stakers delegating Beacon Chain ETH from slashed
Eigen Pods were able to delegate more shares than they should.
Specifically, operators now are delegated a staker's
`withdrawableShares` rather than their `depositShares`.

**Modifications:**

- Changed accounting logic on delegation in `DelegationManger.sol`
- `DepositScalingFactor` now resets when a staker withdraws all their
shares, whether through undelegation, redelegation, or a simple
withdrawal
- Changes in `StrategyManager.sol`, `IShareManager.sol`,
`SlashingLib.sol`, and `EigenPodManager.sol` to accommodate new
accounting
- New test files and changes to others to reflect new accounting and
invariants
- Updated `docs/SharesAccounting.md`

**Result:**

System is now robust to stakers with arbitrary EigenPod states

---------

Co-authored-by: Michael <michael@Michaels-MacBook-Pro.local>
Co-authored-by: Michael Sun <michaelsun97@gmail.com>
Co-authored-by: wadealexc <pragma-services@proton.me>
Co-authored-by: Yash Patil <40046473+ypatil12@users.noreply.github.com>
Co-authored-by: clandestine.eth <96172957+0xClandestine@users.noreply.github.com>
ypatil12 pushed a commit that referenced this pull request Feb 27, 2025
fix(slashing): upgrade script part 4 (#953)

fix: patch (#956)

feat: bindings (#960)

fix: remove numtocomplete interface (#966)

feat: add share helpers (#964)

* feat: add share helpers

* fix: add deposit scaling factor

* fix: rebase

fix: slashable window boundaries (#965)

* fix: slashable window boundaries

* test: regression for alm

* test: update withdrawal delay not passed reversion

* test: burning indices

* refactor: switch conditionals

* fix: added unit tests

* test: assert slashable shares in queue

* fix: typos

---------

Co-authored-by: Yash Patil <ypatil12@gmail.com>

refactor: small cleanup (#959)

refactor small cleanup

chore: `forge fmt`

fix: `getQueuedWithdrawals` + test

fix: add constructor back

test: `totalQueued` > `withdrawal.strategies.length`

test(wip): `completeQueuedWithdrawals`

currently failing

fix: effectBlock

test(wip): @8sunyuan patch

fix: one flaky test

fix: second flaky test

feat: slashing patch upgrade script (#967)

* feat: initial deploy

* feat: slashing patch

fix non-present upgrade.json

fix: try catch out of gas edge case (#971)

chore: slashing consolidated script (#972)

test: more slashing integration todos (#961)

* test(wip): todos

* fix: dealloc issue

* fix: remaining

* fix: forktest upgrade issue

* test: add `check_Withdrawal_AsShares_State_AfterSlash`

* refactor: cleanup

* fix: ci

* refactor: review changes

docs: wip slashing docs (#925)

* docs: add slashing docs
* chore: bindings
* docs: fixed commenting and updated queue withdrawal docs
* docs: minor cleanup

---------

Co-authored-by: Nadir Akhtar <nadirakhtar123@gmail.com>

refactor: scaled shares accounting (#975)

* fix: correct expected share calc

* chore: bindings

* fix: rounding on failing unit test

refactor: final slashing cleanup (#982)

* chore: clean comments and naming in dm

* refactor: simplify undelegate method
* feat: removed 0 address check because 0 stakers cant be delegated
* feat: condensed non-staker caller logic

* refactor: remove unnecessary check

* feat: use checks-effects-interactions when completing withdrawals
* feat: remove implicit public method for queuedWithdrawals and impl dedicated getter

* feat: deprecate withdrawer field

* chore: make bindings and clean compile errors

* refactor: redelegate reuses delegateTo and undelegate

* fix: broken integration test

* docs: update to reflect deprecated field

* feat: add getter for stakers withdrawal roots

fix: integration test initialization params (#978)

* fix: initialization params

* fix: roll blocks usage

fix: `SignatureUtils` construction (#990)

* fix: integration test initialization params (#978)

* fix: initialization params

* fix: roll blocks usage

* fix: `SignatureUtils` construction

---------

Co-authored-by: Yash Patil <40046473+ypatil12@users.noreply.github.com>
Co-authored-by: davidironblocks <david@ironblocks.com>

feat: slashing 1.0.3 upgrade script (#995)

* feat: add step 1

* feat: step 1 & 2 complete; pending step 3 sanity

* test: add `_validateProxyDomainSeparators`

* feat: add rc validation

---------

Co-authored-by: clandestine.eth <96172957+0xClandestine@users.noreply.github.com>

refactor: async burning (#1001)

* refactor: burning

* chore: fmt

* chore: update storage report

* chore: update readme

* refactor: add burnableShares for epm storage

* chore: update storage report

docs: finish delegation manager docs (#1004)

* docs: finish delegation manager docs

* docs: update docs readme

* docs: permission controller

* fix: small typos

* docs: address feedback

* docs: nit

---------

Co-authored-by: Michael Sun <michaelsun97@gmail.com>

docs: Strategy Manager slashing updates (#999)

* docs: update StrategyManager docs with slashing delta

* docs: remove references to thirdPartyTransfersForbidden

* docs: update strategy docs to latest
* also various edits to docs and natspec

* chore: fmt and make bindings

---------

Co-authored-by: wadealexc <pragma-services@proton.me>

test: enable shared setups for integration tests (#1036)

* test: improve integration invariants
* also removes unneeded fork logic
* adds checks to some invariants
* fixes some broken tests

* test(integration): enable shared setups

fix: remove token param from Deposit event and related APIs (#1013)

* fix: remove token param from Deposit event and related APIs

* fix: forge fmt

* fix: rebase

* fix: update EigenPodManager and test

* fix: update tests

* fix: update eigenpodmanager tests

* fix: update StrategyManagerMock

* feat: add bindings

* fix: update docs

feat: changing burnableShares to EnumerableMap (#1028)

* feat: changing burnableShares to EnumerableMap

* style: linter

* docs: storage docs

* style: natspec and import

* style: lint

* feat: adding view function for cronjob and moving functions

* fix: updating storage gap

* docs: storage slots comment

* feat: new bindings

* docs: updating StrategyManager doc

* docs: bindings

---------

Co-authored-by: Michael <michael@Michaels-MacBook-Pro.local>

feat: add `getAllocatedStake` and update `getMinimumSlashableStake` (#1037)

* chore: add view functions for isOperatorSlashable

* feat: add `getAllocatedStake` func

* test: getAllocatedStake

* test: add getMinimumSlashableStake tests

* chore: format

* chore: fmt interface

* chore: remove unnecessary test

* chore: update comment

* chore: bindings

---------

Co-authored-by: Yash Patil <40046473+ypatil12@users.noreply.github.com>

test(integration): implement registration and allocation invariants (#1042)

* chore: fix forge nightly release breaking two tests

* test: fix outdated alm tests

fix: delegate shares (#1045)

**Motivation:**

Fixes an issue where stakers delegating Beacon Chain ETH from slashed
Eigen Pods were able to delegate more shares than they should.
Specifically, operators now are delegated a staker's
`withdrawableShares` rather than their `depositShares`.

**Modifications:**

- Changed accounting logic on delegation in `DelegationManger.sol`
- `DepositScalingFactor` now resets when a staker withdraws all their
shares, whether through undelegation, redelegation, or a simple
withdrawal
- Changes in `StrategyManager.sol`, `IShareManager.sol`,
`SlashingLib.sol`, and `EigenPodManager.sol` to accommodate new
accounting
- New test files and changes to others to reflect new accounting and
invariants
- Updated `docs/SharesAccounting.md`

**Result:**

System is now robust to stakers with arbitrary EigenPod states

---------

Co-authored-by: Michael <michael@Michaels-MacBook-Pro.local>
Co-authored-by: Michael Sun <michaelsun97@gmail.com>
Co-authored-by: wadealexc <pragma-services@proton.me>
Co-authored-by: Yash Patil <40046473+ypatil12@users.noreply.github.com>
Co-authored-by: clandestine.eth <96172957+0xClandestine@users.noreply.github.com>

fix: signature utils (#1015)

- *Dynamic Domain Separator:* `SignatureUtils.domainSeparator()` is now
recomputed for each signature verification. This eliminates the need for
storing initial values in storage or as immutables, which is important
for beacon proxy support.

- ~*Version Bump Command:* Introduced `make bump-version VERSION=2`,
which automatically updates the version function's return values.~

- *Version Fn + Constructor Param:* Adds an immutable oz `ShortString`
that's set in the constructor.

feat: require avs register metadata in allocation manager (#1025)

require avs register metadata in allocation manager before they can
create operatorset

---------

Co-authored-by: clandestine.eth <96172957+0xClandestine@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
⚖️ Audit Fix Audit-related fixes.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants