From 5d1b3936109f501203ffd68ab8a7c0ef627b5823 Mon Sep 17 00:00:00 2001 From: Andreas Fackler Date: Fri, 1 Nov 2024 16:00:16 +0100 Subject: [PATCH] Deliver messages to untracked publisher chains. (#2768) * Fix subscriptions to untracked chains. * Update linera-core/src/chain_worker/state/mod.rs Co-authored-by: Andre da Silva Signed-off-by: Mathieu Baudet <1105398+ma2bd@users.noreply.github.com> --------- Signed-off-by: Mathieu Baudet <1105398+ma2bd@users.noreply.github.com> Co-authored-by: Mathieu Baudet <1105398+ma2bd@users.noreply.github.com> Co-authored-by: Andre da Silva --- linera-core/src/chain_worker/state/mod.rs | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/linera-core/src/chain_worker/state/mod.rs b/linera-core/src/chain_worker/state/mod.rs index 9c19d3a9015..ec88929db1a 100644 --- a/linera-core/src/chain_worker/state/mod.rs +++ b/linera-core/src/chain_worker/state/mod.rs @@ -418,10 +418,22 @@ where let mut heights_by_recipient = BTreeMap::<_, BTreeMap<_, _>>::new(); let mut targets = self.chain.outboxes.indices().await?; if let Some(tracked_chains) = self.tracked_chains.as_ref() { + let publishers = self + .chain + .execution_state + .system + .subscriptions + .indices() + .await? + .iter() + .map(|subscription| subscription.chain_id) + .collect::>(); let tracked_chains = tracked_chains .read() .expect("Panics should not happen while holding a lock to `tracked_chains`"); - targets.retain(|target| tracked_chains.contains(&target.recipient)); + targets.retain(|target| { + tracked_chains.contains(&target.recipient) || publishers.contains(&target.recipient) + }); } let outboxes = self.chain.outboxes.try_load_entries(&targets).await?; for (target, outbox) in targets.into_iter().zip(outboxes) {