Skip to content

Commit

Permalink
perf: skip the timed batch proposal if round progression already trig…
Browse files Browse the repository at this point in the history
…gered one

Signed-off-by: ljedrz <[email protected]>
  • Loading branch information
ljedrz committed Feb 21, 2024
1 parent ed65ff3 commit c1fafe8
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions node/bft/src/primary.rs
Original file line number Diff line number Diff line change
Expand Up @@ -900,6 +900,11 @@ impl<N: Network> Primary<N> {
debug!("Skipping batch proposal {}", "(node is syncing)".dimmed());
continue;
}
// A best-effort attempt to skip the scheduled batch proposal if
// round progression already triggered one.
if self_.propose_lock.try_lock().is_err() {
continue;
};
// If there is no proposed batch, attempt to propose a batch.
// Note: Do NOT spawn a task around this function call. Proposing a batch is a critical path,
// and only one batch needs be proposed at a time.
Expand Down

0 comments on commit c1fafe8

Please sign in to comment.