chore: add rewards v2.2 comprehensive unit/integration/Anvil tests#490
Merged
serichoi65 merged 17 commits intomasterfrom Jan 22, 2026
Merged
chore: add rewards v2.2 comprehensive unit/integration/Anvil tests#490serichoi65 merged 17 commits intomasterfrom
serichoi65 merged 17 commits intomasterfrom
Conversation
2701725 to
9401b5f
Compare
ypatil12
reviewed
Jan 8, 2026
cefb196 to
1f2fde9
Compare
anupsv
reviewed
Jan 9, 2026
pkg/rewards/stakerShareSnapshots.go
Outdated
| INNER JOIN blocks b_queued ON qsw.block_number = b_queued.number | ||
| WHERE | ||
| -- Still within withdrawal queue window (not yet completable) | ||
| b_queued.block_time + INTERVAL '{{.withdrawalQueueWindow}} days' > TIMESTAMP '{{.snapshotDate}}' |
Contributor
There was a problem hiding this comment.
is the source of the .withdrawalQueueWindow from event emission ?
Contributor
Author
There was a problem hiding this comment.
The withdrawalQueueWindow is a configuration value (r.globalConfig.Rewards.WithdrawalQueueWindow), not from event emission. It's set to 14 days for mainnet.
anupsv
reviewed
Jan 9, 2026
5751bbc to
5395626
Compare
5395626 to
ab00045
Compare
7694397 to
8c9826c
Compare
f9fccf7 to
ee10653
Compare
ebc358e to
03175c7
Compare
ypatil12
reviewed
Jan 16, 2026
pkg/eigenState/precommitProcessors/slashingProcessor/createSlashingAdjustments_test.go
Show resolved
Hide resolved
pkg/eigenState/precommitProcessors/slashingProcessor/slashing.go
Outdated
Show resolved
Hide resolved
pkg/eigenState/precommitProcessors/slashingProcessor/createSlashingAdjustments_test.go
Show resolved
Hide resolved
fdfb4ce to
8c6c1eb
Compare
ypatil12
reviewed
Jan 22, 2026
pkg/eigenState/precommitProcessors/slashingProcessor/slashing_test.go
Outdated
Show resolved
Hide resolved
pkg/eigenState/precommitProcessors/slashingProcessor/slashing_test.go
Outdated
Show resolved
Hide resolved
pkg/eigenState/precommitProcessors/slashingProcessor/slashing.go
Outdated
Show resolved
Hide resolved
| ) * (1 - LEAST(@wadSlashed / 1e18, 1)) as slash_multiplier, | ||
| @blockNumber as block_number, | ||
| @transactionHash as transaction_hash, | ||
| @logIndex as log_index |
Contributor
There was a problem hiding this comment.
Since this query is selecting from queued_slashing_withdrawal table, which hasn't been committed yet (ie. latest block not updated), could we have a staleness issue? Edge case: a withdrawal has been queued in this block and then we are slashed a couple times in the same block. Do we need to add accumulated withdrawals in the given block? cc @elhajin
Slashes on day X now correctly become visible for snapshots on day X+1, matching the spec rule: block_date < snapshot_date
8c6c1eb to
9aab10c
Compare
ypatil12
approved these changes
Jan 22, 2026
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.
Description
Summary
Adds comprehensive unit, integration, and Anvil tests for Rewards v2.2 (PRs #476, #481), validating operator allocation snapshots, withdrawal queue logic, and refund calculations. All tests passing with 100% coverage of edge cases defined in the Rewards V2.2 Testing Plan.
Test Coverage
OAS (Operator Allocation Snapshots) - 17 scenarios:
SSS (Staker Share Snapshots) - 15 scenarios:
R (Refunds) - 4 scenarios:
Integration Tests (8 Scenarios - PostgreSQL):
Anvil Tests (10 Scenarios - Real Contract Events):
Bug Fixes & Improvements
Schema Corrections:
Snapshot Timing Logic:
Linter Fixes:
Chain Configuration:
Notes
Type of change
How Has This Been Tested?
Unit tests
Checklist: