Do not drop lookups without peers while awaiting events (#5839)

* Do not drop lookups without peers while awaiting events
This commit is contained in:
Lion - dapplion
2024-05-24 23:28:37 +02:00
committed by GitHub
parent 7fda18bf49
commit f187ad8bb4
3 changed files with 97 additions and 24 deletions

View File

@@ -560,9 +560,10 @@ impl<T: BeaconChainTypes> SyncManager<T> {
futures::stream::iter(ee_responsiveness_watch.await).flatten()
};
// LOOKUP_MAX_DURATION_SECS is 60 seconds. Logging every 30 seconds allows enough timely
// visbility while being sparse and not increasing the debug log volume in a noticeable way
let mut interval = tokio::time::interval(Duration::from_secs(30));
// min(LOOKUP_MAX_DURATION_*) is 15 seconds. The cost of calling prune_lookups more often is
// one iteration over the single lookups HashMap. This map is supposed to be very small < 10
// unless there is a bug.
let mut prune_lookups_interval = tokio::time::interval(Duration::from_secs(15));
// process any inbound messages
loop {
@@ -573,8 +574,8 @@ impl<T: BeaconChainTypes> SyncManager<T> {
Some(engine_state) = check_ee_stream.next(), if check_ee => {
self.handle_new_execution_engine_state(engine_state);
}
_ = interval.tick() => {
self.block_lookups.drop_stuck_lookups();
_ = prune_lookups_interval.tick() => {
self.block_lookups.prune_lookups();
}
}
}