Provisioner polkadot companion (#1940)

* Provisioner companion changes

* update substrate commit hash

* Update Substrate & Polkadot

Co-authored-by: Bastian Köcher <info@kchr.de>
This commit is contained in:
alexgparity
2022-12-03 21:07:15 +01:00
committed by GitHub
parent c3df7db394
commit 04e236fd08
6 changed files with 269 additions and 276 deletions
+257 -254
View File
File diff suppressed because it is too large Load Diff
+5 -18
View File
@@ -39,7 +39,7 @@ use sp_blockchain::HeaderBackend;
use sp_consensus::{EnableProofRecording, Environment, ProofRecording, Proposer, SyncOracle}; use sp_consensus::{EnableProofRecording, Environment, ProofRecording, Proposer, SyncOracle};
use sp_consensus_aura::{AuraApi, SlotDuration}; use sp_consensus_aura::{AuraApi, SlotDuration};
use sp_core::crypto::Pair; use sp_core::crypto::Pair;
use sp_inherents::{CreateInherentDataProviders, InherentData, InherentDataProvider}; use sp_inherents::CreateInherentDataProviders;
use sp_keystore::SyncCryptoStorePtr; use sp_keystore::SyncCryptoStorePtr;
use sp_runtime::traits::{Block as BlockT, Header as HeaderT, Member, NumberFor}; use sp_runtime::traits::{Block as BlockT, Header as HeaderT, Member, NumberFor};
use std::{convert::TryFrom, hash::Hash, marker::PhantomData, sync::Arc}; use std::{convert::TryFrom, hash::Hash, marker::PhantomData, sync::Arc};
@@ -170,9 +170,8 @@ where
parent: B::Hash, parent: B::Hash,
validation_data: &PersistedValidationData, validation_data: &PersistedValidationData,
relay_parent: PHash, relay_parent: PHash,
) -> Option<(InherentData, CIDP::InherentDataProviders)> { ) -> Option<CIDP::InherentDataProviders> {
let inherent_data_providers = self self.create_inherent_data_providers
.create_inherent_data_providers
.create_inherent_data_providers(parent, (relay_parent, validation_data.clone())) .create_inherent_data_providers(parent, (relay_parent, validation_data.clone()))
.await .await
.map_err(|e| { .map_err(|e| {
@@ -182,19 +181,7 @@ where
"Failed to create inherent data providers.", "Failed to create inherent data providers.",
) )
}) })
.ok()?;
inherent_data_providers
.create_inherent_data()
.map_err(|e| {
tracing::error!(
target: LOG_TARGET,
error = ?e,
"Failed to create inherent data.",
)
})
.ok() .ok()
.map(|d| (d, inherent_data_providers))
} }
} }
@@ -213,12 +200,12 @@ where
relay_parent: PHash, relay_parent: PHash,
validation_data: &PersistedValidationData, validation_data: &PersistedValidationData,
) -> Option<ParachainCandidate<B>> { ) -> Option<ParachainCandidate<B>> {
let (inherent_data, inherent_data_providers) = let inherent_data_providers =
self.inherent_data(parent.hash(), validation_data, relay_parent).await?; self.inherent_data(parent.hash(), validation_data, relay_parent).await?;
let info = SlotInfo::new( let info = SlotInfo::new(
inherent_data_providers.slot(), inherent_data_providers.slot(),
inherent_data, Box::new(inherent_data_providers),
self.slot_duration.as_duration(), self.slot_duration.as_duration(),
parent.clone(), parent.clone(),
// Set the block limit to 50% of the maximum PoV size. // Set the block limit to 50% of the maximum PoV size.
@@ -65,8 +65,10 @@ where
.await .await
.map_err(|e| e.to_string())?; .map_err(|e| e.to_string())?;
let inherent_data = let inherent_data = inherent_data_providers
inherent_data_providers.create_inherent_data().map_err(|e| format!("{:?}", e))?; .create_inherent_data()
.await
.map_err(|e| format!("{:?}", e))?;
let block = Block::new(block_params.header.clone(), inner_body); let block = Block::new(block_params.header.clone(), inner_body);
@@ -125,6 +125,7 @@ where
inherent_data_providers inherent_data_providers
.create_inherent_data() .create_inherent_data()
.await
.map_err(|e| { .map_err(|e| {
tracing::error!( tracing::error!(
target: LOG_TARGET, target: LOG_TARGET,
@@ -174,7 +174,7 @@ impl ParachainInherentData {
#[async_trait::async_trait] #[async_trait::async_trait]
impl sp_inherents::InherentDataProvider for ParachainInherentData { impl sp_inherents::InherentDataProvider for ParachainInherentData {
fn provide_inherent_data( async fn provide_inherent_data(
&self, &self,
inherent_data: &mut sp_inherents::InherentData, inherent_data: &mut sp_inherents::InherentData,
) -> Result<(), sp_inherents::Error> { ) -> Result<(), sp_inherents::Error> {
@@ -151,7 +151,7 @@ impl MockXcmConfig {
impl<R: Send + Sync + GenerateRandomness<u64>> InherentDataProvider impl<R: Send + Sync + GenerateRandomness<u64>> InherentDataProvider
for MockValidationDataInherentDataProvider<R> for MockValidationDataInherentDataProvider<R>
{ {
fn provide_inherent_data( async fn provide_inherent_data(
&self, &self,
inherent_data: &mut InherentData, inherent_data: &mut InherentData,
) -> Result<(), sp_inherents::Error> { ) -> Result<(), sp_inherents::Error> {