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

Open
wants to merge 45 commits into
base: slashing-magnitudes-fixes
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
f893aeb
fix: changing accounting math when delegating beacon chain ETH
Jan 22, 2025
9c22d31
fix: changing to special-case approach
Jan 23, 2025
eb011b6
docs: removing logs
Jan 23, 2025
aaa92c8
docs: removing more logs
Jan 23, 2025
e543dd1
refactor: remove getDelegatableShares
Jan 23, 2025
d2f5fe0
docs: shares upon delegation
8sunyuan Jan 24, 2025
a4b8281
chore: fix md view
8sunyuan Jan 24, 2025
3bac447
Merge branch 'slashing-magnitudes-fixes' into delegate-shares-fix
eigenmikem Jan 28, 2025
7f7bd79
refactor: move logic into increaseDelegation and slashingLib
Jan 28, 2025
769f6d7
style: undoing formatting changes
Jan 28, 2025
811c240
chore: lint
Jan 28, 2025
b584ee4
chore: lint
Jan 28, 2025
71e498b
Merge branch 'beacon-delegation-accounting' into delegate-shares-fix
Jan 29, 2025
ef50a8b
test: base scenario integration test
Jan 29, 2025
2b46b93
test: integration tests
Jan 30, 2025
5c6f931
docs: natspec comment for dsf.updateNewDelegation
Jan 30, 2025
9eb35aa
Merge branch 'slashing-magnitudes-fixes' into delegate-shares-fix
eigenmikem Jan 30, 2025
2e5d79d
refactor: use view function to decrease contract size
Jan 30, 2025
0b556de
chore: update allocation refs
Jan 30, 2025
5b8703f
Merge branch 'slashing-magnitudes-fixes' into delegate-shares-fix
eigenmikem Jan 30, 2025
d467531
Merge branch 'slashing-magnitudes-fixes' into delegate-shares-fix
eigenmikem Jan 31, 2025
832153e
chore: cleanup new delegation branching
wadealexc Jan 31, 2025
d6837d5
refactor: explicitly reset dsf for simplicity
Jan 31, 2025
57883c1
chore: lint
Jan 31, 2025
73df934
refactor: removing unnecessary logic after explicit dsf reset
Feb 3, 2025
6b87670
chore: lint
Feb 3, 2025
19952dc
refactor: move reset dsf block
Feb 3, 2025
a465514
feat: clarify edge casing in delegate
wadealexc Feb 3, 2025
8ec0162
test: remove all shares integration test
Feb 3, 2025
4f6ba21
docs: comment explaining dsf rest
Feb 3, 2025
13b5170
style: dsf reset condensed to one line
Feb 3, 2025
55abe6a
Merge branch 'slashing-magnitudes-fixes' into delegate-shares-fix
eigenmikem Feb 3, 2025
1ce151a
Update SharesAccounting.md
eigenmikem Feb 3, 2025
9757137
docs: added explanation of dsf rest
eigenmikem Feb 3, 2025
4292393
chore: remove extra reset in undelegate
Feb 3, 2025
b24ad11
refactor: reset dsf to 0 for gas rebate
Feb 3, 2025
6eb8ab3
refactor: change removeDepositShares to return updated shares and use…
Feb 5, 2025
bfa0c7f
chore: integration prefix
Feb 5, 2025
c5d71cf
Merge branch 'slashing-magnitudes-fixes' into delegate-shares-fix
eigenmikem Feb 5, 2025
2fc9a4c
refactor: fixing tests and rounding issues
Feb 11, 2025
578b9f0
chore: remove logs
Feb 11, 2025
31e04bd
chore: updating queuewithdrawalsm2
Feb 12, 2025
768597f
chore: Revert "chore: updating queuewithdrawalsm2"
Feb 12, 2025
9a6b3de
fix: m2 user creation logic
ypatil12 Feb 12, 2025
6948470
test: randomize beacon chain deposit amount
Feb 12, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/contracts/core/DelegationManager.sol
Original file line number Diff line number Diff line change
Expand Up @@ -412,6 +412,10 @@ contract DelegationManager is
depositSharesToWithdraw: singleDepositShares,
slashingFactors: singleSlashingFactor
});

//Reset DepositScalingFactor
DepositScalingFactor storage dsf = _depositScalingFactor[staker][strategies[i]];
dsf.reset();
eigenmikem marked this conversation as resolved.
Show resolved Hide resolved
}

return withdrawalRoots;
Expand Down
4 changes: 4 additions & 0 deletions src/contracts/libraries/SlashingLib.sol
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,10 @@ library SlashingLib {
dsf._scalingFactor = newDepositScalingFactor;
}

function reset(DepositScalingFactor storage dsf) internal {
dsf._scalingFactor = uint256(WAD);
}

// CONVERSION

function calcWithdrawable(
Expand Down
Loading