mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-05-30 10:31:03 +00:00
Same procedure as every day (#345)
This commit is contained in:
Generated
+209
-207
File diff suppressed because it is too large
Load Diff
@@ -45,8 +45,8 @@ use polkadot_service::ClientHandle;
|
|||||||
use sc_client_api::Backend;
|
use sc_client_api::Backend;
|
||||||
use sp_api::ProvideRuntimeApi;
|
use sp_api::ProvideRuntimeApi;
|
||||||
use sp_consensus::{
|
use sp_consensus::{
|
||||||
BlockImport, BlockImportParams, BlockOrigin, Environment, ForkChoiceStrategy, Proposal,
|
BlockImport, BlockImportParams, BlockOrigin, EnableProofRecording, Environment,
|
||||||
Proposer, RecordProof,
|
ForkChoiceStrategy, ProofRecording, Proposal, Proposer,
|
||||||
};
|
};
|
||||||
use sp_inherents::{InherentData, InherentDataProviders};
|
use sp_inherents::{InherentData, InherentDataProviders};
|
||||||
use sp_runtime::traits::{Block as BlockT, HashFor, Header as HeaderT};
|
use sp_runtime::traits::{Block as BlockT, HashFor, Header as HeaderT};
|
||||||
@@ -162,7 +162,12 @@ where
|
|||||||
RBackend: Backend<PBlock>,
|
RBackend: Backend<PBlock>,
|
||||||
BI: BlockImport<B> + Send + Sync,
|
BI: BlockImport<B> + Send + Sync,
|
||||||
PF: Environment<B> + Send + Sync,
|
PF: Environment<B> + Send + Sync,
|
||||||
PF::Proposer: Proposer<B, Transaction = BI::Transaction>,
|
PF::Proposer: Proposer<
|
||||||
|
B,
|
||||||
|
Transaction = BI::Transaction,
|
||||||
|
ProofRecording = EnableProofRecording,
|
||||||
|
Proof = <EnableProofRecording as ProofRecording>::Proof,
|
||||||
|
>,
|
||||||
{
|
{
|
||||||
async fn produce_candidate(
|
async fn produce_candidate(
|
||||||
&mut self,
|
&mut self,
|
||||||
@@ -191,24 +196,11 @@ where
|
|||||||
Default::default(),
|
Default::default(),
|
||||||
//TODO: Fix this.
|
//TODO: Fix this.
|
||||||
Duration::from_millis(500),
|
Duration::from_millis(500),
|
||||||
RecordProof::Yes,
|
|
||||||
)
|
)
|
||||||
.await
|
.await
|
||||||
.map_err(|e| tracing::error!(target: LOG_TARGET, error = ?e, "Proposing failed."))
|
.map_err(|e| tracing::error!(target: LOG_TARGET, error = ?e, "Proposing failed."))
|
||||||
.ok()?;
|
.ok()?;
|
||||||
|
|
||||||
let proof = match proof {
|
|
||||||
Some(proof) => proof,
|
|
||||||
None => {
|
|
||||||
tracing::error!(
|
|
||||||
target: LOG_TARGET,
|
|
||||||
"Proposer did not return the requested proof.",
|
|
||||||
);
|
|
||||||
|
|
||||||
return None;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
let (header, extrinsics) = block.clone().deconstruct();
|
let (header, extrinsics) = block.clone().deconstruct();
|
||||||
|
|
||||||
let mut block_import_params = BlockImportParams::new(BlockOrigin::Own, header);
|
let mut block_import_params = BlockImportParams::new(BlockOrigin::Own, header);
|
||||||
@@ -262,7 +254,12 @@ pub fn build_relay_chain_consensus<Block, PF, BI, RBackend>(
|
|||||||
where
|
where
|
||||||
Block: BlockT,
|
Block: BlockT,
|
||||||
PF: Environment<Block> + Send + Sync + 'static,
|
PF: Environment<Block> + Send + Sync + 'static,
|
||||||
PF::Proposer: Proposer<Block, Transaction = BI::Transaction>,
|
PF::Proposer: Proposer<
|
||||||
|
Block,
|
||||||
|
Transaction = BI::Transaction,
|
||||||
|
ProofRecording = EnableProofRecording,
|
||||||
|
Proof = <EnableProofRecording as ProofRecording>::Proof,
|
||||||
|
>,
|
||||||
BI: BlockImport<Block> + Send + Sync + 'static,
|
BI: BlockImport<Block> + Send + Sync + 'static,
|
||||||
RBackend: Backend<PBlock> + 'static,
|
RBackend: Backend<PBlock> + 'static,
|
||||||
// Rust bug: https://github.com/rust-lang/rust/issues/24159
|
// Rust bug: https://github.com/rust-lang/rust/issues/24159
|
||||||
@@ -301,7 +298,12 @@ where
|
|||||||
// Rust bug: https://github.com/rust-lang/rust/issues/24159
|
// Rust bug: https://github.com/rust-lang/rust/issues/24159
|
||||||
sc_client_api::StateBackendFor<RBackend, PBlock>: sc_client_api::StateBackend<HashFor<PBlock>>,
|
sc_client_api::StateBackendFor<RBackend, PBlock>: sc_client_api::StateBackend<HashFor<PBlock>>,
|
||||||
PF: Environment<Block> + Send + Sync + 'static,
|
PF: Environment<Block> + Send + Sync + 'static,
|
||||||
PF::Proposer: Proposer<Block, Transaction = BI::Transaction>,
|
PF::Proposer: Proposer<
|
||||||
|
Block,
|
||||||
|
Transaction = BI::Transaction,
|
||||||
|
ProofRecording = EnableProofRecording,
|
||||||
|
Proof = <EnableProofRecording as ProofRecording>::Proof,
|
||||||
|
>,
|
||||||
BI: BlockImport<Block> + Send + Sync + 'static,
|
BI: BlockImport<Block> + Send + Sync + 'static,
|
||||||
RBackend: Backend<PBlock> + 'static,
|
RBackend: Backend<PBlock> + 'static,
|
||||||
{
|
{
|
||||||
@@ -338,7 +340,12 @@ where
|
|||||||
// Rust bug: https://github.com/rust-lang/rust/issues/24159
|
// Rust bug: https://github.com/rust-lang/rust/issues/24159
|
||||||
sc_client_api::StateBackendFor<RBackend, PBlock>: sc_client_api::StateBackend<HashFor<PBlock>>,
|
sc_client_api::StateBackendFor<RBackend, PBlock>: sc_client_api::StateBackend<HashFor<PBlock>>,
|
||||||
PF: Environment<Block> + Send + Sync + 'static,
|
PF: Environment<Block> + Send + Sync + 'static,
|
||||||
PF::Proposer: Proposer<Block, Transaction = BI::Transaction>,
|
PF::Proposer: Proposer<
|
||||||
|
Block,
|
||||||
|
Transaction = BI::Transaction,
|
||||||
|
ProofRecording = EnableProofRecording,
|
||||||
|
Proof = <EnableProofRecording as ProofRecording>::Proof,
|
||||||
|
>,
|
||||||
BI: BlockImport<Block> + Send + Sync + 'static,
|
BI: BlockImport<Block> + Send + Sync + 'static,
|
||||||
RBackend: Backend<PBlock> + 'static,
|
RBackend: Backend<PBlock> + 'static,
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -187,7 +187,7 @@ where
|
|||||||
};
|
};
|
||||||
|
|
||||||
if validator {
|
if validator {
|
||||||
let proposer_factory = sc_basic_authorship::ProposerFactory::new(
|
let proposer_factory = sc_basic_authorship::ProposerFactory::with_proof_recording(
|
||||||
task_manager.spawn_handle(),
|
task_manager.spawn_handle(),
|
||||||
client.clone(),
|
client.clone(),
|
||||||
transaction_pool,
|
transaction_pool,
|
||||||
|
|||||||
@@ -216,7 +216,7 @@ where
|
|||||||
};
|
};
|
||||||
|
|
||||||
if is_collator {
|
if is_collator {
|
||||||
let proposer_factory = sc_basic_authorship::ProposerFactory::new(
|
let proposer_factory = sc_basic_authorship::ProposerFactory::with_proof_recording(
|
||||||
task_manager.spawn_handle(),
|
task_manager.spawn_handle(),
|
||||||
client.clone(),
|
client.clone(),
|
||||||
transaction_pool,
|
transaction_pool,
|
||||||
|
|||||||
Reference in New Issue
Block a user