From 16a356524bdcfc4e7622ac1390d29f077f550651 Mon Sep 17 00:00:00 2001 From: Robert Klotzner Date: Tue, 16 Aug 2022 17:31:12 +0200 Subject: [PATCH] Break cycle collator-procol - backing (#5883) --- polkadot/node/core/backing/src/lib.rs | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/polkadot/node/core/backing/src/lib.rs b/polkadot/node/core/backing/src/lib.rs index 01c2a61485..dbc6e3f819 100644 --- a/polkadot/node/core/backing/src/lib.rs +++ b/polkadot/node/core/backing/src/lib.rs @@ -811,17 +811,22 @@ impl CandidateBackingJob { .sign_import_and_distribute_statement(ctx, statement, root_span) .await? { - ctx.send_message(CollatorProtocolMessage::Seconded( + // Break cycle - bounded as there is only one candidate to + // second per block. + ctx.send_unbounded_message(CollatorProtocolMessage::Seconded( self.parent, stmt, - )) - .await; + )); } } }, Err(candidate) => { - ctx.send_message(CollatorProtocolMessage::Invalid(self.parent, candidate)) - .await; + // Break cycle - bounded as there is only one candidate to + // second per block. + ctx.send_unbounded_message(CollatorProtocolMessage::Invalid( + self.parent, + candidate, + )); }, } }, @@ -911,8 +916,12 @@ impl CandidateBackingJob { .as_ref() .map_or(false, |c| c != &candidate.descriptor().collator) { - ctx.send_message(CollatorProtocolMessage::Invalid(self.parent, candidate.clone())) - .await; + // Break cycle - bounded as there is only one candidate to + // second per block. + ctx.send_unbounded_message(CollatorProtocolMessage::Invalid( + self.parent, + candidate.clone(), + )); return Ok(()) }