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

Feature: Add multi-threading and retry when caching Tokens and Markets during startup #3

Closed
skynetcap opened this issue Jun 16, 2022 · 2 comments
Assignees
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@skynetcap
Copy link
Owner

Abstract

As of now, 2 getProgramAccounts RPC requests are made to a Solana RPC server on startup, first to cache the USDC markets, then the SOL markets. They are very slow, and can timeout, causing startup to fail.

Fix

  1. Add multi-threading to the 2 RPC calls, so they are made concurrently. CompleteableFuture may be preferred, or the most modern Java concurrency pattern that is elegant.
  2. If RPC timeout is experienced during either of the threads, retry up to 3 times.
@skynetcap skynetcap added enhancement New feature or request good first issue Good for newcomers labels Jun 16, 2022
@skynetcap skynetcap self-assigned this Jun 16, 2022
@skynetcap
Copy link
Owner Author

Retry doesn't seem needed anymore, now that the majority of the Solana network is on 1.10.25, and both markets cache in ~1-3 seconds with the threading.

@skynetcap
Copy link
Owner Author

Resolved by 54e3351

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

No branches or pull requests

1 participant