-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
feat: add cross-block cache size cli arg #14305
Conversation
crates/node/core/src/node_config.rs
Outdated
/// Default size of cross-block cache. | ||
pub const DEFAULT_CROSS_BLOCK_CACHE_SIZE: u64 = 4 * 1024 * 1024 * 1024; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is in bytes?
can we mention this?
crates/node/core/src/args/engine.rs
Outdated
/// Configure the size of cross-block cache | ||
#[arg(long = "engine.cross-block-cache-size", default_value_t = DEFAULT_CROSS_BLOCK_CACHE_SIZE)] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this should mention the unit,
for other caches we expect that the input is MB because handling bytes is a bit useless:
for example:
reth/crates/node/core/src/args/rpc_server.rs
Lines 123 to 125 in b955551
/// Set the maximum RPC request payload size for both HTTP and WS in megabytes. | |
#[arg(long = "rpc.max-request-size", alias = "rpc-max-request-size", default_value_t = RPC_DEFAULT_MAX_REQUEST_SIZE_MB.into())] | |
pub rpc_max_request_size: MaxU32, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
makes sense, done here 0918a5b PTAL
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm, one more pedantic q re MB vs bytes 🙃
@@ -65,7 +65,7 @@ impl Default for TreeConfig { | |||
use_state_root_task: false, | |||
always_compare_trie_updates: false, | |||
use_caching_and_prewarming: false, | |||
cross_block_cache_size: DEFAULT_CROSS_BLOCK_CACHE_SIZE, | |||
cross_block_cache_size: DEFAULT_CROSS_BLOCK_CACHE_SIZE_MB, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hmm, not sure if we should mix this here, I lean towards handling this here in bytes as well as build_caches
wdyt @Rjected
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yep better to be consistent internally, i¡ve pushed changes to manage bytes from TreeConfig
, done the change MB -> bytes in the cache size setter invocation, ptal
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
builder.config.engine.state_root_task_compare_updates, | ||
.with_always_compare_trie_updates(builder.config.engine.state_root_task_compare_updates) | ||
.with_cross_block_cache_size( | ||
builder.config.engine.cross_block_cache_size * 1024 * 1024, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
from MB to bytes, lgtm
Closes #14300