Cache asset movement providers by id (300ms -> 30ms during parallel requests)#394
Merged
Merged
Conversation
Merged
sephynox
approved these changes
Jul 9, 2026
|
ezraripps
added a commit
that referenced
this pull request
Jul 9, 2026
Includes changes from: - #394 <!-- CURSOR_SUMMARY --> --- > [!NOTE] > **Low Risk** > Only manifest version fields change with no runtime or dependency updates in the diff. > > **Overview** > Bumps **`@keetanetwork/anchor`** from **0.0.84** to **0.0.85** in `package.json` and the root entry in `package-lock.json`. No dependency or source changes appear in this diff; it is a version-only release cut (PR description notes inclusion of **#394** elsewhere). > > <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit 78305e3. Bugbot is set up for automated code reviews on this repo. Configure [here](https://www.cursor.com/dashboard/bugbot).</sup> <!-- /CURSOR_SUMMARY -->
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.



There were issues with caching providers/metadata during parallel requests. This was causing performance issues on the browser. This PR fixes that, and adds some other optimizations to resolving the chaining graph. All previous tests pass.
Note
Medium Risk
Touches core asset-movement provider resolution and reachability BFS used for transfer routing; caching and graph traversal changes could affect correctness under concurrency or edge-case graph shapes, though behavior is intended to be equivalent with better performance.
Overview
Improves anchor chaining performance when many parallel browser requests resolve the same asset-movement providers and walk the transfer graph.
Asset movement providers:
getAssetMovementProviderByIdnow caches in-flight promises per provider ID (not just resolved providers), so concurrent callers share one fetch; failed lookups are evicted so retries work.getAssetMovementProvidersForAssetbuilds a lazy index of provider IDs by asset+location from graph nodes instead of scanning every node on each lookup, then resolves providers in parallel.EVM asset keys: Optional
EVMChecksumCacheonchecksumEVMAsset,normalizeChainAssetCasing, andconvertAssetSearchInputToCanonicalavoids repeat EIP-55 work;AnchorGraphandResolvereach hold a shared map for metadata canonicalization and#assetLocationKey(with a WeakMap cache on location key objects).Graph
resolveAssets: Drops always-built prev/next adjacency; BFS builds rail-key neighbor buckets only whenfrom/tofilters are set, uses an index-based queue instead ofqueue.shift(), and walks neighbors via those buckets while preserving same-provider FX skip rules.Reviewed by Cursor Bugbot for commit 17aa786. Bugbot is set up for automated code reviews on this repo. Configure here.