Skip to content

Implement caching to reduce unnecessary Ethereum RPC and IPFS gateway calls #2280

@pablomendezroyo

Description

@pablomendezroyo

Is your feature request related to a problem? Please describe.

Currently, dappmanager makes repeated Ethereum RPC and IPFS gateway calls for retrieving dappstore information and smart contract addresses, leading to inefficiencies and potentially increased latency. The staker config is also fetched repeatedly from the frontend. Existing caching for smart contract addresses is limited to an in-memory map.

Describe the solution you'd like

Implement a proper caching class in a new package module within dappmanager, leveraging a robust caching library such as @isaacs/node-lru-cache to provide controlled cache eviction and performance improvements. The caching class should support:

  • Caching dappstore data to avoid unnecessary Ethereum RPC and IPFS gateway calls (used in the dappmanager module, in calls, fetchdirectory).
  • Caching smart contract addresses from the auto-updates daemon (currently cached in-memory in the daemons module, updateMyPackages).
  • Caching staker config when retrieved from the frontend (used in dappmanager module, calls, stakerConfig).

Describe alternatives you've considered

  • Continue using in-memory maps for caching (less robust, harder to maintain and scale).
  • Use Redis or other distributed caching solutions (may be overkill for current use case but could be considered if scaling needs grow).

Additional context

  • The cache should be implemented as a reusable class/module.
  • Integration points: fetchdirectory (dappstore), updateMyPackages (smart contract addresses), stakerConfig (staker config).
  • Reference: @isaacs/node-lru-cache

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions