mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-05-30 07:01:03 +00:00
Companion for Substrate#14612 (#2923)
* Companion for Substrate#14612 https://github.com/paritytech/substrate/pull/14612 * Remove patch * Cargo.lock * Fix * Fix compilation * Fix Fix * ... * :face_palm: * ................. * update lockfile for {"polkadot", "substrate"} * ".git/.scripts/commands/fmt/fmt.sh" --------- Co-authored-by: parity-processbot <>
This commit is contained in:
Generated
+266
-266
File diff suppressed because it is too large
Load Diff
@@ -406,14 +406,12 @@ mod tests {
|
||||
|
||||
// Ensure that we did not include `:code` in the proof.
|
||||
let proof = block.storage_proof();
|
||||
let db = proof
|
||||
.to_storage_proof::<BlakeTwo256>(Some(header.state_root()))
|
||||
.unwrap()
|
||||
.0
|
||||
.into_memory_db();
|
||||
|
||||
let backend = sp_state_machine::new_in_mem_hash_key::<BlakeTwo256>()
|
||||
.update_backend(*header.state_root(), db);
|
||||
let backend = sp_state_machine::create_proof_check_backend::<BlakeTwo256>(
|
||||
*header.state_root(),
|
||||
proof.to_storage_proof::<BlakeTwo256>(None).unwrap().0,
|
||||
)
|
||||
.unwrap();
|
||||
|
||||
// Should return an error, as it was not included while building the proof.
|
||||
assert!(backend
|
||||
|
||||
@@ -95,8 +95,7 @@ where
|
||||
RClient: RelayChainInterface,
|
||||
CIDP: CreateInherentDataProviders<Block, ()> + 'static,
|
||||
BI: BlockImport<Block> + ParachainBlockImportMarker + Send + Sync + 'static,
|
||||
Proposer: ProposerInterface<Block, Transaction = BI::Transaction>,
|
||||
Proposer::Transaction: Sync,
|
||||
Proposer: ProposerInterface<Block>,
|
||||
CS: CollatorServiceInterface<Block>,
|
||||
P: Pair,
|
||||
P::Public: AppPublic + Member,
|
||||
@@ -190,7 +189,7 @@ where
|
||||
.await
|
||||
.map_err(|e| Box::new(e))?;
|
||||
|
||||
let sealed_importable = seal::<_, _, P>(
|
||||
let sealed_importable = seal::<_, P>(
|
||||
proposal.block,
|
||||
proposal.storage_changes,
|
||||
&slot_claim.author_pub,
|
||||
@@ -322,12 +321,12 @@ where
|
||||
}
|
||||
|
||||
/// Seal a block with a signature in the header.
|
||||
pub fn seal<B: BlockT, T, P>(
|
||||
pub fn seal<B: BlockT, P>(
|
||||
pre_sealed: B,
|
||||
storage_changes: StorageChanges<T, HashingFor<B>>,
|
||||
storage_changes: StorageChanges<HashingFor<B>>,
|
||||
author_pub: &P::Public,
|
||||
keystore: &KeystorePtr,
|
||||
) -> Result<BlockImportParams<B, T>, Box<dyn Error>>
|
||||
) -> Result<BlockImportParams<B>, Box<dyn Error>>
|
||||
where
|
||||
P: Pair,
|
||||
P::Signature: Codec + TryFrom<Vec<u8>>,
|
||||
|
||||
@@ -84,8 +84,7 @@ pub async fn run<Block, P, BI, CIDP, Client, RClient, SO, Proposer, CS>(
|
||||
CIDP: CreateInherentDataProviders<Block, ()> + 'static,
|
||||
BI: BlockImport<Block> + ParachainBlockImportMarker + Send + Sync + 'static,
|
||||
SO: SyncOracle + Send + Sync + Clone + 'static,
|
||||
Proposer: ProposerInterface<Block, Transaction = BI::Transaction>,
|
||||
Proposer::Transaction: Sync,
|
||||
Proposer: ProposerInterface<Block>,
|
||||
CS: CollatorServiceInterface<Block>,
|
||||
P: Pair,
|
||||
P::Public: AppPublic + Member,
|
||||
|
||||
@@ -103,8 +103,7 @@ pub async fn run<Block, P, BI, CIDP, Client, Backend, RClient, SO, Proposer, CS>
|
||||
CIDP: CreateInherentDataProviders<Block, ()> + 'static,
|
||||
BI: BlockImport<Block> + ParachainBlockImportMarker + Send + Sync + 'static,
|
||||
SO: SyncOracle + Send + Sync + Clone + 'static,
|
||||
Proposer: ProposerInterface<Block, Transaction = BI::Transaction>,
|
||||
Proposer::Transaction: Sync,
|
||||
Proposer: ProposerInterface<Block>,
|
||||
CS: CollatorServiceInterface<Block>,
|
||||
P: Pair,
|
||||
P::Public: AppPublic + Member,
|
||||
|
||||
@@ -89,8 +89,8 @@ where
|
||||
{
|
||||
async fn verify(
|
||||
&mut self,
|
||||
mut block_params: BlockImportParams<Block, ()>,
|
||||
) -> Result<BlockImportParams<Block, ()>, String> {
|
||||
mut block_params: BlockImportParams<Block>,
|
||||
) -> Result<BlockImportParams<Block>, String> {
|
||||
// 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
|
||||
@@ -221,7 +221,7 @@ pub fn fully_verifying_import_queue<P, Client, Block: BlockT, I, CIDP>(
|
||||
spawner: &impl sp_core::traits::SpawnEssentialNamed,
|
||||
registry: Option<&substrate_prometheus_endpoint::Registry>,
|
||||
telemetry: Option<TelemetryHandle>,
|
||||
) -> BasicQueue<Block, I::Transaction>
|
||||
) -> BasicQueue<Block>
|
||||
where
|
||||
P: Pair + 'static,
|
||||
P::Signature: Codec,
|
||||
@@ -231,7 +231,6 @@ where
|
||||
+ Send
|
||||
+ Sync
|
||||
+ 'static,
|
||||
I::Transaction: Send,
|
||||
Client: ProvideRuntimeApi<Block> + Send + Sync + 'static,
|
||||
<Client as ProvideRuntimeApi<Block>>::Api: BlockBuilderApi<Block> + AuraApi<Block, P::Public>,
|
||||
CIDP: CreateInherentDataProviders<Block, ()> + 'static,
|
||||
|
||||
@@ -60,7 +60,7 @@ pub fn import_queue<P, Block, I, C, S, CIDP>(
|
||||
registry,
|
||||
telemetry,
|
||||
}: ImportQueueParams<'_, I, C, CIDP, S>,
|
||||
) -> Result<DefaultImportQueue<Block, C>, sp_consensus::Error>
|
||||
) -> Result<DefaultImportQueue<Block>, sp_consensus::Error>
|
||||
where
|
||||
Block: BlockT,
|
||||
C::Api: BlockBuilderApi<Block> + AuraApi<Block, P::Public> + ApiExt<Block>,
|
||||
@@ -72,7 +72,7 @@ where
|
||||
+ AuxStore
|
||||
+ UsageProvider<Block>
|
||||
+ HeaderBackend<Block>,
|
||||
I: BlockImport<Block, Error = ConsensusError, Transaction = sp_api::TransactionFor<C, Block>>
|
||||
I: BlockImport<Block, Error = ConsensusError>
|
||||
+ ParachainBlockImportMarker
|
||||
+ Send
|
||||
+ Sync
|
||||
|
||||
@@ -118,18 +118,13 @@ where
|
||||
Client:
|
||||
ProvideRuntimeApi<B> + BlockOf + AuxStore + HeaderBackend<B> + Send + Sync + 'static,
|
||||
Client::Api: AuraApi<B, P::Public>,
|
||||
BI: BlockImport<B, Transaction = sp_api::TransactionFor<Client, B>>
|
||||
+ ParachainBlockImportMarker
|
||||
+ Send
|
||||
+ Sync
|
||||
+ 'static,
|
||||
BI: BlockImport<B> + ParachainBlockImportMarker + Send + Sync + 'static,
|
||||
SO: SyncOracle + Send + Sync + Clone + 'static,
|
||||
BS: BackoffAuthoringBlocksStrategy<NumberFor<B>> + Send + Sync + 'static,
|
||||
PF: Environment<B, Error = Error> + Send + Sync + 'static,
|
||||
PF::Proposer: Proposer<
|
||||
B,
|
||||
Error = Error,
|
||||
Transaction = sp_api::TransactionFor<Client, B>,
|
||||
ProofRecording = EnableProofRecording,
|
||||
Proof = <EnableProofRecording as ProofRecording>::Proof,
|
||||
>,
|
||||
|
||||
@@ -51,8 +51,8 @@ pub struct VerifyNothing;
|
||||
impl<Block: BlockT> Verifier<Block> for VerifyNothing {
|
||||
async fn verify(
|
||||
&mut self,
|
||||
params: BlockImportParams<Block, ()>,
|
||||
) -> Result<BlockImportParams<Block, ()>, String> {
|
||||
params: BlockImportParams<Block>,
|
||||
) -> Result<BlockImportParams<Block>, String> {
|
||||
Ok(params)
|
||||
}
|
||||
}
|
||||
@@ -64,14 +64,13 @@ pub fn verify_nothing_import_queue<Block: BlockT, I>(
|
||||
block_import: I,
|
||||
spawner: &impl sp_core::traits::SpawnEssentialNamed,
|
||||
registry: Option<&substrate_prometheus_endpoint::Registry>,
|
||||
) -> BasicQueue<Block, I::Transaction>
|
||||
) -> BasicQueue<Block>
|
||||
where
|
||||
I: BlockImport<Block, Error = ConsensusError>
|
||||
+ ParachainBlockImportMarker
|
||||
+ Send
|
||||
+ Sync
|
||||
+ 'static,
|
||||
I::Transaction: Send,
|
||||
{
|
||||
BasicQueue::new(VerifyNothing, Box::new(block_import), None, spawner, registry)
|
||||
}
|
||||
|
||||
@@ -143,7 +143,6 @@ where
|
||||
BE: Backend<Block>,
|
||||
{
|
||||
type Error = BI::Error;
|
||||
type Transaction = BI::Transaction;
|
||||
|
||||
async fn check_block(
|
||||
&mut self,
|
||||
@@ -154,7 +153,7 @@ where
|
||||
|
||||
async fn import_block(
|
||||
&mut self,
|
||||
mut params: sc_consensus::BlockImportParams<Block, Self::Transaction>,
|
||||
mut params: sc_consensus::BlockImportParams<Block>,
|
||||
) -> Result<sc_consensus::ImportResult, Self::Error> {
|
||||
// Blocks are stored within the backend by using POST hash.
|
||||
let hash = params.post_hash();
|
||||
|
||||
@@ -50,14 +50,11 @@ impl Error {
|
||||
|
||||
/// A type alias for easily referring to the type of a proposal produced by a specific
|
||||
/// [`Proposer`].
|
||||
pub type ProposalOf<B, T> = Proposal<B, <T as ProposerInterface<B>>::Transaction, StorageProof>;
|
||||
pub type ProposalOf<B> = Proposal<B, StorageProof>;
|
||||
|
||||
/// An interface for proposers.
|
||||
#[async_trait]
|
||||
pub trait ProposerInterface<Block: BlockT> {
|
||||
/// The underlying DB transaction type produced with the block proposal.
|
||||
type Transaction: Default + Send + 'static;
|
||||
|
||||
/// Propose a collation using the supplied `InherentData` and the provided
|
||||
/// `ParachainInherentData`.
|
||||
///
|
||||
@@ -79,7 +76,7 @@ pub trait ProposerInterface<Block: BlockT> {
|
||||
inherent_digests: Digest,
|
||||
max_duration: Duration,
|
||||
block_size_limit: Option<usize>,
|
||||
) -> Result<Proposal<Block, Self::Transaction, StorageProof>, Error>;
|
||||
) -> Result<Proposal<Block, StorageProof>, Error>;
|
||||
}
|
||||
|
||||
/// A simple wrapper around a Substrate proposer for creating collations.
|
||||
@@ -104,8 +101,6 @@ where
|
||||
T::Proposer: SubstrateProposer<B, ProofRecording = EnableProofRecording, Proof = StorageProof>,
|
||||
<T::Proposer as SubstrateProposer<B>>::Error: Send + Sync + 'static,
|
||||
{
|
||||
type Transaction = <<T as Environment<B>>::Proposer as SubstrateProposer<B>>::Transaction;
|
||||
|
||||
async fn propose(
|
||||
&mut self,
|
||||
parent_header: &B::Header,
|
||||
@@ -114,7 +109,7 @@ where
|
||||
inherent_digests: Digest,
|
||||
max_duration: Duration,
|
||||
block_size_limit: Option<usize>,
|
||||
) -> Result<Proposal<B, Self::Transaction, StorageProof>, Error> {
|
||||
) -> Result<Proposal<B, StorageProof>, Error> {
|
||||
let proposer = self
|
||||
.inner
|
||||
.init(parent_header)
|
||||
|
||||
@@ -53,8 +53,8 @@ where
|
||||
{
|
||||
async fn verify(
|
||||
&mut self,
|
||||
mut block_params: BlockImportParams<Block, ()>,
|
||||
) -> Result<BlockImportParams<Block, ()>, String> {
|
||||
mut block_params: BlockImportParams<Block>,
|
||||
) -> Result<BlockImportParams<Block>, String> {
|
||||
// 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
|
||||
@@ -112,14 +112,13 @@ pub fn import_queue<Client, Block: BlockT, I, CIDP>(
|
||||
create_inherent_data_providers: CIDP,
|
||||
spawner: &impl sp_core::traits::SpawnEssentialNamed,
|
||||
registry: Option<&substrate_prometheus_endpoint::Registry>,
|
||||
) -> ClientResult<BasicQueue<Block, I::Transaction>>
|
||||
) -> ClientResult<BasicQueue<Block>>
|
||||
where
|
||||
I: BlockImport<Block, Error = ConsensusError>
|
||||
+ ParachainBlockImportMarker
|
||||
+ Send
|
||||
+ Sync
|
||||
+ 'static,
|
||||
I::Transaction: Send,
|
||||
Client: ProvideRuntimeApi<Block> + Send + Sync + 'static,
|
||||
<Client as ProvideRuntimeApi<Block>>::Api: BlockBuilderApi<Block>,
|
||||
CIDP: CreateInherentDataProviders<Block, ()> + 'static,
|
||||
|
||||
@@ -150,7 +150,6 @@ where
|
||||
PF: Environment<B> + Send + Sync,
|
||||
PF::Proposer: Proposer<
|
||||
B,
|
||||
Transaction = BI::Transaction,
|
||||
ProofRecording = EnableProofRecording,
|
||||
Proof = <EnableProofRecording as ProofRecording>::Proof,
|
||||
>,
|
||||
@@ -239,7 +238,6 @@ where
|
||||
PF: Environment<Block> + Send + Sync + 'static,
|
||||
PF::Proposer: Proposer<
|
||||
Block,
|
||||
Transaction = BI::Transaction,
|
||||
ProofRecording = EnableProofRecording,
|
||||
Proof = <EnableProofRecording as ProofRecording>::Proof,
|
||||
>,
|
||||
|
||||
@@ -269,8 +269,7 @@ fn run_with_externalities<B: BlockT, R, F: FnOnce() -> R>(
|
||||
execute: F,
|
||||
) -> R {
|
||||
let mut overlay = sp_state_machine::OverlayedChanges::default();
|
||||
let mut cache = Default::default();
|
||||
let mut ext = Ext::<B>::new(&mut overlay, &mut cache, backend);
|
||||
let mut ext = Ext::<B>::new(&mut overlay, backend);
|
||||
|
||||
set_and_run_with_externalities(&mut ext, || execute())
|
||||
}
|
||||
|
||||
@@ -68,7 +68,7 @@ pub fn new_partial(
|
||||
ParachainClient,
|
||||
ParachainBackend,
|
||||
(),
|
||||
sc_consensus::DefaultImportQueue<Block, ParachainClient>,
|
||||
sc_consensus::DefaultImportQueue<Block>,
|
||||
sc_transaction_pool::FullPool<Block, ParachainClient>,
|
||||
(ParachainBlockImport, Option<Telemetry>, Option<TelemetryWorkerHandle>),
|
||||
>,
|
||||
@@ -341,7 +341,7 @@ fn build_import_queue(
|
||||
config: &Configuration,
|
||||
telemetry: Option<TelemetryHandle>,
|
||||
task_manager: &TaskManager,
|
||||
) -> Result<sc_consensus::DefaultImportQueue<Block, ParachainClient>, sc_service::Error> {
|
||||
) -> Result<sc_consensus::DefaultImportQueue<Block>, sc_service::Error> {
|
||||
let slot_duration = cumulus_client_consensus_aura::slot_duration(&*client)?;
|
||||
|
||||
cumulus_client_consensus_aura::import_queue::<
|
||||
|
||||
@@ -50,10 +50,7 @@ use sc_telemetry::{Telemetry, TelemetryHandle, TelemetryWorker, TelemetryWorkerH
|
||||
use sp_api::{ApiExt, ConstructRuntimeApi};
|
||||
use sp_consensus_aura::AuraApi;
|
||||
use sp_keystore::KeystorePtr;
|
||||
use sp_runtime::{
|
||||
app_crypto::AppCrypto,
|
||||
traits::{BlakeTwo256, Header as HeaderT},
|
||||
};
|
||||
use sp_runtime::{app_crypto::AppCrypto, traits::Header as HeaderT};
|
||||
use std::{marker::PhantomData, sync::Arc, time::Duration};
|
||||
use substrate_prometheus_endpoint::Registry;
|
||||
|
||||
@@ -233,7 +230,7 @@ pub fn new_partial<RuntimeApi, BIQ>(
|
||||
ParachainClient<RuntimeApi>,
|
||||
ParachainBackend,
|
||||
(),
|
||||
sc_consensus::DefaultImportQueue<Block, ParachainClient<RuntimeApi>>,
|
||||
sc_consensus::DefaultImportQueue<Block>,
|
||||
sc_transaction_pool::FullPool<Block, ParachainClient<RuntimeApi>>,
|
||||
(ParachainBlockImport<RuntimeApi>, Option<Telemetry>, Option<TelemetryWorkerHandle>),
|
||||
>,
|
||||
@@ -244,22 +241,16 @@ where
|
||||
RuntimeApi::RuntimeApi: sp_transaction_pool::runtime_api::TaggedTransactionQueue<Block>
|
||||
+ sp_api::Metadata<Block>
|
||||
+ sp_session::SessionKeys<Block>
|
||||
+ sp_api::ApiExt<
|
||||
Block,
|
||||
StateBackend = sc_client_api::StateBackendFor<ParachainBackend, Block>,
|
||||
> + sp_offchain::OffchainWorkerApi<Block>
|
||||
+ sp_api::ApiExt<Block>
|
||||
+ sp_offchain::OffchainWorkerApi<Block>
|
||||
+ sp_block_builder::BlockBuilder<Block>,
|
||||
sc_client_api::StateBackendFor<ParachainBackend, Block>: sp_api::StateBackend<BlakeTwo256>,
|
||||
BIQ: FnOnce(
|
||||
Arc<ParachainClient<RuntimeApi>>,
|
||||
ParachainBlockImport<RuntimeApi>,
|
||||
&Configuration,
|
||||
Option<TelemetryHandle>,
|
||||
&TaskManager,
|
||||
) -> Result<
|
||||
sc_consensus::DefaultImportQueue<Block, ParachainClient<RuntimeApi>>,
|
||||
sc_service::Error,
|
||||
>,
|
||||
) -> Result<sc_consensus::DefaultImportQueue<Block>, sc_service::Error>,
|
||||
{
|
||||
let telemetry = config
|
||||
.telemetry_endpoints
|
||||
@@ -349,13 +340,10 @@ where
|
||||
RuntimeApi::RuntimeApi: sp_transaction_pool::runtime_api::TaggedTransactionQueue<Block>
|
||||
+ sp_api::Metadata<Block>
|
||||
+ sp_session::SessionKeys<Block>
|
||||
+ sp_api::ApiExt<
|
||||
Block,
|
||||
StateBackend = sc_client_api::StateBackendFor<ParachainBackend, Block>,
|
||||
> + sp_offchain::OffchainWorkerApi<Block>
|
||||
+ sp_api::ApiExt<Block>
|
||||
+ sp_offchain::OffchainWorkerApi<Block>
|
||||
+ sp_block_builder::BlockBuilder<Block>
|
||||
+ cumulus_primitives_core::CollectCollationInfo<Block>,
|
||||
sc_client_api::StateBackendFor<ParachainBackend, Block>: sp_api::StateBackend<BlakeTwo256>,
|
||||
RB: Fn(Arc<ParachainClient<RuntimeApi>>) -> Result<jsonrpsee::RpcModule<()>, sc_service::Error>
|
||||
+ 'static,
|
||||
BIQ: FnOnce(
|
||||
@@ -364,10 +352,7 @@ where
|
||||
&Configuration,
|
||||
Option<TelemetryHandle>,
|
||||
&TaskManager,
|
||||
) -> Result<
|
||||
sc_consensus::DefaultImportQueue<Block, ParachainClient<RuntimeApi>>,
|
||||
sc_service::Error,
|
||||
>,
|
||||
) -> Result<sc_consensus::DefaultImportQueue<Block>, sc_service::Error>,
|
||||
BIC: FnOnce(
|
||||
Arc<ParachainClient<RuntimeApi>>,
|
||||
ParachainBlockImport<RuntimeApi>,
|
||||
@@ -540,15 +525,12 @@ where
|
||||
RuntimeApi::RuntimeApi: sp_transaction_pool::runtime_api::TaggedTransactionQueue<Block>
|
||||
+ sp_api::Metadata<Block>
|
||||
+ sp_session::SessionKeys<Block>
|
||||
+ sp_api::ApiExt<
|
||||
Block,
|
||||
StateBackend = sc_client_api::StateBackendFor<ParachainBackend, Block>,
|
||||
> + sp_offchain::OffchainWorkerApi<Block>
|
||||
+ sp_api::ApiExt<Block>
|
||||
+ sp_offchain::OffchainWorkerApi<Block>
|
||||
+ sp_block_builder::BlockBuilder<Block>
|
||||
+ cumulus_primitives_core::CollectCollationInfo<Block>
|
||||
+ pallet_transaction_payment_rpc::TransactionPaymentRuntimeApi<Block, Balance>
|
||||
+ frame_rpc_system::AccountNonceApi<Block, AccountId, Nonce>,
|
||||
sc_client_api::StateBackendFor<ParachainBackend, Block>: sp_api::StateBackend<BlakeTwo256>,
|
||||
RB: Fn(Arc<ParachainClient<RuntimeApi>>) -> Result<jsonrpsee::RpcModule<()>, sc_service::Error>,
|
||||
BIQ: FnOnce(
|
||||
Arc<ParachainClient<RuntimeApi>>,
|
||||
@@ -556,10 +538,7 @@ where
|
||||
&Configuration,
|
||||
Option<TelemetryHandle>,
|
||||
&TaskManager,
|
||||
) -> Result<
|
||||
sc_consensus::DefaultImportQueue<Block, ParachainClient<RuntimeApi>>,
|
||||
sc_service::Error,
|
||||
>,
|
||||
) -> Result<sc_consensus::DefaultImportQueue<Block>, sc_service::Error>,
|
||||
BIC: FnOnce(
|
||||
Arc<ParachainClient<RuntimeApi>>,
|
||||
ParachainBlockImport<RuntimeApi>,
|
||||
@@ -731,10 +710,7 @@ pub fn rococo_parachain_build_import_queue(
|
||||
config: &Configuration,
|
||||
telemetry: Option<TelemetryHandle>,
|
||||
task_manager: &TaskManager,
|
||||
) -> Result<
|
||||
sc_consensus::DefaultImportQueue<Block, ParachainClient<rococo_parachain_runtime::RuntimeApi>>,
|
||||
sc_service::Error,
|
||||
> {
|
||||
) -> Result<sc_consensus::DefaultImportQueue<Block>, sc_service::Error> {
|
||||
let slot_duration = cumulus_client_consensus_aura::slot_duration(&*client)?;
|
||||
|
||||
cumulus_client_consensus_aura::import_queue::<
|
||||
@@ -862,18 +838,15 @@ pub fn shell_build_import_queue<RuntimeApi>(
|
||||
config: &Configuration,
|
||||
_: Option<TelemetryHandle>,
|
||||
task_manager: &TaskManager,
|
||||
) -> Result<sc_consensus::DefaultImportQueue<Block, ParachainClient<RuntimeApi>>, sc_service::Error>
|
||||
) -> Result<sc_consensus::DefaultImportQueue<Block>, sc_service::Error>
|
||||
where
|
||||
RuntimeApi: ConstructRuntimeApi<Block, ParachainClient<RuntimeApi>> + Send + Sync + 'static,
|
||||
RuntimeApi::RuntimeApi: sp_transaction_pool::runtime_api::TaggedTransactionQueue<Block>
|
||||
+ sp_api::Metadata<Block>
|
||||
+ sp_session::SessionKeys<Block>
|
||||
+ sp_api::ApiExt<
|
||||
Block,
|
||||
StateBackend = sc_client_api::StateBackendFor<ParachainBackend, Block>,
|
||||
> + sp_offchain::OffchainWorkerApi<Block>
|
||||
+ sp_api::ApiExt<Block>
|
||||
+ sp_offchain::OffchainWorkerApi<Block>
|
||||
+ sp_block_builder::BlockBuilder<Block>,
|
||||
sc_client_api::StateBackendFor<ParachainBackend, Block>: sp_api::StateBackend<BlakeTwo256>,
|
||||
{
|
||||
cumulus_client_consensus_relay_chain::import_queue(
|
||||
client,
|
||||
@@ -898,13 +871,10 @@ where
|
||||
RuntimeApi::RuntimeApi: sp_transaction_pool::runtime_api::TaggedTransactionQueue<Block>
|
||||
+ sp_api::Metadata<Block>
|
||||
+ sp_session::SessionKeys<Block>
|
||||
+ sp_api::ApiExt<
|
||||
Block,
|
||||
StateBackend = sc_client_api::StateBackendFor<ParachainBackend, Block>,
|
||||
> + sp_offchain::OffchainWorkerApi<Block>
|
||||
+ sp_api::ApiExt<Block>
|
||||
+ sp_offchain::OffchainWorkerApi<Block>
|
||||
+ sp_block_builder::BlockBuilder<Block>
|
||||
+ cumulus_primitives_core::CollectCollationInfo<Block>,
|
||||
sc_client_api::StateBackendFor<ParachainBackend, Block>: sp_api::StateBackend<BlakeTwo256>,
|
||||
{
|
||||
start_shell_node_impl::<RuntimeApi, _, _, _>(
|
||||
parachain_config,
|
||||
@@ -1052,8 +1022,8 @@ where
|
||||
{
|
||||
async fn verify(
|
||||
&mut self,
|
||||
block_import: BlockImportParams<Block, ()>,
|
||||
) -> Result<BlockImportParams<Block, ()>, String> {
|
||||
block_import: BlockImportParams<Block>,
|
||||
) -> Result<BlockImportParams<Block>, String> {
|
||||
if self
|
||||
.client
|
||||
.runtime_api()
|
||||
@@ -1074,19 +1044,16 @@ pub fn aura_build_import_queue<RuntimeApi, AuraId: AppCrypto>(
|
||||
config: &Configuration,
|
||||
telemetry_handle: Option<TelemetryHandle>,
|
||||
task_manager: &TaskManager,
|
||||
) -> Result<sc_consensus::DefaultImportQueue<Block, ParachainClient<RuntimeApi>>, sc_service::Error>
|
||||
) -> Result<sc_consensus::DefaultImportQueue<Block>, sc_service::Error>
|
||||
where
|
||||
RuntimeApi: ConstructRuntimeApi<Block, ParachainClient<RuntimeApi>> + Send + Sync + 'static,
|
||||
RuntimeApi::RuntimeApi: sp_transaction_pool::runtime_api::TaggedTransactionQueue<Block>
|
||||
+ sp_api::Metadata<Block>
|
||||
+ sp_session::SessionKeys<Block>
|
||||
+ sp_api::ApiExt<
|
||||
Block,
|
||||
StateBackend = sc_client_api::StateBackendFor<ParachainBackend, Block>,
|
||||
> + sp_offchain::OffchainWorkerApi<Block>
|
||||
+ sp_api::ApiExt<Block>
|
||||
+ sp_offchain::OffchainWorkerApi<Block>
|
||||
+ sp_block_builder::BlockBuilder<Block>
|
||||
+ sp_consensus_aura::AuraApi<Block, <<AuraId as AppCrypto>::Pair as Pair>::Public>,
|
||||
sc_client_api::StateBackendFor<ParachainBackend, Block>: sp_api::StateBackend<BlakeTwo256>,
|
||||
<<AuraId as AppCrypto>::Pair as Pair>::Signature:
|
||||
TryFrom<Vec<u8>> + std::hash::Hash + sp_runtime::traits::Member + Codec,
|
||||
{
|
||||
@@ -1146,16 +1113,13 @@ where
|
||||
RuntimeApi::RuntimeApi: sp_transaction_pool::runtime_api::TaggedTransactionQueue<Block>
|
||||
+ sp_api::Metadata<Block>
|
||||
+ sp_session::SessionKeys<Block>
|
||||
+ sp_api::ApiExt<
|
||||
Block,
|
||||
StateBackend = sc_client_api::StateBackendFor<ParachainBackend, Block>,
|
||||
> + sp_offchain::OffchainWorkerApi<Block>
|
||||
+ sp_api::ApiExt<Block>
|
||||
+ sp_offchain::OffchainWorkerApi<Block>
|
||||
+ sp_block_builder::BlockBuilder<Block>
|
||||
+ cumulus_primitives_core::CollectCollationInfo<Block>
|
||||
+ sp_consensus_aura::AuraApi<Block, <<AuraId as AppCrypto>::Pair as Pair>::Public>
|
||||
+ pallet_transaction_payment_rpc::TransactionPaymentRuntimeApi<Block, Balance>
|
||||
+ frame_rpc_system::AccountNonceApi<Block, AccountId, Nonce>,
|
||||
sc_client_api::StateBackendFor<ParachainBackend, Block>: sp_api::StateBackend<BlakeTwo256>,
|
||||
<<AuraId as AppCrypto>::Pair as Pair>::Signature:
|
||||
TryFrom<Vec<u8>> + std::hash::Hash + sp_runtime::traits::Member + Codec,
|
||||
{
|
||||
@@ -1314,15 +1278,12 @@ where
|
||||
RuntimeApi::RuntimeApi: sp_transaction_pool::runtime_api::TaggedTransactionQueue<Block>
|
||||
+ sp_api::Metadata<Block>
|
||||
+ sp_session::SessionKeys<Block>
|
||||
+ sp_api::ApiExt<
|
||||
Block,
|
||||
StateBackend = sc_client_api::StateBackendFor<ParachainBackend, Block>,
|
||||
> + sp_offchain::OffchainWorkerApi<Block>
|
||||
+ sp_api::ApiExt<Block>
|
||||
+ sp_offchain::OffchainWorkerApi<Block>
|
||||
+ sp_block_builder::BlockBuilder<Block>
|
||||
+ cumulus_primitives_core::CollectCollationInfo<Block>
|
||||
+ pallet_transaction_payment_rpc::TransactionPaymentRuntimeApi<Block, Balance>
|
||||
+ frame_rpc_system::AccountNonceApi<Block, AccountId, Nonce>,
|
||||
sc_client_api::StateBackendFor<ParachainBackend, Block>: sp_api::StateBackend<BlakeTwo256>,
|
||||
RB: Fn(Arc<ParachainClient<RuntimeApi>>) -> Result<jsonrpsee::RpcModule<()>, sc_service::Error>,
|
||||
BIQ: FnOnce(
|
||||
Arc<ParachainClient<RuntimeApi>>,
|
||||
@@ -1330,10 +1291,7 @@ where
|
||||
&Configuration,
|
||||
Option<TelemetryHandle>,
|
||||
&TaskManager,
|
||||
) -> Result<
|
||||
sc_consensus::DefaultImportQueue<Block, ParachainClient<RuntimeApi>>,
|
||||
sc_service::Error,
|
||||
>,
|
||||
) -> Result<sc_consensus::DefaultImportQueue<Block>, sc_service::Error>,
|
||||
BIC: FnOnce(
|
||||
Arc<ParachainClient<RuntimeApi>>,
|
||||
ParachainBlockImport<RuntimeApi>,
|
||||
@@ -1504,10 +1462,7 @@ pub fn contracts_rococo_build_import_queue(
|
||||
config: &Configuration,
|
||||
telemetry: Option<TelemetryHandle>,
|
||||
task_manager: &TaskManager,
|
||||
) -> Result<
|
||||
sc_consensus::DefaultImportQueue<Block, ParachainClient<contracts_rococo_runtime::RuntimeApi>>,
|
||||
sc_service::Error,
|
||||
> {
|
||||
) -> Result<sc_consensus::DefaultImportQueue<Block>, sc_service::Error> {
|
||||
let slot_duration = cumulus_client_consensus_aura::slot_duration(&*client)?;
|
||||
|
||||
cumulus_client_consensus_aura::import_queue::<
|
||||
|
||||
@@ -10,6 +10,7 @@ codec = { package = "parity-scale-codec", version = "3.0.0", default-features =
|
||||
# Substrate
|
||||
sp-runtime = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "master" }
|
||||
sp-state-machine = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "master" }
|
||||
sp-trie = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "master" }
|
||||
sp-std = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "master" }
|
||||
|
||||
# Polkadot
|
||||
@@ -24,6 +25,7 @@ std = [
|
||||
"codec/std",
|
||||
"sp-runtime/std",
|
||||
"sp-state-machine/std",
|
||||
"sp-trie/std",
|
||||
"sp-std/std",
|
||||
"cumulus-primitives-core/std",
|
||||
]
|
||||
|
||||
@@ -19,8 +19,8 @@ use cumulus_primitives_core::{
|
||||
};
|
||||
use polkadot_primitives::UpgradeGoAhead;
|
||||
use sp_runtime::traits::HashingFor;
|
||||
use sp_state_machine::MemoryDB;
|
||||
use sp_std::collections::btree_map::BTreeMap;
|
||||
use sp_trie::PrefixedMemoryDB;
|
||||
|
||||
/// Builds a sproof (portmanteau of 'spoof' and 'proof') of the relay chain state.
|
||||
#[derive(Clone)]
|
||||
@@ -105,7 +105,8 @@ impl RelayStateSproofBuilder {
|
||||
pub fn into_state_root_and_proof(
|
||||
self,
|
||||
) -> (polkadot_primitives::Hash, sp_state_machine::StorageProof) {
|
||||
let (db, root) = MemoryDB::<HashingFor<polkadot_primitives::Block>>::default_with_root();
|
||||
let (db, root) =
|
||||
PrefixedMemoryDB::<HashingFor<polkadot_primitives::Block>>::default_with_root();
|
||||
let state_version = Default::default(); // for test using default.
|
||||
let mut backend = sp_state_machine::TrieBackendBuilder::new(db, root).build();
|
||||
|
||||
|
||||
@@ -46,7 +46,6 @@ sp-runtime = { git = "https://github.com/paritytech/substrate", default-features
|
||||
sp-state-machine = { git = "https://github.com/paritytech/substrate", branch = "master" }
|
||||
sp-tracing = { git = "https://github.com/paritytech/substrate", branch = "master" }
|
||||
sp-timestamp = { git = "https://github.com/paritytech/substrate", branch = "master" }
|
||||
sp-trie = { git = "https://github.com/paritytech/substrate", branch = "master" }
|
||||
sp-consensus = { git = "https://github.com/paritytech/substrate", branch = "master" }
|
||||
substrate-test-client = { git = "https://github.com/paritytech/substrate", branch = "master" }
|
||||
sc-cli = { git = "https://github.com/paritytech/substrate", branch = "master" }
|
||||
|
||||
@@ -72,9 +72,8 @@ use sp_arithmetic::traits::SaturatedConversion;
|
||||
use sp_blockchain::HeaderBackend;
|
||||
use sp_core::{Pair, H256};
|
||||
use sp_keyring::Sr25519Keyring;
|
||||
use sp_runtime::{codec::Encode, generic, traits::BlakeTwo256};
|
||||
use sp_runtime::{codec::Encode, generic};
|
||||
use sp_state_machine::BasicExternalities;
|
||||
use sp_trie::PrefixedMemoryDB;
|
||||
use std::sync::Arc;
|
||||
use substrate_test_client::{
|
||||
BlockchainEventsExt, RpcHandlersExt, RpcTransactionError, RpcTransactionOutput,
|
||||
@@ -183,7 +182,7 @@ pub fn new_partial(
|
||||
Client,
|
||||
Backend,
|
||||
(),
|
||||
sc_consensus::import_queue::BasicQueue<Block, PrefixedMemoryDB<BlakeTwo256>>,
|
||||
sc_consensus::import_queue::BasicQueue<Block>,
|
||||
sc_transaction_pool::FullPool<Block, Client>,
|
||||
ParachainBlockImport,
|
||||
>,
|
||||
|
||||
Reference in New Issue
Block a user