@@ -127,8 +127,7 @@ impl ExecutionTimeObserver {
127
127
}
128
128
Some ( ( tx, timings, total_duration) ) = rx_local_execution_time. recv( ) => {
129
129
observer
130
- . record_local_observations( & tx, & timings, total_duration)
131
- . await ;
130
+ . record_local_observations( & tx, & timings, total_duration) ;
132
131
}
133
132
else => { break }
134
133
}
@@ -173,7 +172,7 @@ impl ExecutionTimeObserver {
173
172
// Updates moving averages and submits observation to consensus if local observation differs
174
173
// from consensus median.
175
174
// TODO: Consider more detailed heuristic to account for overhead outside of commands.
176
- async fn record_local_observations (
175
+ fn record_local_observations (
177
176
& mut self ,
178
177
tx : & ProgrammableTransaction ,
179
178
timings : & [ ExecutionTiming ] ,
@@ -320,10 +319,10 @@ impl ExecutionTimeObserver {
320
319
}
321
320
322
321
// Share new observations.
323
- self . share_observations ( to_share) . await ;
322
+ self . share_observations ( to_share) ;
324
323
}
325
324
326
- async fn share_observations ( & mut self , to_share : Vec < ( ExecutionTimeObservationKey , Duration ) > ) {
325
+ fn share_observations ( & mut self , to_share : Vec < ( ExecutionTimeObservationKey , Duration ) > ) {
327
326
if to_share. is_empty ( ) {
328
327
return ;
329
328
}
@@ -670,9 +669,7 @@ mod tests {
670
669
// Record an observation
671
670
let timings = vec ! [ ExecutionTiming :: Success ( Duration :: from_millis( 100 ) ) ] ;
672
671
let total_duration = Duration :: from_millis ( 110 ) ;
673
- observer
674
- . record_local_observations ( & ptb, & timings, total_duration)
675
- . await ;
672
+ observer. record_local_observations ( & ptb, & timings, total_duration) ;
676
673
677
674
let key = ExecutionTimeObservationKey :: MoveEntryPoint {
678
675
package,
@@ -693,9 +690,7 @@ mod tests {
693
690
// Record another observation
694
691
let timings = vec ! [ ExecutionTiming :: Success ( Duration :: from_millis( 110 ) ) ] ;
695
692
let total_duration = Duration :: from_millis ( 120 ) ;
696
- observer
697
- . record_local_observations ( & ptb, & timings, total_duration)
698
- . await ;
693
+ observer. record_local_observations ( & ptb, & timings, total_duration) ;
699
694
700
695
// Check that moving average was updated
701
696
let local_obs = observer. local_observations . get ( & key) . unwrap ( ) ;
@@ -710,9 +705,7 @@ mod tests {
710
705
// Record another observation
711
706
let timings = vec ! [ ExecutionTiming :: Success ( Duration :: from_millis( 120 ) ) ] ;
712
707
let total_duration = Duration :: from_millis ( 130 ) ;
713
- observer
714
- . record_local_observations ( & ptb, & timings, total_duration)
715
- . await ;
708
+ observer. record_local_observations ( & ptb, & timings, total_duration) ;
716
709
717
710
// Check that moving average was updated
718
711
let local_obs = observer. local_observations . get ( & key) . unwrap ( ) ;
@@ -738,9 +731,7 @@ mod tests {
738
731
// Record last observation
739
732
let timings = vec ! [ ExecutionTiming :: Success ( Duration :: from_millis( 120 ) ) ] ;
740
733
let total_duration = Duration :: from_millis ( 120 ) ;
741
- observer
742
- . record_local_observations ( & ptb, & timings, total_duration)
743
- . await ;
734
+ observer. record_local_observations ( & ptb, & timings, total_duration) ;
744
735
745
736
// Verify that moving average is the same and a new observation was shared, as
746
737
// enough time has now elapsed
@@ -818,9 +809,7 @@ mod tests {
818
809
ExecutionTiming :: Success ( Duration :: from_millis( 50 ) ) ,
819
810
] ;
820
811
let total_duration = Duration :: from_millis ( 180 ) ;
821
- observer
822
- . record_local_observations ( & ptb, & timings, total_duration)
823
- . await ;
812
+ observer. record_local_observations ( & ptb, & timings, total_duration) ;
824
813
825
814
// Check that both commands were recorded
826
815
let move_key = ExecutionTimeObservationKey :: MoveEntryPoint {
@@ -917,9 +906,7 @@ mod tests {
917
906
918
907
// First observation - should not share due to low utilization
919
908
let timings = vec ! [ ExecutionTiming :: Success ( Duration :: from_secs( 1 ) ) ] ;
920
- observer
921
- . record_local_observations ( & ptb, & timings, Duration :: from_secs ( 2 ) )
922
- . await ;
909
+ observer. record_local_observations ( & ptb, & timings, Duration :: from_secs ( 2 ) ) ;
923
910
assert ! ( observer
924
911
. local_observations
925
912
. get( & key)
@@ -929,9 +916,7 @@ mod tests {
929
916
930
917
// Second observation - no time has passed, so now utilization is high; should share
931
918
let timings = vec ! [ ExecutionTiming :: Success ( Duration :: from_secs( 1 ) ) ] ;
932
- observer
933
- . record_local_observations ( & ptb, & timings, Duration :: from_secs ( 2 ) )
934
- . await ;
919
+ observer. record_local_observations ( & ptb, & timings, Duration :: from_secs ( 2 ) ) ;
935
920
assert_eq ! (
936
921
observer
937
922
. local_observations
@@ -947,9 +932,7 @@ mod tests {
947
932
// when accounting for the new observation; should share
948
933
tokio:: time:: advance ( Duration :: from_secs ( 5 ) ) . await ;
949
934
let timings = vec ! [ ExecutionTiming :: Success ( Duration :: from_secs( 3 ) ) ] ;
950
- observer
951
- . record_local_observations ( & ptb, & timings, Duration :: from_secs ( 5 ) )
952
- . await ;
935
+ observer. record_local_observations ( & ptb, & timings, Duration :: from_secs ( 5 ) ) ;
953
936
assert_eq ! (
954
937
observer
955
938
. local_observations
@@ -964,9 +947,7 @@ mod tests {
964
947
// Fourth execution after utilization drops - should not share, even though diff still high
965
948
tokio:: time:: advance ( Duration :: from_secs ( 60 ) ) . await ;
966
949
let timings = vec ! [ ExecutionTiming :: Success ( Duration :: from_secs( 11 ) ) ] ;
967
- observer
968
- . record_local_observations ( & ptb, & timings, Duration :: from_secs ( 11 ) )
969
- . await ;
950
+ observer. record_local_observations ( & ptb, & timings, Duration :: from_secs ( 11 ) ) ;
970
951
assert_eq ! (
971
952
observer
972
953
. local_observations
0 commit comments