test: rounding tests low slashing factors#1178
Merged
8sunyuan merged 10 commits intotest/slashing-integration-testingfrom Mar 4, 2025
Merged
test: rounding tests low slashing factors#11788sunyuan merged 10 commits intotest/slashing-integration-testingfrom
8sunyuan merged 10 commits intotest/slashing-integration-testingfrom
Conversation
eigenmikem
reviewed
Feb 28, 2025
| bytes32[] memory withdrawalRoots = _getWithdrawalHashes(withdrawals); | ||
| check_Undelegate_State(staker, operator, withdrawals, withdrawalRoots, strategies, initDepositShares, 0.toArrayU256()); | ||
|
|
||
| // 6. redeposit (start/complete checkpoint) |
Collaborator
There was a problem hiding this comment.
Should we be actually depositing another 32 ETH and starting a validator in these steps to check that "redepositing" is working?
Contributor
Author
There was a problem hiding this comment.
Good point, I personally define redeposit as adding shares so this can be either from verify wc of new validators, completing checkpoints, or completing any queued withdrawals.
I'll update this test to randomly choose between those 2 paths on the EigenPod
5ee230a to
63451b2
Compare
eigenmikem
approved these changes
Mar 4, 2025
837d3fa to
b86b8ab
Compare
ypatil12
pushed a commit
that referenced
this pull request
Mar 5, 2025
<!--
🚨 ATTENTION! 🚨
This PR template is REQUIRED. PRs not following this format will be
closed without review.
Requirements:
- PR title must follow commit conventions:
https://www.conventionalcommits.org/en/v1.0.0/
- Label your PR with the correct type (e.g., 🐛 Bug, ✨ Enhancement, 🧪
Test, etc.)
- Provide clear and specific details in each section
-->
**Motivation:**
Testing coverage for rounding edge cases.
**Modifications:**
Added test file in `Register_Allocate_Slash_VerifyWC_.t.sol`
The _init setup creates an Operator registered to an OperatorSet who
gets slashed down to 1 maxMagnitude.
- Removed duplicate function `assert_Snap_StakeBecomeUnslashable`
- Added setter for BCSF on EPMWrapper
- Fixed `assert_Snap_DSF_State_WithdrawalAsShares()` for when fully
slashed
- Fixed `assert_Snap_DSF_State_Delegation()` to use staker's operator
magnitudes instead of staker's magnitude itself
- Additional checks helpers
- Added helper `getSlashingFactor` for User.t.sol
**Result:**
Integration Tests with 1 operator MaxMagnitude
`test_slashBC_startCompleteCP_queue_complete`
`test_slash_undelegate_redeposit`
`test_slash_undelegate_completeAsTokens_verifyWC`
`test_slash_undelegate_completeAsShares_startCompleteCP`
`test_queueAllShares_completeAsTokens`
Integration Tests with 1 BCSF
`test_verifyWC_startCompleteCP`
`test_slashFullyBC_deposit`
`test_slashAVS_delegate_startCompleteCP`
Integration Tests with High DSF and repeat deposits
`test_multiple_deposits`
This was referenced Mar 5, 2025
ypatil12
pushed a commit
that referenced
this pull request
Mar 5, 2025
<!--
🚨 ATTENTION! 🚨
This PR template is REQUIRED. PRs not following this format will be
closed without review.
Requirements:
- PR title must follow commit conventions:
https://www.conventionalcommits.org/en/v1.0.0/
- Label your PR with the correct type (e.g., 🐛 Bug, ✨ Enhancement, 🧪
Test, etc.)
- Provide clear and specific details in each section
-->
**Motivation:**
Testing coverage for rounding edge cases.
**Modifications:**
Added test file in `Register_Allocate_Slash_VerifyWC_.t.sol`
The _init setup creates an Operator registered to an OperatorSet who
gets slashed down to 1 maxMagnitude.
- Removed duplicate function `assert_Snap_StakeBecomeUnslashable`
- Added setter for BCSF on EPMWrapper
- Fixed `assert_Snap_DSF_State_WithdrawalAsShares()` for when fully
slashed
- Fixed `assert_Snap_DSF_State_Delegation()` to use staker's operator
magnitudes instead of staker's magnitude itself
- Additional checks helpers
- Added helper `getSlashingFactor` for User.t.sol
**Result:**
Integration Tests with 1 operator MaxMagnitude
`test_slashBC_startCompleteCP_queue_complete`
`test_slash_undelegate_redeposit`
`test_slash_undelegate_completeAsTokens_verifyWC`
`test_slash_undelegate_completeAsShares_startCompleteCP`
`test_queueAllShares_completeAsTokens`
Integration Tests with 1 BCSF
`test_verifyWC_startCompleteCP`
`test_slashFullyBC_deposit`
`test_slashAVS_delegate_startCompleteCP`
Integration Tests with High DSF and repeat deposits
`test_multiple_deposits`
ypatil12
added a commit
that referenced
this pull request
Mar 5, 2025
**Motivation:** Slashing Integration Testing for Competition Audit **Modifications:** ***General State Validation*** - #1204 - #1198 - #1169 - #1158 ***Upgrade Tests*** - #1187 - #1171 - #1143 ***Dual Slash Tests*** - #1195 - #1153 ***Rounding Tests*** - #1178 ***EigenPod Tests*** - #1191 - #1188 - #1203 - #1194 - #1163 ***Invariants*** - #1201 - #1176 - #1192 - #1197 - #1175 - #1189 - #1150 - #1149 **Result:** Comprehensive Test Coverage
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation:
Testing coverage for rounding edge cases.
Modifications:
Added test file in
Register_Allocate_Slash_VerifyWC_.t.solThe _init setup creates an Operator registered to an OperatorSet who gets slashed down to 1 maxMagnitude.
assert_Snap_StakeBecomeUnslashableassert_Snap_DSF_State_WithdrawalAsShares()for when fully slashedassert_Snap_DSF_State_Delegation()to use staker's operator magnitudes instead of staker's magnitude itselfgetSlashingFactorfor User.t.solResult:
Integration Tests with 1 operator MaxMagnitude
test_slashBC_startCompleteCP_queue_completetest_slash_undelegate_redeposittest_slash_undelegate_completeAsTokens_verifyWCtest_slash_undelegate_completeAsShares_startCompleteCPtest_queueAllShares_completeAsTokensIntegration Tests with 1 BCSF
test_verifyWC_startCompleteCPtest_slashFullyBC_deposittest_slashAVS_delegate_startCompleteCPIntegration Tests with High DSF and repeat deposits
test_multiple_deposits