mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-05-31 01:41:03 +00:00
Companion for paritytech/substrate#13551 (#2278)
* Companion for paritytech/substrate#13551 * update lockfile for {"substrate", "polkadot"} --------- Co-authored-by: parity-processbot <>
This commit is contained in:
Generated
+259
-258
File diff suppressed because it is too large
Load Diff
@@ -140,7 +140,6 @@ where
|
|||||||
async fn import_block(
|
async fn import_block(
|
||||||
&mut self,
|
&mut self,
|
||||||
mut params: sc_consensus::BlockImportParams<Block, Self::Transaction>,
|
mut params: sc_consensus::BlockImportParams<Block, Self::Transaction>,
|
||||||
cache: std::collections::HashMap<sp_consensus::CacheKeyId, Vec<u8>>,
|
|
||||||
) -> Result<sc_consensus::ImportResult, Self::Error> {
|
) -> Result<sc_consensus::ImportResult, Self::Error> {
|
||||||
// Blocks are stored within the backend by using POST hash.
|
// Blocks are stored within the backend by using POST hash.
|
||||||
let hash = params.post_hash();
|
let hash = params.post_hash();
|
||||||
@@ -158,7 +157,7 @@ where
|
|||||||
monitor.release_mutex()
|
monitor.release_mutex()
|
||||||
});
|
});
|
||||||
|
|
||||||
let res = self.inner.import_block(params, cache).await?;
|
let res = self.inner.import_block(params).await?;
|
||||||
|
|
||||||
if let (Some(mut monitor_lock), ImportResult::Imported(_)) = (maybe_lock, &res) {
|
if let (Some(mut monitor_lock), ImportResult::Imported(_)) = (maybe_lock, &res) {
|
||||||
let mut monitor = monitor_lock.upgrade();
|
let mut monitor = monitor_lock.upgrade();
|
||||||
|
|||||||
@@ -456,7 +456,7 @@ where
|
|||||||
block_import_params.fork_choice = Some(ForkChoiceStrategy::Custom(true));
|
block_import_params.fork_choice = Some(ForkChoiceStrategy::Custom(true));
|
||||||
block_import_params.import_existing = true;
|
block_import_params.import_existing = true;
|
||||||
|
|
||||||
if let Err(err) = (&*parachain).import_block(block_import_params, Default::default()).await {
|
if let Err(err) = (&*parachain).import_block(block_import_params).await {
|
||||||
tracing::warn!(
|
tracing::warn!(
|
||||||
target: LOG_TARGET,
|
target: LOG_TARGET,
|
||||||
block_hash = ?hash,
|
block_hash = ?hash,
|
||||||
|
|||||||
@@ -248,7 +248,7 @@ async fn import_block<I: BlockImport<Block>>(
|
|||||||
block_import_params.body = Some(body);
|
block_import_params.body = Some(body);
|
||||||
block_import_params.post_digests.push(post_digest);
|
block_import_params.post_digests.push(post_digest);
|
||||||
|
|
||||||
importer.import_block(block_import_params, Default::default()).await.unwrap();
|
importer.import_block(block_import_params).await.unwrap();
|
||||||
}
|
}
|
||||||
|
|
||||||
fn import_block_sync<I: BlockImport<Block>>(
|
fn import_block_sync<I: BlockImport<Block>>(
|
||||||
@@ -508,7 +508,7 @@ fn follow_new_best_sets_best_after_it_is_imported() {
|
|||||||
block_import_params.body = Some(body);
|
block_import_params.body = Some(body);
|
||||||
|
|
||||||
// Now import the unkown block to make it "known"
|
// Now import the unkown block to make it "known"
|
||||||
client.import_block(block_import_params, Default::default()).await.unwrap();
|
client.import_block(block_import_params).await.unwrap();
|
||||||
|
|
||||||
loop {
|
loop {
|
||||||
Delay::new(Duration::from_millis(100)).await;
|
Delay::new(Duration::from_millis(100)).await;
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ use sc_consensus::{
|
|||||||
use sp_api::ProvideRuntimeApi;
|
use sp_api::ProvideRuntimeApi;
|
||||||
use sp_block_builder::BlockBuilder as BlockBuilderApi;
|
use sp_block_builder::BlockBuilder as BlockBuilderApi;
|
||||||
use sp_blockchain::Result as ClientResult;
|
use sp_blockchain::Result as ClientResult;
|
||||||
use sp_consensus::{error::Error as ConsensusError, CacheKeyId};
|
use sp_consensus::error::Error as ConsensusError;
|
||||||
use sp_inherents::{CreateInherentDataProviders, InherentDataProvider};
|
use sp_inherents::{CreateInherentDataProviders, InherentDataProvider};
|
||||||
use sp_runtime::traits::{Block as BlockT, Header as HeaderT};
|
use sp_runtime::traits::{Block as BlockT, Header as HeaderT};
|
||||||
|
|
||||||
@@ -54,13 +54,13 @@ where
|
|||||||
async fn verify(
|
async fn verify(
|
||||||
&mut self,
|
&mut self,
|
||||||
mut block_params: BlockImportParams<Block, ()>,
|
mut block_params: BlockImportParams<Block, ()>,
|
||||||
) -> Result<(BlockImportParams<Block, ()>, Option<Vec<(CacheKeyId, Vec<u8>)>>), String> {
|
) -> Result<BlockImportParams<Block, ()>, String> {
|
||||||
// Skip checks that include execution, if being told so, or when importing only state.
|
// Skip checks that include execution, if being told so, or when importing only state.
|
||||||
//
|
//
|
||||||
// This is done for example when gap syncing and it is expected that the block after the gap
|
// This is done for example when gap syncing and it is expected that the block after the gap
|
||||||
// was checked/chosen properly, e.g. by warp syncing to this block using a finality proof.
|
// was checked/chosen properly, e.g. by warp syncing to this block using a finality proof.
|
||||||
if block_params.state_action.skip_execution_checks() || block_params.with_state() {
|
if block_params.state_action.skip_execution_checks() || block_params.with_state() {
|
||||||
return Ok((block_params, Default::default()))
|
return Ok(block_params)
|
||||||
}
|
}
|
||||||
|
|
||||||
if let Some(inner_body) = block_params.body.take() {
|
if let Some(inner_body) = block_params.body.take() {
|
||||||
@@ -101,7 +101,7 @@ where
|
|||||||
|
|
||||||
block_params.post_hash = Some(block_params.header.hash());
|
block_params.post_hash = Some(block_params.header.hash());
|
||||||
|
|
||||||
Ok((block_params, None))
|
Ok(block_params)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -197,13 +197,7 @@ where
|
|||||||
sc_consensus::StorageChanges::Changes(storage_changes),
|
sc_consensus::StorageChanges::Changes(storage_changes),
|
||||||
);
|
);
|
||||||
|
|
||||||
if let Err(err) = self
|
if let Err(err) = self.block_import.lock().await.import_block(block_import_params).await {
|
||||||
.block_import
|
|
||||||
.lock()
|
|
||||||
.await
|
|
||||||
.import_block(block_import_params, Default::default())
|
|
||||||
.await
|
|
||||||
{
|
|
||||||
tracing::error!(
|
tracing::error!(
|
||||||
target: LOG_TARGET,
|
target: LOG_TARGET,
|
||||||
at = ?parent.hash(),
|
at = ?parent.hash(),
|
||||||
|
|||||||
@@ -48,7 +48,6 @@ use sc_network_sync::SyncingService;
|
|||||||
use sc_service::{Configuration, PartialComponents, TFullBackend, TFullClient, TaskManager};
|
use sc_service::{Configuration, PartialComponents, TFullBackend, TFullClient, TaskManager};
|
||||||
use sc_telemetry::{Telemetry, TelemetryHandle, TelemetryWorker, TelemetryWorkerHandle};
|
use sc_telemetry::{Telemetry, TelemetryHandle, TelemetryWorker, TelemetryWorkerHandle};
|
||||||
use sp_api::{ApiExt, ConstructRuntimeApi};
|
use sp_api::{ApiExt, ConstructRuntimeApi};
|
||||||
use sp_consensus::CacheKeyId;
|
|
||||||
use sp_consensus_aura::AuraApi;
|
use sp_consensus_aura::AuraApi;
|
||||||
use sp_keystore::SyncCryptoStorePtr;
|
use sp_keystore::SyncCryptoStorePtr;
|
||||||
use sp_runtime::{
|
use sp_runtime::{
|
||||||
@@ -1034,7 +1033,7 @@ where
|
|||||||
async fn verify(
|
async fn verify(
|
||||||
&mut self,
|
&mut self,
|
||||||
block_import: BlockImportParams<Block, ()>,
|
block_import: BlockImportParams<Block, ()>,
|
||||||
) -> Result<(BlockImportParams<Block, ()>, Option<Vec<(CacheKeyId, Vec<u8>)>>), String> {
|
) -> Result<BlockImportParams<Block, ()>, String> {
|
||||||
if self
|
if self
|
||||||
.client
|
.client
|
||||||
.runtime_api()
|
.runtime_api()
|
||||||
|
|||||||
Reference in New Issue
Block a user