Skip to content
This repository was archived by the owner on Nov 15, 2023. It is now read-only.

Commit 84b69e9

Browse files
committed
clean up unused import errors
1 parent c6f272d commit 84b69e9

File tree

4 files changed

+29
-85
lines changed

4 files changed

+29
-85
lines changed

client/consensus/aura/src/collator.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,7 @@ use cumulus_primitives_parachain_inherent::ParachainInherentData;
3737
use cumulus_relay_chain_interface::RelayChainInterface;
3838

3939
use polkadot_node_primitives::{Collation, MaybeCompressedPoV};
40-
use polkadot_overseer::Handle as OverseerHandle;
41-
use polkadot_primitives::{Block as PBlock, Header as PHeader, Id as ParaId};
40+
use polkadot_primitives::{Header as PHeader, Id as ParaId};
4241

4342
use futures::prelude::*;
4443
use sc_consensus::{BlockImport, BlockImportParams, ForkChoiceStrategy, StateAction};
@@ -56,7 +55,7 @@ use sp_runtime::{
5655
};
5756
use sp_state_machine::StorageChanges;
5857
use sp_timestamp::Timestamp;
59-
use std::{convert::TryFrom, error::Error, fmt::Debug, hash::Hash, sync::Arc, time::Duration};
58+
use std::{convert::TryFrom, error::Error, hash::Hash, sync::Arc, time::Duration};
6059

6160
/// Parameters for instantiating a [`Collator`].
6261
pub struct Params<BI, CIDP, RClient, Proposer, CS> {

client/consensus/aura/src/collators/basic.rs

Lines changed: 10 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -24,44 +24,28 @@
2424
2525
use codec::{Decode, Encode};
2626
use cumulus_client_collator::service::ServiceInterface as CollatorServiceInterface;
27-
use cumulus_client_consensus_common::{
28-
ParachainBlockImportMarker, ParachainCandidate, ParentSearchParams,
29-
};
27+
use cumulus_client_consensus_common::ParachainBlockImportMarker;
3028
use cumulus_client_consensus_proposer::ProposerInterface;
31-
use cumulus_primitives_core::{
32-
relay_chain::Hash as PHash, CollectCollationInfo, PersistedValidationData,
33-
};
34-
use cumulus_primitives_parachain_inherent::ParachainInherentData;
29+
use cumulus_primitives_core::CollectCollationInfo;
3530
use cumulus_relay_chain_interface::RelayChainInterface;
3631

37-
use polkadot_node_primitives::{CollationResult, MaybeCompressedPoV};
32+
use polkadot_node_primitives::CollationResult;
3833
use polkadot_overseer::Handle as OverseerHandle;
39-
use polkadot_primitives::{Block as PBlock, CollatorPair, Header as PHeader, Id as ParaId};
34+
use polkadot_primitives::{CollatorPair, Id as ParaId};
4035

4136
use futures::prelude::*;
4237
use sc_client_api::{backend::AuxStore, BlockBackend, BlockOf};
43-
use sc_consensus::{
44-
import_queue::{BasicQueue, Verifier as VerifierT},
45-
BlockImport, BlockImportParams, ForkChoiceStrategy, StateAction,
46-
};
47-
use sc_consensus_aura::standalone as aura_internal;
48-
use sc_telemetry::{telemetry, TelemetryHandle, CONSENSUS_DEBUG, CONSENSUS_TRACE};
38+
use sc_consensus::BlockImport;
4939
use sp_api::ProvideRuntimeApi;
5040
use sp_application_crypto::AppPublic;
51-
use sp_block_builder::BlockBuilder as BlockBuilderApi;
5241
use sp_blockchain::HeaderBackend;
53-
use sp_consensus::{error::Error as ConsensusError, BlockOrigin, SyncOracle};
54-
use sp_consensus_aura::{AuraApi, Slot, SlotDuration};
42+
use sp_consensus::SyncOracle;
43+
use sp_consensus_aura::{AuraApi, SlotDuration};
5544
use sp_core::crypto::Pair;
56-
use sp_inherents::{CreateInherentDataProviders, InherentData, InherentDataProvider};
45+
use sp_inherents::CreateInherentDataProviders;
5746
use sp_keystore::KeystorePtr;
58-
use sp_runtime::{
59-
generic::Digest,
60-
traits::{Block as BlockT, HashFor, Header as HeaderT, Member},
61-
};
62-
use sp_state_machine::StorageChanges;
63-
use sp_timestamp::Timestamp;
64-
use std::{convert::TryFrom, error::Error, fmt::Debug, hash::Hash, sync::Arc, time::Duration};
47+
use sp_runtime::traits::{Block as BlockT, Header as HeaderT, Member};
48+
use std::{convert::TryFrom, hash::Hash, sync::Arc, time::Duration};
6549

6650
use crate::collator as collator_util;
6751

@@ -107,8 +91,6 @@ pub async fn run<Block, P, BI, CIDP, Client, RClient, SO, Proposer, CS>(
10791
P::Public: AppPublic + Hash + Member + Encode + Decode,
10892
P::Signature: TryFrom<Vec<u8>> + Hash + Member + Encode + Decode,
10993
{
110-
let mut params = params;
111-
11294
let mut collation_requests = cumulus_client_collator::relay_chain_driven::init(
11395
params.key,
11496
params.para_id,

client/consensus/aura/src/collators/lookahead.rs

Lines changed: 11 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -34,45 +34,32 @@
3434
use codec::{Decode, Encode};
3535
use cumulus_client_collator::service::ServiceInterface as CollatorServiceInterface;
3636
use cumulus_client_consensus_common::{
37-
self as consensus_common, ParachainBlockImportMarker, ParachainCandidate, ParentSearchParams,
37+
self as consensus_common, ParachainBlockImportMarker, ParentSearchParams,
3838
};
3939
use cumulus_client_consensus_proposer::ProposerInterface;
4040
use cumulus_primitives_core::{
4141
relay_chain::Hash as PHash, CollectCollationInfo, PersistedValidationData,
4242
};
43-
use cumulus_primitives_parachain_inherent::ParachainInherentData;
4443
use cumulus_relay_chain_interface::RelayChainInterface;
4544

46-
use polkadot_node_primitives::{CollationResult, MaybeCompressedPoV};
4745
use polkadot_overseer::Handle as OverseerHandle;
48-
use polkadot_primitives::{
49-
Block as PBlock, CollatorPair, Header as PHeader, Id as ParaId, OccupiedCoreAssumption,
50-
};
46+
use polkadot_primitives::{CollatorPair, Id as ParaId, OccupiedCoreAssumption};
5147

5248
use futures::prelude::*;
5349
use sc_client_api::{backend::AuxStore, BlockBackend, BlockOf};
54-
use sc_consensus::{
55-
import_queue::{BasicQueue, Verifier as VerifierT},
56-
BlockImport, BlockImportParams, ForkChoiceStrategy, StateAction,
57-
};
50+
use sc_consensus::BlockImport;
5851
use sc_consensus_aura::standalone as aura_internal;
59-
use sc_telemetry::{telemetry, TelemetryHandle, CONSENSUS_DEBUG, CONSENSUS_TRACE};
6052
use sp_api::ProvideRuntimeApi;
6153
use sp_application_crypto::AppPublic;
62-
use sp_block_builder::BlockBuilder as BlockBuilderApi;
6354
use sp_blockchain::HeaderBackend;
64-
use sp_consensus::{error::Error as ConsensusError, BlockOrigin, SyncOracle};
55+
use sp_consensus::SyncOracle;
6556
use sp_consensus_aura::{AuraApi, Slot, SlotDuration};
6657
use sp_core::crypto::Pair;
67-
use sp_inherents::{CreateInherentDataProviders, InherentData, InherentDataProvider};
58+
use sp_inherents::CreateInherentDataProviders;
6859
use sp_keystore::KeystorePtr;
69-
use sp_runtime::{
70-
generic::Digest,
71-
traits::{Block as BlockT, HashFor, Header as HeaderT, Member},
72-
};
73-
use sp_state_machine::StorageChanges;
60+
use sp_runtime::traits::{Block as BlockT, Header as HeaderT, Member};
7461
use sp_timestamp::Timestamp;
75-
use std::{convert::TryFrom, error::Error, fmt::Debug, hash::Hash, sync::Arc, time::Duration};
62+
use std::{convert::TryFrom, hash::Hash, sync::Arc, time::Duration};
7663

7764
use crate::collator::{self as collator_util, SlotClaim};
7865

@@ -129,8 +116,6 @@ pub async fn run<Block, P, BI, CIDP, Client, Backend, RClient, SO, Proposer, CS>
129116
// rules specified by the parachain's runtime and thus will never be too deep.
130117
const PARENT_SEARCH_DEPTH: usize = 10;
131118

132-
let mut params = params;
133-
134119
let mut import_notifications = match params.relay_client.import_notification_stream().await {
135120
Ok(s) => s,
136121
Err(err) => {
@@ -186,7 +171,7 @@ pub async fn run<Block, P, BI, CIDP, Client, Backend, RClient, SO, Proposer, CS>
186171
params.relay_chain_slot_duration,
187172
) {
188173
None => continue,
189-
Some((s, t)) => (Slot::from_timestamp(t, params.slot_duration), t),
174+
Some((_, t)) => (Slot::from_timestamp(t, params.slot_duration), t),
190175
};
191176

192177
let parent_search_params = ParentSearchParams {
@@ -296,13 +281,14 @@ pub async fn run<Block, P, BI, CIDP, Client, Backend, RClient, SO, Proposer, CS>
296281
)
297282
.await
298283
{
299-
Ok((collation, block_data, new_block_hash)) => {
284+
Ok((_collation, block_data, new_block_hash)) => {
300285
parent_hash = new_block_hash;
301286
parent_header = block_data.into_header();
302287

303288
// TODO [now]: we should be able to directly announce, as long as
304289
// we have full nodes do some equivocation checks locally.
305-
let _sender = params.collator_service.announce_with_barrier(new_block_hash);
290+
// The equivocation checks should allow up to `v + 1` equivocations.
291+
let _sender = collator.collator_service().announce_with_barrier(new_block_hash);
306292

307293
// TODO [https://github.com/paritytech/polkadot/issues/5056]:
308294
// announce collation to relay-chain validators.

client/consensus/aura/src/unstable_reimpl.rs

Lines changed: 6 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -17,45 +17,22 @@
1717
// TODO [now]: docs + rename file here
1818

1919
use codec::{Decode, Encode};
20-
use cumulus_client_collator::service::ServiceInterface as CollatorServiceInterface;
21-
use cumulus_client_consensus_common::{
22-
ParachainBlockImportMarker, ParachainCandidate, ParentSearchParams,
23-
};
24-
use cumulus_client_consensus_proposer::ProposerInterface;
25-
use cumulus_primitives_core::{
26-
relay_chain::Hash as PHash, CollectCollationInfo, PersistedValidationData,
27-
};
28-
use cumulus_primitives_parachain_inherent::ParachainInherentData;
29-
use cumulus_relay_chain_interface::RelayChainInterface;
20+
use cumulus_client_consensus_common::ParachainBlockImportMarker;
3021

31-
use polkadot_node_primitives::{CollationResult, MaybeCompressedPoV};
32-
use polkadot_overseer::Handle as OverseerHandle;
33-
use polkadot_primitives::{Block as PBlock, CollatorPair, Header as PHeader, Id as ParaId};
34-
35-
use futures::prelude::*;
36-
use sc_client_api::{backend::AuxStore, BlockBackend, BlockOf};
3722
use sc_consensus::{
3823
import_queue::{BasicQueue, Verifier as VerifierT},
39-
BlockImport, BlockImportParams, ForkChoiceStrategy, StateAction,
24+
BlockImport, BlockImportParams, ForkChoiceStrategy,
4025
};
4126
use sc_consensus_aura::standalone as aura_internal;
4227
use sc_telemetry::{telemetry, TelemetryHandle, CONSENSUS_DEBUG, CONSENSUS_TRACE};
4328
use sp_api::ProvideRuntimeApi;
44-
use sp_application_crypto::AppPublic;
4529
use sp_block_builder::BlockBuilder as BlockBuilderApi;
46-
use sp_blockchain::HeaderBackend;
47-
use sp_consensus::{error::Error as ConsensusError, BlockOrigin, SyncOracle};
30+
use sp_consensus::error::Error as ConsensusError;
4831
use sp_consensus_aura::{AuraApi, Slot, SlotDuration};
4932
use sp_core::crypto::Pair;
50-
use sp_inherents::{CreateInherentDataProviders, InherentData, InherentDataProvider};
51-
use sp_keystore::KeystorePtr;
52-
use sp_runtime::{
53-
generic::Digest,
54-
traits::{Block as BlockT, HashFor, Header as HeaderT, Member},
55-
};
56-
use sp_state_machine::StorageChanges;
57-
use sp_timestamp::Timestamp;
58-
use std::{convert::TryFrom, error::Error, fmt::Debug, hash::Hash, sync::Arc, time::Duration};
33+
use sp_inherents::{CreateInherentDataProviders, InherentDataProvider};
34+
use sp_runtime::traits::{Block as BlockT, Header as HeaderT};
35+
use std::{fmt::Debug, sync::Arc};
5936

6037
struct Verifier<P, Client, Block, CIDP> {
6138
client: Arc<Client>,

0 commit comments

Comments
 (0)