Aavechan/chaos departure - #35
Conversation
- Cancel all AGENT_HUB_AUTOMATION robots dynamically via getKeepersList() + getKeeperInfo() filter instead of hardcoded constants - Revoke RISK_ADMIN from all agents on both AaveV3Ethereum (Core) and AaveV3EthereumLido ACL managers - Extend IAaveCLRobotOperator with KeeperInfo struct, getKeepersList(), and getKeeperInfo() - Add test_agentsDisabledAndRiskAdminRevoked (Core + Lido) and test_robotsCancelled Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
… library - Create CancelAgentRobots library (mirrors DelistAllAgents pattern): iterates getKeepersList(), cancels any keeper registered for AGENT_HUB_AUTOMATION - Apply to Ethereum, Arbitrum, Avalanche, Base, BNB, Optimism, Polygon (Gnosis and Linea have no AAVE_CL_ROBOT_OPERATOR on-chain) - Ethereum: replace inline robot loop with CancelAgentRobots.cancel() - Remove IAaveCLRobotOperator direct import from Ethereum payload (now handled through library) - Deduplicate Ethereum delist into two-manager overload on DelistAllAgents - Clean up leftover boilerplate comments across all chain contracts Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Chainlink Automation Registry on Arbitrum calls the arbBlockNumber() precompile (0x0000...0064) inside cancelUpkeep. Foundry fork mode does not replicate Arbitrum native precompiles — known limitation: foundry-rs/foundry#5085 foundry-rs/foundry#7294 foundry-rs/foundry#6035 Mock the precompile in setUp() so the cancel path is exercisable in tests. The proposal executes correctly on Arbitrum mainnet. All 11 tests now pass across 9 chains. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Fix comment: CANCELLATION_DELAY is 50 blocks (not ~20), sourced from KeeperRegistryBase2_1 - Add test_linkReturnedToCollectorAfterCancellation: executes proposal, rolls 50 blocks using getCancellationDelay() on the deployed registry, withdraws LINK for all cancelled agent hub robots and asserts collector balance increased - Use AaveV3EthereumAssets.LINK_UNDERLYING from address book instead of hardcoded address Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Adds LINK recovery test to Arbitrum, Avalanche, Base, BNB, Optimism, Polygon. Pattern: discover AGENT_HUB_AUTOMATION robots dynamically, execute proposal, roll forward getCancellationDelay() blocks, withdrawLink, assert collector LINK balance increased. Chain-specific notes: - Arbitrum: vm.roll resets Foundry mocks, so the arbBlockNumber() mock is re-applied with fork_block + delay instead of using vm.roll. - Polygon: Chainlink registry uses a different LINK than AaveV3PolygonAssets; getLinkAddress() is called on the registry to get the correct token. - LINK in address book (Arbitrum, Optimism): AaveV3<Chain>Assets used. - LINK not in address book (Avalanche, Base, BNB, Polygon): getLinkAddress() from registry. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Add test_agentsDisabledAndRiskAdminRevoked and test_robotsCancelled to Arbitrum, Avalanche, Base, BNB, Optimism, Polygon — mirroring the Ethereum test suite. Also fix duplicate comment block in Arbitrum setUp. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
🌈Test ResultsCompiling 536 files with Solc 0.8.27 Solc 0.8.27 finished in 183.79s Compiler run successful!Ran 4 tests for src/20260410_Multi_OrderlyTransitionAndOffboardingPlanForChaosLabs/AaveV3Arbitrum_OrderlyTransitionAndOffboardingPlanForChaosLabs_20260410.t.sol:AaveV3Arbitrum_OrderlyTransitionAndOffboardingPlanForChaosLabs_20260410_Test [PASS] test_linkReturnedToCollectorAfterCancellation() (gas: 445792) Ran 1 test suite in 9.53s (9.51s CPU time): 4 tests passed, 0 failed, 0 skipped (4 total tests) Ran 4 tests for src/20260410_Multi_OrderlyTransitionAndOffboardingPlanForChaosLabs/AaveV3Avalanche_OrderlyTransitionAndOffboardingPlanForChaosLabs_20260410.t.sol:AaveV3Avalanche_OrderlyTransitionAndOffboardingPlanForChaosLabs_20260410_Test [PASS] test_linkReturnedToCollectorAfterCancellation() (gas: 446699) Ran 1 test suite in 2.26s (2.24s CPU time): 4 tests passed, 0 failed, 0 skipped (4 total tests) Ran 4 tests for src/20260410_Multi_OrderlyTransitionAndOffboardingPlanForChaosLabs/AaveV3BNB_OrderlyTransitionAndOffboardingPlanForChaosLabs_20260410.t.sol:AaveV3BNB_OrderlyTransitionAndOffboardingPlanForChaosLabs_20260410_Test [PASS] test_linkReturnedToCollectorAfterCancellation() (gas: 341534) Ran 1 test suite in 2.04s (2.03s CPU time): 4 tests passed, 0 failed, 0 skipped (4 total tests) Ran 4 tests for src/20260410_Multi_OrderlyTransitionAndOffboardingPlanForChaosLabs/AaveV3Base_OrderlyTransitionAndOffboardingPlanForChaosLabs_20260410.t.sol:AaveV3Base_OrderlyTransitionAndOffboardingPlanForChaosLabs_20260410_Test [PASS] test_linkReturnedToCollectorAfterCancellation() (gas: 379303) Ran 1 test suite in 2.16s (2.14s CPU time): 4 tests passed, 0 failed, 0 skipped (4 total tests) Ran 4 tests for src/20260410_Multi_OrderlyTransitionAndOffboardingPlanForChaosLabs/AaveV3Ethereum_OrderlyTransitionAndOffboardingPlanForChaosLabs_20260410.t.sol:AaveV3Ethereum_OrderlyTransitionAndOffboardingPlanForChaosLabs_20260410_Test [PASS] test_linkReturnedToCollectorAfterCancellation() (gas: 897240) Ran 1 test suite in 3.04s (2.99s CPU time): 4 tests passed, 0 failed, 0 skipped (4 total tests) Ran 1 test for src/20260410_Multi_OrderlyTransitionAndOffboardingPlanForChaosLabs/AaveV3Gnosis_OrderlyTransitionAndOffboardingPlanForChaosLabs_20260410.t.sol:AaveV3Gnosis_OrderlyTransitionAndOffboardingPlanForChaosLabs_20260410_Test |
There was a problem hiding this comment.
Pull request overview
This PR adds a multi-network governance proposal package to offboard Chaos Labs by disabling Chaos risk agents across Aave V3 deployments, cancelling associated Chainlink Automation (keeper) registrations, and (on Ethereum) cancelling stream 100073 and sending a final 30-day bulk payment.
Changes:
- Introduces reusable Solidity libraries to (a) disable all registered agents and revoke risk-admin roles and (b) cancel Chainlink keeper entries tied to the Agent Hub automation upkeep.
- Adds per-network payload contracts + Foundry tests for Ethereum, Polygon, Avalanche, Optimism, Arbitrum, Base, BNB, Gnosis, and Linea, plus a multi-chain deploy/create-proposal script and generator config.
- Extends
IAaveCLRobotOperatorinterface with keeper enumeration/info getters used by the proposal and tests.
Reviewed changes
Copilot reviewed 34 out of 35 changed files in this pull request and generated 9 comments.
Show a summary per file
| File | Description |
|---|---|
| src/interfaces/IAaveCLRobotOperator.sol | Adds keeper listing/info accessors used to locate and cancel Agent Hub-related keepers. |
| src/20260410_Multi_OrderlyTransitionAndOffboardingPlanForChaosLabs/config.ts | Proposal generator config (pools, metadata, cache blocks). |
| src/20260410_Multi_OrderlyTransitionAndOffboardingPlanForChaosLabs/OrderlyTransitionAndOffboardingPlanForChaosLabs_20260410.s.sol | Deployment scripts per chain + cross-chain proposal creation script. |
| src/20260410_Multi_OrderlyTransitionAndOffboardingPlanForChaosLabs/OrderlyTransitionAndOffboardingPlanForChaosLabs.md | AIP write-up/spec and references. |
| src/20260410_Multi_OrderlyTransitionAndOffboardingPlanForChaosLabs/DelistAllAgents.sol | Library to disable all agents and revoke risk-admin role(s). |
| src/20260410_Multi_OrderlyTransitionAndOffboardingPlanForChaosLabs/CancelAgentRobots.sol | Library to find and cancel keepers for the Agent Hub automation upkeep. |
| src/20260410_Multi_OrderlyTransitionAndOffboardingPlanForChaosLabs/AaveV3Ethereum_OrderlyTransitionAndOffboardingPlanForChaosLabs_20260410.sol | Ethereum payload: delist agents (Core+Lido), cancel stream 100073, bulk transfer, cancel keepers. |
| src/20260410_Multi_OrderlyTransitionAndOffboardingPlanForChaosLabs/AaveV3Ethereum_OrderlyTransitionAndOffboardingPlanForChaosLabs_20260410.t.sol | Ethereum tests for agent disablement, keeper cancellation, and LINK withdrawal behavior. |
| src/20260410_Multi_OrderlyTransitionAndOffboardingPlanForChaosLabs/AaveV3Polygon_OrderlyTransitionAndOffboardingPlanForChaosLabs_20260410.sol | Polygon payload: delist agents + cancel keepers. |
| src/20260410_Multi_OrderlyTransitionAndOffboardingPlanForChaosLabs/AaveV3Polygon_OrderlyTransitionAndOffboardingPlanForChaosLabs_20260410.t.sol | Polygon tests for agent disablement, keeper cancellation, and LINK withdrawal behavior. |
| src/20260410_Multi_OrderlyTransitionAndOffboardingPlanForChaosLabs/AaveV3Avalanche_OrderlyTransitionAndOffboardingPlanForChaosLabs_20260410.sol | Avalanche payload: delist agents + cancel keepers. |
| src/20260410_Multi_OrderlyTransitionAndOffboardingPlanForChaosLabs/AaveV3Avalanche_OrderlyTransitionAndOffboardingPlanForChaosLabs_20260410.t.sol | Avalanche tests for agent disablement, keeper cancellation, and LINK withdrawal behavior. |
| src/20260410_Multi_OrderlyTransitionAndOffboardingPlanForChaosLabs/AaveV3Optimism_OrderlyTransitionAndOffboardingPlanForChaosLabs_20260410.sol | Optimism payload: delist agents + cancel keepers. |
| src/20260410_Multi_OrderlyTransitionAndOffboardingPlanForChaosLabs/AaveV3Optimism_OrderlyTransitionAndOffboardingPlanForChaosLabs_20260410.t.sol | Optimism tests for agent disablement, keeper cancellation, and LINK withdrawal behavior. |
| src/20260410_Multi_OrderlyTransitionAndOffboardingPlanForChaosLabs/AaveV3Arbitrum_OrderlyTransitionAndOffboardingPlanForChaosLabs_20260410.sol | Arbitrum payload: delist agents + cancel keepers. |
| src/20260410_Multi_OrderlyTransitionAndOffboardingPlanForChaosLabs/AaveV3Arbitrum_OrderlyTransitionAndOffboardingPlanForChaosLabs_20260410.t.sol | Arbitrum tests incl. Foundry precompile mocking to allow keeper cancellation simulation. |
| src/20260410_Multi_OrderlyTransitionAndOffboardingPlanForChaosLabs/AaveV3Base_OrderlyTransitionAndOffboardingPlanForChaosLabs_20260410.sol | Base payload: delist agents + cancel keepers. |
| src/20260410_Multi_OrderlyTransitionAndOffboardingPlanForChaosLabs/AaveV3Base_OrderlyTransitionAndOffboardingPlanForChaosLabs_20260410.t.sol | Base tests for agent disablement, keeper cancellation, and LINK withdrawal behavior. |
| src/20260410_Multi_OrderlyTransitionAndOffboardingPlanForChaosLabs/AaveV3BNB_OrderlyTransitionAndOffboardingPlanForChaosLabs_20260410.sol | BNB payload: delist agents + cancel keepers. |
| src/20260410_Multi_OrderlyTransitionAndOffboardingPlanForChaosLabs/AaveV3BNB_OrderlyTransitionAndOffboardingPlanForChaosLabs_20260410.t.sol | BNB tests for agent disablement, keeper cancellation, and LINK withdrawal behavior. |
| src/20260410_Multi_OrderlyTransitionAndOffboardingPlanForChaosLabs/AaveV3Gnosis_OrderlyTransitionAndOffboardingPlanForChaosLabs_20260410.sol | Gnosis payload: delist agents. |
| src/20260410_Multi_OrderlyTransitionAndOffboardingPlanForChaosLabs/AaveV3Gnosis_OrderlyTransitionAndOffboardingPlanForChaosLabs_20260410.t.sol | Gnosis default proposal execution test. |
| src/20260410_Multi_OrderlyTransitionAndOffboardingPlanForChaosLabs/AaveV3Linea_OrderlyTransitionAndOffboardingPlanForChaosLabs_20260410.sol | Linea payload: delist agents. |
| src/20260410_Multi_OrderlyTransitionAndOffboardingPlanForChaosLabs/AaveV3Linea_OrderlyTransitionAndOffboardingPlanForChaosLabs_20260410.t.sol | Linea default proposal execution test. |
| foundry.lock | Updates aave-helpers dependency revision. |
| diffs/AaveV3Ethereum_OrderlyTransitionAndOffboardingPlanForChaosLabs_20260410_before_AaveV3Ethereum_OrderlyTransitionAndOffboardingPlanForChaosLabs_20260410_after.md | Simulation diff report (events/storage) for Ethereum payload. |
| diffs/AaveV3Polygon_OrderlyTransitionAndOffboardingPlanForChaosLabs_20260410_before_AaveV3Polygon_OrderlyTransitionAndOffboardingPlanForChaosLabs_20260410_after.md | Simulation diff report for Polygon payload. |
| diffs/AaveV3Avalanche_OrderlyTransitionAndOffboardingPlanForChaosLabs_20260410_before_AaveV3Avalanche_OrderlyTransitionAndOffboardingPlanForChaosLabs_20260410_after.md | Simulation diff report for Avalanche payload. |
| diffs/AaveV3Optimism_OrderlyTransitionAndOffboardingPlanForChaosLabs_20260410_before_AaveV3Optimism_OrderlyTransitionAndOffboardingPlanForChaosLabs_20260410_after.md | Simulation diff report for Optimism payload. |
| diffs/AaveV3Arbitrum_OrderlyTransitionAndOffboardingPlanForChaosLabs_20260410_before_AaveV3Arbitrum_OrderlyTransitionAndOffboardingPlanForChaosLabs_20260410_after.md | Simulation diff report for Arbitrum payload. |
| diffs/AaveV3Base_OrderlyTransitionAndOffboardingPlanForChaosLabs_20260410_before_AaveV3Base_OrderlyTransitionAndOffboardingPlanForChaosLabs_20260410_after.md | Simulation diff report for Base payload. |
| diffs/AaveV3BNB_OrderlyTransitionAndOffboardingPlanForChaosLabs_20260410_before_AaveV3BNB_OrderlyTransitionAndOffboardingPlanForChaosLabs_20260410_after.md | Simulation diff report for BNB payload. |
| diffs/AaveV3Gnosis_OrderlyTransitionAndOffboardingPlanForChaosLabs_20260410_before_AaveV3Gnosis_OrderlyTransitionAndOffboardingPlanForChaosLabs_20260410_after.md | Simulation diff report for Gnosis payload. |
| diffs/AaveV3Linea_OrderlyTransitionAndOffboardingPlanForChaosLabs_20260410_before_AaveV3Linea_OrderlyTransitionAndOffboardingPlanForChaosLabs_20260410_after.md | Simulation diff report for Linea payload. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| This AIP will disable all the agents operating on the followings V3 instances: | ||
|
|
||
| - Arbitrum |
There was a problem hiding this comment.
Spelling/grammar: "followings" should be "following".
| AaveV3Linea: {configs: {OTHERS: {}}, cache: {blockNumber: 30151483}}, | ||
| AaveV3Plasma: {configs: {OTHERS: {}}, cache: {blockNumber: 18901819}}, | ||
| }, |
There was a problem hiding this comment.
poolOptions defines an AaveV3Plasma entry, but there is no corresponding Plasma payload in this PR and the proposal creation script only builds 9 payloads. Align poolOptions with the actual set of networks being targeted (remove Plasma or add the Plasma payload).
| IAaveCLRobotOperator operator = IAaveCLRobotOperator(robotOperator); | ||
| uint256[] memory keeperIds = operator.getKeepersList(); | ||
| for (uint256 i = 0; i < keeperIds.length; i++) { | ||
| if (operator.getKeeperInfo(keeperIds[i]).upkeep == agentHubAutomation) { | ||
| operator.cancel(keeperIds[i]); | ||
| } |
There was a problem hiding this comment.
CancelAgentRobots.cancel() does an unbounded loop over operator.getKeepersList() and calls getKeeperInfo() for every keeper. Since the keeper list size is dynamic, execution gas can grow over time and could potentially make the payload run out of gas on execution day. Consider mitigating by (a) cancelling a precomputed list of keeperIds, (b) adding a bounded/chunked cancellation mechanism, or (c) using an operator API that can filter by upkeep address if available.
| // chaos labs mentioned cutting the stream themselves | ||
| try AaveV3EthereumLido.COLLECTOR.cancelStream(PREVIOUS_STREAM) {} catch {} | ||
|
|
There was a problem hiding this comment.
Swallowing all errors from cancelStream means the proposal will still proceed to the bulk transfer even if the stream wasn't actually canceled (e.g., wrong stream id, collector mismatch, unexpected revert), potentially causing overpayment while the stream continues. Prefer verifying the stream state and only tolerating the “already canceled/nonexistent stream” case, otherwise revert if cancellation fails.
| ## Financial and Administrative Changes | ||
|
|
||
| Chaos Labs will immediately cancel its outstanding stream 100073. Stream 100015 is already being canceled due to a stream misconfiguration. We will refund the portion of AAVE tokens corresponding to the remaining stream duration. | ||
|
|
||
| In connection with this transition, 30 days’ worth of stream will be transferred to Chaos Labs as the final compensation associated with the support and wind-down period described in this proposal. This is intended to align compensation with the defined transition window while avoiding a prolonged or ambiguous tail period. |
There was a problem hiding this comment.
The write-up says the stream cancellation will refund “AAVE tokens”, but the on-chain payload transfers AaveV3EthereumLidoAssets.GHO_A_TOKEN (aGHO). Please align the text with the actual asset being streamed/transferred to avoid misleading reviewers and voters.
| ### Stream cancelation and bulk payment | ||
|
|
||
| The stream 100073 will be canceled (if not already done) and an amount equivalent to 30 days of said stream will be transfered from the collector to the following Chaos Labs operated wallet: [0xbC540e0729B732fb14afA240aA5A047aE9ba7dF0](https://etherscan.io/address/0xbC540e0729B732fb14afA240aA5A047aE9ba7dF0) | ||
|
|
There was a problem hiding this comment.
Spelling: "cancelation"/"transfered" should be "cancellation"/"transferred".
| 'AaveV3Linea', | ||
| 'AaveV3Plasma', | ||
| ], |
There was a problem hiding this comment.
AaveV3Plasma is included in rootOptions.pools, but this PR doesn't add a Plasma payload/script/test (and the AIP spec list also omits Plasma). This will make generation/configuration inconsistent. Either remove Plasma here or add the missing Plasma implementation and wire it into the proposal creation script.
| // create payloads | ||
| PayloadsControllerUtils.Payload[] memory payloads = new PayloadsControllerUtils.Payload[](9); | ||
|
|
There was a problem hiding this comment.
payloads is hard-coded to length 9 and Plasma isn't included. This currently conflicts with config.ts (which lists Plasma) and can confuse proposal generation/verification. Either add Plasma payload creation here or remove Plasma from the config/spec so all artifacts agree.
| IProposalGenericExecutor | ||
| { | ||
| function execute() external { | ||
| DelistAllAgents.delist(MiscLinea.AGENT_HUB, address(AaveV3Linea.ACL_MANAGER)); |
There was a problem hiding this comment.
Line uses a tab/irregular indentation before DelistAllAgents.delist(...). This can cause lint/formatting noise and inconsistent diffs; please normalize to the surrounding spacing style.
| DelistAllAgents.delist(MiscLinea.AGENT_HUB, address(AaveV3Linea.ACL_MANAGER)); | |
| DelistAllAgents.delist(MiscLinea.AGENT_HUB, address(AaveV3Linea.ACL_MANAGER)); |
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
No description provided.