Vanilla validator compounding staking strategy#2905
Conversation
Refactored CompoundingStakingSSVStrategy to inherit CompoundingStakingStrategy. Removed ConsolidationController. Removed migrateClusterToETH.
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## nicka/initial-deposit-32 #2905 +/- ##
============================================================
+ Coverage 50.83% 51.27% +0.43%
============================================================
Files 110 110
Lines 4873 4919 +46
Branches 1353 1362 +9
============================================================
+ Hits 2477 2522 +45
Misses 2392 2392
- Partials 4 5 +1 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Add registerSsvValidators and stakeEth forwarding functions to the old NativeStakingStrategy
… stored initialDepositAmountWei
* Fix contracts cron image pnpm version * Changed package.json to use pnpm
…icka/vanilla-staking
Added withdrawSsvClusterEth to the NativeStakingStrategy and CompoundingStakingSSVStrategy Deploy script now upgrades old NativeStakingStrategy and CompoundingStakingSSVStrategy
sparrowDom
left a comment
There was a problem hiding this comment.
I think there is another approach to vanilla staking where the risk of not being able to fully verify the deposit on-chain is transferred from trusting the node operator's honesty to trusting our strategist's honesty.
| { | ||
| ValidatorState currentState = validator[pubKeyHash].state; | ||
| require( | ||
| currentState == ValidatorState.NON_REGISTERED || |
There was a problem hiding this comment.
As per this comment we could allow for currentState == ValidatorState.STAKED to also admit a stake. This way we can:
- do an initial deposit of 1 ETH
- verify on beaconChain that it has been deposited
- reset the first deposit (ideally via a strategist action)
- deposit remaining 2029 ETH
We can not get front-run this way by the node operator. Extra risk is carried by the strategist though. I guess we are to decide who we can trust more.
There was a problem hiding this comment.
the problem with doing a 1 ETH deposit first is it currently takes 55 days for the deposit to be processed on the beacon chain. That's needed before the validator and deposit can be verified. It then takes another 55 days for the second 2029 ETH deposit to be processed. So that's 110 days if no yield.
While we have a large amount of ETH to deposit, we are taking on the risk that a large validator deposit could be front-run by the node operator.
There was a problem hiding this comment.
Agreed, the point I am trying to make is that we can do 1ETH & 2029ETH deposits both in 1 day. The verification that we aren't front ran can be done off-chain without waiting for the deposit to be processed by the beacon chain.
There was a problem hiding this comment.
It would be nice, but the staking contract would have to be changed to support this. Once the first initial deposit of 1 ETH is done, the validator status changes to STAKED. This prevents the second deposit from being made on the same day.
|
Claude's review 🔴 Blocker — 1. New implementation exceeds the EIP-170 size limit; migration 196 will fail to deploy on mainnet
Tests/compile pass locally only because Worth chasing: the committed config produces 25,077 bytes locally, yet the deployed mainnet artifact is only 24,223 bytes (854 smaller) — implying the Action: Before queuing 196, compile under the exact production profile and confirm runtime bytecode < 24,576 ( 🟠 High — 2. Off-chain
|
|
Thanks for your review @sparrowDom
|
…2914) * All removeSsvValidator to be called for the Compounding Staking SSV Strategy on the ConsolidationController * Split withdrawSsvClusterEth and removeStrategy into separate gov prop so the 10 validators can be removed post upgrade
* All removeSsvValidator to be called for the Compounding Staking SSV Strategy on the ConsolidationController * Split withdrawSsvClusterEth and removeStrategy into separate gov prop so the 10 validators can be removed post upgrade * Added back NON_REGISTERED check on registerSsvValidator
Summary
This PR splits the compounding staking strategy into a deployable vanilla strategy and an SSV-specific extension, then wires the deployment flow for migrating away from the old compounding SSV strategy.
CompoundingStakingStrategyCompoundingStakingSSVStrategyCompoundingStakingStrategyProxyfor vanilla compounding validatorsCompoundingStakingStrategyViewConsolidationControllerto target the new vanilla compounding strategyConsolidationControllerwithdrawSsvClusterEthsupport to SSV strategies so empty SSV cluster ETH can be recoveredresetFirstDepositto be called by either Governor or StrategistDetails
CompoundingStakingStrategynow contains the shared compounding validator logic:CompoundingStakingSSVStrategynow only contains SSV-specific behavior:registerSsvValidatorremoveSsvValidatorwithdrawSsvClusterEthREGISTERED,VERIFIED, orACTIVEstateThe vanilla strategy allows the first deposit to an unregistered validator:
NON_REGISTERED -> STAKEDVERIFIEDorACTIVEThe initial validator deposit amount can be configured up to
2048 ETH, and first deposits are allowed up to the storedinitialDepositAmountWei.CompoundingStakingSSVStrategy.registerSsvValidator()requires validators to be inNON_REGISTEREDstate before registration, preventing already-used orREMOVEDpubkeys from being registered again.First Deposit Reset
resetFirstDepositcan now be called by either:This lets the Strategist clear the first-deposit guard after the pending first deposit has been reviewed/handled, while still rejecting regular users.
SSV Cluster ETH Withdrawal
withdrawSsvClusterEthwas added to both:NativeStakingSSVStrategyCompoundingStakingSSVStrategyThe function is governor-only and withdraws ETH from an empty SSV cluster. Any ETH held by the strategy is wrapped to WETH and transferred back to the OETH Vault.
SSV cluster helpers now normalize migrated ETH clusters so
ethBalanceis treated as the clusterbalance.Consolidation
ConsolidationControllernow targets the newCompoundingStakingStrategyand supports:nativeStakingStrategy2as the source strategyCompoundingStakingSSVStrategyfor post-upgrade validator removalIt forwards old native staking operations through to
nativeStakingStrategy2, including:registerSsvValidatorsstakeEthdoAccountingexitSsvValidatorremoveSsvValidatorIt also forwards target strategy operations needed during consolidation:
snapBalancesverifyBalancesvalidatorWithdrawalstakeEthDeploy Scripts
196_deploy_compounding_staking_strategy.js:CompoundingStakingSSVStrategyimplementationNativeStakingSSVStrategyimplementationCompoundingStakingStrategyProxyCompoundingStakingStrategy2030 ETHinitial validator deposit amountBeaconProofsCompoundingStakingStrategyViewConsolidationControllerGovernance proposal actions:
CompoundingStakingSSVStrategyProxyNativeStakingSSVStrategy2ProxynativeStakingStrategy2registrator to the controller197_remove_old_compounding_ssv_strategy.js:On fork tests, script 197 simulates removing the 10 old compounding SSV validators so the cleanup proposal can be tested end-to-end.
Operational Flow
validatorCount == 0.CompoundingStakingSSVStrategyProxyfrom the OETH Vault.Testing
19382671998612Dependencies
This change is dependent on:
Verification
pnpm prettier:solpnpm prettier:jspnpm hardhat compilepnpm test test/strategies/compoundingStaking.jspnpm test test/strategies/compoundingSSVStaking.js197_deploy_compounding_staking_strategy.jsagainst a mainnet fork; deployment and governance proposal execution completed successfully.Code Change Checklist
To be completed before internal review begins:
Internal review: