Skip to content
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

Vote 08.10.2024 #253

Merged
merged 65 commits into from
Oct 14, 2024
Merged
Changes from 1 commit
Commits
Show all changes
65 commits
Select commit Hold shift + click to select a range
dbbf25a
upgrade L1 optimism bridge
kovalgek Apr 8, 2024
b181576
add optimism contracts upgrade actions
kovalgek Apr 8, 2024
1e712fe
feat: mvp code to run the voting on Sepolia
arwer13 Jul 3, 2024
e818d6a
fix l2 actions, add function to run vote for fork
kovalgek Jul 24, 2024
5298b0d
add upgrade finalization to l1, l2 bridges and l2 wstETH
kovalgek Jul 24, 2024
b979169
add tests
kovalgek Jul 26, 2024
8e7a763
add tests for oracle report and token rate notifier
kovalgek Aug 1, 2024
e51378f
fix small comments
kovalgek Aug 1, 2024
e5b453c
rename files
kovalgek Aug 8, 2024
4277d8f
disable tests for mainnet that are for sepolia state only, rename files
kovalgek Aug 9, 2024
c7375e1
feat(stETH on optimism): add fallback vote script for enabling deposits
arwer13 Aug 22, 2024
56b9b02
feat(stETH on optimism): add mvp of the upgrade script
arwer13 Aug 24, 2024
1598211
feat(stETH on optimism): add fallback vote script if L2 upgrade fails
arwer13 Aug 24, 2024
f8ac524
fix: import brownie to mitigate reverts failure
TheDZhon Sep 12, 2024
5765220
fix voting for executing on forks
kovalgek Sep 12, 2024
16537ad
top up contract balances for london hardfork
kovalgek Sep 13, 2024
abdaa2d
top up balances in fixtures
kovalgek Sep 16, 2024
d752529
use middleware to top up balances
kovalgek Sep 16, 2024
befebcb
fix typo
kovalgek Sep 17, 2024
126a1f1
fix constants
kovalgek Sep 17, 2024
1cb3aad
update description and voting text
kovalgek Sep 18, 2024
4568af1
fix test by considering gas usage in tx
kovalgek Sep 20, 2024
b27f41f
add pause and resume help methods
kovalgek Sep 20, 2024
77fd946
fix el reward test by considering gas usage in tx
kovalgek Sep 20, 2024
a678104
remove block check in snapshot test
kovalgek Sep 20, 2024
7eae83f
feat: use london hardfork for mainnet-fork instead of istanbul
Ivan-Feofanov Sep 26, 2024
88d2504
increase precision to fix the test
kovalgek Sep 27, 2024
235e523
fix: use common hardhat and anvil setBalance method
Ivan-Feofanov Sep 27, 2024
579efae
remove comment
kovalgek Sep 30, 2024
a44e546
Merge pull request #245 from lidofinance/feat/vote-steth-optimism
Ivan-Feofanov Sep 30, 2024
ce0346d
raise large action timeout to 2h 30min
Ivan-Feofanov Sep 30, 2024
b80febb
fix: node operator 33 is not exited anymore
Ivan-Feofanov Sep 30, 2024
7129442
fix: load TokenRateNotifier contract to catch error
Ivan-Feofanov Oct 1, 2024
82139e4
Merge pull request #256 from lidofinance/feat/next-vote_fix-trn-error
Ivan-Feofanov Oct 1, 2024
a84843f
Merge branch 'master' into feat/next-vote
Ivan-Feofanov Oct 1, 2024
27ce7d6
refactor steth vote script
kovalgek Oct 2, 2024
b878488
move check functions to tests, don't use addresses from config file
kovalgek Oct 2, 2024
9922c51
Merge pull request #258 from lidofinance/feat/steth_op_vote_refactoring
Ivan-Feofanov Oct 3, 2024
105d8a1
fix: get last exited validator index from the network to avoid real w…
Ivan-Feofanov Oct 3, 2024
93c2688
alliance vote and tests blocks added
kate-aleksseeva Oct 3, 2024
e5329bf
vote description fixed
kate-aleksseeva Oct 3, 2024
75f85a8
check all events
kovalgek Oct 3, 2024
3823533
small refactoring
kovalgek Oct 3, 2024
e2ea68b
Merge pull request #261 from lidofinance/feat/check_events_in_steth_o…
Ivan-Feofanov Oct 3, 2024
298bb79
Merge branch 'feat/next-vote' into feat/next-vote-alliance
Ivan-Feofanov Oct 4, 2024
3f57a0f
feat: balance check
Ivan-Feofanov Oct 4, 2024
be96b7e
Merge pull request #259 from lidofinance/feat/next-vote-alliance
Ivan-Feofanov Oct 4, 2024
db1e7b4
description is changed, contract addresses for tests added, displayin…
kate-aleksseeva Oct 4, 2024
7ee676a
use for wstETH on L2 version instead of
kovalgek Oct 4, 2024
de6ac45
fix: temporary disable easy-track snapshot test
Ivan-Feofanov Oct 4, 2024
7899b5c
Merge pull request #262 from lidofinance/feat/fix_l2_wst_version
Ivan-Feofanov Oct 4, 2024
451bbb9
fix: update metadata CID
Ivan-Feofanov Oct 4, 2024
62f1b71
call optimism portal to load events
kovalgek Oct 6, 2024
05a6e54
Merge pull request #263 from lidofinance/feat/optimism_event
kovalgek Oct 7, 2024
e3c856e
feedback fixes
kovalgek Oct 7, 2024
b47e4ae
Merge pull request #264 from lidofinance/feat/steth-on-op-feedback
kovalgek Oct 8, 2024
6d077bf
fix feedback part 2
kovalgek Oct 8, 2024
d3d1798
fix test
kovalgek Oct 8, 2024
d0929c7
Merge pull request #266 from lidofinance/feat/steth-on-op-feedback2
Psirex Oct 8, 2024
b1170bd
use env to setup vote id in fork upgrade rehearsal
kovalgek Oct 8, 2024
5b5100d
fix getting env
kovalgek Oct 11, 2024
488b2a1
Merge pull request #267 from lidofinance/feat/steth-on-op-improve-for…
kovalgek Oct 11, 2024
83c6a8c
fix: return EasyTrack check
Ivan-Feofanov Oct 14, 2024
f9371c5
feat: archive 2024_10_08 upgrade files
arwer13 Oct 14, 2024
e0495ee
Merge pull request #272 from lidofinance/feat/archive-upgrade-2024_10_08
Ivan-Feofanov Oct 14, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
update description and voting text
kovalgek authored and Ivan-Feofanov committed Sep 26, 2024
commit 1cb3aad7944db8776277f65b9939f3bdd467112c
69 changes: 47 additions & 22 deletions scripts/upgrade_2024_01_10.py
Original file line number Diff line number Diff line change
@@ -1,22 +1,26 @@
"""
kovalgek marked this conversation as resolved.
Show resolved Hide resolved
Voting 01/10/2024.
kovalgek marked this conversation as resolved.
Show resolved Hide resolved

1. Upgrade L1 Bridge implementation
2. Finalize L1 Bridge upgrade
3. Upgrade L1 LidoLocator implementation
4. Grant DEPOSITS_ENABLER_ROLE to Emergency Brakes Committee multisig
5. Send L2 upgrade call:
(a) upgrade L2TokenBridge;
(b) finalize L2TokenBridge upgrade;
(c) upgrade wstETH on L2;
(d) finalize wstETH upgrade";
I. Upgrade Ethereum Contracts
1. Upgrade L1ERC20TokenBridge contract implementation 0x168Cfea1Ad879d7032B3936eF3b0E90790b6B6D4
kovalgek marked this conversation as resolved.
Show resolved Hide resolved
2. Call L1ERC20TokenBridge's finalizeUpgrade_v2() to update internal version counter
3. Upgrade Lido Locator contract implementation 0x39aFE23cE59e8Ef196b81F0DCb165E9aD38b9463
4. Grant permission DEPOSITS_ENABLER_ROLE to Ethereum Emergency Brakes Multisig

II. Upgrade Optimism Contracts
1. Send Optimism upgrade call:
(a) Upgrade L2ERC20TokenBridge contract implementation 0x2734602C0CEbbA68662552CacD5553370B283E2E
(b) Call L2ERC20TokenBridge's finalizeUpgrade_v2() to update internal version counter
(c) Upgrade WstETH ERC20Bridged contract implementation 0xFe57042De76c8D6B1DF0E9E2047329fd3e2B7334
(d) Call WstETH ERC20Bridged's finalizeUpgrade_v2() to update internal version counter

"""

import time
import eth_abi
import brownie

from brownie.exceptions import VirtualMachineError
from brownie import interface, web3, accounts
from typing import Dict
from brownie.network.transaction import TransactionReceipt
@@ -49,9 +53,17 @@
)

DESCRIPTION = """
Voting 01/10/2024.

Upgrade L1Bridge, L2Bridge, L2 wstETH
This vote follows a [Lido DAO decision on Snapshot](https://snapshot.org/#/lido-snapshot.eth/proposal/0xb1a3c33a4911712770c351504bac0499611ceb0faff248eacb1e96354f8e21e8) and [proposes to upgrade](https://research.lido.fi/t/lip-22-steth-on-l2/6855) the Lido bridge on the mainnet, introducing rebaseable stETH token on Optimism.
All audit reports can be found here: [MixBytes Audit Report](https://github.com/lidofinance/audits/blob/main/L2/stETH-on-Optimism-2024-06-MixBytes-Audit-Report.pdf), [Ackee Audit Report](https://github.com/lidofinance/audits/blob/main/L2/stETH-on-Optimism-2024-06-Ackee-Blockchain-Audit-report.pdf)

**Upgrade L1ERC20TokenBridge and L2ERC20TokenBridge** contracts

**Upgrade Lido Locator** contract implementation

**Grant permission** DEPOSITS_ENABLER_ROLE to Ethereum Emergency Brakes Multisig

**Upgrade WstETH ERC20Bridged** contract on Optimism implementation

"""

@@ -104,7 +116,9 @@ def start_vote(tx_params: Dict[str, str], silent: bool) -> bool | list[int | Tra
l1_token_bridge = interface.L1LidoTokensBridge(L1_OPTIMISM_TOKENS_BRIDGE)

call_script_items = [
# 1. L1 TokenBridge upgrade proxy
# I. Upgrade Ethereum Contracts

# 1. Upgrade L1ERC20TokenBridge contract implementation 0x168Cfea1Ad879d7032B3936eF3b0E90790b6B6D4
agent_forward(
[
(
@@ -113,9 +127,11 @@ def start_vote(tx_params: Dict[str, str], silent: bool) -> bool | list[int | Tra
)
]
),
# 2. L1 TokenBridge finalize upgrade

# 2. Call L1ERC20TokenBridge's finalizeUpgrade_v2() to update internal version counter
agent_forward([(l1_token_bridge.address, l1_token_bridge.finalizeUpgrade_v2.encode_input())]),
# 3. Upgrade L1 LidoLocator implementation

# 3. Upgrade Lido Locator contract implementation 0x39aFE23cE59e8Ef196b81F0DCb165E9aD38b9463"
agent_forward(
[
(
@@ -124,7 +140,8 @@ def start_vote(tx_params: Dict[str, str], silent: bool) -> bool | list[int | Tra
)
]
),
# 4. Grant DEPOSITS_ENABLER_ROLE to Emergency Brakes Committee multisig

# 4. Grant permission DEPOSITS_ENABLER_ROLE to Ethereum Emergency Brakes Multisig
agent_forward(
[
(
@@ -133,7 +150,13 @@ def start_vote(tx_params: Dict[str, str], silent: bool) -> bool | list[int | Tra
)
]
),
# 5. L2 TokenBridge

# II. Upgrade Optimism Contracts
# 1. Send Optimism upgrade call:
# (a) Upgrade L2ERC20TokenBridge contract implementation 0x2734602C0CEbbA68662552CacD5553370B283E2E
# (b) Call L2ERC20TokenBridge's finalizeUpgrade_v2() to update internal version counter
# (c) Upgrade WstETH ERC20Bridged contract implementation 0xFe57042De76c8D6B1DF0E9E2047329fd3e2B7334
# (d) Call WstETH ERC20Bridged's finalizeUpgrade_v2() to update internal version counter
agent_forward(
[
(
@@ -153,11 +176,11 @@ def start_vote(tx_params: Dict[str, str], silent: bool) -> bool | list[int | Tra
]

vote_desc_items = [
"1) Upgrade Optimism L1 Bridge implementation",
"2) Finalize Optimism L1 Bridge upgrade",
"3) Upgrade LidoLocator implementation",
"4) Grant DEPOSITS_ENABLER_ROLE to Emergency Brakes Committee multisig",
"5) Send Optimism L2 upgrade call: (a) upgrade L2TokenBridge; (b) finalize L2TokenBridge upgrade; (c) upgrade wstETH; (d) finalize wstETH upgrade",
"1) Upgrade L1ERC20TokenBridge contract implementation 0x168Cfea1Ad879d7032B3936eF3b0E90790b6B6D4",
"2) Call L1ERC20TokenBridge's finalizeUpgrade_v2() to update internal version counter",
"3) Upgrade Lido Locator contract implementation 0x39aFE23cE59e8Ef196b81F0DCb165E9aD38b9463",
"4) Grant permission DEPOSITS_ENABLER_ROLE to Ethereum Emergency Brakes Multisig",
"5) Send Optimism upgrade call: (a) Upgrade L2ERC20TokenBridge contract implementation 0x2734602C0CEbbA68662552CacD5553370B283E2E; (b) Call L2ERC20TokenBridge's finalizeUpgrade_v2() to update internal version counter; (c) Upgrade WstETH ERC20Bridged contract implementation 0xFe57042De76c8D6B1DF0E9E2047329fd3e2B7334; (d) Call WstETH ERC20Bridged's finalizeUpgrade_v2() to update internal version counter;",
]

vote_items = bake_vote_items(list(vote_desc_items), list(call_script_items))
@@ -224,8 +247,10 @@ def check_pre_upgrade_state():
assert l1_token_bridge_implementation_address_before == L1_OPTIMISM_TOKENS_BRIDGE_IMPL, "Old address is incorrect"

# L1 Bridge doesn't have version before update
with brownie.reverts():
try:
l1_token_bridge.getContractVersion()
except VirtualMachineError:
pass

# Upgrade LidoLocator implementation
lido_locator_impl_before = lido_locator_proxy.proxy__getImplementation()