Skip to content

Commit bd6e69a

Browse files
rswansonclaude
andauthored
feat(cold): increase LRU cache from 128 to 2048 entries (#55)
* feat(cold): increase LRU cache from 128 to 2048 entries per map 128 entries is too small for RPC workloads where the same recent blocks, transactions, and receipts are queried repeatedly by different concurrent callers, causing unnecessary cold storage round-trips. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * chore: revert added comment, bump version to 0.7.2 Removes the explanatory comment on DEFAULT_CACHE_CAPACITY per review feedback. Bumps workspace version from 0.7.1 to 0.7.2. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent e422918 commit bd6e69a

2 files changed

Lines changed: 10 additions & 10 deletions

File tree

Cargo.toml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ members = ["crates/*"]
33
resolver = "2"
44

55
[workspace.package]
6-
version = "0.7.1"
6+
version = "0.7.2"
77
edition = "2024"
88
rust-version = "1.92"
99
authors = ["init4"]
@@ -35,13 +35,13 @@ incremental = false
3535

3636
[workspace.dependencies]
3737
# internal
38-
signet-hot = { version = "0.7.1", path = "./crates/hot" }
39-
signet-hot-mdbx = { version = "0.7.1", path = "./crates/hot-mdbx" }
40-
signet-cold = { version = "0.7.1", path = "./crates/cold" }
41-
signet-cold-mdbx = { version = "0.7.1", path = "./crates/cold-mdbx" }
42-
signet-cold-sql = { version = "0.7.1", path = "./crates/cold-sql" }
43-
signet-storage = { version = "0.7.1", path = "./crates/storage" }
44-
signet-storage-types = { version = "0.7.1", path = "./crates/types" }
38+
signet-hot = { version = "0.7.2", path = "./crates/hot" }
39+
signet-hot-mdbx = { version = "0.7.2", path = "./crates/hot-mdbx" }
40+
signet-cold = { version = "0.7.2", path = "./crates/cold" }
41+
signet-cold-mdbx = { version = "0.7.2", path = "./crates/cold-mdbx" }
42+
signet-cold-sql = { version = "0.7.2", path = "./crates/cold-sql" }
43+
signet-storage = { version = "0.7.2", path = "./crates/storage" }
44+
signet-storage-types = { version = "0.7.2", path = "./crates/types" }
4545

4646
# External, in-house
4747
signet-libmdbx = { version = "0.8.0" }

crates/cold/src/task/cache.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ use signet_storage_types::{RecoveredTx, SealedHeader};
1010
use std::num::NonZeroUsize;
1111

1212
/// Default capacity for each LRU cache map.
13-
const DEFAULT_CACHE_CAPACITY: usize = 128;
13+
const DEFAULT_CACHE_CAPACITY: usize = 2048;
1414

1515
/// Evict all entries from an LRU cache whose keys satisfy the predicate.
1616
fn evict_where<K: Copy + Eq + std::hash::Hash, V>(
@@ -34,7 +34,7 @@ pub(crate) struct ColdCache {
3434
}
3535

3636
impl ColdCache {
37-
/// Create a new cache with the default capacity (128 per map).
37+
/// Create a new cache with the default capacity (2048 per map).
3838
pub(crate) fn new() -> Self {
3939
Self::new_with_cap(DEFAULT_CACHE_CAPACITY)
4040
}

0 commit comments

Comments
 (0)