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

experiment with chunk and block cache #384

Draft
wants to merge 7 commits into
base: develop
Choose a base branch
from
Draft

Conversation

kobayurii
Copy link
Member

No description provided.

@kobayurii kobayurii requested a review from khorolets December 26, 2024 11:00
@kobayurii kobayurii self-assigned this Dec 26, 2024
@kobayurii kobayurii force-pushed the chunk_cache branch 3 times, most recently from 1eb438e to 9be2fc2 Compare December 30, 2024 09:11
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
Copy link
Member

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 =
Copy link
Member

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 =
Copy link
Member

Choose a reason for hiding this comment

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

and this

// 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
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
// For chunk block we use 5GB. make it configurable. temporary hardcoded
// For chunk block we use 5GB
// TODO: make it configurable. temporary hardcoded

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants