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

Merged
merged 4 commits into from
Nov 20, 2024
Merged
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
13 changes: 13 additions & 0 deletions prdoc/pr_6546.prdoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
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`.\
The CLI option `--state-cache-size` is also removed, which was not having any effect anymore.\r\
\n"
crates:
- name: sc-cli
bump: patch
sandreim marked this conversation as resolved.
Show resolved Hide resolved
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