Skip to content

Commit 668a8f0

Browse files
committed
Disable use of quanta clock
1 parent e65a07f commit 668a8f0

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

crates/sui-core/src/authority/execution_time_estimator.rs

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ use std::{
1010

1111
use super::authority_per_epoch_store::AuthorityPerEpochStore;
1212
use crate::consensus_adapter::SubmitToConsensus;
13-
use governor::{Quota, RateLimiter};
13+
use governor::{clock::MonotonicClock, Quota, RateLimiter};
1414
use itertools::Itertools;
1515
use lru::LruCache;
1616
use mysten_common::debug_fatal;
@@ -54,7 +54,10 @@ pub struct ExecutionTimeObserver {
5454
sharing_rate_limiter: RateLimiter<
5555
governor::state::NotKeyed,
5656
governor::state::InMemoryState,
57-
governor::clock::DefaultClock,
57+
governor::clock::MonotonicClock,
58+
governor::middleware::NoOpMiddleware<
59+
<governor::clock::MonotonicClock as governor::clock::Clock>::Instant,
60+
>,
5861
>,
5962
}
6063

@@ -95,9 +98,10 @@ impl ExecutionTimeObserver {
9598
consensus_adapter,
9699
local_observations: LruCache::new(config.observation_cache_size()),
97100
object_utilization_tracker: LruCache::new(config.object_utilization_cache_size()),
98-
sharing_rate_limiter: RateLimiter::direct(
101+
sharing_rate_limiter: RateLimiter::direct_with_clock(
99102
Quota::per_second(config.observation_sharing_rate_limit())
100103
.allow_burst(config.observation_sharing_burst_limit()),
104+
&MonotonicClock,
101105
),
102106
protocol_params,
103107
config,
@@ -136,7 +140,10 @@ impl ExecutionTimeObserver {
136140
},
137141
local_observations: LruCache::new(NonZeroUsize::new(10000).unwrap()),
138142
object_utilization_tracker: LruCache::new(NonZeroUsize::new(50000).unwrap()),
139-
sharing_rate_limiter: RateLimiter::direct(Quota::per_hour(std::num::NonZeroU32::MAX)),
143+
sharing_rate_limiter: RateLimiter::direct_with_clock(
144+
Quota::per_hour(std::num::NonZeroU32::MAX),
145+
&MonotonicClock,
146+
),
140147
}
141148
}
142149

0 commit comments

Comments
 (0)