extends crds values timeouts if stakes are unknown (#17261)

If stakes are unknown, then timeouts will be short, resulting in values
being purged from the crds table, and consequently higher pull-response
load when they are obtained again from gossip. In particular, this slows
down validator start where almost all values obtained from entrypoint
are immediately discarded.
This commit is contained in:
behzad nouri
2021-05-21 15:55:22 +00:00
committed by GitHub
parent 44831c18d2
commit 2adce67260
4 changed files with 87 additions and 89 deletions

View File

@ -333,7 +333,10 @@ fn network_run_push(
.par_iter()
.map(|node| {
let mut node_lock = node.lock().unwrap();
let timeouts = node_lock.make_timeouts_test();
let timeouts = node_lock.make_timeouts(
&HashMap::default(), // stakes
Duration::from_millis(node_lock.pull.crds_timeout),
);
node_lock.purge(thread_pool, now, &timeouts);
(node_lock.id, node_lock.new_push_messages(vec![], now))
})