feat: runoff plan#269
Open
blockgroot wants to merge 16 commits into
Open
Conversation
Adopt BNBx custody-sweep pattern across ETHx contracts for orderly sunset. - SDUtilityPool: add assetCustodied/sweepToCustodyTimestamp/depositsPaused; gate delegate/utilize/withdraw/finalize/maxApproveSD; setCustodyDelay (Admin), setDepositsPaused (Manager), sweepToCustody (Admin) - OperatorRewardsCollector: add assetCustodied/sweepToCustodyTimestamp; gate claim/claimWithAmount/claimLiquidation; replace claimOnBehalf with adminSettleOperator (Manager) that pays liquidator, treasury covers terminal SD interest, nets ETH→treasury, pushes remainder to op - SocializingPool: add assetCustodied/sweepToCustodyTimestamp; gate claim/claimAndDepositSD/maxApproveSD - StaderStakePoolsManager: add depositsPaused/assetCustodied/sweepToCustodyTimestamp; gate deposit/validatorBatchDeposit/transferETHToUserWithdrawManager/depositETHOverTargetWeight; setDepositsPaused (Manager), setCustodyDelay (Admin), sweepToCustody (Admin) - UserWithdrawalManager: gate requestWithdraw - PermissionlessPool: gate preDepositOnBeaconChain/stakeUserETHToBeaconChain; setCustodyDelay/sweepToCustody - interfaces + mocks updated
Returns false so existing tests for downstream contracts (UWM, etc.) keep passing without false-positive reverts on the cross-contract gate.
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #269 +/- ##
==========================================
+ Coverage 92.67% 93.14% +0.47%
==========================================
Files 45 45
Lines 3248 3428 +180
Branches 298 380 +82
==========================================
+ Hits 3010 3193 +183
+ Misses 234 230 -4
- Partials 4 5 +1 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
…erator exit reporting
…max keys per operator
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Adopts the BNBx custody-sweep pattern across ETHx contracts to enable an orderly sunset/wind-down. Each touched contract gains a
depositsPaused/assetCustodiedgate and a delayedsweepToCustodyflow so the multisig can pause new inflows, then sweep idle balances to a custody account after a public delay. Existing user redemption paths revert once assets are custodied so funds settle off-chain.Changes by contract
assetCustodied/sweepToCustodyTimestamp/depositsPaused; gatesdelegate,utilize,withdraw,finalize,maxApproveSD. New admin/manager entrypoints:setCustodyDelay(Admin),setDepositsPaused(Manager),sweepToCustody(Admin).claim/claimWithAmount/claimLiquidation. ReplacesclaimOnBehalfwithadminSettleOperator(Manager) — pays liquidator, has treasury cover terminal SD interest, nets ETH→treasury, pushes the remainder to the operator.claim,claimAndDepositSD,maxApproveSDbehind custody.depositsPausedand custody state; gatesdeposit,validatorBatchDeposit,transferETHToUserWithdrawManager,depositETHOverTargetWeight. AddssetDepositsPaused(Manager),setCustodyDelay(Admin),sweepToCustody(Admin).requestWithdrawvia the StakePoolsManager custody flag.preDepositOnBeaconChain/stakeUserETHToBeaconChain; addssetCustodyDelay/sweepToCustody.assetCustodied() == falseso existing downstream tests keep passing.Tests
SDUtilityPool,OperatorRewardsCollector,SocializingPool,StaderStakePoolManager,PermissionlessPool,UserWithdrawalManager) — ~1,000 lines covering pause toggles, custody-delay enforcement, sweep authorization, and post-sweep revert behavior.test/fork/sunset-runoff.tsexercising the end-to-end runoff flow.Test plan
forge testpasses across all touched suitestest/fork/sunset-runoff.tspasses against a mainnet forksweepToCustody→ user-facing entrypoints revertadminSettleOperatorpayouts (liquidator, treasury SD interest, ETH netting, operator remainder)