Break cycle collator-procol - backing (#5883)

This commit is contained in:
Robert Klotzner
2022-08-16 17:31:12 +02:00
committed by GitHub
parent 05a7966505
commit 16a356524b
+16 -7
View File
@@ -811,17 +811,22 @@ impl<Context> CandidateBackingJob<Context> {
.sign_import_and_distribute_statement(ctx, statement, root_span) .sign_import_and_distribute_statement(ctx, statement, root_span)
.await? .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, self.parent,
stmt, stmt,
)) ));
.await;
} }
} }
}, },
Err(candidate) => { Err(candidate) => {
ctx.send_message(CollatorProtocolMessage::Invalid(self.parent, candidate)) // Break cycle - bounded as there is only one candidate to
.await; // second per block.
ctx.send_unbounded_message(CollatorProtocolMessage::Invalid(
self.parent,
candidate,
));
}, },
} }
}, },
@@ -911,8 +916,12 @@ impl<Context> CandidateBackingJob<Context> {
.as_ref() .as_ref()
.map_or(false, |c| c != &candidate.descriptor().collator) .map_or(false, |c| c != &candidate.descriptor().collator)
{ {
ctx.send_message(CollatorProtocolMessage::Invalid(self.parent, candidate.clone())) // Break cycle - bounded as there is only one candidate to
.await; // second per block.
ctx.send_unbounded_message(CollatorProtocolMessage::Invalid(
self.parent,
candidate.clone(),
));
return Ok(()) return Ok(())
} }