Skip to content

test: more slashing state validation#1169

Merged
0xClandestine merged 25 commits intotest/slashing-integration-testingfrom
0xclandestine/slashing-integration-testing-2
Feb 28, 2025
Merged

test: more slashing state validation#1169
0xClandestine merged 25 commits intotest/slashing-integration-testingfrom
0xclandestine/slashing-integration-testing-2

Conversation

@0xClandestine
Copy link
Copy Markdown
Member

@0xClandestine 0xClandestine commented Feb 25, 2025

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.

@0xClandestine 0xClandestine added 🗡️ Slashing Release Changes for the slashing release. 🧪 Test Test-related changes (unit, integration, etc.). labels Feb 25, 2025
@0xClandestine 0xClandestine changed the title test: upgrade integration testing test: state validation integration testing Feb 25, 2025
@0xClandestine 0xClandestine marked this pull request as draft February 25, 2025 20:48
@0xClandestine 0xClandestine force-pushed the 0xclandestine/slashing-integration-testing-2 branch from 5ae42b2 to e7189ef Compare February 26, 2025 00:38
@0xClandestine
Copy link
Copy Markdown
Member Author

Curious what state validation we're looking to do, the doc didn't specify? @ypatil12

@0xClandestine 0xClandestine marked this pull request as ready for review February 26, 2025 01:03
// 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);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

What case is causing the need for this?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

testFuzz_deposit_delegate_allocate_partialSlash_redeposit_queue_complete

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@eigenmikem Shouldn't we just be recalculating on this one?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

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

@0xClandestine 0xClandestine force-pushed the 0xclandestine/slashing-integration-testing-2 branch from 342301b to 6b4612f Compare February 28, 2025 16:50
@0xClandestine 0xClandestine changed the title test: state validation integration testing test: more slashing state validation Feb 28, 2025
Copy link
Copy Markdown
Contributor

@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.

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);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@eigenmikem Shouldn't we just be recalculating on this one?

@0xClandestine 0xClandestine merged commit 98b0b3d into test/slashing-integration-testing Feb 28, 2025
10 checks passed
@0xClandestine 0xClandestine deleted the 0xclandestine/slashing-integration-testing-2 branch February 28, 2025 22:35
ypatil12 pushed a commit that referenced this pull request Mar 5, 2025
**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>
ypatil12 pushed a commit that referenced this pull request Mar 5, 2025
**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>
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🗡️ Slashing Release Changes for the slashing release. 🧪 Test Test-related changes (unit, integration, etc.).

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants