Unverified Commit 4dc7f4dc authored by Bastian Köcher's avatar Bastian Köcher Committed by GitHub
Browse files

Companion for Substrate #8185 (#2507)

* Companion for Substrate #8185

https://github.com/paritytech/substrate/pull/8185

* "Update Substrate"

Co-authored-by: parity-processbot <>
parent be24e2a4
Pipeline #125728 passed with stages
in 31 minutes and 58 seconds
This diff is collapsed.
...@@ -32,7 +32,7 @@ use sc_block_builder::{BlockBuilderApi, BlockBuilderProvider}; ...@@ -32,7 +32,7 @@ use sc_block_builder::{BlockBuilderApi, BlockBuilderProvider};
use sp_core::traits::SpawnNamed; use sp_core::traits::SpawnNamed;
use sp_api::{ApiExt, ProvideRuntimeApi}; use sp_api::{ApiExt, ProvideRuntimeApi};
use sp_blockchain::HeaderBackend; use sp_blockchain::HeaderBackend;
use sp_consensus::{Proposal, RecordProof}; use sp_consensus::{Proposal, DisableProofRecording};
use sp_inherents::InherentData; use sp_inherents::InherentData;
use sp_runtime::traits::{DigestFor, HashFor}; use sp_runtime::traits::{DigestFor, HashFor};
use sp_transaction_pool::TransactionPool; use sp_transaction_pool::TransactionPool;
...@@ -44,7 +44,7 @@ const PROPOSE_TIMEOUT: core::time::Duration = core::time::Duration::from_millis( ...@@ -44,7 +44,7 @@ const PROPOSE_TIMEOUT: core::time::Duration = core::time::Duration::from_millis(
/// Custom Proposer factory for Polkadot /// Custom Proposer factory for Polkadot
pub struct ProposerFactory<TxPool, Backend, Client> { pub struct ProposerFactory<TxPool, Backend, Client> {
inner: sc_basic_authorship::ProposerFactory<TxPool, Backend, Client>, inner: sc_basic_authorship::ProposerFactory<TxPool, Backend, Client, DisableProofRecording>,
overseer: OverseerHandler, overseer: OverseerHandler,
} }
...@@ -116,7 +116,7 @@ where ...@@ -116,7 +116,7 @@ where
/// This proposer gets the ProvisionerInherentData and injects it into the wrapped /// This proposer gets the ProvisionerInherentData and injects it into the wrapped
/// proposer's inherent data, then delegates the actual proposal generation. /// proposer's inherent data, then delegates the actual proposal generation.
pub struct Proposer<TxPool: TransactionPool<Block = Block>, Backend, Client> { pub struct Proposer<TxPool: TransactionPool<Block = Block>, Backend, Client> {
inner: sc_basic_authorship::Proposer<Backend, Block, Client, TxPool>, inner: sc_basic_authorship::Proposer<Backend, Block, Client, TxPool, DisableProofRecording>,
overseer: OverseerHandler, overseer: OverseerHandler,
parent_header: Header, parent_header: Header,
parent_header_hash: Hash, parent_header_hash: Hash,
...@@ -187,16 +187,17 @@ where ...@@ -187,16 +187,17 @@ where
{ {
type Transaction = sc_client_api::TransactionFor<Backend, Block>; type Transaction = sc_client_api::TransactionFor<Backend, Block>;
type Proposal = Pin<Box< type Proposal = Pin<Box<
dyn Future<Output = Result<Proposal<Block, sp_api::TransactionFor<Client, Block>>, Error>> + Send, dyn Future<Output = Result<Proposal<Block, sp_api::TransactionFor<Client, Block>, ()>, Error>> + Send,
>>; >>;
type Error = Error; type Error = Error;
type ProofRecording = DisableProofRecording;
type Proof = ();
fn propose( fn propose(
self, self,
mut inherent_data: InherentData, mut inherent_data: InherentData,
inherent_digests: DigestFor<Block>, inherent_digests: DigestFor<Block>,
max_duration: time::Duration, max_duration: time::Duration,
record_proof: RecordProof,
) -> Self::Proposal { ) -> Self::Proposal {
async move { async move {
let span = jaeger::hash_span(&self.parent_header_hash, "propose"); let span = jaeger::hash_span(&self.parent_header_hash, "propose");
...@@ -224,7 +225,7 @@ where ...@@ -224,7 +225,7 @@ where
let _span = span.child("authorship-propose"); let _span = span.child("authorship-propose");
self.inner self.inner
.propose(inherent_data, inherent_digests, max_duration, record_proof) .propose(inherent_data, inherent_digests, max_duration)
.await .await
.map_err(Into::into) .map_err(Into::into)
} }
......
...@@ -58,7 +58,7 @@ use telemetry::{TelemetryConnectionNotifier, TelemetrySpan}; ...@@ -58,7 +58,7 @@ use telemetry::{TelemetryConnectionNotifier, TelemetrySpan};
pub use self::client::{AbstractClient, Client, ClientHandle, ExecuteWithClient, RuntimeApiCollection}; pub use self::client::{AbstractClient, Client, ClientHandle, ExecuteWithClient, RuntimeApiCollection};
pub use chain_spec::{PolkadotChainSpec, KusamaChainSpec, WestendChainSpec, RococoChainSpec}; pub use chain_spec::{PolkadotChainSpec, KusamaChainSpec, WestendChainSpec, RococoChainSpec};
pub use consensus_common::{Proposal, SelectChain, BlockImport, RecordProof, block_validation::Chain}; pub use consensus_common::{Proposal, SelectChain, BlockImport, block_validation::Chain};
pub use polkadot_parachain::wasm_executor::IsolationStrategy; pub use polkadot_parachain::wasm_executor::IsolationStrategy;
pub use polkadot_primitives::v1::{Block, BlockId, CollatorId, Hash, Id as ParaId}; pub use polkadot_primitives::v1::{Block, BlockId, CollatorId, Hash, Id as ParaId};
pub use sc_client_api::{Backend, ExecutionStrategy, CallExecutor}; pub use sc_client_api::{Backend, ExecutionStrategy, CallExecutor};
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment