Skip to content

Validator consolidation#2758

Open
naddison36 wants to merge 95 commits intomasterfrom
nicka/consolidation
Open

Validator consolidation#2758
naddison36 wants to merge 95 commits intomasterfrom
nicka/consolidation

Conversation

@naddison36
Copy link
Collaborator

@naddison36 naddison36 commented Jan 21, 2026

Overview

A new staking strategy was implemented in 2025 that used the compounding validators introduced in Ethereum’s Pectra release. The plan was to exit from the sweeping (0x01 type) validators used by the old Native Staking Strategy and then deposit to the new compounding (0x02 type) validators used by the new Compounding Staking Strategy.

Unfortunately, since the start of 2026, the validator deposit queue has blown out to over 70 days as of 3 February 2026. As deposits do not earn any yield, having 18.6k ETH (71.1%) of OETH’s collateral not earning yield is not acceptable. A better approach is to use the validator consolidation that was introduced in the Pectra release, which reduced the loss of yield to 27 hours.

See https://www.validatorqueue.com/ for deposit queue times.

Objectives/Requirements

  • Migrate from the old sweeping (0x01 type) validators to the new compounding (0x02) validators with minimal yield lose.
  • Keep the contract changes to a minimum given this is a one-off migration.
  • Atomically migrate balances from the old native staking strategy to the new compounding staking strategy. That is, the OETH Vault can not under or over count the amount of ETH across all validators at any point in time.
  • Changes to the new Compounding Staking Strategy required for the SSV Network switching operator payments from SSV tokens to ETH.

Link

SSV Clusters

Consolidation Processes

oethProcesses-consolidation

Contract Changes

New ConsolidationController contract

  • requestConsolidation function
    • parameters sourcePubKeys, targetPubKey
    • only callable by the Origin Admin multi-sig (5/8)
    • check no consolidations are already in progress. ie consolidationCount == 0
    • check target validator is Active on the new Compounding Staking Strategy
    • check no pending deposits in the new target validator. need to iterate over the strategy’s deposits
    • Store
      • number of validators being consolidated
      • the timestamp of the consolidation request
      • the source strategy
      • target validator hash
    • call requestConsolidation on the old Native Staking Strategy
    • call snapBalances on the new Compounding Staking Strategy as this will be the last time the balance can be updated until after the consolidation process has completed.
  • confirmConsolidation function
    • parameters balanceProofs and pendingDepositProofs
    • only callable by the Origin Admin multi-sig (5/8)
    • check a consolidation is in progress. ie consolidationCount > 0
    • check the minimum time the consolidation could be processed has passed
    • reset the consolidation state
    • call verifyBalances on the new Compounding Staking Strategy with the balance and pending deposit proofs
    • call confirmConsolidation on the old Native Staking Strategy with the number of validators that were consolidated.
  • failConfirmation function
    • parameters sourcePubKeys
    • only callable by the Origin Admin multi-sig (5/8)
    • check a consolidation is in progress. ie consolidationCount > 0
    • Reduce the number of validators being consolidated
    • call failConsolidation on the old Native Staking Strategy
  • The following functions are only callable by the Validator Registrator and forward to the old Native Staking Strategy
    • doAccounting - can be forwarded at any time
    • exitSsvValidator - can be forwarded at any time
    • removeSsvValidator - can only be forwarded if no consolidation is in progress
  • The following functions are only callable by the Validator Registrator and forward to the Compounding Staking Strategy
    • validatorWithdrawal - full validator exits are prevented. Partial withdrawals are allowed
    • stakeEth - deposits to a target validator of an active consolidation is prevented. Initial 1 ETH deposits to new validators and top-ups are allowed.
  • verifyBalances can be called by anyone and forward to the the Compounding Staking Strategy when
    • there is no consolidation in progress
    • the balances snapshot time is the consolidation start time

old Native Staking Strategy

  • new requestConsolidation function
    • parameters sourcePubKeys and targetPubKey
    • is only callable by the validator registrator that is changed to new ConsolidationController contract
    • for each source validator
  • new confirmConsolidation function
    • parameter is the number of validators that were consolidated
    • is only callable by the validator registrator that is changed to new ConsolidationController contract
    • decrease the activeDepositedValidators by the number of validators that were consolidated. This effectively decreases the strategy’s balance from checkBalance by 32 ETH times thye number of validators that were consolidated.
  • new failConsolidation function
    • parameters sourcePubKeys
    • is only callable by the validator registrator that is changed to new ConsolidationController contract
    • for each source validator
      • check the validator is EXITING
      • store the validator as STAKED
  • add migrateClusterToETH to upgrade the SSV cluster to ETH payments
  • Change registerSsvValidator to use ETH and not SSV for cluster payment

New Compounding Staking Strategy

  • restrict snapBalances and verifyBalances to only the validator registrator
  • add migrateClusterToETH to upgrade the SSV cluster to ETH payments
  • Change registerSsvValidator to use ETH and not SSV for cluster payment. This is only for Hoodi testing and will not be used on mainnet

Security Audit Scope

In scope contracts

  • ConsolidationController
  • NativeStakingSSVStrategy with a focus on the requestConsolidation, failConsolidation and confirmConsolidation functions
  • CompoundingStakingSSVStrategy with a focus on snapBalances, verifyBalances and registerSsvValidator.

Out of scope contracts

  • FeeAccumulator
  • BeaconProofs
  • CompoundingStakingStrategyView

Tests

Consolidation fork tests are in contracts/test/strategies/stakingConsolidation.mainnet.fork-test.js

# Start a local node
pnpm run node

# Run the fork tests
pnpm run test:fork

Deployment

Deployment script is in contracts/deploy/mainnet/179_staking_consolidation.js

pnpm run deploy:mainnet

Code Change Checklist

To be completed before internal review begins:

  • The contract code is complete
  • Executable deployment file
  • Fork tests that test after the deployment file runs
  • Unit tests *if needed
  • The owner has done a full checklist review of the code + tests

Internal review:

  • Two approvals by internal reviewers

@codecov
Copy link

codecov bot commented Jan 21, 2026

Codecov Report

❌ Patch coverage is 6.91824% with 148 lines in your changes missing coverage. Please review.
✅ Project coverage is 40.11%. Comparing base (6b88f3d) to head (b04eb84).

Files with missing lines Patch % Lines
...rategies/NativeStaking/ConsolidationController.sol 0.00% 109 Missing ⚠️
.../strategies/NativeStaking/ValidatorRegistrator.sol 5.55% 34 Missing ⚠️
...gies/NativeStaking/CompoundingValidatorManager.sol 70.00% 3 Missing ⚠️
...s/contracts/strategies/Generalized4626Strategy.sol 0.00% 1 Missing ⚠️
...es/NativeStaking/CompoundingStakingSSVStrategy.sol 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2758      +/-   ##
==========================================
- Coverage   41.35%   40.11%   -1.24%     
==========================================
  Files         108      109       +1     
  Lines        4607     4744     +137     
  Branches     1254     1302      +48     
==========================================
- Hits         1905     1903       -2     
- Misses       2699     2838     +139     
  Partials        3        3              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 33 out of 51 changed files in this pull request and generated 5 comments.

Files not reviewed (1)
  • contracts/pnpm-lock.yaml: Language not supported

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

All consolidation fork tests are now working
…rds (#2819)

* Check enough ETH value was included in requestConsolidation to cover the fee

* Fix fork test
…2820)

* Do not call snapBalances in requestConsolidation if the balances were recently snapped

* Allow verifyBalances to run for snaps before the consolidation was started
…onsolidation() to prevent the contract from entering an inconsistent state (#2822)
…or Correct Accounting (#2825)

* Require that at least
MIN_CONSOLIDATION_PERIOD has elapsed since the consolidation was requested before it can be failed

* Track source validators being consolidated so they can be verified when failConsolidation is called
* Correct Natspec of stakingMonitor on old Native Staking Strategy

* Allow validators to be removed from the SSV cluster during consolidation if not in the source strategy
* Check enough ETH value was included in requestConsolidation to cover the fee

* Fix fork test

* Do not call snapBalances in requestConsolidation if the balances were recently snapped

* Increased MIN_CONSOLIDATION_PERIOD  to 261 epochs

* Add a zero length check on sourcePubKeys at the beginning of requestConsolidation() to prevent the contract from entering an inconsistent state

* Correct Natspec of stakingMonitor on old Native Staking Strategy

* Allow validators to be removed from the SSV cluster during consolidation if not in the source strategy

* Require that at least
MIN_CONSOLIDATION_PERIOD has elapsed since the consolidation was requested before it can be failed

* Track source validators being consolidated so they can be verified when failConsolidation is called

* Added a MIN_CONSOLIDATION_PERIOD check to snapBalances() when a consolidation is in progress

* Allow verifyBalances to run for snaps before the consolidation was started
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.

4 participants