4
4
5
5
use crate :: {
6
6
block_storage:: {
7
+ tracing:: { observe_block, BlockStage } ,
7
8
BlockStore ,
8
- tracing:: { BlockStage , observe_block} ,
9
9
} ,
10
10
counters,
11
11
dag:: { DagBootstrapper , DagCommitSigner , StorageAdapter } ,
12
- error:: { DbError , error_kind } ,
12
+ error:: { error_kind , DbError } ,
13
13
liveness:: {
14
14
cached_proposer_election:: CachedProposerElection ,
15
15
leader_reputation:: {
16
- AptosDBBackend , extract_epoch_to_proposers , LeaderReputation ,
16
+ extract_epoch_to_proposers , AptosDBBackend , LeaderReputation ,
17
17
ProposerAndVoterHeuristic , ReputationHeuristic ,
18
18
} ,
19
19
proposal_generator:: {
@@ -28,15 +28,12 @@ use crate::{
28
28
metrics_safety_rules:: MetricsSafetyRules ,
29
29
monitor,
30
30
network:: {
31
- IncomingBatchRetrievalRequest , IncomingBlockRetrievalRequest ,
32
- IncomingDAGRequest ,
33
- IncomingRandGenRequest ,
34
- IncomingRpcRequest ,
35
- NetworkReceivers , NetworkSender ,
31
+ IncomingBatchRetrievalRequest , IncomingBlockRetrievalRequest , IncomingDAGRequest ,
32
+ IncomingRandGenRequest , IncomingRpcRequest , NetworkReceivers , NetworkSender ,
36
33
} ,
37
34
network_interface:: { ConsensusMsg , ConsensusNetworkClient } ,
38
35
payload_client:: {
39
- mixed:: MixedPayloadClient , PayloadClient , user:: quorum_store_client:: QuorumStoreClient ,
36
+ mixed:: MixedPayloadClient , user:: quorum_store_client:: QuorumStoreClient , PayloadClient ,
40
37
} ,
41
38
payload_manager:: PayloadManager ,
42
39
persistent_liveness_storage:: { LedgerRecoveryData , PersistentLivenessStorage , RecoveryData } ,
@@ -54,7 +51,7 @@ use crate::{
54
51
round_manager:: { RoundManager , UnverifiedEvent , VerifiedEvent } ,
55
52
util:: time_service:: TimeService ,
56
53
} ;
57
- use anyhow:: { anyhow, bail, Context , ensure } ;
54
+ use anyhow:: { anyhow, bail, ensure , Context } ;
58
55
use aptos_bounded_executor:: BoundedExecutor ;
59
56
use aptos_channels:: { aptos_channel, message_queues:: QueueStyle } ;
60
57
use aptos_config:: config:: {
@@ -66,7 +63,7 @@ use aptos_consensus_types::{
66
63
epoch_retrieval:: EpochRetrievalRequest ,
67
64
} ;
68
65
use aptos_dkg:: {
69
- pvss:: { Player , traits:: Transcript } ,
66
+ pvss:: { traits:: Transcript , Player } ,
70
67
weighted_vuf:: traits:: WeightedVUF ,
71
68
} ;
72
69
use aptos_event_notifications:: ReconfigNotificationListener ;
@@ -79,27 +76,27 @@ use aptos_safety_rules::SafetyRulesManager;
79
76
use aptos_secure_storage:: { KVStorage , Storage } ;
80
77
use aptos_types:: {
81
78
account_address:: AccountAddress ,
82
- dkg:: { DefaultDKG , DKGState , DKGTrait , real_dkg :: maybe_dk_from_bls_sk } ,
79
+ dkg:: { real_dkg :: maybe_dk_from_bls_sk , DKGState , DKGTrait , DefaultDKG } ,
83
80
epoch_change:: EpochChangeProof ,
84
81
epoch_state:: EpochState ,
85
82
on_chain_config:: {
86
- Features , LeaderReputationType , OnChainConfigPayload , OnChainConfigProvider ,
83
+ FeatureFlag , Features , LeaderReputationType , OnChainConfigPayload , OnChainConfigProvider ,
87
84
OnChainConsensusConfig , OnChainExecutionConfig , ProposerElectionType , ValidatorSet ,
88
85
} ,
89
- randomness:: { RandKeys , WVUF , WvufPP } ,
86
+ randomness:: { RandKeys , WvufPP , WVUF } ,
90
87
} ;
91
88
use aptos_validator_transaction_pool:: VTxnPoolState ;
92
89
use fail:: fail_point;
93
90
use futures:: {
94
91
channel:: {
95
92
mpsc,
96
- mpsc:: { Sender , unbounded , UnboundedSender } ,
93
+ mpsc:: { unbounded , Sender , UnboundedSender } ,
97
94
oneshot,
98
95
} ,
99
96
SinkExt , StreamExt ,
100
97
} ;
101
98
use itertools:: Itertools ;
102
- use rand:: { prelude:: StdRng , SeedableRng , thread_rng } ;
99
+ use rand:: { prelude:: StdRng , thread_rng , SeedableRng } ;
103
100
use std:: {
104
101
cmp:: Ordering ,
105
102
collections:: HashMap ,
@@ -108,7 +105,6 @@ use std::{
108
105
sync:: Arc ,
109
106
time:: Duration ,
110
107
} ;
111
- use aptos_types:: on_chain_config:: FeatureFlag ;
112
108
113
109
/// Range of rounds (window) that we might be calling proposer election
114
110
/// functions with at any given time, in addition to the proposer history length.
@@ -341,9 +337,9 @@ impl<P: OnChainConfigProvider> EpochManager<P> {
341
337
LeaderReputationType :: ProposerAndVoter ( proposer_and_voter_config)
342
338
| LeaderReputationType :: ProposerAndVoterV2 ( proposer_and_voter_config) => {
343
339
let proposer_window_size = proposers. len ( )
344
- * proposer_and_voter_config. proposer_window_num_validators_multiplier ;
340
+ * proposer_and_voter_config. proposer_window_num_validators_multiplier ;
345
341
let voter_window_size = proposers. len ( )
346
- * proposer_and_voter_config. voter_window_num_validators_multiplier ;
342
+ * proposer_and_voter_config. voter_window_num_validators_multiplier ;
347
343
let heuristic: Box < dyn ReputationHeuristic > =
348
344
Box :: new ( ProposerAndVoterHeuristic :: new (
349
345
self . author ,
@@ -820,7 +816,8 @@ impl<P: OnChainConfigProvider> EpochManager<P> {
820
816
821
817
let safety_rules_container = Arc :: new ( Mutex :: new ( safety_rules) ) ;
822
818
823
- self . rand_manager_msg_tx = self . execution_client
819
+ self . rand_manager_msg_tx = self
820
+ . execution_client
824
821
. start_epoch (
825
822
epoch_state. clone ( ) ,
826
823
safety_rules_container. clone ( ) ,
@@ -1027,7 +1024,10 @@ impl<P: OnChainConfigProvider> EpochManager<P> {
1027
1024
epoch : payload. epoch ( ) ,
1028
1025
verifier : ( & validator_set) . into ( ) ,
1029
1026
} ) ;
1030
- debug ! ( epoch = epoch_state. epoch, "EpochManager::star_new_epoch() starting." ) ;
1027
+ debug ! (
1028
+ epoch = epoch_state. epoch,
1029
+ "EpochManager::star_new_epoch() starting."
1030
+ ) ;
1031
1031
1032
1032
self . epoch_state = Some ( epoch_state. clone ( ) ) ;
1033
1033
@@ -1185,7 +1185,8 @@ impl<P: OnChainConfigProvider> EpochManager<P> {
1185
1185
"decoupled execution must be enabled"
1186
1186
) ;
1187
1187
1188
- self . rand_manager_msg_tx = self . execution_client
1188
+ self . rand_manager_msg_tx = self
1189
+ . execution_client
1189
1190
. start_epoch (
1190
1191
epoch_state. clone ( ) ,
1191
1192
commit_signer,
0 commit comments