Skip to content

test: upgrade integration testing#1143

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

test: upgrade integration testing#1143
0xClandestine merged 10 commits intotest/slashing-integration-testingfrom
0xclandestine/slashing-integration-testing

Conversation

@0xClandestine
Copy link
Copy Markdown
Member

@0xClandestine 0xClandestine commented Feb 20, 2025

Motivation:

The changes are focused on adding test coverage for pre-slashing withdrawal scenarios and how the slashing upgrade affects them.

Modifications:

  1. Added new test cases for withdrawal completion:
  • testFuzz_upgrade_delegate_queuePartial_completeAsShares
  • testFuzz_upgrade_delegate_queuePartial_completeAsTokens
  • testFuzz_delegate_deposit_queue_completeBeforeUpgrade_asShares
  • testFuzz_delegate_deposit_queue_completeBeforeUpgrade_asTokens
  • testFuzz_delegate_deposit_queue_completeBeforeUpgrade_partial_asShares
  • testFuzz_delegate_deposit_queue_completeBeforeUpgrade_partial_asTokens

Result:

Move coverage.

@0xClandestine 0xClandestine added 🧪 Test Test-related changes (unit, integration, etc.). 🗡️ Slashing Release Changes for the slashing release. labels Feb 20, 2025
@0xClandestine 0xClandestine force-pushed the 0xclandestine/slashing-integration-testing branch from e48f4b3 to 0c3d923 Compare February 24, 2025 19:06
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.

Minor organizational comments

- Combine full and partial withdrawal tests into single parameterized tests
- Add random toggle between full/partial withdrawal scenarios
- Improve variable naming for clarity
- Remove redundant test cases
- Added TestState struct to hold all test state in one place
- Created _init_() helper that handles common setup patterns:
  - Creating staker and operator
  - Handling delegation
  - Setting up withdrawal shares (full/partial)
- Refactored all tests to use the helper function
- Reduced code duplication and improved readability
- Merge duplicate test cases into parameterized tests using completeAsTokens flag
- Add _completeWithdrawal helper to reduce code duplication
- Remove allocation test case (handled separately)
- Improve code organization and readability
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.

Fire

@0xClandestine 0xClandestine merged commit 7f9f55a into test/slashing-integration-testing Feb 25, 2025
10 checks passed
@0xClandestine 0xClandestine deleted the 0xclandestine/slashing-integration-testing branch February 25, 2025 16:38
ypatil12 pushed a commit that referenced this pull request Feb 27, 2025
**Motivation:**

The changes are focused on adding test coverage for pre-slashing
withdrawal scenarios and how the slashing upgrade affects them.

**Modifications:**

1. Added new test cases for withdrawal completion:
- [x] `testFuzz_upgrade_delegate_queuePartial_completeAsShares`  
- [x] `testFuzz_upgrade_delegate_queuePartial_completeAsTokens`  
- [x] `testFuzz_delegate_deposit_queue_completeBeforeUpgrade_asShares`  
- [x] `testFuzz_delegate_deposit_queue_completeBeforeUpgrade_asTokens`  
- [x]
`testFuzz_delegate_deposit_queue_completeBeforeUpgrade_partial_asShares`
- [x]
`testFuzz_delegate_deposit_queue_completeBeforeUpgrade_partial_asTokens`

**Result:**

Move coverage.
ypatil12 pushed a commit that referenced this pull request Feb 27, 2025
**Motivation:**

The changes are focused on adding test coverage for pre-slashing
withdrawal scenarios and how the slashing upgrade affects them.

**Modifications:**

1. Added new test cases for withdrawal completion:
- [x] `testFuzz_upgrade_delegate_queuePartial_completeAsShares`  
- [x] `testFuzz_upgrade_delegate_queuePartial_completeAsTokens`  
- [x] `testFuzz_delegate_deposit_queue_completeBeforeUpgrade_asShares`  
- [x] `testFuzz_delegate_deposit_queue_completeBeforeUpgrade_asTokens`  
- [x]
`testFuzz_delegate_deposit_queue_completeBeforeUpgrade_partial_asShares`
- [x]
`testFuzz_delegate_deposit_queue_completeBeforeUpgrade_partial_asTokens`

**Result:**

Move coverage.
ypatil12 pushed a commit that referenced this pull request Feb 27, 2025
**Motivation:**

The changes are focused on adding test coverage for pre-slashing
withdrawal scenarios and how the slashing upgrade affects them.

**Modifications:**

1. Added new test cases for withdrawal completion:
- [x] `testFuzz_upgrade_delegate_queuePartial_completeAsShares`  
- [x] `testFuzz_upgrade_delegate_queuePartial_completeAsTokens`  
- [x] `testFuzz_delegate_deposit_queue_completeBeforeUpgrade_asShares`  
- [x] `testFuzz_delegate_deposit_queue_completeBeforeUpgrade_asTokens`  
- [x]
`testFuzz_delegate_deposit_queue_completeBeforeUpgrade_partial_asShares`
- [x]
`testFuzz_delegate_deposit_queue_completeBeforeUpgrade_partial_asTokens`

**Result:**

Move coverage.
ypatil12 pushed a commit that referenced this pull request Mar 5, 2025
**Motivation:**

The changes are focused on adding test coverage for pre-slashing
withdrawal scenarios and how the slashing upgrade affects them.

**Modifications:**

1. Added new test cases for withdrawal completion:
- [x] `testFuzz_upgrade_delegate_queuePartial_completeAsShares`  
- [x] `testFuzz_upgrade_delegate_queuePartial_completeAsTokens`  
- [x] `testFuzz_delegate_deposit_queue_completeBeforeUpgrade_asShares`  
- [x] `testFuzz_delegate_deposit_queue_completeBeforeUpgrade_asTokens`  
- [x]
`testFuzz_delegate_deposit_queue_completeBeforeUpgrade_partial_asShares`
- [x]
`testFuzz_delegate_deposit_queue_completeBeforeUpgrade_partial_asTokens`

**Result:**

Move coverage.
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.

2 participants