Keep a longer of queue of blocks to get

This commit is contained in:
Boog900 2024-06-03 16:08:10 +01:00
parent 44c7ad4992
commit 51e67163a8
No known key found for this signature in database
GPG key ID: 42AB1287CB0041C2
3 changed files with 9 additions and 7 deletions

View file

@ -123,7 +123,7 @@ impl Service<ChainSvcRequest> for OurChainSvc {
} }
} }
#[tokio::main(flavor = "multi_thread", worker_threads = 12)] #[tokio::main(flavor = "multi_thread")]
async fn main() { async fn main() {
tracing_subscriber::fmt() tracing_subscriber::fmt()
.with_max_level(Level::DEBUG) .with_max_level(Level::DEBUG)
@ -151,7 +151,7 @@ async fn main() {
.await .await
.unwrap(); .unwrap();
sleep(Duration::from_secs(15)).await; sleep(Duration::from_secs(17)).await;
loop { loop {
let mut buffer = download_blocks( let mut buffer = download_blocks(
@ -162,8 +162,8 @@ async fn main() {
buffer_size: 50_000_000, buffer_size: 50_000_000,
in_progress_queue_size: 30_000_000, in_progress_queue_size: 30_000_000,
check_client_pool_interval: Duration::from_secs(20), check_client_pool_interval: Duration::from_secs(20),
target_batch_size: 1_000_000, target_batch_size: 2_000_000,
initial_batch_size: 100, initial_batch_size: 10,
}, },
); );
@ -175,6 +175,8 @@ async fn main() {
) )
} }
panic!();
sleep(Duration::from_secs(2)).await; sleep(Duration::from_secs(2)).await;
} }
} }

View file

@ -363,7 +363,7 @@ where
client: ClientPoolDropGuard<N>, client: ClientPoolDropGuard<N>,
) { ) {
if self.chain_entry_task.len() < 2 if self.chain_entry_task.len() < 2
&& chain_tracker.block_requests_queued(self.amount_of_blocks_to_request) < 30 && chain_tracker.block_requests_queued(self.amount_of_blocks_to_request) < 500
&& chain_tracker.should_ask_for_next_chain_entry(&client.info.pruning_seed) && chain_tracker.should_ask_for_next_chain_entry(&client.info.pruning_seed)
{ {
let history = chain_tracker.get_simple_history(); let history = chain_tracker.get_simple_history();
@ -517,7 +517,7 @@ where
let mut amount_of_blocks_to_request_updated_at = 0; let mut amount_of_blocks_to_request_updated_at = 0;
let mut check_client_pool_interval = interval(self.config.check_client_pool_interval); let mut check_client_pool_interval = interval(self.config.check_client_pool_interval);
check_client_pool_interval.set_missed_tick_behavior(MissedTickBehavior::Delay); check_client_pool_interval.set_missed_tick_behavior(MissedTickBehavior::Skip);
loop { loop {
tokio::select! { tokio::select! {

View file

@ -10,7 +10,7 @@ default = ["borsh"]
borsh = ["dep:borsh", "monero-pruning/borsh"] borsh = ["dep:borsh", "monero-pruning/borsh"]
[dependencies] [dependencies]
cuprate-helper = { path = "../../helper" } cuprate-helper = { path = "../../helper", features = ["asynch"] }
monero-wire = { path = "../../net/monero-wire", features = ["tracing"] } monero-wire = { path = "../../net/monero-wire", features = ["tracing"] }
monero-pruning = { path = "../../pruning" } monero-pruning = { path = "../../pruning" }