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

slashing: cleanup #842

Merged
merged 12 commits into from
Oct 23, 2024
Merged

slashing: cleanup #842

merged 12 commits into from
Oct 23, 2024

Conversation

8sunyuan
Copy link
Collaborator

@8sunyuan 8sunyuan commented Oct 17, 2024

PR Fixes:

Additional Changes:

  • totalMagnitude -> maxMagnitude
  • renamed scaledSharesToWithdraw to scaledShares. Previous name indicates that its the actual shares to withdraw which is a bit misleading
  • added some clarification to comments and natspec
  • IDelegationManager still had description of undelegation limbo in its natspec. This was removed
  • fixed run-coverage CI due to RPC_MAINNET env not being set

@8sunyuan 8sunyuan marked this pull request as draft October 18, 2024 20:45
@8sunyuan 8sunyuan marked this pull request as ready for review October 21, 2024 02:03
@ypatil12 ypatil12 self-requested a review October 21, 2024 15:19
Copy link

Reading tracefile ./lcov.info.pruned
                                        |Lines       |Functions  |Branches    
Filename                                  |Rate     Num|Rate    Num|Rate     Num
================================================================================
[src/contracts/]
core/AVSDirectory.sol                     |96.4%    112|93.8%    32|    -      0
core/AllocationManager.sol                |90.1%    151|90.0%    20|    -      0
core/DelegationManager.sol                |91.4%    187|81.6%    38|    -      0
core/RewardsCoordinator.sol               |94.3%    123|87.1%    31|    -      0
core/StrategyManager.sol                  |97.0%     67|90.9%    22|    -      0
libraries/BeaconChainProofs.sol           | 100%     22| 100%    11|    -      0
libraries/BytesLib.sol                    | 0.0%    156| 0.0%    14|    -      0
libraries/Endian.sol                      | 100%      2| 100%     1|    -      0
libraries/Merkle.sol                      | 100%     38| 100%     5|    -      0
libraries/SlashingLib.sol                 | 100%     19| 100%    12|    -      0
libraries/Snapshots.sol                   |68.0%     25|85.7%     7|    -      0
mixins/SignatureUtils.sol                 | 100%      6| 100%     5|    -      0
permissions/Pausable.sol                  |95.7%     23|90.9%    11|    -      0
permissions/PauserRegistry.sol            | 100%     12| 100%     6|    -      0
pods/EigenPod.sol                         |96.2%    131|96.2%    26|    -      0
pods/EigenPodManager.sol                  |80.3%     66|93.3%    15|    -      0
strategies/EigenStrategy.sol              | 0.0%     10| 0.0%     5|    -      0
strategies/StrategyBase.sol               |90.9%     44|78.9%    19|    -      0
strategies/StrategyBaseTVLLimits.sol      | 100%     12| 100%     6|    -      0
strategies/StrategyFactory.sol            | 100%     32| 100%     8|    -      0
token/BackingEigen.sol                    |83.3%     30|69.2%    13|    -      0
token/Eigen.sol                           |45.0%     40|61.5%    13|    -      0
================================================================================
                                  Total:|79.5%   1308|83.4%   320|    -      0

Copy link
Collaborator

@ypatil12 ypatil12 left a comment

Choose a reason for hiding this comment

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

Generally looks good. Can we add explicit tests on rounding up?

docs/release/slashing/AllocationManager.md Outdated Show resolved Hide resolved
src/contracts/interfaces/IDelegationManager.sol Outdated Show resolved Hide resolved
src/contracts/core/AllocationManager.sol Show resolved Hide resolved
*
* BACKWARDS COMPATIBLE LEGACY FUNCTIONS
* TO BE DEPRECATED IN FUTURE
*
Copy link
Collaborator

Choose a reason for hiding this comment

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

I feel like we may want a non-reverting getCompletableTimestamp function? Wdyt

src/contracts/core/DelegationManager.sol Outdated Show resolved Hide resolved
src/contracts/libraries/SlashingLib.sol Outdated Show resolved Hide resolved
Copy link

Reading tracefile ./lcov.info.pruned
                                        |Lines       |Functions  |Branches    
Filename                                  |Rate     Num|Rate    Num|Rate     Num
================================================================================
[src/contracts/]
core/AVSDirectory.sol                     |96.4%    112|93.8%    32|    -      0
core/AllocationManager.sol                |90.1%    151|90.0%    20|    -      0
core/DelegationManager.sol                |91.4%    187|81.6%    38|    -      0
core/RewardsCoordinator.sol               |94.3%    123|87.1%    31|    -      0
core/StrategyManager.sol                  |97.0%     67|90.9%    22|    -      0
libraries/BeaconChainProofs.sol           | 100%     22| 100%    11|    -      0
libraries/BytesLib.sol                    | 0.0%    156| 0.0%    14|    -      0
libraries/Endian.sol                      | 100%      2| 100%     1|    -      0
libraries/Merkle.sol                      | 100%     38| 100%     5|    -      0
libraries/SlashingLib.sol                 | 100%     19| 100%    12|    -      0
libraries/Snapshots.sol                   |68.0%     25|85.7%     7|    -      0
mixins/SignatureUtils.sol                 | 100%      6| 100%     5|    -      0
permissions/Pausable.sol                  |95.7%     23|90.9%    11|    -      0
permissions/PauserRegistry.sol            | 100%     12| 100%     6|    -      0
pods/EigenPod.sol                         |96.2%    131|96.2%    26|    -      0
pods/EigenPodManager.sol                  |80.3%     66|93.3%    15|    -      0
strategies/EigenStrategy.sol              | 0.0%     10| 0.0%     5|    -      0
strategies/StrategyBase.sol               |90.9%     44|78.9%    19|    -      0
strategies/StrategyBaseTVLLimits.sol      | 100%     12| 100%     6|    -      0
strategies/StrategyFactory.sol            | 100%     32| 100%     8|    -      0
token/BackingEigen.sol                    |83.3%     30|69.2%    13|    -      0
token/Eigen.sol                           |45.0%     40|61.5%    13|    -      0
================================================================================
                                  Total:|79.5%   1308|83.4%   320|    -      0

Copy link

Reading tracefile ./lcov.info.pruned
                                        |Lines       |Functions  |Branches    
Filename                                  |Rate     Num|Rate    Num|Rate     Num
================================================================================
[src/contracts/]
core/AVSDirectory.sol                     |96.4%    112|93.8%    32|    -      0
core/AllocationManager.sol                |90.1%    151|90.0%    20|    -      0
core/DelegationManager.sol                |91.4%    187|81.6%    38|    -      0
core/RewardsCoordinator.sol               |94.3%    123|87.1%    31|    -      0
core/StrategyManager.sol                  |97.0%     67|90.9%    22|    -      0
libraries/BeaconChainProofs.sol           | 100%     22| 100%    11|    -      0
libraries/BytesLib.sol                    | 0.0%    156| 0.0%    14|    -      0
libraries/Endian.sol                      | 100%      2| 100%     1|    -      0
libraries/Merkle.sol                      | 100%     38| 100%     5|    -      0
libraries/SlashingLib.sol                 | 100%     19| 100%    12|    -      0
libraries/Snapshots.sol                   |88.0%     25|85.7%     7|    -      0
mixins/SignatureUtils.sol                 | 100%      6| 100%     5|    -      0
permissions/Pausable.sol                  |95.7%     23|90.9%    11|    -      0
permissions/PauserRegistry.sol            | 100%     12| 100%     6|    -      0
pods/EigenPod.sol                         |96.2%    131|96.2%    26|    -      0
pods/EigenPodManager.sol                  |80.3%     66|93.3%    15|    -      0
strategies/EigenStrategy.sol              | 0.0%     10| 0.0%     5|    -      0
strategies/StrategyBase.sol               |90.9%     44|78.9%    19|    -      0
strategies/StrategyBaseTVLLimits.sol      | 100%     12| 100%     6|    -      0
strategies/StrategyFactory.sol            | 100%     32| 100%     8|    -      0
token/BackingEigen.sol                    |83.3%     30|69.2%    13|    -      0
token/Eigen.sol                           |45.0%     40|61.5%    13|    -      0
================================================================================
                                  Total:|79.9%   1308|83.4%   320|    -      0

@8sunyuan 8sunyuan merged commit 12848bb into slashing-magnitudes Oct 23, 2024
10 of 11 checks passed
@8sunyuan 8sunyuan deleted the slashing-cleanup branch October 23, 2024 21:01
Copy link

Reading tracefile ./lcov.info.pruned
                                        |Lines       |Functions  |Branches    
Filename                                  |Rate     Num|Rate    Num|Rate     Num
================================================================================
[src/contracts/]
core/AVSDirectory.sol                     |96.4%    112|93.8%    32|    -      0
core/AllocationManager.sol                |88.9%    153|85.7%    21|    -      0
core/DelegationManager.sol                |91.4%    187|81.6%    38|    -      0
core/RewardsCoordinator.sol               |94.3%    123|87.1%    31|    -      0
core/StrategyManager.sol                  |97.0%     67|90.9%    22|    -      0
libraries/BeaconChainProofs.sol           | 100%     22| 100%    11|    -      0
libraries/BytesLib.sol                    | 0.0%    156| 0.0%    14|    -      0
libraries/Endian.sol                      | 100%      2| 100%     1|    -      0
libraries/Merkle.sol                      | 100%     38| 100%     5|    -      0
libraries/SlashingLib.sol                 | 100%     19| 100%    12|    -      0
libraries/Snapshots.sol                   |88.0%     25|85.7%     7|    -      0
mixins/SignatureUtils.sol                 | 100%      6| 100%     5|    -      0
permissions/Pausable.sol                  |95.7%     23|90.9%    11|    -      0
permissions/PauserRegistry.sol            | 100%     12| 100%     6|    -      0
pods/EigenPod.sol                         |96.2%    131|96.2%    26|    -      0
pods/EigenPodManager.sol                  |80.3%     66|93.3%    15|    -      0
strategies/EigenStrategy.sol              | 0.0%     10| 0.0%     5|    -      0
strategies/StrategyBase.sol               |90.9%     44|78.9%    19|    -      0
strategies/StrategyBaseTVLLimits.sol      | 100%     12| 100%     6|    -      0
strategies/StrategyFactory.sol            | 100%     32| 100%     8|    -      0
token/BackingEigen.sol                    |83.3%     30|69.2%    13|    -      0
token/Eigen.sol                           |45.0%     40|61.5%    13|    -      0
================================================================================
                                  Total:|79.8%   1310|83.2%   321|    -      0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants