-
Notifications
You must be signed in to change notification settings - Fork 225
feat: upgrade on forking #978
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
Merged
+2,857
−695
Merged
Changes from all commits
Commits
Show all changes
87 commits
Select commit
Hold shift + click to select a range
42c64b6
feat: untangle Sanity Checker and Locator deployment
arwer13 3673df4
feat: untangle Delegation deployment and Locator upgrade
arwer13 ac5e23b
fix: integration tests are now runnable on fork after upgrade
arwer13 969dcf5
fix: upgrade initialization in Lido and AccountingOracle
arwer13 9f00310
feat: initial version of upgrade on forking (with template)
arwer13 9a18b10
fix: ci scratch integration tests (provisioning)
arwer13 c3840d5
feat: restore CI integration test
arwer13 2fa8d9a
fix: ci mainnet integration test
arwer13 ba9417a
feat: move burner burnt shares initialization to upgrade template
arwer13 ef7c242
fix: burner scratch deployment
arwer13 43814a5
feat: add Burner migration with stETH in Lido.finalizeUpgrade_v3
arwer13 67c7d88
fix: add workaround to fix forking forks (e.g. hardhat forking hardhat)
arwer13 23877f5
fix: ci but setting no chainId on hardhat-node
arwer13 ed61031
Merge 'feat/vaults' (pdg) into 'feat/ugprade-on-forking'
arwer13 d1bf561
feat(upgrade): separate mocking aragon voting into yarn command
arwer13 be49584
fix(tests): update burner migration unit tests
arwer13 7554864
feat(upgrade): little improvements here and there
arwer13 a3685a5
fix(upgrade): remove failed unnecessary test and uncomment checks
arwer13 863a3c0
feat(scratch): save aragon app repo addresses on scratch deploy
arwer13 df4508d
feat(upgrade): more burner allowance migration + more template checks
arwer13 8f21f92
feat(upgrade): remove upgrade template from coverage report
arwer13 896bd55
Merge branch 'feat/vaults' into feat/upgrade-on-forking
arwer13 1167c03
feat(upgrade): remove WithdrawalVault upgrade from upgrade
arwer13 47fb019
chore: update .vscode settings.json cSpell.words
arwer13 57074e0
chore: update .gitignore to include vscode snippets
arwer13 bf8c893
Merge feat/vaults into feat/upgrade-on-forking
arwer13 1d0144a
fix: a few integration tests on forking update
arwer13 d1a589c
Merge branch 'feat/vaults' into feat/upgrade-on-forking
arwer13 af8044e
Merge 'feat/vaults' into 'feat/upgrade-on-forking'
arwer13 11da9d7
Merge 'feat/vaults' into 'feat/upgrade-on-forking'
arwer13 6509f6b
fix: upgrade deployment and tests
arwer13 93ae002
fix: eip7002 mock storage issue
arwer13 9f89d64
fix: vault-creation.integration test for upgrade mode
arwer13 a114a94
chore: remove .vscode from repo
arwer13 8381da4
feat(upgrade): retrieve more contracts from other contracts (code rev…
arwer13 4c6773d
Merge 'feat/vaults' into 'feat/upgrade-on-forking'
arwer13 32ea160
Merge branch 'feat/vaults' into feat/upgrade-on-forking
arwer13 db30967
Merge branch 'feat/vaults' into feat/upgrade-on-forking
arwer13 381f529
feat(upgrade): revoke old Burner's REQUEST_BURN_SHARES_ROLE
arwer13 250c32d
Merge 'feat/vaults' into 'feat/upgrade-on-forking'
arwer13 35a3e50
feat: set Error.stackTraceLimit to 30 (the default was 10)
arwer13 a997641
feat(upgrade): refactor UpgradeTemplateV3
arwer13 3935209
refactor(upgrade): move UpgradeTemplateV3 file
arwer13 11f3a90
feat(upgrade): remove template non-single block upgrade hack
arwer13 cd6e6ad
fix(upgrade): operatorGrid address discovery
arwer13 97f0c21
Merge branch 'feat/vaults' into 'feat/upgrade-on-forking'
arwer13 8c56e92
refactor(upgrade): refactor upgrade template
arwer13 b82d387
Merge 'feat/vaults' into 'feat/upgrade-on-forking'
arwer13 890dcd9
fix(upgrade): disable other staking modules when staking via utils
arwer13 b541196
Merge 'feat/vaults' into 'feat/upgrade-on-forking'
arwer13 342163a
feat: code review + fix single block transactions issue
arwer13 b7959b2
feat: mvp of upgrade template tests + gh workflow + code review
arwer13 1676148
feat: skip extra full items, half-fix and refactoring
arwer13 0044853
Merge 'feat/vaults' into 'feat/upgrade-on-forking'
arwer13 7ca3ae1
fix: vaults/{connected,disconnected}.integration.ts test
arwer13 30a9065
fix: core/happy-path.integration Should rebase correctly WQ burn
arwer13 e1b07f6
feat: update AO consensus version as it changed on mainnet
arwer13 d18e077
fix: withdrawal-happy-path.integration for upgrade
arwer13 6472692
refactor(upgrade): restructure immutables in upgrade template
arwer13 07ad3c2
feat(upgrade): add mvp of onchain voting script generation
arwer13 2ec2a00
Merge branch 'feat/vaults' into feat/upgrade-on-forking
arwer13 515b809
Merge branch 'feat/vaults' into feat/upgrade-on-forking
arwer13 c9428c3
Merge branch 'feat/vaults' into feat/upgrade-on-forking
arwer13 d8a46b4
feat: fix a few integration tests
arwer13 7ea6f7c
Merge 'feat/vaults' into 'feat/upgrade-on-forking'
arwer13 ee8c52d
feat(upgrade): fix a few tests
arwer13 f4019c7
fix(upgrade): tricky fix of test accounts having weird bytecode
arwer13 0eae15d
fix(upgrade): fix a test and a bit of refactoring
arwer13 5a66af9
feat(upgrade): fix AO extra data full items test
arwer13 bb82e3f
Merge branch 'feat/vaults' into feat/upgrade-on-forking
arwer13 fd8584d
fix: typecheck error
arwer13 88c951d
feat(upgrade): code review
arwer13 8086d57
feat(upgrade): move V3Addresses to V3Template
arwer13 159bb13
feat(upgrade): remove immutable roles from upgrade template
arwer13 f9bbcc2
fix(upgrade): upgrade-template-v3 test
arwer13 cc5c8d1
feat(upgrade): code review
arwer13 35a0d7d
Merge 'feat/vaults' into 'feat/upgrade-on-forking'
arwer13 7942841
feat(upgrade): refactor addresses order in V3Addresses
arwer13 730b21e
Merge 'feat/vaults' into 'feat/upgrade-on-forking'
arwer13 ad94d17
feat(upgrade): code review
arwer13 5a1ce00
feat(upgrade): fix setNodeOperatorFeeBP integration test
arwer13 990a53d
feat(upgrade): fix template tests
arwer13 9882e1c
Update contracts/upgrade/V3Template.sol
TheDZhon 818253d
Update contracts/upgrade/V3Template.sol
TheDZhon 7b9aec1
Merge branch 'feat/vaults' into feat/upgrade-on-forking
arwer13 82867dd
fix: formatting
arwer13 5aa4ea8
fix: linter
arwer13 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 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
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,24 @@ | ||
name: Integration Test For Upgrade Template | ||
|
||
on: [push] | ||
|
||
jobs: | ||
test_hardhat_integration_fork_template: | ||
name: Hardhat / Upgrade Template | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 120 | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Common setup | ||
uses: ./.github/workflows/setup | ||
|
||
- name: Prepare network state file | ||
run: cp deployed-mainnet.json deployed-mainnet-upgrade.json | ||
|
||
- name: Run Upgrade Template Integration Tests | ||
run: yarn test:integration:upgrade-template | ||
env: | ||
RPC_URL: "${{ secrets.ETH_RPC_URL }}" | ||
UPGRADE_PARAMETERS_FILE: upgrade-parameters-mainnet.json |
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
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 |
---|---|---|
@@ -1,32 +1,34 @@ | ||
// SPDX-FileCopyrightText: 2020 Lido <[email protected]> | ||
// SPDX-FileCopyrightText: 2025 Lido <[email protected]> | ||
|
||
// SPDX-License-Identifier: GPL-3.0 | ||
|
||
pragma solidity 0.4.24; | ||
|
||
import "@aragon/os/contracts/factory/APMRegistryFactory.sol"; | ||
import "@aragon/os/contracts/acl/ACL.sol"; | ||
import "@aragon/os/contracts/apm/Repo.sol"; | ||
import "@aragon/os/contracts/apm/APMRegistry.sol"; | ||
import "@aragon/os/contracts/ens/ENSSubdomainRegistrar.sol"; | ||
import "@aragon/os/contracts/kernel/Kernel.sol"; | ||
import "@aragon/os/contracts/lib/ens/ENS.sol"; | ||
import "@aragon/os/contracts/lib/ens/PublicResolver.sol"; | ||
import "@aragon/os/contracts/factory/DAOFactory.sol"; | ||
import "@aragon/os/contracts/common/IsContract.sol"; | ||
import {APMRegistryFactory} from "@aragon/os/contracts/factory/APMRegistryFactory.sol"; | ||
import {ACL} from "@aragon/os/contracts/acl/ACL.sol"; | ||
import {Repo} from "@aragon/os/contracts/apm/Repo.sol"; | ||
import {APMRegistry} from "@aragon/os/contracts/apm/APMRegistry.sol"; | ||
import {ENSSubdomainRegistrar} from "@aragon/os/contracts/ens/ENSSubdomainRegistrar.sol"; | ||
import {Kernel} from "@aragon/os/contracts/kernel/Kernel.sol"; | ||
import {ENS} from "@aragon/os/contracts/lib/ens/ENS.sol"; | ||
import {PublicResolver} from "@aragon/os/contracts/lib/ens/PublicResolver.sol"; | ||
import {DAOFactory} from "@aragon/os/contracts/factory/DAOFactory.sol"; | ||
import {IsContract} from "@aragon/os/contracts/common/IsContract.sol"; | ||
import {MiniMeToken, MiniMeTokenFactory} from "@aragon/minime/contracts/MiniMeToken.sol"; | ||
import {EVMScriptRegistry } from "@aragon/os/contracts/evmscript/EVMScriptRegistry.sol"; | ||
|
||
import "@aragon/apps-agent/contracts/Agent.sol"; | ||
import "@aragon/apps-vault/contracts/Vault.sol"; | ||
|
||
import "@aragon/apps-lido/apps/voting/contracts/Voting.sol"; | ||
import {Agent} from "@aragon/apps-agent/contracts/Agent.sol"; | ||
import {Vault} from "@aragon/apps-vault/contracts/Vault.sol"; | ||
|
||
import "@aragon/apps-finance/contracts/Finance.sol"; | ||
import "@aragon/apps-lido/apps/token-manager/contracts/TokenManager.sol"; | ||
import {Voting} from "@aragon/apps-lido/apps/voting/contracts/Voting.sol"; | ||
import {Finance} from "@aragon/apps-finance/contracts/Finance.sol"; | ||
import {TokenManager} from "@aragon/apps-lido/apps/token-manager/contracts/TokenManager.sol"; | ||
|
||
import "@aragon/id/contracts/IFIFSResolvingRegistrar.sol"; | ||
import {IFIFSResolvingRegistrar} from "@aragon/id/contracts/IFIFSResolvingRegistrar.sol"; | ||
|
||
import "../Lido.sol"; | ||
import "../nos/NodeOperatorsRegistry.sol"; | ||
import {Lido} from "../Lido.sol"; | ||
import {NodeOperatorsRegistry} from "../nos/NodeOperatorsRegistry.sol"; | ||
|
||
contract LidoTemplate is IsContract { | ||
// Configuration errors | ||
|
@@ -119,7 +121,7 @@ contract LidoTemplate is IsContract { | |
APMRegistryFactory private apmRegistryFactory; | ||
|
||
DeployState private deployState; | ||
APMRepos private apmRepos; | ||
APMRepos public apmRepos; | ||
|
||
event TmplAPMDeployed(address apm); | ||
event TmplReposCreated(); | ||
|
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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
// SPDX-FileCopyrightText: 2024 Lido <[email protected]> | ||
// SPDX-FileCopyrightText: 2025 Lido <[email protected]> | ||
// SPDX-License-Identifier: GPL-3.0 | ||
|
||
// See contracts/COMPILERS.md | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. probably should be a proxy? |
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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
// SPDX-FileCopyrightText: 2023 Lido <[email protected]> | ||
// SPDX-FileCopyrightText: 2025 Lido <[email protected]> | ||
// SPDX-License-Identifier: GPL-3.0 | ||
|
||
/* See contracts/COMPILERS.md */ | ||
|
@@ -58,12 +58,14 @@ contract Burner is IBurner, AccessControlEnumerable { | |
using SafeERC20 for IERC20; | ||
|
||
error AppAuthFailed(); | ||
error MigrationNotAllowedOrAlreadyMigrated(); | ||
error DirectETHTransfer(); | ||
error ZeroRecoveryAmount(); | ||
error StETHRecoveryWrongFunc(); | ||
error ZeroBurnAmount(); | ||
error BurnAmountExceedsActual(uint256 requestedAmount, uint256 actualAmount); | ||
error ZeroAddress(string field); | ||
error OnlyLidoCanMigrate(); | ||
|
||
bytes32 public constant REQUEST_BURN_MY_STETH_ROLE = keccak256("REQUEST_BURN_MY_STETH_ROLE"); | ||
bytes32 public constant REQUEST_BURN_SHARES_ROLE = keccak256("REQUEST_BURN_SHARES_ROLE"); | ||
|
@@ -74,6 +76,8 @@ contract Burner is IBurner, AccessControlEnumerable { | |
uint256 private totalCoverSharesBurnt; | ||
uint256 private totalNonCoverSharesBurnt; | ||
|
||
bool public isMigrationAllowed; | ||
|
||
ILidoLocator public immutable LOCATOR; | ||
ILido public immutable LIDO; | ||
|
||
|
@@ -116,16 +120,9 @@ contract Burner is IBurner, AccessControlEnumerable { | |
* @param _admin the Lido DAO Aragon agent contract address | ||
* @param _locator the Lido locator address | ||
* @param _stETH stETH token address | ||
* @param _totalCoverSharesBurnt Shares burnt counter init value (cover case) | ||
* @param _totalNonCoverSharesBurnt Shares burnt counter init value (non-cover case) | ||
* @param _isMigrationAllowed whether migration is allowed initially | ||
*/ | ||
constructor( | ||
address _admin, | ||
address _locator, | ||
address _stETH, | ||
uint256 _totalCoverSharesBurnt, | ||
uint256 _totalNonCoverSharesBurnt | ||
) { | ||
constructor(address _admin, address _locator, address _stETH, bool _isMigrationAllowed) { | ||
if (_admin == address(0)) revert ZeroAddress("_admin"); | ||
if (_locator == address(0)) revert ZeroAddress("_locator"); | ||
if (_stETH == address(0)) revert ZeroAddress("_stETH"); | ||
|
@@ -135,9 +132,26 @@ contract Burner is IBurner, AccessControlEnumerable { | |
|
||
LOCATOR = ILidoLocator(_locator); | ||
LIDO = ILido(_stETH); | ||
isMigrationAllowed = _isMigrationAllowed; | ||
} | ||
|
||
totalCoverSharesBurnt = _totalCoverSharesBurnt; | ||
totalNonCoverSharesBurnt = _totalNonCoverSharesBurnt; | ||
/** | ||
* @param _oldBurner The address of the old Burner contract | ||
* @dev Can be called only by Lido contract. Migrates state from the old Burner. Can be run only once. | ||
* Cannot be run if migration is disabled upon deployment. | ||
*/ | ||
function migrate(address _oldBurner) external { | ||
if (msg.sender != address(LIDO)) revert OnlyLidoCanMigrate(); | ||
if (_oldBurner == address(0)) revert ZeroAddress("_oldBurner"); | ||
if (!isMigrationAllowed) revert MigrationNotAllowedOrAlreadyMigrated(); | ||
isMigrationAllowed = false; | ||
|
||
IBurner oldBurner = IBurner(_oldBurner); | ||
totalCoverSharesBurnt = oldBurner.getCoverSharesBurnt(); | ||
totalNonCoverSharesBurnt = oldBurner.getNonCoverSharesBurnt(); | ||
(uint256 coverShares, uint256 nonCoverShares) = oldBurner.getSharesRequestedToBurn(); | ||
coverSharesBurnRequested = coverShares; | ||
nonCoverSharesBurnRequested = nonCoverShares; | ||
} | ||
|
||
/** | ||
|
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.