Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

Larger timeouts for collation fetching #3741

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
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
4 changes: 4 additions & 0 deletions node/network/collator-protocol/src/collator_side/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,10 @@ const COST_APPARENT_FLOOD: Rep =
/// the transfer should be possible within 0.1 seconds. 400 milliseconds should therefore be
/// plenty and should be low enough for later validators to still be able to finish on time.
///
/// NOTE: We choose a smaller timeout here, as all validators in the backing group will need the
/// PoV anyway, so a parallel upload is not necessarily wasteful here. The situation is differently
/// on the validator side, where we pick a slightly larger timeout.
///
/// There is debug logging output, so we can adjust this value based on production results.
const MAX_UNSHARED_UPLOAD_TIME: Duration = Duration::from_millis(400);

Expand Down
12 changes: 9 additions & 3 deletions node/network/collator-protocol/src/validator_side/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -80,12 +80,18 @@ const BENEFIT_NOTIFY_GOOD: Rep =
/// This is to protect from a single slow collator preventing collations from happening.
///
/// With a collation size of 5MB and bandwidth of 500Mbit/s (requirement for Kusama validators),
/// the transfer should be possible within 0.1 seconds. 400 milliseconds should therefore be
/// the transfer should be possible within 0.1 seconds. 600 milliseconds should therefore be
/// plenty, even with multiple heads and should be low enough for later collators to still be able
/// to finish on time.
///
/// We pick a larger timeout here, as parallel downloads here are purely wasteful (we will only
/// ever second one collation per block).
///
/// There is debug logging output, so we can adjust this value based on production results.
const MAX_UNSHARED_DOWNLOAD_TIME: Duration = Duration::from_millis(400);
#[cfg(not(test))]
const MAX_UNSHARED_DOWNLOAD_TIME: Duration = Duration::from_millis(600);
#[cfg(test)]
const MAX_UNSHARED_DOWNLOAD_TIME: Duration = Duration::from_millis(60);

// How often to check all peers with activity.
#[cfg(not(test))]
Expand Down Expand Up @@ -1187,7 +1193,7 @@ where
tracing::debug!(
target: LOG_TARGET,
?relay_parent,
"Fetch for collation took too long, starting parallel download for next collator as well."
"Fetching collation took too long, starting parallel download for next collator as well."
);
dequeue_next_collation_and_fetch(&mut ctx, &mut state, relay_parent, collator_id).await;
}
Expand Down