diff --git a/linera-client/src/chain_listener.rs b/linera-client/src/chain_listener.rs index 91bb62accd25..4e976680c27c 100644 --- a/linera-client/src/chain_listener.rs +++ b/linera-client/src/chain_listener.rs @@ -16,7 +16,7 @@ use linera_base::{ }; use linera_chain::data_types::OutgoingMessage; use linera_core::{ - client::ChainClient, + client::{ChainClient, ChainClientError}, node::{LocalValidatorNodeProvider, ValidatorNode, ValidatorNodeProvider}, worker::Reason, }; @@ -183,7 +183,8 @@ where continue; } debug!("Processing inbox"); - match client.process_inbox_if_owned().await { + match client.process_inbox_without_prepare().await { + Err(ChainClientError::CannotFindKeyForChain(_)) => continue, Err(error) => { warn!(%error, "Failed to process inbox."); timeout = Timestamp::from(u64::MAX); diff --git a/linera-core/src/client.rs b/linera-core/src/client.rs index 1eb56009f653..441af2f1ef0a 100644 --- a/linera-core/src/client.rs +++ b/linera-core/src/client.rs @@ -2687,8 +2687,8 @@ where } #[tracing::instrument(level = "trace")] - /// Creates blocks without any operations to process all incoming messages. This may require - /// several blocks. + /// Synchronizes the chain with the validators and creates blocks without any operations to + /// process all incoming messages. This may require several blocks. /// /// If not all certificates could be processed due to a timeout, the timestamp for when to retry /// is returned, too. @@ -2696,6 +2696,18 @@ where &self, ) -> Result<(Vec, Option), ChainClientError> { self.prepare_chain().await?; + self.process_inbox_without_prepare().await + } + + #[tracing::instrument(level = "trace")] + /// Creates blocks without any operations to process all incoming messages. This may require + /// several blocks. + /// + /// If not all certificates could be processed due to a timeout, the timestamp for when to retry + /// is returned, too. + pub async fn process_inbox_without_prepare( + &self, + ) -> Result<(Vec, Option), ChainClientError> { let mut certificates = Vec::new(); loop { let incoming_bundles = self.pending_message_bundles().await?; @@ -2713,21 +2725,6 @@ where } } - #[tracing::instrument(level = "trace")] - /// Creates blocks without any operations to process all incoming messages. This may require - /// several blocks. - /// - /// If we are not a chain owner, this doesn't fail, and just returns an empty list. - pub async fn process_inbox_if_owned( - &self, - ) -> Result<(Vec, Option), ChainClientError> { - match self.process_inbox().await { - Ok(result) => Ok(result), - Err(ChainClientError::CannotFindKeyForChain(_)) => Ok((Vec::new(), None)), - Err(error) => Err(error), - } - } - #[tracing::instrument(level = "trace")] /// Starts listening to the admin chain for new committees. (This is only useful for /// other genesis chains or for testing.)