Skip to content

fix: skip validators with pending deposits for stake-bound balance checks#188

Merged
matthias-wright merged 3 commits into
audit-may-2026from
m/handle-pending-deposits
May 26, 2026
Merged

fix: skip validators with pending deposits for stake-bound balance checks#188
matthias-wright merged 3 commits into
audit-may-2026from
m/handle-pending-deposits

Conversation

@matthias-wright

Copy link
Copy Markdown
Collaborator

Note: this PR builds on #187 because it addresses a similar edge case, and the code changes are overlapping.

This addresses #180.

Changes:

  • When checking validator balances after changing MinimumStake, only validators without pending deposits are considered.
  • An e2e test test_stake_bound_skips_pending_deposit_placeholder is added that verifies that inactive validator accounts with zero balance and has_pending_deposit = true are skipped when enforcing stake bounds
  • An e2e test test_stake_bound_refunds_top_up_when_max_lowered_before_processing is added that verifies that when a top-up deposit is queued before a max stake reduction makes the post-top-up balance invalid, deposit processing refunds the top-up and leaves the validator's pre-top-up balance and flags untouched.

@sebastian-osec

Copy link
Copy Markdown

Looks good to me.

@matthias-wright matthias-wright force-pushed the m/handle-pending-deposits branch from cff1d59 to 293140e Compare May 26, 2026 19:16
@matthias-wright matthias-wright changed the base branch from main to audit-may-2026 May 26, 2026 19:16
@matthias-wright matthias-wright merged commit 44aefde into audit-may-2026 May 26, 2026
7 of 8 checks passed
@matthias-wright matthias-wright deleted the m/handle-pending-deposits branch May 26, 2026 19:59
matthias-wright added a commit that referenced this pull request May 26, 2026
…ithdrawals (#208)

Builds on #188 (which builds on #187).

This addresses #204.

Changes:
- On the last block of an epoch, in case the min or max stake was changed, the pending_execution_requests will be peeked and validators that have an exit scheduled for the next epoch will be skipped when creating partial withdrawals. This ensures that a partial withdrawal won't block the validator exit.
- Adds a unit test to verify the behavior.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants