Multiple varied scripts for operational tasks#378
Conversation
…tETH redemption manager
…uling and reverting scripts
…e and user fee settings
…iquidity decisions and rate limits
…ions, exits, and unrestaking
📊 Forge Coverage ReportGenerated by workflow run #716 |
| keccak256("CONSOLIDATION_REQUEST_LIMIT_ID"); | ||
|
|
||
| uint256 internal constant FULL_EXIT_GWEI = 2_048_000_000_000; | ||
| uint256 internal constant SECONDS_PER_DAY = 86_400; |
There was a problem hiding this comment.
Unused SECONDS_PER_DAY constant in rate-limit scripts
Low Severity
SECONDS_PER_DAY is declared in both ReduceRateLimits.s.sol and RaiseRateLimits.s.sol but is never referenced in the code. The refill-rate divisions (e.g., 1_064_960_000_000_000 / 86_400) were computed offline and hardcoded as constants, leaving SECONDS_PER_DAY as dead code.
Additional Locations (1)
Reviewed by Cursor Bugbot for commit a9198f0. Configure here.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a9198f0ad2
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| ICreate2Factory constant mainnetCreate2Factory = ICreate2Factory(0x356d1B83970CeF2018F2c9337cDdb67dff5AEF99); | ||
|
|
||
| uint256 constant MIN_DELAY_OPERATING_TIMELOCK = 28800; // 8 hours | ||
| uint256 constant MIN_DELAY_OPERATING_TIMELOCK = 172800; // 2 days |
There was a problem hiding this comment.
Keep operating timelock delay aligned with production value
Changing MIN_DELAY_OPERATING_TIMELOCK from 28,800 to 172,800 in the shared Utils base alters every script that schedules through this constant to a 2-day delay, while the operational flow in this repo still assumes 8 hours (including the newly added whale-ops runbook). In practice this creates schedule/execute mismatches where execute transactions are attempted on the old window and revert as not-ready, delaying critical ops by an extra 40 hours. This shared constant should remain consistent with the actual timelock delay (or be read dynamically from getMinDelay()).
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
This is intentional because of the change on the mainnet
| uint256 stEthAfter = IERC20(lido).balanceOf(address(restaker)); | ||
| console2.log("stETH received:", stEthAfter - stEthBefore); | ||
|
|
||
| uint256 depositAmount = IERC20(lido).balanceOf(address(restaker)); |
There was a problem hiding this comment.
Avoid encoding a stale stETH deposit amount in STEP=2 batch
depositAmount is snapshotted during fork simulation and then hardcoded into the generated depositIntoStrategy calldata, but STEP=2 is executed later in production after a waiting period; if the restaker’s stETH balance changes in the meantime (e.g., redemptions or accounting drift), the batch can either fail on tx3 (insufficient balance) or leave funds undeployed. This makes the multi-tx redelegation flow brittle and should be replaced with a runtime balance-based deposit step.
Useful? React with 👍 / 👎.
…g stETH withdrawals
…herFiNodes to LiquidityPool
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
There are 2 total unresolved issues (including 1 from previous review).
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 1e69082. Configure here.
| pick[picked++] = ws[j]; | ||
| remaining -= amt; | ||
| } | ||
| } |
There was a problem hiding this comment.
Unit mismatch defeats greedy-fit budget check
Medium Severity
budgetWei is computed as _readWithdrawableGwei(pod) * 1 gwei, converting the gwei value to wei (multiplying by 1e9). However, ws[j].scaledShares[0] for the BeaconChainETH strategy is denominated in gwei. The comparison amt <= remaining therefore compares a gwei-scale value against a wei-scale value, making the budget check always pass — the greedy fit includes every withdrawal regardless of the pod's actual withdrawable balance. The remaining -= amt subtraction also barely changes remaining since it subtracts gwei from wei. Either budgetWei should not be multiplied by 1 gwei, or amt should be multiplied by 1 gwei before comparison.
Reviewed by Cursor Bugbot for commit 1e69082. Configure here.
…naging beacon validator creation


Note
Medium Risk
Adds and updates multiple mainnet operations scripts that generate Safe transactions and directly exercise privileged on-chain actions (rate limits, oracle cadence, redemptions, withdrawals), so misuse or wrong parameters could impact protocol operations despite no core contract changes.
Overview
Adds a large set of new
script/operations/*runbooks to generate Safe JSON batches and fork-simulate privileged mainnet ops, including batch beacon-validator creation from a JSON payload, priority-queue whitelist/fee maintenance, oraclereportPeriodSlotupdate (640→1280) with validation flow, and rate-limiter capacity/refill adjustments.Introduces several stETH/EigenLayer operational scripts to complete/queue withdrawals, redelegate restaked stETH, and temporarily raise
EtherFiRedemptionManagerstETH redemption capacity (with scheduled revert) including a whale-specific capacity change runbook. Also adds an end-to-end EigenLayer withdrawal completion + node sweep flow (Solidity scripts plusquery_node_ids.py/node-ids.json) and updatesfoundry.tomlFS permissions to allow writing underscript/operations.Updates
Utils.MIN_DELAY_OPERATING_TIMELOCKfrom 8 hours to 2 days, affecting scripts that schedule via the operating timelock.Reviewed by Cursor Bugbot for commit a87e276. Bugbot is set up for automated code reviews on this repo. Configure here.