|
34 | 34 | use codec::{Decode, Encode}; |
35 | 35 | use cumulus_client_collator::service::ServiceInterface as CollatorServiceInterface; |
36 | 36 | use cumulus_client_consensus_common::{ |
37 | | - self as consensus_common, ParachainBlockImportMarker, ParachainCandidate, ParentSearchParams, |
| 37 | + self as consensus_common, ParachainBlockImportMarker, ParentSearchParams, |
38 | 38 | }; |
39 | 39 | use cumulus_client_consensus_proposer::ProposerInterface; |
40 | 40 | use cumulus_primitives_core::{ |
41 | 41 | relay_chain::Hash as PHash, CollectCollationInfo, PersistedValidationData, |
42 | 42 | }; |
43 | | -use cumulus_primitives_parachain_inherent::ParachainInherentData; |
44 | 43 | use cumulus_relay_chain_interface::RelayChainInterface; |
45 | 44 |
|
46 | | -use polkadot_node_primitives::{CollationResult, MaybeCompressedPoV}; |
47 | 45 | 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}; |
51 | 47 |
|
52 | 48 | use futures::prelude::*; |
53 | 49 | 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; |
58 | 51 | use sc_consensus_aura::standalone as aura_internal; |
59 | | -use sc_telemetry::{telemetry, TelemetryHandle, CONSENSUS_DEBUG, CONSENSUS_TRACE}; |
60 | 52 | use sp_api::ProvideRuntimeApi; |
61 | 53 | use sp_application_crypto::AppPublic; |
62 | | -use sp_block_builder::BlockBuilder as BlockBuilderApi; |
63 | 54 | use sp_blockchain::HeaderBackend; |
64 | | -use sp_consensus::{error::Error as ConsensusError, BlockOrigin, SyncOracle}; |
| 55 | +use sp_consensus::SyncOracle; |
65 | 56 | use sp_consensus_aura::{AuraApi, Slot, SlotDuration}; |
66 | 57 | use sp_core::crypto::Pair; |
67 | | -use sp_inherents::{CreateInherentDataProviders, InherentData, InherentDataProvider}; |
| 58 | +use sp_inherents::CreateInherentDataProviders; |
68 | 59 | 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}; |
74 | 61 | 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}; |
76 | 63 |
|
77 | 64 | use crate::collator::{self as collator_util, SlotClaim}; |
78 | 65 |
|
@@ -129,8 +116,6 @@ pub async fn run<Block, P, BI, CIDP, Client, Backend, RClient, SO, Proposer, CS> |
129 | 116 | // rules specified by the parachain's runtime and thus will never be too deep. |
130 | 117 | const PARENT_SEARCH_DEPTH: usize = 10; |
131 | 118 |
|
132 | | - let mut params = params; |
133 | | - |
134 | 119 | let mut import_notifications = match params.relay_client.import_notification_stream().await { |
135 | 120 | Ok(s) => s, |
136 | 121 | Err(err) => { |
@@ -186,7 +171,7 @@ pub async fn run<Block, P, BI, CIDP, Client, Backend, RClient, SO, Proposer, CS> |
186 | 171 | params.relay_chain_slot_duration, |
187 | 172 | ) { |
188 | 173 | 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), |
190 | 175 | }; |
191 | 176 |
|
192 | 177 | let parent_search_params = ParentSearchParams { |
@@ -296,13 +281,14 @@ pub async fn run<Block, P, BI, CIDP, Client, Backend, RClient, SO, Proposer, CS> |
296 | 281 | ) |
297 | 282 | .await |
298 | 283 | { |
299 | | - Ok((collation, block_data, new_block_hash)) => { |
| 284 | + Ok((_collation, block_data, new_block_hash)) => { |
300 | 285 | parent_hash = new_block_hash; |
301 | 286 | parent_header = block_data.into_header(); |
302 | 287 |
|
303 | 288 | // TODO [now]: we should be able to directly announce, as long as |
304 | 289 | // 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); |
306 | 292 |
|
307 | 293 | // TODO [https://github.com/paritytech/polkadot/issues/5056]: |
308 | 294 | // announce collation to relay-chain validators. |
|
0 commit comments