-
Notifications
You must be signed in to change notification settings - Fork 6
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
experiment with chunk and block cache #384
base: develop
Are you sure you want to change the base?
Conversation
1eb438e
to
9be2fc2
Compare
pub blocks_cache: std::sync::Arc<crate::cache::RwLockLruMemoryCache<u64, CacheBlock>>, | ||
pub blocks_cache: | ||
std::sync::Arc<crate::cache::RwLockLruMemoryCache<u64, near_primitives::views::BlockView>>, | ||
/// Chunks cache |
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 comment is redundant imo. Alternatively, you can change it to describe the cache if it has something worth mentioning
@@ -83,18 +86,31 @@ pub struct ServerContext { | |||
|
|||
impl ServerContext { | |||
pub async fn init(rpc_server_config: configuration::RpcServerConfig) -> anyhow::Result<Self> { | |||
let contract_code_cache_size_in_bytes = | |||
utils::gigabytes_to_bytes(rpc_server_config.general.contract_code_cache_size).await; | |||
// let contract_code_cache_size_in_bytes = |
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.
don't forget to drop it
let contract_code_cache = std::sync::Arc::new(crate::cache::RwLockLruMemoryCache::new( | ||
contract_code_cache_size_in_bytes, | ||
)); | ||
|
||
let block_cache_size_in_bytes = | ||
utils::gigabytes_to_bytes(rpc_server_config.general.block_cache_size).await; | ||
// let block_cache_size_in_bytes = |
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.
and this
rpc-server/src/config.rs
Outdated
// let block_cache_size_in_bytes = | ||
// crate::utils::gigabytes_to_bytes(rpc_server_config.general.block_cache_size).await; | ||
|
||
// For chunk block we use 5GB. make it configurable. temporary hardcoded |
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.
// For chunk block we use 5GB. make it configurable. temporary hardcoded | |
// For chunk block we use 5GB | |
// TODO: make it configurable. temporary hardcoded |
No description provided.