Skip to content

Commit 75173f8

Browse files
sistemdgithub-actions[bot]bkchr
authored
fix: parachain informant (#9581)
Closes #9559. The parachain informant was logging information for all parachains, not just ours. This PR fixes that by filtering the events by parachain ID. I tried adding a zombienet test for this but there isn't really a good way to do it. So I ended up only testing manually with zombienet, by creating a network of two parachains and adding some extra logging to ensure that the events are now being filtered out correctly. --------- Co-authored-by: cmd[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Bastian Köcher <[email protected]>
1 parent 01abd9e commit 75173f8

File tree

2 files changed

+22
-3
lines changed

2 files changed

+22
-3
lines changed

cumulus/client/service/src/lib.rs

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -300,6 +300,7 @@ where
300300
.spawn("cumulus-pov-recovery", None, pov_recovery.run());
301301

302302
let parachain_informant = parachain_informant::<Block, _>(
303+
para_id,
303304
relay_chain_interface.clone(),
304305
client.clone(),
305306
prometheus_registry.map(ParachainInformantMetrics::new).transpose()?,
@@ -605,6 +606,7 @@ where
605606

606607
/// Task for logging candidate events and some related metrics.
607608
async fn parachain_informant<Block: BlockT, Client>(
609+
para_id: ParaId,
608610
relay_chain_interface: impl RelayChainInterface + Clone,
609611
client: Arc<Client>,
610612
metrics: Option<ParachainInformantMetrics>,
@@ -632,7 +634,10 @@ async fn parachain_informant<Block: BlockT, Client>(
632634
let mut timed_out_candidates = Vec::new();
633635
for event in candidate_events {
634636
match event {
635-
CandidateEvent::CandidateBacked(_, head, _, _) => {
637+
CandidateEvent::CandidateBacked(receipt, head, _, _) => {
638+
if receipt.descriptor.para_id() != para_id {
639+
continue;
640+
}
636641
let backed_block = match Block::Header::decode(&mut &head.0[..]) {
637642
Ok(header) => header,
638643
Err(e) => {
@@ -652,7 +657,10 @@ async fn parachain_informant<Block: BlockT, Client>(
652657
last_backed_block_time = Some(backed_block_time);
653658
backed_candidates.push(backed_block);
654659
},
655-
CandidateEvent::CandidateIncluded(_, head, _, _) => {
660+
CandidateEvent::CandidateIncluded(receipt, head, _, _) => {
661+
if receipt.descriptor.para_id() != para_id {
662+
continue;
663+
}
656664
let included_block = match Block::Header::decode(&mut &head.0[..]) {
657665
Ok(header) => header,
658666
Err(e) => {
@@ -670,7 +678,10 @@ async fn parachain_informant<Block: BlockT, Client>(
670678
}
671679
included_candidates.push(included_block);
672680
},
673-
CandidateEvent::CandidateTimedOut(_, head, _) => {
681+
CandidateEvent::CandidateTimedOut(receipt, head, _) => {
682+
if receipt.descriptor.para_id() != para_id {
683+
continue;
684+
}
674685
let timed_out_block = match Block::Header::decode(&mut &head.0[..]) {
675686
Ok(header) => header,
676687
Err(e) => {

prdoc/pr_9581.prdoc

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
title: 'fix: parachain informant'
2+
doc:
3+
- audience: Node Operator
4+
description: |-
5+
The parachain informant was logging information for all parachains, not just ours. This PR fixes that by filtering the events by parachain ID.
6+
crates:
7+
- name: cumulus-client-service
8+
bump: patch

0 commit comments

Comments
 (0)