Skip to content

Commit

Permalink
[consensus] trigger sync based on remote LI timestamp
Browse files Browse the repository at this point in the history
  • Loading branch information
ibalajiarun committed Nov 22, 2024
1 parent 9060dee commit af0b055
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions consensus/src/block_storage/sync_manager.rs
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,13 @@ impl BlockStore {
&& !self.block_exists(li.commit_info().id()))
|| self.commit_root().round() + 30.max(2 * self.vote_back_pressure_limit)
< li.commit_info().round()
// If the LI commit block timestamp is more than 30 secs ahead of self commit block
// timestamp, sync to the ledger info
|| li
.commit_info()
.timestamp_usecs()
.saturating_sub(self.commit_root().timestamp_usecs())
>= Duration::from_secs(30).as_micros() as u64
}

/// Checks if quorum certificate can be inserted in block store without RPC
Expand Down

0 comments on commit af0b055

Please sign in to comment.