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

Increase default trie cache size to 1GiB #6546

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions prdoc/pr_6546.prdoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
title: Increase default trie cache size to 1GiB
doc:
- audience: Node Operator
description: "The default trie cache size before was set to `64MiB`, which is quite\
\ low to achieve real speed ups. `1GiB` should be a reasonable number as the requirements\
\ for validators/collators/full nodes are much higher when it comes to minimum\
\ memory requirements. Also the cache will not use `1GiB` from the start and fills\
\ over time. The setting can be changed by setting `--trie-cache-size BYTE_SIZE`.\r\
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: removal of state_cache_size could be mentioned.

\n"
crates:
- name: sc-cli
bump: patch
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doesn't removal of state_cache_size require a major here ?

10 changes: 1 addition & 9 deletions substrate/client/cli/src/params/import_params.rs
Original file line number Diff line number Diff line change
Expand Up @@ -78,21 +78,13 @@ pub struct ImportParams {
/// Specify the state cache size.
///
/// Providing `0` will disable the cache.
#[arg(long, value_name = "Bytes", default_value_t = 67108864)]
#[arg(long, value_name = "Bytes", default_value_t = 1024 * 1024 * 1024)]
pub trie_cache_size: usize,

/// DEPRECATED: switch to `--trie-cache-size`.
#[arg(long)]
state_cache_size: Option<usize>,
}

impl ImportParams {
/// Specify the trie cache maximum size.
pub fn trie_cache_maximum_size(&self) -> Option<usize> {
if self.state_cache_size.is_some() {
eprintln!("`--state-cache-size` was deprecated. Please switch to `--trie-cache-size`.");
}

if self.trie_cache_size == 0 {
None
} else {
Expand Down
Loading