-
Notifications
You must be signed in to change notification settings - Fork 338
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
[1.0.0] slashing upgrade script #916
base: slashing-magnitudes
Are you sure you want to change the base?
Conversation
jbrower95
commented
Dec 2, 2024
•
edited
Loading
edited
- TODO: implement rest of upgrade
5663b7c
to
579bb1e
Compare
1d94413
to
baa1f73
Compare
f04ad2b
to
f819336
Compare
fe047e9
to
428d52d
Compare
|
|
|
1 similar comment
|
|
|
2 similar comments
|
|
|
|
|
…ashing (#938) * save * rm helper * script works * more prints * fix: cleanup --------- Co-authored-by: gpsanant <[email protected]>
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Quick Review
@@ -0,0 +1 @@ | |||
[{"type":"constructor","inputs":[{"name":"_ethPOS","type":"address","internalType":"contract IETHPOSDeposit"},{"name":"_eigenPodManager","type":"address","internalType":"contract IEigenPodManager"},{"name":"_GENESIS_TIME","type":"uint64","internalType":"uint64"}],"stateMutability":"nonpayable"},{"type":"receive","stateMutability":"payable"},{"type":"function","name":"GENESIS_TIME","inputs":[],"outputs":[{"name":"","type":"uint64","internalType":"uint64"}],"stateMutability":"view"},{"type":"function","name":"activeValidatorCount","inputs":[],"outputs":[{"name":"","type":"uint256","internalType":"uint256"}],"stateMutability":"view"},{"type":"function","name":"checkpointBalanceExitedGwei","inputs":[{"name":"","type":"uint64","internalType":"uint64"}],"outputs":[{"name":"","type":"uint64","internalType":"uint64"}],"stateMutability":"view"},{"type":"function","name":"currentCheckpoint","inputs":[],"outputs":[{"name":"","type":"tuple","internalType":"struct IEigenPodTypes.Checkpoint","components":[{"name":"beaconBlockRoot","type":"bytes32","internalType":"bytes32"},{"name":"proofsRemaining","type":"uint24","internalType":"uint24"},{"name":"podBalanceGwei","type":"uint64","internalType":"uint64"},{"name":"balanceDeltasGwei","type":"int64","internalType":"int64"},{"name":"prevBeaconBalanceGwei","type":"uint64","internalType":"uint64"}]}],"stateMutability":"view"},{"type":"function","name":"currentCheckpointTimestamp","inputs":[],"outputs":[{"name":"","type":"uint64","internalType":"uint64"}],"stateMutability":"view"},{"type":"function","name":"eigenPodManager","inputs":[],"outputs":[{"name":"","type":"address","internalType":"contract IEigenPodManager"}],"stateMutability":"view"},{"type":"function","name":"ethPOS","inputs":[],"outputs":[{"name":"","type":"address","internalType":"contract IETHPOSDeposit"}],"stateMutability":"view"},{"type":"function","name":"getParentBlockRoot","inputs":[{"name":"timestamp","type":"uint64","internalType":"uint64"}],"outputs":[{"name":"","type":"bytes32","internalType":"bytes32"}],"stateMutability":"view"},{"type":"function","name":"initialize","inputs":[{"name":"_podOwner","type":"address","internalType":"address"}],"outputs":[],"stateMutability":"nonpayable"},{"type":"function","name":"lastCheckpointTimestamp","inputs":[],"outputs":[{"name":"","type":"uint64","internalType":"uint64"}],"stateMutability":"view"},{"type":"function","name":"podOwner","inputs":[],"outputs":[{"name":"","type":"address","internalType":"address"}],"stateMutability":"view"},{"type":"function","name":"proofSubmitter","inputs":[],"outputs":[{"name":"","type":"address","internalType":"address"}],"stateMutability":"view"},{"type":"function","name":"recoverTokens","inputs":[{"name":"tokenList","type":"address[]","internalType":"contract IERC20[]"},{"name":"amountsToWithdraw","type":"uint256[]","internalType":"uint256[]"},{"name":"recipient","type":"address","internalType":"address"}],"outputs":[],"stateMutability":"nonpayable"},{"type":"function","name":"setProofSubmitter","inputs":[{"name":"newProofSubmitter","type":"address","internalType":"address"}],"outputs":[],"stateMutability":"nonpayable"},{"type":"function","name":"stake","inputs":[{"name":"pubkey","type":"bytes","internalType":"bytes"},{"name":"signature","type":"bytes","internalType":"bytes"},{"name":"depositDataRoot","type":"bytes32","internalType":"bytes32"}],"outputs":[],"stateMutability":"payable"},{"type":"function","name":"startCheckpoint","inputs":[{"name":"revertIfNoBalance","type":"bool","internalType":"bool"}],"outputs":[],"stateMutability":"nonpayable"},{"type":"function","name":"validatorPubkeyHashToInfo","inputs":[{"name":"validatorPubkeyHash","type":"bytes32","internalType":"bytes32"}],"outputs":[{"name":"","type":"tuple","internalType":"struct IEigenPodTypes.ValidatorInfo","components":[{"name":"validatorIndex","type":"uint64","internalType":"uint64"},{"name":"restakedBalanceGwei","type":"uint64","internalType":"uint64"},{"name":"lastCheckpointedAt","type":"uint64","internalType":"uint64"},{"name":"status","type":"uint8","internalType":"enum IEigenPodTypes.VALIDATOR_STATUS"}]}],"stateMutability":"view"},{"type":"function","name":"validatorPubkeyToInfo","inputs":[{"name":"validatorPubkey","type":"bytes","internalType":"bytes"}],"outputs":[{"name":"","type":"tuple","internalType":"struct IEigenPodTypes.ValidatorInfo","components":[{"name":"validatorIndex","type":"uint64","internalType":"uint64"},{"name":"restakedBalanceGwei","type":"uint64","internalType":"uint64"},{"name":"lastCheckpointedAt","type":"uint64","internalType":"uint64"},{"name":"status","type":"uint8","internalType":"enum IEigenPodTypes.VALIDATOR_STATUS"}]}],"stateMutability":"view"},{"type":"function","name":"validatorStatus","inputs":[{"name":"validatorPubkey","type":"bytes","internalType":"bytes"}],"outputs":[{"name":"","type":"uint8","internalType":"enum IEigenPodTypes.VALIDATOR_STATUS"}],"stateMutability":"view"},{"type":"function","name":"validatorStatus","inputs":[{"name":"pubkeyHash","type":"bytes32","internalType":"bytes32"}],"outputs":[{"name":"","type":"uint8","internalType":"enum IEigenPodTypes.VALIDATOR_STATUS"}],"stateMutability":"view"},{"type":"function","name":"verifyCheckpointProofs","inputs":[{"name":"balanceContainerProof","type":"tuple","internalType":"struct BeaconChainProofs.BalanceContainerProof","components":[{"name":"balanceContainerRoot","type":"bytes32","internalType":"bytes32"},{"name":"proof","type":"bytes","internalType":"bytes"}]},{"name":"proofs","type":"tuple[]","internalType":"struct BeaconChainProofs.BalanceProof[]","components":[{"name":"pubkeyHash","type":"bytes32","internalType":"bytes32"},{"name":"balanceRoot","type":"bytes32","internalType":"bytes32"},{"name":"proof","type":"bytes","internalType":"bytes"}]}],"outputs":[],"stateMutability":"nonpayable"},{"type":"function","name":"verifyStaleBalance","inputs":[{"name":"beaconTimestamp","type":"uint64","internalType":"uint64"},{"name":"stateRootProof","type":"tuple","internalType":"struct BeaconChainProofs.StateRootProof","components":[{"name":"beaconStateRoot","type":"bytes32","internalType":"bytes32"},{"name":"proof","type":"bytes","internalType":"bytes"}]},{"name":"proof","type":"tuple","internalType":"struct BeaconChainProofs.ValidatorProof","components":[{"name":"validatorFields","type":"bytes32[]","internalType":"bytes32[]"},{"name":"proof","type":"bytes","internalType":"bytes"}]}],"outputs":[],"stateMutability":"nonpayable"},{"type":"function","name":"verifyWithdrawalCredentials","inputs":[{"name":"beaconTimestamp","type":"uint64","internalType":"uint64"},{"name":"stateRootProof","type":"tuple","internalType":"struct BeaconChainProofs.StateRootProof","components":[{"name":"beaconStateRoot","type":"bytes32","internalType":"bytes32"},{"name":"proof","type":"bytes","internalType":"bytes"}]},{"name":"validatorIndices","type":"uint40[]","internalType":"uint40[]"},{"name":"validatorFieldsProofs","type":"bytes[]","internalType":"bytes[]"},{"name":"validatorFields","type":"bytes32[][]","internalType":"bytes32[][]"}],"outputs":[],"stateMutability":"nonpayable"},{"type":"function","name":"withdrawRestakedBeaconChainETH","inputs":[{"name":"recipient","type":"address","internalType":"address"},{"name":"amountWei","type":"uint256","internalType":"uint256"}],"outputs":[],"stateMutability":"nonpayable"},{"type":"function","name":"withdrawableRestakedExecutionLayerGwei","inputs":[],"outputs":[{"name":"","type":"uint64","internalType":"uint64"}],"stateMutability":"view"},{"type":"event","name":"CheckpointCreated","inputs":[{"name":"checkpointTimestamp","type":"uint64","indexed":true,"internalType":"uint64"},{"name":"beaconBlockRoot","type":"bytes32","indexed":true,"internalType":"bytes32"},{"name":"validatorCount","type":"uint256","indexed":false,"internalType":"uint256"}],"anonymous":false},{"type":"event","name":"CheckpointFinalized","inputs":[{"name":"checkpointTimestamp","type":"uint64","indexed":true,"internalType":"uint64"},{"name":"totalShareDeltaWei","type":"int256","indexed":false,"internalType":"int256"}],"anonymous":false},{"type":"event","name":"EigenPodStaked","inputs":[{"name":"pubkey","type":"bytes","indexed":false,"internalType":"bytes"}],"anonymous":false},{"type":"event","name":"Initialized","inputs":[{"name":"version","type":"uint8","indexed":false,"internalType":"uint8"}],"anonymous":false},{"type":"event","name":"NonBeaconChainETHReceived","inputs":[{"name":"amountReceived","type":"uint256","indexed":false,"internalType":"uint256"}],"anonymous":false},{"type":"event","name":"ProofSubmitterUpdated","inputs":[{"name":"prevProofSubmitter","type":"address","indexed":false,"internalType":"address"},{"name":"newProofSubmitter","type":"address","indexed":false,"internalType":"address"}],"anonymous":false},{"type":"event","name":"RestakedBeaconChainETHWithdrawn","inputs":[{"name":"recipient","type":"address","indexed":true,"internalType":"address"},{"name":"amount","type":"uint256","indexed":false,"internalType":"uint256"}],"anonymous":false},{"type":"event","name":"ValidatorBalanceUpdated","inputs":[{"name":"validatorIndex","type":"uint40","indexed":false,"internalType":"uint40"},{"name":"balanceTimestamp","type":"uint64","indexed":false,"internalType":"uint64"},{"name":"newValidatorBalanceGwei","type":"uint64","indexed":false,"internalType":"uint64"}],"anonymous":false},{"type":"event","name":"ValidatorCheckpointed","inputs":[{"name":"checkpointTimestamp","type":"uint64","indexed":true,"internalType":"uint64"},{"name":"validatorIndex","type":"uint40","indexed":true,"internalType":"uint40"}],"anonymous":false},{"type":"event","name":"ValidatorRestaked","inputs":[{"name":"validatorIndex","type":"uint40","indexed":false,"internalType":"uint40"}],"anonymous":false},{"type":"event","name":"ValidatorWithdrawn","inputs":[{"name":"checkpointTimestamp","type":"uint64","indexed":true,"internalType":"uint64"},{"name":"validatorIndex","type":"uint40","indexed":true,"internalType":"uint40"}],"anonymous":false},{"type":"error","name":"AmountMustBeMultipleOfGwei","inputs":[]},{"type":"error","name":"BeaconTimestampTooFarInPast","inputs":[]},{"type":"error","name":"CannotCheckpointTwiceInSingleBlock","inputs":[]},{"type":"error","name":"CheckpointAlreadyActive","inputs":[]},{"type":"error","name":"CredentialsAlreadyVerified","inputs":[]},{"type":"error","name":"CurrentlyPaused","inputs":[]},{"type":"error","name":"InputAddressZero","inputs":[]},{"type":"error","name":"InputArrayLengthMismatch","inputs":[]},{"type":"error","name":"InsufficientWithdrawableBalance","inputs":[]},{"type":"error","name":"InvalidEIP4788Response","inputs":[]},{"type":"error","name":"InvalidProof","inputs":[]},{"type":"error","name":"InvalidProofLength","inputs":[]},{"type":"error","name":"InvalidProofLength","inputs":[]},{"type":"error","name":"InvalidPubKeyLength","inputs":[]},{"type":"error","name":"InvalidValidatorFieldsLength","inputs":[]},{"type":"error","name":"MsgValueNot32ETH","inputs":[]},{"type":"error","name":"NoActiveCheckpoint","inputs":[]},{"type":"error","name":"NoBalanceToCheckpoint","inputs":[]},{"type":"error","name":"OnlyEigenPodManager","inputs":[]},{"type":"error","name":"OnlyEigenPodOwner","inputs":[]},{"type":"error","name":"OnlyEigenPodOwnerOrProofSubmitter","inputs":[]},{"type":"error","name":"TimestampOutOfRange","inputs":[]},{"type":"error","name":"ValidatorInactiveOnBeaconChain","inputs":[]},{"type":"error","name":"ValidatorIsExitingBeaconChain","inputs":[]},{"type":"error","name":"ValidatorNotActiveInPod","inputs":[]},{"type":"error","name":"ValidatorNotSlashedOnBeaconChain","inputs":[]},{"type":"error","name":"WithdrawalCredentialsNotForEigenPod","inputs":[]}] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not use bindings already in repo instead of json abi?
} | ||
} | ||
|
||
func runScript(args TArgs) error { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For validation, I assume we plan to run this script twice - once to complete checkpoints, again to validate none are pending?
|
|
return _envAddress("MultiSendCallOnly"); | ||
} | ||
|
||
function EIGENPOD_GENESIS_TIME() internal view returns (uint64) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This can be removed entirely and also from EigenPod.sol itself
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I swear we removed this though way back
deployedTo: address(new AllocationManager({ | ||
_delegation: Env.proxy.delegationManager(), | ||
_pauserRegistry: Env.impl.pauserRegistry(), | ||
_permissionController: Env.proxy.permissionController(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How can we validate in Zeus this contract is correctly deployed and not some 0 address? Because this is being deployed from above from the deployImpl
and deployProxy
calls
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- You can check the deployed address, via the
deployments()
struct - You can check the updated tracked value within zeus via the
Env
object (see how it fetches the contract address in there). - You can assert against the updated address in your test methods, which are foundry fork tests.
deployImpl({ | ||
name: type(DelegationManager).name, | ||
deployedTo: address(new DelegationManager({ | ||
_avsDirectory: Env.proxy.avsDirectory(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
would be good to rebase since you will have to update constructors (avsd is removed here)
deployImpl({ | ||
name: type(DelegationManager).name, | ||
deployedTo: address(new DelegationManager({ | ||
_avsDirectory: Env.proxy.avsDirectory(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: rebase, so we don't have avsD
deployedTo: address(new TransparentUpgradeableProxy({ | ||
_logic: address(Env.impl.allocationManager()), | ||
admin_: Env.proxyAdmin(), | ||
_data: "" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Initialize? cc @8sunyuan
// 3- execute | ||
execute(); | ||
|
||
assertTrue(timelock.isOperationDone(txHash), "Transaction should be complete."); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we validate ALM has been initialized here?
_delegation: Env.proxy.delegationManager(), | ||
_pauserRegistry: Env.impl.pauserRegistry(), | ||
_permissionController: Env.proxy.permissionController(), | ||
_DEALLOCATION_DELAY: Env.MIN_WITHDRAWAL_DELAY(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
50 for withdrawal delay and 75 for allocation config delay: https://www.notion.so/eigen-labs/Slashing-Upgrade-14d13c11c3e080dca3abfb2eca7a8bf4?pvs=4#14d13c11c3e0803ca724c68d09638918
to: Env.proxyAdmin(), | ||
data: Encode.proxyAdmin.upgrade({ | ||
proxy: proxyInstance, | ||
impl: address(Env.impl.strategyFactory()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wrong upgrade implementation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be new StrategyBase
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is why I find the _verify...
functions in ExistingDeploymentParser to be useful as part of sanity check tests. We should port those over.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you link? What do these do?
* pods/ | ||
*/ | ||
|
||
function eigenPod(DeployedProxy) internal view returns (EigenPod) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hm. this is gross. makes it weird to treat a beacon the same way as TUPs...
I need to read thru zeus
to: Env.proxyAdmin(), | ||
data: Encode.proxyAdmin.upgrade({ | ||
proxy: proxyInstance, | ||
impl: address(Env.impl.strategyFactory()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we change this to the Strategy factory beacon? That way we never need to special case old strategies