Skip to content

fix(token-info): Reduce token-info metadata fetch fan out.#4420

Open
metalurgical wants to merge 3 commits into
cowprotocol:mainfrom
metalurgical:token_info_bound
Open

fix(token-info): Reduce token-info metadata fetch fan out.#4420
metalurgical wants to merge 3 commits into
cowprotocol:mainfrom
metalurgical:token_info_bound

Conversation

@metalurgical
Copy link
Copy Markdown
Contributor

Description

Reduce token-info metadata fetch fan out.

Changes

  • Replace unbounded join_all token-info fetching with buffer_unordered
  • Add a fixed concurrency limit (20) for fetches

How to test

cargo nextest run

Replace unbounded token-info join_all fan-out with bounded
buffer_unordered concurrency to avoid excessive calls for large token sets.
@metalurgical metalurgical requested a review from a team as a code owner May 17, 2026 11:25
Copy link
Copy Markdown

@claude claude Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Claude Code Review

This pull request is from a fork — automated review is disabled. A repository maintainer can comment @claude review to run a one-time review.

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request replaces join_all with a buffered stream approach in TokenInfoFetcher and CachedTokenInfoFetcher to limit concurrent token info requests to a maximum of 20. Feedback suggests deduplicating the input address list using a HashSet in both fetchers to prevent redundant processing and unnecessary RPC calls.

Comment thread crates/token-info/src/lib.rs Outdated
Comment thread crates/token-info/src/lib.rs Outdated
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