fix(polygon/aave_v3): guard removed v3.2 reads + bricked incentives feed (zd79) - #148
Open
thrilok-code wants to merge 3 commits into
Open
thrilok-code wants to merge 3 commits into
thrilok-code wants to merge 3 commits into
Conversation
added 3 commits
August 30, 2026 09:33
…debt metadata reads (zd79) Base: commit e9596a3 — PROVEN byte-for-byte identical to deployed 0x44ac5ed26d8b7bbcf3bcb9ac486191cbb294b140 when compiled with solc 0.8.6, optimizer runs=800, metadata.bytecodeHash=none (on-chain name() is v1.0, not v1.1 as previously recorded). Fix: getAaveTokensData no longer calls symbol()/decimals() on stableDebtToken when address(0) (Aave v3.3 Polygon upgrade removed stable debt at block 91037023). Struct layout unchanged; stable-debt Token fields return (address(0), "", 0). ABI verified identical to deployed ABI (anyabi/polygonscan mirror). KNOWN INCOMPLETE: state-override eth_call of this fixed bytecode still reverts — a SECOND address(0) call site exists in the getPositionAll path (suspect: getIncentivesInfo -> getUserReward -> rewardsCntr.getAllUserRewards with sIncentiveData.tokenAddress=0). Do NOT deploy until that is guarded and the override test passes.
… getAllUserRewards addr(0) guard (zd79) SECOND call site pinned by callTracer (drpc.org, state-override): resolver -> UiIncentiveDataProviderV3 0x05e309c9..cec0 getReservesIncentivesData -> Chainlink EACAggregatorProxy 0x97371dF4..a13f decimals()/latestAnswer() -> proxy.aggregator() == address(0) (feed DEPRECATED) -> revert. External to resolver; guarded via try/catch -> empty incentives array. 🔴 DEPLOY-TRUTH CORRECTION: on-chain 0x44ac..b140 reproduces byte-for-byte at solc 0.8.6, optimizer runs=200 (NOT 800), bytecodeHash=none, evm berlin. TEST A GREEN: eth_call getPositionAll(0xdead), fixed code substituted at resolver addr, storage untouched (old DP in slot2), NO dummy at addr(0): SUCCESS 36928 bytes. Field diff vs deployed+dummy@0 baseline (58208B): userData IDENTICAL, userTokenData[21] IDENTICAL, tokenData[21] IDENTICAL (0 leaf diffs), incentives 0 vs 21 entries (dummy-tainted data dropped). 🔴 KNOWN INCOMPLETE — TEST B (fresh-deploy sim: slot2 -> new DP 0x243aa9) still REVERTS: new PoolDataProvider REMOVED getReserveEModeCategory(address) (sel 0x163a0f20, helpers.sol:371). Needs try/catch->0 guard. Constructor-time storage means deployed-storage config (Test A) is NOT the fresh-deploy config. Do NOT deploy until Test B green + getPosition(5ba81c87) verified.
… Aave v3.2 DP (zd79) Guarded call site: - helpers.sol:376 (getV3Token): aaveData.getReserveEModeCategory(address) (selector 0x163a0f20) — removed from PoolDataProvider in the Aave v3.2 eMode rework. Pulled out of the tuple assignment into try/catch; tokenData.eModeCategory zeroed on failure. AaveV3Token struct layout unchanged. Checked, no guard needed: - helpers.sol:395 pool.getEModeCategoryData(uint8) — live v3.2+ pool keeps a legacy-shaped shim; verified by eth_call in both storage configs: identical decode (ltv 9125 / lt 9425 / bonus 10100 / priceSource addr(0) / label 'Stablecoins'). Verification (fixed bytecode, solc 0.8.6 runs=200 berlin bytecodeHash=none, via eth_call state override at 0x44ac5ed26d8b7bbcf3bcb9ac486191cbb294b140): - TEST A (deployed 2022 storage, old DP): GREEN. getPositionAll(0xdead) = 36928 bytes, identical to on-chain baseline. - TEST B (storage slot 2 -> new PoolDataProvider 0x243aa95cac2a25651eda86e80bee66114413c43b, fresh-deploy sim): GREEN. getPositionAll(0xdead) = 36256 bytes. - getPosition(address,address[]) [USDC.e, WETH, WMATIC]: GREEN in both configs (5824 / 5728 bytes). Field diff TEST B vs TEST A (getPositionAll, 76 leaf diffs, all in tokenData[]; userData + userTokenData byte-identical — position balances unaffected): - 21x reserves.stableDebtToken.tokenAddress -> addr(0) - 21x reserves.stableDebtToken.symbol -> '' - 21x reserves.stableDebtToken.decimals -> 0 - 13x token.eModeCategory -> 0 (stable debt + per-reserve eMode both removed in Aave v3.2)
|
Deployed this head ( API repoint: Instadapp/defi-express-multichain#1010. Merging this PR keeps the repo equal to what's live. |
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
Fixes the polygon aave-v3 resolver reverts breaking legacy Instadapp app position pages (Zendesk 79 — users down since Jul 28).
Root cause (today's live revert): deprecated Chainlink reward feed —
getAllUserRewardspath hits an incentives aggregator that now returnsaddress(0)→ revert inside the incentives periphery.Three guards (polygon aave_v3 legacy resolver):
a47ba76— guard stable-debt metadata reads (stable debt removed in Aave v3.2; matters on redeploy against new DP storage)1112cda— try/catch the bricked incentives periphery +address(0)aggregator guard ingetAllUserRewards6f28957— guardgetReserveEModeCategory(getter removed in Aave v3.2 DataProvider)Verification
State-override simulation (eth_call with code override at the deployed resolver address
0x44ac...b140):getPositionAll+getPositionboth green on old and new DataProvider storage layouts; position data byte-identical to pre-revert output. Deploy gate passed.Deploy
Repo HEAD fix only — the on-chain resolver at
0x44ac...b140needs redeploy (constructor-pinned DP storage). Deploy is team-side per Thrilok.Context: Mert//Lauki TG thread, msgs 1041034/1041075/1041076.