@@ -10,7 +10,7 @@ use std::{
10
10
11
11
use super :: authority_per_epoch_store:: AuthorityPerEpochStore ;
12
12
use crate :: consensus_adapter:: SubmitToConsensus ;
13
- use governor:: { Quota , RateLimiter } ;
13
+ use governor:: { clock :: MonotonicClock , Quota , RateLimiter } ;
14
14
use itertools:: Itertools ;
15
15
use lru:: LruCache ;
16
16
use mysten_common:: debug_fatal;
@@ -54,7 +54,10 @@ pub struct ExecutionTimeObserver {
54
54
sharing_rate_limiter : RateLimiter <
55
55
governor:: state:: NotKeyed ,
56
56
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
+ > ,
58
61
> ,
59
62
}
60
63
@@ -95,9 +98,10 @@ impl ExecutionTimeObserver {
95
98
consensus_adapter,
96
99
local_observations : LruCache :: new ( config. observation_cache_size ( ) ) ,
97
100
object_utilization_tracker : LruCache :: new ( config. object_utilization_cache_size ( ) ) ,
98
- sharing_rate_limiter : RateLimiter :: direct (
101
+ sharing_rate_limiter : RateLimiter :: direct_with_clock (
99
102
Quota :: per_second ( config. observation_sharing_rate_limit ( ) )
100
103
. allow_burst ( config. observation_sharing_burst_limit ( ) ) ,
104
+ & MonotonicClock ,
101
105
) ,
102
106
protocol_params,
103
107
config,
@@ -136,7 +140,10 @@ impl ExecutionTimeObserver {
136
140
} ,
137
141
local_observations : LruCache :: new ( NonZeroUsize :: new ( 10000 ) . unwrap ( ) ) ,
138
142
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
+ ) ,
140
147
}
141
148
}
142
149
0 commit comments