-
Notifications
You must be signed in to change notification settings - Fork 329
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
DM Cleanup #788
DM Cleanup #788
Conversation
mapping(address => mapping(IStrategy => Shares)) public stakerStrategyShares; | ||
/// @notice Mapping: staker => Strategy => number of shares which they have deposited. All of these shares | ||
/// may not be withdrawable if the staker has delegated to an operator that has been slashed. | ||
mapping(address => mapping(IStrategy => uint256)) public stakerDepositShares; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is it ok to break this interface?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
few comments and todos
8f0e116
to
01fed89
Compare
f62d94e
to
069c669
Compare
01fed89
to
055bece
Compare
uint64 totalMagnitudeBeforeSlashing = uint64(totalMagnitudes.latest()); | ||
totalMagnitudes.push({key: uint32(block.timestamp), value: totalMagnitudeBeforeSlashing - slashedMagnitude}); | ||
|
||
// 3. Decrease operators shares in the DM | ||
delegation.decreaseOperatorShares(operator, strategies[i], totalMagnitudeBeforeSlashing, uint64(totalMagnitudes.latest())); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we calc and reuse rather than reading from state?
uint64 totalMagnitudeAfterSlashing = totalMagnitudeBeforeSlashing - slashedMagnitude
Will get naming feedback later |
This PR updates the storage of the delegationManager to store the operator's magnitude as part of its shares. Thus, we essentially store$$b_n$$ in this doc
In doing so, we only need two types of shares
What I'm looking for feedback on:
depositShares
andshares
everywhereoperatorShares
on slashOperator?Note: this only compiles for SM/DM, not EPM.
TODOs: