Skip to content
Closed
Show file tree
Hide file tree
Changes from 3 commits
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
b93045e
page_fault metric
roberto-bayardo Apr 7, 2026
efbe263
reuse context
roberto-bayardo Apr 8, 2026
35d776c
track page_evictions
roberto-bayardo Apr 10, 2026
8176b29
fix counting
patrick-ogrady Apr 13, 2026
54d11eb
[runtime] Cleanup Page Fault Metrics (#3586)
patrick-ogrady Apr 14, 2026
04d387e
Merge branch 'main' into pr/3544
patrick-ogrady Apr 14, 2026
60cb5f6
[runtime] Page Cache Cleanup (v2) (#3600)
patrick-ogrady Apr 15, 2026
d92aa60
Merge remote-tracking branch 'origin/main' into pr/3544
patrick-ogrady Apr 15, 2026
1c1f815
nits
patrick-ogrady Apr 15, 2026
943f995
fmt
patrick-ogrady Apr 15, 2026
9586ad8
align
patrick-ogrady Apr 15, 2026
4c18bfb
more labeling
patrick-ogrady Apr 15, 2026
d9443e8
nits
patrick-ogrady Apr 15, 2026
22cf5c6
nits
patrick-ogrady Apr 15, 2026
4f7657c
nits
patrick-ogrady Apr 15, 2026
2bdca32
nits
patrick-ogrady Apr 15, 2026
467b9ca
more labeling
patrick-ogrady Apr 15, 2026
bcd3ae7
use db
patrick-ogrady Apr 15, 2026
fe305e0
nits
patrick-ogrady Apr 15, 2026
c7003c1
fix remaining clone
patrick-ogrady Apr 15, 2026
da89740
fix labels
patrick-ogrady Apr 15, 2026
7623c3d
more labels
patrick-ogrady Apr 15, 2026
f85bcc2
more nits
patrick-ogrady Apr 15, 2026
e814444
fmt
patrick-ogrady Apr 15, 2026
be8237d
major diff
patrick-ogrady Apr 15, 2026
0f33210
fmt
patrick-ogrady Apr 15, 2026
27a19e3
fix dynamic labels
patrick-ogrady Apr 15, 2026
c536581
nits
patrick-ogrady Apr 15, 2026
9c30aed
fix restarts
patrick-ogrady Apr 15, 2026
79191ac
recovery
patrick-ogrady Apr 15, 2026
5de0e76
nit
patrick-ogrady Apr 15, 2026
ae2616d
nits
patrick-ogrady Apr 15, 2026
052053d
fix missing labels
patrick-ogrady Apr 15, 2026
bf166f4
journal
patrick-ogrady Apr 15, 2026
22f293a
more changes
patrick-ogrady Apr 15, 2026
6279852
fmt
patrick-ogrady Apr 15, 2026
5b3522b
fix
patrick-ogrady Apr 15, 2026
cf8fc90
nits
patrick-ogrady Apr 15, 2026
cea5925
[runtime] Refactor Context (#3614)
patrick-ogrady Apr 17, 2026
0066f21
Merge branch 'main' into pr/3544
patrick-ogrady Apr 17, 2026
e512537
nits
patrick-ogrady Apr 17, 2026
7e44f56
nits
patrick-ogrady Apr 19, 2026
c625525
Merge remote-tracking branch 'origin/main' into pr/3544
patrick-ogrady Apr 20, 2026
ed497e8
dedup
patrick-ogrady Apr 20, 2026
a1b684f
nits
patrick-ogrady Apr 20, 2026
180d065
cleanup
patrick-ogrady Apr 20, 2026
1e5366c
Merge branch 'main' into pr/3544
patrick-ogrady Apr 21, 2026
83ba05b
Merge remote-tracking branch 'origin/main' into pr/3544
patrick-ogrady Apr 21, 2026
be6cc74
add changes
patrick-ogrady Apr 22, 2026
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
6 changes: 3 additions & 3 deletions consensus/src/aggregation/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -498,7 +498,7 @@ mod tests {
journal_heights_per_section: std::num::NonZeroU64::new(6).unwrap(),
journal_compression: Some(3),
journal_page_cache: CacheRef::from_pooler(
&context,
&validator_context,
PAGE_SIZE,
PAGE_CACHE_SIZE,
),
Expand Down Expand Up @@ -652,7 +652,7 @@ mod tests {
journal_heights_per_section: std::num::NonZeroU64::new(6).unwrap(),
journal_compression: Some(3),
journal_page_cache: CacheRef::from_pooler(
&context,
&validator_context,
Comment thread
patrick-ogrady marked this conversation as resolved.
Outdated
PAGE_SIZE,
PAGE_CACHE_SIZE,
),
Expand Down Expand Up @@ -739,7 +739,7 @@ mod tests {
journal_heights_per_section: std::num::NonZeroU64::new(6).unwrap(),
journal_compression: Some(3),
journal_page_cache: CacheRef::from_pooler(
&context,
&validator_context,
PAGE_SIZE,
PAGE_CACHE_SIZE,
),
Expand Down
12 changes: 8 additions & 4 deletions consensus/src/marshal/standard/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -876,13 +876,17 @@ mod tests {
let executor = deterministic::Runner::timed(Duration::from_secs(10));
executor.start(|context| async move {
let prefix = "test-cache";
let make_cfg = || cache::Config {
let make_cfg = |label: &str| cache::Config {
partition_prefix: prefix.to_string(),
prunable_items_per_section: NZU64!(10),
replay_buffer: NonZeroUsize::new(1024).unwrap(),
key_write_buffer: NonZeroUsize::new(1024).unwrap(),
value_write_buffer: NonZeroUsize::new(1024).unwrap(),
key_page_cache: CacheRef::from_pooler(&context, PAGE_SIZE, PAGE_CACHE_SIZE),
key_page_cache: CacheRef::from_pooler(
&context.with_label(label),
PAGE_SIZE,
PAGE_CACHE_SIZE,
),
};

let block = make_raw_block(Sha256::hash(b""), Height::new(1), 100);
Expand All @@ -893,7 +897,7 @@ mod tests {
{
let mut mgr = cache::Manager::<_, Standard<B>, S>::init(
context.with_label("write"),
make_cfg(),
make_cfg("cfg1"),
(),
)
.await;
Expand All @@ -904,7 +908,7 @@ mod tests {
// before loading persisted epochs.
let mut mgr = cache::Manager::<_, Standard<B>, S>::init(
context.with_label("read"),
make_cfg(),
make_cfg("cfg2"),
(),
)
.await;
Expand Down
54 changes: 44 additions & 10 deletions consensus/src/simplex/actors/voter/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1632,6 +1632,7 @@ mod tests {
actor.start();

// Initialize voter actor
let voter_context = context.with_label("voter");
let voter_cfg = Config {
scheme: schemes[0].clone(),
elector: elector.clone(),
Expand All @@ -1648,9 +1649,13 @@ mod tests {
activity_timeout: ViewDelta::new(10),
replay_buffer: NZUsize!(1024 * 1024),
write_buffer: NZUsize!(1024 * 1024),
page_cache: CacheRef::from_pooler(&context, PAGE_SIZE, PAGE_CACHE_SIZE),
page_cache: CacheRef::from_pooler(
&voter_context,
PAGE_SIZE,
PAGE_CACHE_SIZE,
),
};
let (voter, mut mailbox) = Actor::new(context.with_label("voter"), voter_cfg);
let (voter, mut mailbox) = Actor::new(voter_context, voter_cfg);

// Resolver and batcher mailboxes
let (resolver_sender, mut resolver_receiver) = mpsc::channel(8);
Expand Down Expand Up @@ -1739,7 +1744,11 @@ mod tests {
activity_timeout: ViewDelta::new(10),
replay_buffer: NZUsize!(1024 * 1024),
write_buffer: NZUsize!(1024 * 1024),
page_cache: CacheRef::from_pooler(&context, PAGE_SIZE, PAGE_CACHE_SIZE),
page_cache: CacheRef::from_pooler(
&context.with_label("voter_restarted"),
PAGE_SIZE,
PAGE_CACHE_SIZE,
),
};
let (voter, _mailbox) = Actor::new(context.with_label("voter_restarted"), voter_cfg);

Expand Down Expand Up @@ -1884,7 +1893,11 @@ mod tests {
};

// First run: persist progress to a later view.
let cfg = make_cfg(CacheRef::from_pooler(&context, PAGE_SIZE, PAGE_CACHE_SIZE));
let cfg = make_cfg(CacheRef::from_pooler(
&context.with_label("voter_initial"),
PAGE_SIZE,
PAGE_CACHE_SIZE,
));
let (voter, mut mailbox) = Actor::new(context.with_label("voter_initial"), cfg);

let (resolver_sender, _resolver_receiver) = mpsc::channel(8);
Expand Down Expand Up @@ -1924,7 +1937,11 @@ mod tests {
handle.abort();

// Restart and inject startup timeout hint from first update.
let cfg = make_cfg(CacheRef::from_pooler(&context, PAGE_SIZE, PAGE_CACHE_SIZE));
let cfg = make_cfg(CacheRef::from_pooler(
&context.with_label("voter_restarted"),
PAGE_SIZE,
PAGE_CACHE_SIZE,
));
let (voter, _mailbox) = Actor::new(context.with_label("voter_restarted"), cfg);

let (resolver_sender, _resolver_receiver) = mpsc::channel(8);
Expand Down Expand Up @@ -3517,6 +3534,7 @@ mod tests {
mocks::application::Application::new(context.with_label("app"), app_cfg);
actor.start();

let voter_context = context.with_label("voter");
let voter_cfg = Config {
scheme: schemes[0].clone(),
elector: elector.clone(),
Expand All @@ -3533,9 +3551,13 @@ mod tests {
activity_timeout: ViewDelta::new(10),
replay_buffer: NZUsize!(1024 * 1024),
write_buffer: NZUsize!(1024 * 1024),
page_cache: CacheRef::from_pooler(&context, PAGE_SIZE, PAGE_CACHE_SIZE),
page_cache: CacheRef::from_pooler(
&voter_context,
Comment thread
patrick-ogrady marked this conversation as resolved.
Outdated
PAGE_SIZE,
PAGE_CACHE_SIZE,
),
};
let (voter, mut mailbox) = Actor::new(context.with_label("voter"), voter_cfg);
let (voter, mut mailbox) = Actor::new(voter_context, voter_cfg);

let (resolver_sender, _) = mpsc::channel(8);
let (batcher_sender, mut batcher_receiver) = mpsc::channel(8);
Expand Down Expand Up @@ -3669,7 +3691,11 @@ mod tests {
activity_timeout: ViewDelta::new(10),
replay_buffer: NZUsize!(1024 * 1024),
write_buffer: NZUsize!(1024 * 1024),
page_cache: CacheRef::from_pooler(&context, PAGE_SIZE, PAGE_CACHE_SIZE),
page_cache: CacheRef::from_pooler(
&context.with_label("voter_restarted"),
PAGE_SIZE,
PAGE_CACHE_SIZE,
),
};
let (voter, _mailbox) = Actor::new(context.with_label("voter_restarted"), voter_cfg);

Expand Down Expand Up @@ -4839,7 +4865,11 @@ mod tests {
activity_timeout: ViewDelta::new(10),
replay_buffer: NZUsize!(1024 * 1024),
write_buffer: NZUsize!(1024 * 1024),
page_cache: CacheRef::from_pooler(&context, PAGE_SIZE, PAGE_CACHE_SIZE),
page_cache: CacheRef::from_pooler(
&context.with_label("voter_cancel"),
PAGE_SIZE,
PAGE_CACHE_SIZE,
),
};
let (voter, mut mailbox) = Actor::new(context.with_label("voter_cancel"), voter_cfg);

Expand Down Expand Up @@ -4952,7 +4982,11 @@ mod tests {
activity_timeout: ViewDelta::new(10),
replay_buffer: NZUsize!(1024 * 1024),
write_buffer: NZUsize!(1024 * 1024),
page_cache: CacheRef::from_pooler(&context, PAGE_SIZE, PAGE_CACHE_SIZE),
page_cache: CacheRef::from_pooler(
&context.with_label("voter_restarted"),
PAGE_SIZE,
PAGE_CACHE_SIZE,
),
};
let (voter, _mailbox) = Actor::new(context.with_label("voter_restarted"), voter_cfg);

Expand Down
1 change: 1 addition & 0 deletions consensus/src/simplex/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4838,6 +4838,7 @@ mod tests {
let relay = Arc::new(mocks::relay::Relay::new());
let mut honest_reporters = Vec::new();
for (idx, validator) in participants.iter().enumerate() {
let context = context.with_label(&format!("validator_{}", *validator));
let (pending, recovered, resolver) = registrations
.remove(validator)
.expect("validator should be registered");
Expand Down
2 changes: 1 addition & 1 deletion p2p/src/authenticated/discovery/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,7 @@ mod tests {
/// We set a unique `base_port` for each test to avoid "address already in use"
/// errors when tests are run immediately after each other.
async fn run_network(
context: impl Spawner + BufferPooler + Clock + CryptoRngCore + RNetwork + Resolver + Metrics,
context: impl Spawner + BufferPooler + Clock + CryptoRngCore + RNetwork + Resolver,
max_message_size: u32,
base_port: u16,
n: usize,
Expand Down
2 changes: 1 addition & 1 deletion p2p/src/authenticated/lookup/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ mod tests {
/// We set a unique `base_port` for each test to avoid "address already in use"
/// errors when tests are run immediately after each other.
async fn run_network(
context: impl Spawner + BufferPooler + Clock + CryptoRngCore + RNetwork + Resolver + Metrics,
context: impl Spawner + BufferPooler + Clock + CryptoRngCore + RNetwork + Resolver,
max_message_size: u32,
base_port: u16,
n: usize,
Expand Down
2 changes: 1 addition & 1 deletion runtime/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -753,7 +753,7 @@ stability_scope!(BETA {
}

/// Interface that any runtime must implement to provide buffer pools.
pub trait BufferPooler: Clone + Send + Sync + 'static {
pub trait BufferPooler: Metrics + Clone + Send + Sync + 'static {
Comment thread
patrick-ogrady marked this conversation as resolved.
Outdated
/// Returns the network [BufferPool].
Comment thread
roberto-bayardo marked this conversation as resolved.
fn network_buffer_pool(&self) -> &BufferPool;

Expand Down
2 changes: 1 addition & 1 deletion runtime/src/utils/buffer/paged/append.rs
Original file line number Diff line number Diff line change
Expand Up @@ -991,7 +991,7 @@ mod tests {
.with_max_per_class(NZUsize!(2)),
&mut registry,
);
let cache_ref = CacheRef::new(pool.clone(), PAGE_SIZE, NZUsize!(1));
let cache_ref = CacheRef::new(&context, pool.clone(), PAGE_SIZE, NZUsize!(1));

let (blob, blob_size) = context
.open("test_partition", b"release_tip_backing")
Expand Down
Loading
Loading