-
Notifications
You must be signed in to change notification settings - Fork 99
Validator consolidation #2758
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
Open
naddison36
wants to merge
61
commits into
master
Choose a base branch
from
nicka/consolidation
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Validator consolidation #2758
Changes from all commits
Commits
Show all changes
61 commits
Select commit
Hold shift + click to select a range
c51db01
WIP validator consolidation
naddison36 45af6b3
Fixes
naddison36 35aa5e1
Fixed unit tests
naddison36 aa658ff
Added deploy script for consolidation
naddison36 6732e8d
Fix the Native Staking Strategy fork tests for the second SSV cluster
naddison36 8133367
Cleanup
naddison36 fc93cb3
Made ConsolidationController Ownable
naddison36 f2e42ec
WIP removing target strategy balance check to confirm consolidation
naddison36 79c98c4
All validatorWithdrawal for partial withdrawals
naddison36 8081673
Changed to owner calling consolidation functions
naddison36 d5c8d14
Fixed pending consolidation queue length
naddison36 2bcd1ec
Allow stakeEth if not depositing to a target of a consolidation
naddison36 857d225
Linter
naddison36 9753e29
Allow anyone to call snapBalances
naddison36 4946d2f
Merge remote-tracking branch 'origin/master' into nicka/consolidation
naddison36 d5b1512
Fix deploy script
naddison36 a5144b5
Fixed verifyBalances logic in ConsolidationController
naddison36 3572057
Made requestConsolidation payable and pass on the msg.value
naddison36 d4f6516
WIP consolidation fork tests
naddison36 660f096
Fix verifyBalances activeIds param default
naddison36 e165e09
Fixed storing the updated validator state
naddison36 23a6b37
requestConsolidation fork tests
naddison36 0d8f18b
More consolidation fork tests
naddison36 2d38510
More failed consolidation fork tests
naddison36 a563012
Fix failConsolidation when reset
naddison36 21848ce
More fork tests
naddison36 afde0de
Fixes to confirmConsolidation
naddison36 66715ac
confirmConsolidation fork test
naddison36 5dc5ed8
Updated verifyBalances HH task to override balances
naddison36 8d148dc
Changed amoStrat Hardhat task to use OETH/WETH Curve pool
naddison36 4d5b0a3
Added more fork tests
naddison36 93fa8dc
Added more fork tests
naddison36 752c3fe
Slither fixes
naddison36 7914c08
Update consolidation process diagram
naddison36 fefe967
Natspec cleanup
naddison36 cfa37c5
Added more consolidation fork tests
naddison36 dfdc548
Changed to ConsolidationController for Hoodi deployment
naddison36 c9e7331
Deployment to Hoodi
naddison36 b567597
added requestConsol Hardhat task
naddison36 926f34b
Added failConsol and confirmConsol HH tasks
naddison36 b22eb7e
Bumped Lodestar version
naddison36 f8da4d4
Added consol option to verifyBalances
naddison36 16b083b
Fixed failConsolidation
naddison36 787bf0b
Added check of pub key length in _hashPubKey
naddison36 e2bd274
Check source pub key lengths in confirm and fail consolidations
naddison36 493a8a5
Fixed "Source not withdrawable" check
naddison36 9dde901
setRegistrator HH task to work against old and new staking strategies
naddison36 4e03dfe
Added setStakingMonitor
naddison36 00735ae
Fixed typo in fork test
naddison36 160f67f
Fixed typos in fork tests
naddison36 0692950
Fixed fork test description
naddison36 0185f07
Restricted snapBalances when consolidation is in progress
naddison36 aa61519
Hoodi upgrade script
naddison36 0bbfc8c
Merge remote-tracking branch 'origin/master' into nicka/consolidation
naddison36 39dfdeb
Bumped the deploy script number
naddison36 2c1e237
New Hoodi deployment
naddison36 5419da0
Add support for multiple validator consolidation requests
naddison36 0b54ddf
Added limit of 9 validators per consolidation request
naddison36 49c8b11
Fix linter
naddison36 90188b4
Merge remote-tracking branch 'origin/master' into nicka/consolidation
naddison36 bb649cf
Bumped deploy number
naddison36 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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
497 changes: 497 additions & 0 deletions
497
contracts/contracts/strategies/NativeStaking/ConsolidationController.sol
Large diffs are not rendered by default.
Oops, something went wrong.
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,68 @@ | ||
| const { | ||
| upgradeCompoundingStakingSSVStrategy, | ||
| upgradeNativeStakingSSVStrategy, | ||
| } = require("../deployActions"); | ||
| const { deployWithConfirmation } = require("../../utils/deploy"); | ||
| const { getDefenderSigner, getSigner } = require("../../utils/signers"); | ||
| const { isFork } = require("../../test/helpers.js"); | ||
| const { resolveContract } = require("../../utils/resolvers"); | ||
|
|
||
| const mainExport = async () => { | ||
| const sDeployer = isFork ? await getSigner() : await getDefenderSigner(); | ||
| const deployerAddress = await sDeployer.getAddress(); | ||
|
|
||
| // 1. Upgrade the Native Staking Strategy | ||
| await upgradeNativeStakingSSVStrategy(); | ||
|
|
||
| const nativeStakingStrategy = await resolveContract( | ||
| "NativeStakingSSVStrategyProxy", | ||
| "NativeStakingSSVStrategy" | ||
| ); | ||
|
|
||
| // 2. Upgrade the Compounding Staking Strategy | ||
| await upgradeCompoundingStakingSSVStrategy(); | ||
|
|
||
| const compoundingStakingStrategy = await resolveContract( | ||
| "CompoundingStakingSSVStrategyProxy", | ||
| "CompoundingStakingSSVStrategy" | ||
| ); | ||
|
|
||
| // 3. Deploy the new Consolidation Controller | ||
| console.log(`Deploy ConsolidationController`); | ||
| const dConsolidationController = await deployWithConfirmation( | ||
| "ConsolidationController", | ||
| [ | ||
| deployerAddress, // Owner | ||
| deployerAddress, // Validator Registrator | ||
| nativeStakingStrategy.address, // Old Native Staking Strategy 2 | ||
| nativeStakingStrategy.address, // Old Native Staking Strategy 3 | ||
| compoundingStakingStrategy.address, // New Compounding Staking Strategy | ||
| ] | ||
| ); | ||
|
|
||
| // 4. Set the Registrator of the Compounding Staking Strategy to the Consolidation Controller | ||
| console.log( | ||
| `About to set Registrator of CompoundingStakingSSVStrategy to ConsolidationController` | ||
| ); | ||
| await compoundingStakingStrategy | ||
| .connect(sDeployer) | ||
| .setRegistrator(dConsolidationController.address); | ||
|
|
||
| // 5. Set the Registrator of the Native Staking Strategy to the Consolidation Controller | ||
| console.log( | ||
| `About to set Registrator of NativeStakingSSVStrategy to ConsolidationController` | ||
| ); | ||
| await nativeStakingStrategy | ||
| .connect(sDeployer) | ||
| .setRegistrator(dConsolidationController.address); | ||
|
|
||
| console.log("Running 033 deployment done"); | ||
| return true; | ||
| }; | ||
|
|
||
| mainExport.id = "033_validator_consolidation"; | ||
| mainExport.tags = []; | ||
| mainExport.dependencies = []; | ||
| mainExport.skip = () => false; | ||
|
|
||
| module.exports = mainExport; |
61 changes: 61 additions & 0 deletions
61
contracts/deploy/hoodi/034_validator_consolidation_upgrade.js
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,61 @@ | ||
| const { upgradeNativeStakingSSVStrategy } = require("../deployActions"); | ||
| const { deployWithConfirmation } = require("../../utils/deploy"); | ||
| const { getDefenderSigner, getSigner } = require("../../utils/signers"); | ||
| const { isFork } = require("../../test/helpers.js"); | ||
| const { resolveContract } = require("../../utils/resolvers"); | ||
|
|
||
| const mainExport = async () => { | ||
| const sDeployer = isFork ? await getSigner() : await getDefenderSigner(); | ||
| const deployerAddress = await sDeployer.getAddress(); | ||
|
|
||
| const nativeStakingStrategy = await resolveContract( | ||
| "NativeStakingSSVStrategyProxy", | ||
| "NativeStakingSSVStrategy" | ||
| ); | ||
| const compoundingStakingStrategy = await resolveContract( | ||
| "CompoundingStakingSSVStrategyProxy", | ||
| "CompoundingStakingSSVStrategy" | ||
| ); | ||
|
|
||
| // 1. Upgrade the Native Staking Strategy | ||
| await upgradeNativeStakingSSVStrategy(); | ||
|
|
||
| // 2. Deploy the new Consolidation Controller | ||
| console.log(`Deploy ConsolidationController`); | ||
| const dConsolidationController = await deployWithConfirmation( | ||
| "ConsolidationController", | ||
| [ | ||
| deployerAddress, // Owner | ||
| deployerAddress, // Validator Registrator | ||
| nativeStakingStrategy.address, // Old Native Staking Strategy 2 | ||
| nativeStakingStrategy.address, // Old Native Staking Strategy 3 | ||
| compoundingStakingStrategy.address, // New Compounding Staking Strategy | ||
| ] | ||
| ); | ||
|
|
||
| // 3. Set the Registrator of the Compounding Staking Strategy to the Consolidation Controller | ||
| console.log( | ||
| `About to set Registrator of CompoundingStakingSSVStrategy to ConsolidationController` | ||
| ); | ||
| await compoundingStakingStrategy | ||
| .connect(sDeployer) | ||
| .setRegistrator(dConsolidationController.address); | ||
|
|
||
| // 4. Set the Registrator of the Native Staking Strategy to the Consolidation Controller | ||
| console.log( | ||
| `About to set Registrator of NativeStakingSSVStrategy to ConsolidationController` | ||
| ); | ||
| await nativeStakingStrategy | ||
| .connect(sDeployer) | ||
| .setRegistrator(dConsolidationController.address); | ||
|
|
||
| console.log("Running 034 deployment done"); | ||
| return true; | ||
| }; | ||
|
|
||
| mainExport.id = "034_validator_consolidation_upgrade"; | ||
| mainExport.tags = []; | ||
| mainExport.dependencies = []; | ||
| mainExport.skip = () => false; | ||
|
|
||
| module.exports = mainExport; |
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
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.