test(lend): deployed-sanity flow suite for the dev deployment#200
Open
nikkaroraa wants to merge 2 commits into
Open
test(lend): deployed-sanity flow suite for the dev deployment#200nikkaroraa wants to merge 2 commits into
nikkaroraa wants to merge 2 commits into
Conversation
…ripts The gateway self-approves as each safe's Aave position manager through execTransactionFromModule, which only a default module may call. Without default-module status every gateway supply is silently left loose and every migration, credit spend, and signed borrow reverts. The deploy script now registers it and Verify asserts it. This fix was silently dropped in an earlier merge and is being re-applied.
Fork-based sanity suite that drives one live operation through every deployed Lend surface against the Optimism dev contracts: engine routing and lifecycle, opt-out states, cashback and mixed-engine top-ups, a sandwich per module (with external protocols etched at their real addresses), and withdrawal reservation edges. Also adds RetireOldModulesDev, the future retire pass gated behind a pending-withdrawal preflight; the withdrawals suite rehearses it on a fork to show why the scan must run first. Run: forge test --match-path "test/deployed-sanity/LendDev*" --threads 2 -vv (pin LEND_DEV_FORK_BLOCK to reuse the fork cache).
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
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.
What
A fork-based sanity suite (
test/deployed-sanity/LendDev*) that drives one live operation through every deployed Lend surface against the live Optimism dev contracts, plus the future retire pass as a real script.LEND_DEV_FORK_BLOCKpin to reuse the fork cache.scripts/lend/RetireOldModulesDev.s.sol— the future retire pass, gated behind aPENDING_WITHDRAWALS_CHECKED=truepreflight.Why
Post-deploy confidence that the live dev wiring actually works end to end. It already caught a real gap: the deployed
LendGatewaywas not registered as a default module, so every gateway supply was silently left loose and migrations/credit spends/signed borrows reverted. That fix is re-applied here in the deploy/verify scripts (it had been silently dropped in an earlier merge).How tested
```
source .env && forge test --match-path "test/deployed-sanity/LendDev*" --threads 2 -vv
```
All 32 green against live Optimism dev (pin
LEND_DEV_FORK_BLOCKto reuse the fork cache; parallel suites 429 public RPCs). Run manually post-deploy — added as a checklist step in the Notion runbook, not wired into CI.Note for review
Look closely at the
DeployCashLendDev/VerifyCashLendDevhunk — that default-module registration has vanished in a merge once already. External-protocol stubs inLendDevModulesare test-only and carry the expectederc20-unchecked-transferlint warnings.Note
Low Risk
Changes are dev-only scripts and fork tests plus a one-time data-provider config in deploy; no production contract logic changes, though the default-module gap it fixes was operationally critical for gateway supplies.
Overview
Adds a manual fork suite (
test/deployed-sanity/LendDev*) that exercises live Optimism dev Cash/Lend wiring end-to-end: legacy vs gateway routing, migration, onboarding, spends/borrows, opt-out, per-module Aave sandwiches (external protocols stubbed viavm.etch), withdrawal reservation edges, and a retire-script rehearsal.Deploy/verify fix:
DeployCashLendDevnow callsconfigureDefaultModulessoLendGatewayis a default module (needed forexecTransactionFromModule/ Aave position-manager self-approval);VerifyCashLendDevasserts that flag. The base patches the fork if live chain is still wrong so flow tests pass whiletest_deployedConfig_gatewayIsDefaultModulestays red until fixed on-chain.Ops: New
RetireOldModulesDev.s.solrevokes withdraw-requester and default/whitelist status for the seven pre-Lend modules, gated onPENDING_WITHDRAWALS_CHECKED=trueaftercheck-pending-withdrawals.sh.Reviewed by Cursor Bugbot for commit 0bc02aa. Bugbot is set up for automated code reviews on this repo. Configure here.