Improve dispute-coordinator message burstiness handling (#5471)

* Increase message channel size to 2048

Signed-off-by: Andrei Sandu <andrei-mihail@parity.io>

* Use unbounded channel for reading data

Signed-off-by: Andrei Sandu <andrei-mihail@parity.io>
This commit is contained in:
Andrei Sandu
2022-05-09 13:00:05 +03:00
committed by GitHub
parent 992705d127
commit e29d8e91da
3 changed files with 14 additions and 11 deletions
+6 -4
View File
@@ -599,7 +599,8 @@ async fn request_disputes(
RequestType::Recent => DisputeCoordinatorMessage::RecentDisputes(tx),
RequestType::Active => DisputeCoordinatorMessage::ActiveDisputes(tx),
};
sender.send_message(msg.into()).await;
// Bounded by block production - `ProvisionerMessage::RequestInherentData`.
sender.send_unbounded_message(msg.into());
let recent_disputes = match rx.await {
Ok(r) => r,
@@ -617,9 +618,10 @@ async fn request_votes(
disputes_to_query: Vec<(SessionIndex, CandidateHash)>,
) -> Vec<(SessionIndex, CandidateHash, CandidateVotes)> {
let (tx, rx) = oneshot::channel();
sender
.send_message(DisputeCoordinatorMessage::QueryCandidateVotes(disputes_to_query, tx).into())
.await;
// Bounded by block production - `ProvisionerMessage::RequestInherentData`.
sender.send_unbounded_message(
DisputeCoordinatorMessage::QueryCandidateVotes(disputes_to_query, tx).into(),
);
match rx.await {
Ok(v) => v,