diff --git a/crates/sui-core/src/authority_active.rs b/crates/sui-core/src/authority_active.rs index 65313075658d7..6cca383b370ca 100644 --- a/crates/sui-core/src/authority_active.rs +++ b/crates/sui-core/src/authority_active.rs @@ -205,12 +205,12 @@ where A: AuthorityAPI + Send + Sync + 'static + Clone, { pub async fn spawn_checkpoint_process(self) { - self._spawn_checkpoint_process(Some(CheckpointProcessControl::default())) + self.spawn_checkpoint_process_with_config(Some(CheckpointProcessControl::default())) .await } /// Spawn all active tasks. - pub async fn _spawn_checkpoint_process( + pub async fn spawn_checkpoint_process_with_config( self, checkpoint_process_control: Option, ) { diff --git a/crates/sui-core/src/authority_active/checkpoint_driver/tests.rs b/crates/sui-core/src/authority_active/checkpoint_driver/tests.rs index 4b99a9b76de85..4e681684fd5ec 100644 --- a/crates/sui-core/src/authority_active/checkpoint_driver/tests.rs +++ b/crates/sui-core/src/authority_active/checkpoint_driver/tests.rs @@ -110,7 +110,7 @@ async fn checkpoint_active_flow_crash_client_with_gossip() { .unwrap(); // Spin the gossip service. active_state - ._spawn_checkpoint_process(Some(CheckpointProcessControl::default())) + .spawn_checkpoint_process_with_config(Some(CheckpointProcessControl::default())) .await; }); } @@ -198,7 +198,7 @@ async fn checkpoint_active_flow_crash_client_no_gossip() { .unwrap(); // Spin the gossip service. active_state - ._spawn_checkpoint_process(Some(CheckpointProcessControl::default())) + .spawn_checkpoint_process_with_config(Some(CheckpointProcessControl::default())) .await; }); } diff --git a/crates/sui-core/src/authority_active/gossip/mod.rs b/crates/sui-core/src/authority_active/gossip/mod.rs index a060fe6ea9229..38bc7230dc593 100644 --- a/crates/sui-core/src/authority_active/gossip/mod.rs +++ b/crates/sui-core/src/authority_active/gossip/mod.rs @@ -269,27 +269,25 @@ where Some(Ok(BatchInfoResponseItem(UpdateItem::Batch(signed_batch)) )) => { let next_seq = signed_batch.batch.next_sequence_number; self.follower_store.record_next_sequence(&self.peer_name, next_seq)?; + match self.max_seq { + Some(max_seq) => { + if next_seq < max_seq { + info!("Gossip sequence number unexpected: found {:?} but previously received {:?}", next_seq, max_seq); + } + } + None => {} + } }, // Upon receiving a transaction digest, store it if it is not processed already. - Some(Ok(BatchInfoResponseItem(UpdateItem::Transaction((seq, digest))))) => { + Some(Ok(BatchInfoResponseItem(UpdateItem::Transaction((_seq, digest))))) => { if !self.state.database.effects_exists(&digest.transaction)? { queue.push(async move { tokio::time::sleep(Duration::from_millis(EACH_ITEM_DELAY_MS)).await; digest }); self.state.metrics.gossip_queued_count.inc(); - - } - match self.max_seq { - Some(max_seq) => { - if seq < max_seq { - info!("Gossip sequence number unexpected: found {:?} but previously received {:?}", seq, max_seq); - } - } - None => {} } - self.max_seq = Some(seq + 1); }, // Return any errors. diff --git a/crates/sui/tests/checkpoints_tests.rs b/crates/sui/tests/checkpoints_tests.rs index dcdfa9d5e1b74..eef1832cb3f1b 100644 --- a/crates/sui/tests/checkpoints_tests.rs +++ b/crates/sui/tests/checkpoints_tests.rs @@ -149,7 +149,7 @@ async fn end_to_end() { ..CheckpointProcessControl::default() }; active_state - ._spawn_checkpoint_process(Some(checkpoint_process_control)) + .spawn_checkpoint_process_with_config(Some(checkpoint_process_control)) .await }); } @@ -230,7 +230,7 @@ async fn checkpoint_with_shared_objects() { ..CheckpointProcessControl::default() }; active_state - ._spawn_checkpoint_process(Some(checkpoint_process_control)) + .spawn_checkpoint_process_with_config(Some(checkpoint_process_control)) .await }); }