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

Add rpcCacheCapacity option to ApiOptions #6020

Merged
merged 1 commit into from
Nov 6, 2024

Conversation

TarikGul
Copy link
Member

@TarikGul TarikGul commented Nov 5, 2024

The ApiPromise options (ApiOptions) now has support for rpcCacheCapacity. This will allow the ability to set the size of the cache in RpcCore.

interface ApiOptions extends RegisteredTypes {
  ...
  /**
   * @description Defines the size of the cache for the rpc-core. Defaults to 1024 * 10 * 10.
   */
  rpcCacheCapacity?: number;
  ...
}

This use to be infinite but for long standing instances where the api is used, this was terrible for memory, therefore we added an internal TTL for the LRUCache in #5997. But that PR also changed the storage cache for rpc calls from a Map to an LRUCache, which needs a defined size. This PR aims to allow the user to define an escape hatch to not have to deal with the default size.

@TarikGul TarikGul added the -auto label Nov 6, 2024
@polkadot-js-bot polkadot-js-bot merged commit e84c58d into master Nov 6, 2024
6 checks passed
@polkadot-js-bot polkadot-js-bot deleted the tg-add-rpcCacheCapacity-option branch November 6, 2024 14:57
@polkadot-js-bot
Copy link

This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@polkadot-js polkadot-js locked as resolved and limited conversation to collaborators Nov 8, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants