Skip to content

Reduce Tenderly request fan-out#1325

Open
rossgalloway wants to merge 2 commits into
mainfrom
codex/tenderly-main-flow-update
Open

Reduce Tenderly request fan-out#1325
rossgalloway wants to merge 2 commits into
mainfrom
codex/tenderly-main-flow-update

Conversation

@rossgalloway

@rossgalloway rossgalloway commented Jul 25, 2026

Copy link
Copy Markdown
Collaborator

Summary

Keep global wallet balances canonical through Enso in Tenderly mode while refreshing only the tokens required by the active vault workflow from the VNet. This also bounds VNet status transaction-history requests, rejects unsuccessful snapshot reverts in the admin CLI, and adds the reference branch's Tenderly script safety guidance.

Standalone vault-widget application files, QA runners, and package commands remain intentionally excluded because the widget does not exist on main. The scripts/AGENTS.md guidance is included verbatim from the reference branch as requested.

How to review

Start with useTenderlyVaultBalanceOverrides.ts and useWallet.tsx to review the route-scoped override lifecycle, including reconnect cleanup. Then review useBalancesCombined.ts and useBalancesRouting.ts for the Tenderly-mode Enso routing, followed by the VNet status and CLI changes under scripts/.

Review scripts/AGENTS.md separately as operational guidance copied from the reference branch. It includes safety rules for the future vault-widget QA runner, while that runner itself is not part of this PR.

For a smoke test, enable Tenderly mode in a non-production environment, open a vault detail route, fund or revert the connected wallet, and confirm the active vault balances refresh while portfolio balances remain canonical. Leaving the route or reconnecting should clear and rebuild the scoped override.

Test plan

  • Automated: focused Vitest suite covering 6 files and 50 tests
  • Automated: bun run lint:fix and bun run lint
  • Automated: bun run tslint
  • Automated: NEXT_PUBLIC_TENDERLY_MODE=false bun run build
  • Automated: commit hooks after adding scripts/AGENTS.md
  • Manual: production preview returned HTTP 200 for / and /vaults with Tenderly mode disabled
  • Manual: live Tenderly vault mutation flow; intentionally not run to avoid consuming Tenderly Units

Risk / impact

The wallet routing and scoped overrides affect Tenderly mode only; normal production balance behavior is unchanged. The primary risk is stale or incorrectly scoped simulated balances on vault routes, covered by unit tests for refresh, cleanup, reconnect, and pricing behavior. The copied script guidance references vault-widget QA commands that are not yet available on main; it is non-runtime documentation for that future workflow. There are no migrations or production fund movements. Reverting commits 662e2b98 and 9f2eefba restores the prior behavior.

Keep portfolio balances canonical while refreshing only active vault workflow tokens from Tenderly.

- bound VNet transaction history lookups behind explicit modes
- scope simulated balance overrides to the active vault route
- reject unsuccessful snapshot reverts in the admin CLI

This avoids broad VNet multicalls while preserving simulated workflow state.
@vercel

vercel Bot commented Jul 25, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
yearnfi Ready Ready Preview, Comment Jul 25, 2026 7:49pm
2 Skipped Deployments
Project Deployment Actions Updated (UTC)
yearnfi-nextjs Ignored Ignored Preview Jul 25, 2026 7:49pm
yearnfi-nextjs-2 Ignored Ignored Preview Jul 25, 2026 7:49pm

Request Review

@github-actions

Copy link
Copy Markdown

Dependency Review

✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.

Scanned Files

None

Document safe Tenderly VNet usage for scripts, including scoped live runs, RPC budgeting, cleanup guarantees, and status-query limits.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant