Skip to content

Commit

Permalink
[consensus adapter] Max cap for estimated network latency (MystenLabs…
Browse files Browse the repository at this point in the history
  • Loading branch information
andll authored Apr 2, 2023
1 parent a8bc827 commit d5ab929
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions crates/sui-core/src/consensus_adapter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -376,8 +376,10 @@ impl ConsensusAdapter {
let (position, mapped_to_low_scoring) =
self.submission_position(committee, tx_digest);
const DEFAULT_LATENCY: Duration = Duration::from_secs(5);
const MAX_LATENCY: Duration = Duration::from_secs(5 * 60);
let latency = self.latency_observer.latency().unwrap_or(DEFAULT_LATENCY);
let latency = std::cmp::max(latency, DEFAULT_LATENCY);
let latency = std::cmp::min(latency, MAX_LATENCY);
self.metrics
.sequencing_estimated_latency
.set(latency.as_millis() as i64);
Expand Down

0 comments on commit d5ab929

Please sign in to comment.