Skip to content

Conversation

@sprites0
Copy link
Collaborator

@sprites0 sprites0 commented Nov 5, 2025

Resolves #72

Implements persistent caching of ERC20 contract to spot token mappings to minimize API requests and improve performance.

Changes:

  • Add SpotMetadata database table for persistent storage
  • Implement cache loading on startup via load_spot_metadata_cache()
  • Add init_spot_metadata() for init-state command pre-population
  • Extract store_spot_metadata() helper to DRY serialization logic
  • Enable on-demand API fetches with automatic persistence

Falls back to on-demand API fetches when database is empty, with automatic persistence for future use.

Implements persistent caching of ERC20 contract address to spot token ID
mappings in the database to minimize API requests and improve performance.

Changes:
- Add SpotMetadata database table for persistent storage
- Implement load_spot_metadata_cache() to initialize cache on startup
- Add init_spot_metadata() for init-state command to pre-populate cache
- Extract store_spot_metadata() helper to DRY serialization logic
- Enable on-demand API fetches with automatic database persistence
- Integrate cache loading in main node startup flow

The cache falls back to on-demand API fetches if database is empty,
with automatic persistence of fetched data for future use.
@sprites0 sprites0 merged commit 524db5a into node-builder Nov 5, 2025
4 checks passed
@sprites0 sprites0 deleted the feat/cache-spot-meta branch November 5, 2025 08:13
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.

Save spot_meta to reth DB

2 participants