test: more slashing state validation#1169
test: more slashing state validation#11690xClandestine merged 25 commits intotest/slashing-integration-testingfrom
Conversation
5ae42b2 to
e7189ef
Compare
|
Curious what state validation we're looking to do, the doc didn't specify? @ypatil12 |
| // For each strategy, check (prev - removed == cur) | ||
| for (uint i = 0; i < strategies.length; i++) { | ||
| assertEq(prevShares[i] + addedShares[i], curShares[i], err); | ||
| assertApproxEqAbs(prevShares[i] + addedShares[i], curShares[i], 1, err); |
There was a problem hiding this comment.
What case is causing the need for this?
There was a problem hiding this comment.
testFuzz_deposit_delegate_allocate_partialSlash_redeposit_queue_complete
There was a problem hiding this comment.
@eigenmikem Shouldn't we just be recalculating on this one?
There was a problem hiding this comment.
Yea, elsewhere we've always been depositing before delegating when interacting with a slashed operator so this was never hit. @0xClandestine take a look at the assert_Snap_Expected functions to see explicit calculation, or I can push a commit to change this
src/test/integration/tests/Deposit_Delegate_Allocate_Slash_Queue_Redeposit.t.sol
Outdated
Show resolved
Hide resolved
src/test/integration/tests/Deposit_Delegate_Allocate_Slash_Queue_Redeposit.t.sol
Outdated
Show resolved
Hide resolved
src/test/integration/tests/Deposit_Delegate_Allocate_Slash_Queue_Redeposit.t.sol
Outdated
Show resolved
Hide resolved
src/test/integration/tests/Deposit_Delegate_Allocate_Slash_Queue_Redeposit.t.sol
Outdated
Show resolved
Hide resolved
src/test/integration/tests/Deposit_Delegate_Allocate_Slash_Queue_Redeposit.t.sol
Show resolved
Hide resolved
src/test/integration/tests/Deposit_Delegate_Allocate_Slash_Queue_Redeposit.t.sol
Outdated
Show resolved
Hide resolved
src/test/integration/tests/Deposit_Delegate_Allocate_Slash_Queue_Redeposit.t.sol
Outdated
Show resolved
Hide resolved
src/test/integration/tests/Deposit_Delegate_Allocate_Slash_Queue_Redeposit.t.sol
Show resolved
Hide resolved
src/test/integration/tests/Deposit_Delegate_Allocate_Slash_Queue_Redeposit.t.sol
Show resolved
Hide resolved
src/test/integration/tests/Deposit_Delegate_Allocate_Slash_Queue_Redeposit.t.sol
Show resolved
Hide resolved
- Add TestState struct to manage test state consistently - Extract setup into _init_ and _setupAllocation functions - Add test stubs for various slashing paths: * Partial slash with redeposit * Undelegate with partial slash * Deallocate with partial slash * Deregister with partial slash
342301b to
6b4612f
Compare
ypatil12
left a comment
There was a problem hiding this comment.
Checks look good, minor comments
| // For each strategy, check (prev - removed == cur) | ||
| for (uint i = 0; i < strategies.length; i++) { | ||
| assertEq(prevShares[i] + addedShares[i], curShares[i], err); | ||
| assertApproxEqAbs(prevShares[i] + addedShares[i], curShares[i], 1, err); |
There was a problem hiding this comment.
@eigenmikem Shouldn't we just be recalculating on this one?
src/test/integration/tests/Deposit_Delegate_Allocate_Slash_Queue_Redeposit.t.sol
Show resolved
Hide resolved
98b0b3d
into
test/slashing-integration-testing
**Motivation:**
We want to increase coverage for integration state validation.
**Modifications:**
- Added new test cases:
-
`testFuzz_deposit_delegate_allocate_partialSlash_redeposit_queue_complete`
- `testFuzz_deposit_delegate_undelegate_partialSlash_complete`
- `testFuzz_deposit_delegate_deallocate_partialSlash_queue_complete`
- `testFuzz_deposit_delegate_deregister_partialSlash_queue_complete`
-
`testFuzz_delegate_zeroShares_partialSlash_deposit_undelegate_complete`
- `testFuzz_deposit_delegate_allocate_partialSlash_deallocate`
**Result:**
Move coverage.
---------
Co-authored-by: Michael <michael@Michaels-MacBook-Pro.local>
**Motivation:**
We want to increase coverage for integration state validation.
**Modifications:**
- Added new test cases:
-
`testFuzz_deposit_delegate_allocate_partialSlash_redeposit_queue_complete`
- `testFuzz_deposit_delegate_undelegate_partialSlash_complete`
- `testFuzz_deposit_delegate_deallocate_partialSlash_queue_complete`
- `testFuzz_deposit_delegate_deregister_partialSlash_queue_complete`
-
`testFuzz_delegate_zeroShares_partialSlash_deposit_undelegate_complete`
- `testFuzz_deposit_delegate_allocate_partialSlash_deallocate`
**Result:**
Move coverage.
---------
Co-authored-by: Michael <michael@Michaels-MacBook-Pro.local>
**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
Motivation:
We want to increase coverage for integration state validation.
Modifications:
testFuzz_deposit_delegate_allocate_partialSlash_redeposit_queue_completetestFuzz_deposit_delegate_undelegate_partialSlash_completetestFuzz_deposit_delegate_deallocate_partialSlash_queue_completetestFuzz_deposit_delegate_deregister_partialSlash_queue_completetestFuzz_delegate_zeroShares_partialSlash_deposit_undelegate_completetestFuzz_deposit_delegate_allocate_partialSlash_deallocateResult:
Move coverage.