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

Chore/ ynETH/ynEigen verify implementation and proxyadmins #176

Merged
merged 14 commits into from
Oct 11, 2024

Conversation

danoctavian
Copy link
Contributor

@danoctavian danoctavian commented Oct 10, 2024

Add assertions to ensure the json deployment contracts never go out of sync, and the verify scripts always cross check all entries.

The focus is to see given the Proxy address, do the ProxyAdmin and implementation of said proxy match what's stored in the json.

Additionally checks are added for all withdrawals contracts.

Consolidates:

all deployed contracts into the single ynETH-1.json and ynETH-17000.json:

delete deployments/ynETHWithdrawals-17000.json
delete deployments/ynETHWithdrawalsProcessor-17000.json

And add the contents to ynETH-17000.json

add the missing ynViewer which acts as a rate provider to ynETH-1.json and ynETH-17000.json

The following all pass:

make ynEigen-verify path=script/ynEigen/input/lsd-mainnet.json rpc="https://black-young-pool.quiknode.pro/[mykey]"

make ynEigen-verify path=script/ynEigen/input/lsd-holesky.json rpc="https://rpc.ankr.com/eth_holesky"

forge script script/ynETH/VerifyYnETH.s.sol --rpc-url https://rpc.ankr.com/eth_holesky

forge script script/ynETH/VerifyYnETH.s.sol --rpc-url https://black-young-pool.quiknode.pro/[mykey]

@danoctavian danoctavian requested review from xhad and gearcat0 October 10, 2024 18:11
@danoctavian danoctavian changed the title Chore/yneigen verify implementations Chore/ ynETH verify implementations Oct 10, 2024
@danoctavian danoctavian changed the title Chore/ ynETH verify implementations Chore/ ynETH/ynEigen verify implementation and proxyadmins Oct 10, 2024
@danoctavian danoctavian marked this pull request as ready for review October 10, 2024 20:16
@@ -16,7 +16,7 @@
"implementation-eigenStrategyManager": "0xE2343a850394ee1b1e33b16Da5bD73B076D6Fa81",
"implementation-rateProvider": "0xAEDC83F607126b4D2437F79285e2C635685BBA01",
"implementation-tokenStakingNodesManager": "0x17e77F964538fed3ADEc3E8dBB6147dA258206Da",
"implementation-ynEigenDepositAdapter": "0x5F8c55A5A33d63CAa231c668a62f69AA862020E9",
"implementation-ynEigenDepositAdapter": "0xA9CD5a5199177b704287e379e85af95F0f061Bf2",
Copy link
Contributor Author

@danoctavian danoctavian Oct 10, 2024

Choose a reason for hiding this comment

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

implementation was not updated properly in the json file post hotfix

@@ -17,15 +17,18 @@
"implementation-rewardsDistributor": "0x306EBed66642867B94b29752be37b8f20fEb5F72",
"implementation-stakingNodesManager": "0xaBD3A755E4eEF24f862c268D21Fd5235904cc811",
"implementation-ynETH": "0x14DC3d915107DcA9ed39E29E14fbdfe4358a1346",
"implementation-ynViewer": "0x0365a6eF790e05EEe386B57326e5Ceaf5B10899e",
Copy link
Contributor Author

Choose a reason for hiding this comment

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

added in ynViewer which was missing

@@ -11,20 +11,32 @@
"STAKING_NODES_OPERATOR": "0x9Dd8F69b62ddFd990241530F47dcEd0Dad7f7d39",
"STAKING_NODE_CREATOR": "0x9Dd8F69b62ddFd990241530F47dcEd0Dad7f7d39",
"VALIDATOR_MANAGER": "0x9Dd8F69b62ddFd990241530F47dcEd0Dad7f7d39",
"implementation-StakingNodesManager": "0x104f0c5156BC0D9Cbda3f30d1B74F42b5610A2dF",
"implementation-ynETH": "0x0E60A5db38c545ced3d3480B6768811cc603649A",
"implementation-stakingNodesManager": "0xC9cf6740282617f3B392f900De0449E687Ce05e3",
Copy link
Contributor Author

Choose a reason for hiding this comment

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

this was outdated post M3 upgrade

"implementation-StakingNodesManager": "0x104f0c5156BC0D9Cbda3f30d1B74F42b5610A2dF",
"implementation-ynETH": "0x0E60A5db38c545ced3d3480B6768811cc603649A",
"implementation-stakingNodesManager": "0xC9cf6740282617f3B392f900De0449E687Ce05e3",
"implementation-ynETH": "0x090D67d3C97712f6C17a037515CbB8502561EE57",
Copy link
Contributor Author

Choose a reason for hiding this comment

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

this was outdated post M3 upgrade

"implementation-executionLayerReceiver": "0x1fbedf3773418f20b9dfeafcd9d263030eb0e42f",
"implementation-consensusLayerReceiver": "0xe7acc0533c650ad0cc11f57f81c38fa19634b1d7",
"implementation-RewardsDistributor": "0xb6ec4d9f71e437c672147c576f1c70ba5da8d159",
"implementation-rewardsDistributor": "0xb6ec4d9f71e437c672147c576f1c70ba5da8d159",
"implementation-withdrawalsProcessor": "0x36a38AA91947DbE6539e19512E6FF26576015Bb2",
Copy link
Contributor Author

@danoctavian danoctavian Oct 10, 2024

Choose a reason for hiding this comment

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

add in the missing withdrawals extra contracts + ynViewer

@@ -64,7 +71,12 @@ contract ActorAddresses {
// TODO: replace with concrete deployment
YNStrategyController: 0x1234567890123456789012345678901234567890,
// TODO: replace with concrete deployment
YNTokenStakingNodeOperator: 0x2234567890123456789012345678901234567890
YNTokenStakingNodeOperator: 0x2234567890123456789012345678901234567890,
ynETHWithdrawalsWallets: YnETHWithdrawalsWallets({
Copy link
Contributor Author

Choose a reason for hiding this comment

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

add in freshly created multisigs to handle withdrawals on Holesky


// TODO: MUST fill for prod. same as YnDev for now
ynETHWithdrawalsWallets: YnETHWithdrawalsWallets({
YNStakingNodesWithdrawer: 0xa08F39d30dc865CC11a49b6e5cBd27630D6141C3,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

have YnDEV for now until set to newly minted multisigs

abstract contract BaseScript is Script, Utils {
using stdJson for string;

struct ProxyAddresses {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

load up all data from JSON file into this struct.

This way you can assert that the JSON matches the on-chain for the trinity:

Proxy - ProxyAdmin - Implementation

deployment.ynViewer = ynViewer(payable(jsonContent.readAddress(".proxy-ynViewer")));
proxies.ynViewer = loadProxyAddresses(jsonContent, "ynViewer");

if (block.chainid == 17000) { // Holesky chain ID
Copy link
Contributor Author

@danoctavian danoctavian Oct 10, 2024

Choose a reason for hiding this comment

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

nothing to parse until we deploy those for mainnet.

@@ -0,0 +1,717 @@
/// SPDX-License-Identifier: BSD 3-Clause License
pragma solidity ^0.8.24;
Copy link
Contributor Author

@danoctavian danoctavian Oct 10, 2024

Choose a reason for hiding this comment

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

the verify ynETH is now heavily enhanced to check:

Proxy - ProxyAdmin - Implementation Trinity matches the JSON with what's on-chain.

All the deps and fields of withdrawals are asserted currently just for holesky, to be enabled easily for mainnet.

A suite of sanity checks check supply, total assets and that other sums are consistent.

console.log(string.concat("\u2705 ", contractName, ": Implementation address - ", vm.toString(implementationAddress)));
}

function verifyProxies() internal view {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

check the trinity

Proxy - ProxyAdmin - Implementation

for ynEigen as well

@danoctavian
Copy link
Contributor Author

Screenshot 2024-10-10 at 11 44 06 PM Screenshot 2024-10-10 at 11 44 46 PM Screenshot 2024-10-10 at 11 46 00 PM Screenshot 2024-10-10 at 11 46 32 PM

| Contract Name | Contract Address |
|----------------------------|-------------------------------------------|
| ynETH Proxy | [`0x09db87A538BD693E9d08544577d5cCfAA6373A48`](https://etherscan.io/address/0x09db87A538BD693E9d08544577d5cCfAA6373A48) |
| StakingNodesManager Proxy | [`0x8C33A1d6d062dB7b51f79702355771d44359cD7d`](https://etherscan.io/address/0x8C33A1d6d062dB7b51f79702355771d44359cD7d) |
| RewardsDistributor Proxy | [`0x40d5FF3E218f54f4982661a0464a298Cf6652351`](https://etherscan.io/address/0x40d5FF3E218f54f4982661a0464a298Cf6652351) |
| ExecutionLayerReceiver Proxy | [`0x1D6b2a11FFEa5F9a8Ed85A02581910b3d695C12b`](https://etherscan.io/address/0x1D6b2a11FFEa5F9a8Ed85A02581910b3d695C12b) |
| ConsensusLayerReceiver Proxy | [`0xE439fe4563F7666FCd7405BEC24aE7B0d226536e`](https://etherscan.io/address/0xE439fe4563F7666FCd7405BEC24aE7B0d226536e) |

### Implementations
Copy link
Contributor Author

@danoctavian danoctavian Oct 10, 2024

Choose a reason for hiding this comment

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

keep only proxies here to not confuse people

Happened numerous times they'd copy paste the implementation instead of the proxy address.

@danoctavian danoctavian merged commit ba6cd48 into release-candidate Oct 11, 2024
1 check passed
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.

2 participants