Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Tech Debt] Optimize parallel requests for token/contracts #2181

Open
hectorgomezv opened this issue Dec 9, 2024 · 0 comments
Open

[Tech Debt] Optimize parallel requests for token/contracts #2181

hectorgomezv opened this issue Dec 9, 2024 · 0 comments
Assignees
Labels
enhancement New feature or request

Comments

@hectorgomezv
Copy link
Member

hectorgomezv commented Dec 9, 2024

Description

Context

The async nature of the CGW causes the service to send several requests to the Safe Transaction Service in parallel for the same data, so only after the first one gets a response is the result cached.

This is especially problematic when the CGW requests the tokens/contracts for all the transactions on a page, and the same token/contract is repeated many times on that page. This causes the CGW to request the same token/contract N times (before receiving any response from the Transaction Service) instead of 1 for each repeated token/contract.

Requirements

  • Collect a Set (no repeated items) before sending the requests to the Safe Transaction Service.
  • Wait for the requests in the Set to be fulfilled/rejected. Subsequent calls will be cached.

Examples

Screenshot 2024-12-09 at 16 02 33
Screenshot 2024-12-09 at 16 03 23

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant