-
-
Notifications
You must be signed in to change notification settings - Fork 260
Remove token cache for immediate token availability #582
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
Merged
Conversation
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
sync / Gateway staging -> main for Hummingbot version 2.10.0
sync / Client development -> staging v2.11
Sync / staging to main v2.11
- Remove tokenList and _tokenMap in-memory cache from Solana class
- Update getTokenList() to read from TokenService on each call
- Update getToken() and balance methods to use fresh token list
- Remove cache reload logic from /tokens/save/{address} endpoint
- Update POST /tokens/ to indicate requiresRestart: false
Tokens added via any endpoint are now immediately available without
restart. File reads for small token lists (~4KB) take <0.2ms which
is negligible compared to RPC calls (50-500ms).
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <[email protected]>
- Remove tokenList and tokenMap in-memory cache from Ethereum class - Add getTokenList() method to read from TokenService on each call - Update getToken() to use fresh token list from disk - Update getAllTokenBalances() to use getTokenList() - Update allowances, wrap, and unwrap routes to use async token methods 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <[email protected]>
🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <[email protected]>
Since tokens are now read from disk on each request, no restart is ever needed. Remove the requiresRestart field entirely from the schema and all token operation responses. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <[email protected]>
nikspz
approved these changes
Dec 30, 2025
Contributor
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- commit 0ecb92c
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.






Summary
tokenList,tokenMap) from both Solana and Ethereum classesChanges
Solana
tokenListand_tokenMapcache, updatedgetTokenList()to read fromTokenServiceeach timerequiresRestart: false- tokens work immediatelyEthereum
tokenListandtokenMapcache, added asyncgetTokenList()methodallowances.ts,wrap.ts,unwrap.tsto use async token methodsMotivation
Previously, both Solana and Ethereum cached tokens in memory at startup. Adding a token via
POST /tokens/only saved to disk without refreshing the cache, requiring a restart. The/tokens/save/{address}endpoint had special logic to reload the cache, creating inconsistent behavior.Since token files are small (~4KB for 10-20 tokens), reading from disk takes <0.2ms - negligible compared to RPC calls (50-500ms). This simplifies the code and makes both endpoints behave consistently.
Test plan
POST /tokens/for Solana and verify it appears in/solana/balanceswithout restartPOST /tokens/for Ethereum and verify it appears in/ethereum/balanceswithout restart/tokens/save/{address}and verify it appears in balances🤖 Generated with Claude Code