diff --git a/linera-core/src/client.rs b/linera-core/src/client.rs index 90cdb1b14d7..db9f684adca 100644 --- a/linera-core/src/client.rs +++ b/linera-core/src/client.rs @@ -633,9 +633,9 @@ where let certificate = self .communicate_chain_action(committee, submit_action, value) .await?; + self.process_certificate(certificate.clone(), vec![], vec![]) + .await?; if certificate.value().is_confirmed() { - self.process_certificate(certificate.clone(), vec![], vec![]) - .await?; Ok(certificate) } else { self.finalize_block(committee, certificate).await diff --git a/linera-core/src/unit_tests/client_tests.rs b/linera-core/src/unit_tests/client_tests.rs index 13ee433b103..16a9aa7d4cb 100644 --- a/linera-core/src/unit_tests/client_tests.rs +++ b/linera-core/src/unit_tests/client_tests.rs @@ -41,6 +41,7 @@ use crate::{ node::{ CrossChainMessageDelivery, NodeError::{self, ClientIoError}, + ValidatorNode, }, test_utils::{FaultType, MemoryStorageBuilder, StorageBuilder, TestBuilder}, updater::CommunicationError, @@ -1810,6 +1811,25 @@ where .burn(None, Amount::from_tokens(3), UserData::default()) .await; assert!(result.is_err()); + let manager = client0 + .chain_info_with_manager_values() + .await + .unwrap() + .manager; + // Validator 0 may or may not have processed the validated block before the update was + // canceled due to the errors from the faulty validators. Submit it again to make sure + // it's there, so that client 1 can download and re-propose it later. + let validated_block_certificate = manager.highest_validated().unwrap().clone(); + builder + .node(0) + .handle_certificate( + validated_block_certificate, + Vec::new(), + Vec::new(), + CrossChainMessageDelivery::Blocking, + ) + .await + .unwrap(); // Client 1 wants to burn 2 tokens. They learn about the proposal in round 0, but now the // validator 0 is offline, so they don't learn about the validated block and make their own diff --git a/linera-core/src/unit_tests/test_utils.rs b/linera-core/src/unit_tests/test_utils.rs index 3c829f2a410..8e0ea208cd1 100644 --- a/linera-core/src/unit_tests/test_utils.rs +++ b/linera-core/src/unit_tests/test_utils.rs @@ -602,6 +602,10 @@ where self.validator_clients.iter().cloned().collect() } + pub fn node(&mut self, index: usize) -> &mut LocalValidatorClient { + &mut self.validator_clients[index] + } + pub async fn make_storage(&mut self) -> anyhow::Result { Ok(self .genesis_storage_builder