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

test: rounding tests low slashing factors #1178

Open
wants to merge 3 commits into
base: test/slashing-integration-testing
Choose a base branch
from

Conversation

8sunyuan
Copy link
Collaborator

@8sunyuan 8sunyuan commented Feb 26, 2025

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
  • Additional checks helpers
  • Added helper getSlashingFactor for User.t.sol

Result:
Added following integration tests
test_slashBC_startCompleteCP_queue_complete
test_slash_undelegate_redeposit
test_slash_undelegate_completeAsTokens_verifyWC
test_slash_undelegate_completeAsShares_startCompleteCP
test_queueAllShares_completeAsTokens NOTE: currently failing but passes with changes in #1176

@8sunyuan 8sunyuan added 🗡️ Slashing Release Changes for the slashing release. 🧪 Test Test-related changes (unit, integration, etc.). labels Feb 27, 2025
bytes32[] memory withdrawalRoots = _getWithdrawalHashes(withdrawals);
check_Undelegate_State(staker, operator, withdrawals, withdrawalRoots, strategies, initDepositShares, 0.toArrayU256());

// 6. redeposit (start/complete checkpoint)
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we be actually depositing another 32 ETH and starting a validator in these steps to check that "redepositing" is working?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

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

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