Skip to content

feat: assets controller resilience#8582

Draft
salimtb wants to merge 3 commits intomainfrom
feat/assets-controller-resilience
Draft

feat: assets controller resilience#8582
salimtb wants to merge 3 commits intomainfrom
feat/assets-controller-resilience

Conversation

@salimtb
Copy link
Copy Markdown
Contributor

@salimtb salimtb commented Apr 24, 2026

Explanation

References

Checklist

  • I've updated the test suite for new or updated code as appropriate
  • I've updated documentation (JSDoc, Markdown, etc.) for new or updated code as appropriate
  • I've communicated my changes to consumers by updating changelogs for packages I've changed
  • I've introduced breaking changes in this PR and have prepared draft pull requests for clients and consumer packages to resolve them

salimtb added 3 commits April 24, 2026 23:18
Introduces CustomAssetGraduationMiddleware. When AccountsAPI or the
backend websocket reports a balance for an asset that lives in
customAssets[selectedAccount], the asset is removed from customAssets
(EVM only). Snap-served chains (Solana, BTC, Tron) are excluded; RPC
continues to be the sole balance fetcher for anything still in
customAssets, so graduation is gated by sourceId on the subscription
pipeline.
…et fails

Introduces RpcFallbackMiddleware, inserted in the fast pipeline right
after the parallel balance middleware. Any chain present in
response.errors (network error, unprocessedNetworks, timeout) is handed
off to RpcDataSource with the request filtered to just those chains.
Successful RPC results are merged into the response and their entries
are cleared from response.errors.

Also adds a 15s (configurable) timeout to AccountsApiDataSource fetch;
on timeout, every requested chain is marked as errored so the fallback
middleware picks them up.
…urces

Extracts the timeout helper into a shared `fetchWithTimeout` util and
applies a configurable 15s timeout (`fetchTimeoutMs`) to PriceDataSource
and TokenDataSource's API calls. On timeout the batch rejects so the
surrounding middleware can proceed gracefully — metadata and price
enrichment degrade instead of hanging the pipeline.

Also migrates AccountsApiDataSource to use the shared util.
@salimtb salimtb changed the title Feat/assets controller resilience feat: assets controller resilience Apr 24, 2026
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