Skip to content

Commit 653ba99

Browse files
committed
wip
1 parent 7694823 commit 653ba99

File tree

5 files changed

+382
-5
lines changed

5 files changed

+382
-5
lines changed

Cargo.lock

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

crates/sharding/Cargo.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,3 +27,6 @@ parking_lot.workspace = true
2727
tokio.workspace = true
2828
tracing.workspace = true
2929
url.workspace = true
30+
31+
[dev-dependencies]
32+
jsonrpsee.workspace = true

crates/sharding/src/scheduler.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,11 @@ impl Scheduler {
101101
self.inner.time_quantum
102102
}
103103

104+
/// Returns the current number of scheduled shard tasks in the queue.
105+
pub fn queue_len(&self) -> usize {
106+
self.inner.queue.lock().len()
107+
}
108+
104109
/// Signal shutdown and wake all waiting workers.
105110
pub fn shutdown(&self) {
106111
self.inner.shutdown.store(true, Ordering::SeqCst);

crates/sharding/src/worker.rs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,10 @@ use std::time::Instant;
22

33
use anyhow::Result;
44
use katana_pool::TransactionPool;
5-
use katana_primitives::env::BlockEnv;
6-
use katana_primitives::transaction::ExecutableTxWithHash;
7-
use katana_provider::api::state::StateFactoryProvider;
8-
use katana_provider::ProviderFactory;
95
use tracing::{error, trace};
106

117
use crate::scheduler::Scheduler;
12-
use crate::shard::{Shard, ShardState};
8+
use crate::shard::ShardState;
139

1410
/// A worker that picks shards from the scheduler and executes their pending transactions.
1511
///

0 commit comments

Comments
 (0)