mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-05-31 15:41:02 +00:00
refactor+feat: allow subsystems to send only declared messages, generate graphviz (#5314)
Closes #3774 Closes #3826
This commit is contained in:
committed by
GitHub
parent
26340b9054
commit
511891dcce
@@ -71,11 +71,7 @@ struct NoteCandidate<Spawner> {
|
||||
|
||||
impl<Sender, Spawner> MessageInterceptor<Sender> for NoteCandidate<Spawner>
|
||||
where
|
||||
Sender: overseer::SubsystemSender<AllMessages>
|
||||
+ overseer::SubsystemSender<CandidateBackingMessage>
|
||||
+ Clone
|
||||
+ Send
|
||||
+ 'static,
|
||||
Sender: overseer::CandidateBackingSenderTrait + Clone + Send + 'static,
|
||||
Spawner: SpawnNamed + Clone + 'static,
|
||||
{
|
||||
type Message = CandidateBackingMessage;
|
||||
@@ -219,20 +215,21 @@ where
|
||||
}
|
||||
}
|
||||
|
||||
fn intercept_outgoing(&self, msg: AllMessages) -> Option<AllMessages> {
|
||||
fn intercept_outgoing(
|
||||
&self,
|
||||
msg: overseer::CandidateBackingOutgoingMessages,
|
||||
) -> Option<overseer::CandidateBackingOutgoingMessages> {
|
||||
let msg = match msg {
|
||||
AllMessages::CollatorProtocol(CollatorProtocolMessage::Seconded(
|
||||
relay_parent,
|
||||
statement,
|
||||
)) => {
|
||||
overseer::CandidateBackingOutgoingMessages::CollatorProtocolMessage(
|
||||
CollatorProtocolMessage::Seconded(relay_parent, statement),
|
||||
) => {
|
||||
// `parachain::collator-protocol: received an unexpected `CollationSeconded`: unknown statement statement=...`
|
||||
// TODO: Fix this error. We get this on colaltors because `malicious backing` creates a candidate that gets backed/included.
|
||||
// It is harmless for test parachain collators, but it will prevent cumulus based collators to make progress
|
||||
// as they wait for the relay chain to confirm the seconding of the collation.
|
||||
AllMessages::CollatorProtocol(CollatorProtocolMessage::Seconded(
|
||||
relay_parent,
|
||||
statement,
|
||||
))
|
||||
overseer::CandidateBackingOutgoingMessages::CollatorProtocolMessage(
|
||||
CollatorProtocolMessage::Seconded(relay_parent, statement),
|
||||
)
|
||||
},
|
||||
msg => msg,
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user