Infinifi report accuracy: batch-order simulation, Outland context, named-mapping state reads - #378
Merged
Merged
Conversation
…tions mapping(uint256 chainId => bool) failed the declaration regex and fell through to the setter-signature guess, so ConnectorCCTP_Chainlink's cctpDomainConfigured was reported as uint32 instead of bool. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…bundle Batch calls were simulated independently against current state, so a call depending on an earlier one in the same batch showed a false revert (OutlandFarm.setVault needs the oracle set by call 1). Simulate the batch in order from the executor via simulate-bundle; calls after a revert, or all calls when the bundle fails, fall back to independent simulations. Also strip TENDERLY_API_KEY in test isolation so no test can reach Tenderly live. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Resolves farm type names, the new oracle's scaled price, whether PortalHub.setVault adds or replaces a chain vault, and whether a connector route is actually configured (peer / gas limit) so the LLM does not report an unconfigured route as live. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Those tests only asserted our assumptions about Tenderly's API, which changes on their side; simulation is verified with a live report run. Keep the balance-override merge tests, which cover our own logic. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
The route status used the pre-batch chainConfig whenever it was already configured, so a batch that changed or cleared a live route was reported as leaving the old peer in place. Parse setConfiguration's peer/selector/gasLimit from the batch (last call per chain wins) and report the post-batch route alongside the current one. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
spalen0
marked this pull request as ready for review
September 25, 2026 10:16
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
Follow-up to validating the Infinifi Outland chain-143 report (timelock tx
0x4f721e0751fbd99bea32f3682365e9d29a14a37cfc7d03400bfe400b57684f99). All of the report's facts checked out on-chain. It rated the batch HIGH because of several things it said it couldn't verify, and it said the chain-143 USDC route was now open, which isn't true. Three commits:1. Batch simulation now runs the calls in order (
utils/tenderly/simulation.py,ai_explainer._prepare_batch_items)OutlandFarm.setVaultreverted because it needs the oracle that call 1 (Accounting.setOracle) sets.simulate-bundlein order, from the executor, so each call sees the state left by the earlier ones. That is howexecuteBatchruns it.Batch simulationorIndependent simulation. Failed simulations are still left out of the risk prompt, as before.setVaultcall still reverts when simulated alone.conftest.pynow stripsTENDERLY_API_KEY. Some existing tests had been making live Tenderly calls when a developer.envwas loaded, and the suite now runs in about 9s instead of about 15s.2. New Infinifi Outland context adapter (
utils/llm/infinifi_outland_context.py)addFarmstype → itsFarmTypesname (2 =MATURITY, an illiquid farm).setOracle→ the new oracle'sprice()scaled by the asset's decimals (for OV-143,1e18= parity with USDC).PortalHub.setVault→ whether it adds a chain or replaces an existing vault (chains registered before:8453).chainConfig(chainId). For chain 143 the peer, gas limit and selector are all unset, so sends revert until a latersetConfigurationsets the peer. The route is not live after this batch.utils/llm/abi_exposure.py).3. Fix: state reads now handle named mapping parameters (
utils/on_chain_state.py)mapping(uint256 chainId => bool)didn't match the declaration regex, so the code guessed the type from the setter's arguments. As a resultcctpDomainConfiguredwas reported asuint32. This affected any contract using Solidity ≥0.8.18 named mapping parameters.Not in scope
skip_simulation=True. The inner CALLs run withmsg.sender= the Safe, so the same bundle approach could simulate them when every inner call is operation 0. That's a follow-up.threejane_contexthas its own copy of the ABI check; it could move toabi_exposure.exposes.Call 0), while the report numbers them from 1.Test plan
simulate_bundlemocked), for the Outland adapter, and for named mappings_merge_balance_overridetests stay intests/test_tenderly_simulation.pyexplain_batch_transactionon the real batch (not published): one 8-call bundle from the timelock, and all 8 calls showBatch simulation: SUCCESS, includingOutlandFarm.setVault, which showed "reverted" in the original report. The re-run rates the batch LOW, says the route is not live yet, and reportscctpDomainConfiguredasbooluv run pytest tests/(1361 passed),ruff check,ruff format; mypy shows no new errors (the 27 existing ones are unchanged)🤖 Generated with Claude Code