Unverified Commit 8a8d52b6 authored by Gavin Wood's avatar Gavin Wood Committed by GitHub
Browse files

Update substrate (#878)

* Switch branch

* Small changes

* Update substrate branch

* Switch

* Revert "Switch branch"

This reverts commit b9d48b2c.

* fix

* add `wipe` and `commit`

* Remove deprecated_host_interface

* Switch branch

* HasherFor -> HashFor

* More HasherFor changes

* Final touches

* Revert "Switch branch"

This reverts commit d0da2731

.
Co-authored-by: thiolliere's avatarthiolliere <gui.thiolliere@gmail.com>
Co-authored-by: Shawn Tabrizi's avatarShawn Tabrizi <shawntabrizi@gmail.com>
parent 9a4e33f0
Pipeline #81659 passed with stages
in 23 minutes and 4 seconds
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -32,7 +32,7 @@ use polkadot_primitives::{
ParachainHost, AvailableData, OmittedValidationData,
},
};
use sp_runtime::traits::{BlakeTwo256, Hash as HashT, HasherFor};
use sp_runtime::traits::{BlakeTwo256, Hash as HashT, HashFor};
use sp_blockchain::{Result as ClientResult};
use client::{
BlockchainEvents, BlockBody,
......@@ -199,7 +199,7 @@ impl Store {
P::Api: ParachainHost<Block>,
P::Api: ApiExt<Block, Error=sp_blockchain::Error>,
// Rust bug: https://github.com/rust-lang/rust/issues/24159
sp_api::StateBackendFor<P, Block>: sp_api::StateBackend<HasherFor<Block>>,
sp_api::StateBackendFor<P, Block>: sp_api::StateBackend<HashFor<Block>>,
{
let to_worker = self.to_worker.clone();
......
......@@ -21,7 +21,7 @@ use std::thread;
use log::{error, info, trace, warn};
use sp_blockchain::{Result as ClientResult};
use sp_runtime::traits::{Header as HeaderT, Block as BlockT, HasherFor};
use sp_runtime::traits::{Header as HeaderT, Block as BlockT, HashFor, BlakeTwo256};
use sp_api::{ApiExt, ProvideRuntimeApi};
use client::{
BlockchainEvents, BlockBody,
......@@ -205,7 +205,7 @@ where
P: ProvideRuntimeApi<Block>,
P::Api: ParachainHost<Block, Error = sp_blockchain::Error>,
// Rust bug: https://github.com/rust-lang/rust/issues/24159
sp_api::StateBackendFor<P, Block>: sp_api::StateBackend<HasherFor<Block>>,
sp_api::StateBackendFor<P, Block>: sp_api::StateBackend<HashFor<Block>>,
{
let api = client.runtime_api();
......@@ -229,7 +229,7 @@ where
P::Api: ParachainHost<Block> + ApiExt<Block, Error=sp_blockchain::Error>,
S: Sink<WorkerMsg> + Clone + Send + Sync + Unpin,
// Rust bug: https://github.com/rust-lang/rust/issues/24159
sp_api::StateBackendFor<P, Block>: sp_api::StateBackend<HasherFor<Block>>,
sp_api::StateBackendFor<P, Block>: sp_api::StateBackend<HashFor<Block>>,
{
let mut finality_notification_stream = client.finality_notification_stream();
......@@ -613,7 +613,7 @@ impl<I, P> BlockImport<Block> for AvailabilityBlockImport<I, P> where
P: ProvideRuntimeApi<Block> + ProvideCache<Block>,
P::Api: ParachainHost<Block, Error = sp_blockchain::Error>,
// Rust bug: https://github.com/rust-lang/rust/issues/24159
sp_api::StateBackendFor<P, Block>: sp_api::StateBackend<sp_core::Blake2Hasher>
sp_api::StateBackendFor<P, Block>: sp_api::StateBackend<BlakeTwo256>
{
type Error = ConsensusError;
type Transaction = sp_api::TransactionFor<P, Block>;
......@@ -726,7 +726,7 @@ impl<I, P> AvailabilityBlockImport<I, P> {
P::Api: ParachainHost<Block>,
P::Api: ApiExt<Block, Error = sp_blockchain::Error>,
// Rust bug: https://github.com/rust-lang/rust/issues/24159
sp_api::StateBackendFor<P, Block>: sp_api::StateBackend<HasherFor<Block>>,
sp_api::StateBackendFor<P, Block>: sp_api::StateBackend<HashFor<Block>>,
{
let (signal, exit) = exit_future::signal();
......
......@@ -26,7 +26,7 @@ tokio = { version = "0.2.10", features = ["rt-threaded"], optional = true }
wasm-bindgen = { version = "0.2.57", optional = true }
wasm-bindgen-futures = { version = "0.4.7", optional = true }
browser-utils = { package = "browser-utils", git = "https://github.com/paritytech/substrate", branch = "polkadot-master", optional = true }
browser-utils = { package = "substrate-browser-utils", git = "https://github.com/paritytech/substrate", branch = "polkadot-master", optional = true }
[features]
default = [ "wasmtime", "rocksdb", "cli" ]
......
......@@ -15,7 +15,7 @@
// along with Polkadot. If not, see <http://www.gnu.org/licenses/>.
use log::info;
use sp_core::Blake2Hasher;
use sp_runtime::traits::BlakeTwo256;
use service::{IsKusama, Block, self, RuntimeApiCollection, TFullClient};
use sp_api::ConstructRuntimeApi;
use sc_executor::NativeExecutionDispatch;
......@@ -116,7 +116,7 @@ where
D: service::NativeExecutionDispatch + 'static,
// Rust bug: https://github.com/rust-lang/rust/issues/24159
<<R as ConstructRuntimeApi<Block, TFullClient<Block, R, D>>>::RuntimeApi as sp_api::ApiExt<Block>>::StateBackend:
sp_api::StateBackend<Blake2Hasher>,
sp_api::StateBackend<BlakeTwo256>,
// Rust bug: https://github.com/rust-lang/rust/issues/43580
R: ConstructRuntimeApi<
Block,
......@@ -140,11 +140,11 @@ where
// We can't simply use `service::TLightClient` due to a
// Rust bug: https://github.com/rust-lang/rust/issues/43580
type TLightClient<Runtime, Dispatch> = sc_client::Client<
sc_client::light::backend::Backend<sc_client_db::light::LightStorage<Block>, Blake2Hasher>,
sc_client::light::backend::Backend<sc_client_db::light::LightStorage<Block>, BlakeTwo256>,
sc_client::light::call_executor::GenesisCallExecutor<
sc_client::light::backend::Backend<sc_client_db::light::LightStorage<Block>, Blake2Hasher>,
sc_client::light::backend::Backend<sc_client_db::light::LightStorage<Block>, BlakeTwo256>,
sc_client::LocalCallExecutor<
sc_client::light::backend::Backend<sc_client_db::light::LightStorage<Block>, Blake2Hasher>,
sc_client::light::backend::Backend<sc_client_db::light::LightStorage<Block>, BlakeTwo256>,
sc_executor::NativeExecutor<Dispatch>
>
>,
......
......@@ -52,7 +52,8 @@ use std::time::Duration;
use futures::{future, Future, Stream, FutureExt, TryFutureExt, StreamExt, task::Spawn};
use log::warn;
use sc_client::BlockchainEvents;
use sp_core::{Pair, Blake2Hasher};
use sp_core::Pair;
use sp_runtime::traits::BlakeTwo256;
use polkadot_primitives::{
BlockId, Hash, Block,
parachain::{
......@@ -145,14 +146,14 @@ pub trait BuildParachainContext {
<PolkadotClient<B, E, R> as ProvideRuntimeApi<Block>>::Api: RuntimeApiCollection<Extrinsic>,
// Rust bug: https://github.com/rust-lang/rust/issues/24159
<<PolkadotClient<B, E, R> as ProvideRuntimeApi<Block>>::Api as sp_api::ApiExt<Block>>::StateBackend:
sp_api::StateBackend<Blake2Hasher>,
sp_api::StateBackend<BlakeTwo256>,
Extrinsic: codec::Codec + Send + Sync + 'static,
E: sc_client::CallExecutor<Block> + Clone + Send + Sync + 'static,
SP: Spawn + Clone + Send + Sync + 'static,
R: Send + Sync + 'static,
B: sc_client_api::Backend<Block> + 'static,
// Rust bug: https://github.com/rust-lang/rust/issues/24159
B::State: sp_api::StateBackend<Blake2Hasher>;
B::State: sp_api::StateBackend<BlakeTwo256>;
}
/// Parachain context needed for collation.
......@@ -236,7 +237,7 @@ fn build_collator_service<S, P, Extrinsic>(
S::Backend: service::Backend<service::Block>,
// Rust bug: https://github.com/rust-lang/rust/issues/24159
<S::Backend as service::Backend<service::Block>>::State:
sp_api::StateBackend<sp_runtime::traits::HasherFor<Block>>,
sp_api::StateBackend<sp_runtime::traits::HashFor<Block>>,
// Rust bug: https://github.com/rust-lang/rust/issues/24159
S::CallExecutor: service::CallExecutor<service::Block>,
// Rust bug: https://github.com/rust-lang/rust/issues/24159
......
......@@ -35,7 +35,7 @@ use polkadot_primitives::parachain::{
use parking_lot::Mutex;
use sp_blockchain::Result as ClientResult;
use sp_api::{ApiRef, Core, RuntimeVersion, StorageProof, ApiErrorExt, ApiExt, ProvideRuntimeApi};
use sp_runtime::traits::{Block as BlockT, HasherFor, NumberFor};
use sp_runtime::traits::{Block as BlockT, HashFor, NumberFor};
use sp_state_machine::ChangesTrieState;
use std::collections::HashMap;
......@@ -206,7 +206,7 @@ impl ApiErrorExt for RuntimeApi {
}
impl ApiExt<Block> for RuntimeApi {
type StateBackend = sp_state_machine::InMemoryBackend<sp_api::HasherFor<Block>>;
type StateBackend = sp_state_machine::InMemoryBackend<HashFor<Block>>;
fn map_api_result<F: FnOnce(&Self) -> Result<R, E>, R, E>(
&self,
......@@ -228,7 +228,7 @@ impl ApiExt<Block> for RuntimeApi {
fn into_storage_changes(
&self,
_: &Self::StateBackend,
_: Option<&ChangesTrieState<HasherFor<Block>, NumberFor<Block>>>,
_: Option<&ChangesTrieState<HashFor<Block>, NumberFor<Block>>>,
_: <Block as sp_api::BlockT>::Hash,
) -> std::result::Result<sp_api::StorageChanges<Self::StateBackend, Block>, String>
where Self: Sized
......
......@@ -758,9 +758,6 @@ async fn statement_import_loop<Api>(
if let Some(producer) = producer {
trace!(target: "validation", "driving statement work to completion");
let table = table.clone();
let gossip_handle = gossip_handle.clone();
let work = producer.prime(api.clone()).validate();
let work = future::select(work.boxed(), exit.clone()).map(drop);
let _ = executor.spawn(work);
......
......@@ -143,7 +143,6 @@ pub fn validate_candidate<E: Externalities + 'static>(
/// The host functions provided by the wasm executor to the parachain wasm blob.
type HostFunctions = (
sp_io::SubstrateHostFunctions,
sc_executor::deprecated_host_interface::SubstrateExternals,
crate::wasm_api::parachain::HostFunctions,
);
......@@ -251,6 +250,14 @@ impl sp_externalities::Externalities for ValidationExternalities {
fn next_storage_key(&self, _: &[u8]) -> Option<Vec<u8>> {
panic!("next_storage_key: unsupported feature for parachain validation")
}
fn wipe(&mut self) {
panic!("wipe: unsupported feature for parachain validation")
}
fn commit(&mut self) {
panic!("commit: unsupported feature for parachain validation")
}
}
impl sp_externalities::ExtensionStore for ValidationExternalities {
......
......@@ -75,11 +75,19 @@ impl RewardAttestation for () {
impl<T: staking::Trait> RewardAttestation for staking::Module<T> {
fn reward_immediate(validator_indices: impl IntoIterator<Item=u32>) {
use staking::SessionInterface;
// The number of points to reward for a validity statement.
// https://research.web3.foundation/en/latest/polkadot/Token%20Economics/#payment-details
const STAKING_REWARD_POINTS: u32 = 20;
Self::reward_by_indices(validator_indices.into_iter().map(|i| (i, STAKING_REWARD_POINTS)))
let validators = T::SessionInterface::validators();
let validator_rewards = validator_indices.into_iter()
.filter_map(|i| validators.get(i as usize).cloned())
.map(|v| (v, STAKING_REWARD_POINTS));
Self::reward_by_ids(validator_rewards);
}
}
......
......@@ -1023,6 +1023,7 @@ mod tests {
pub const SlashDeferDuration: staking::EraIndex = 7;
pub const AttestationPeriod: BlockNumber = 100;
pub const RewardCurve: &'static PiecewiseLinear<'static> = &REWARD_CURVE;
pub const MaxNominatorRewardedPerValidator: u32 = 64;
}
impl staking::Trait for Test {
......@@ -1039,6 +1040,7 @@ mod tests {
type SessionInterface = Self;
type Time = timestamp::Module<Test>;
type RewardCurve = RewardCurve;
type MaxNominatorRewardedPerValidator = MaxNominatorRewardedPerValidator;
}
impl attestations::Trait for Test {
......@@ -1159,7 +1161,6 @@ mod tests {
}.assimilate_storage(&mut t).unwrap();
staking::GenesisConfig::<Test> {
current_era: 0,
stakers,
validator_count: 10,
minimum_validator_count: 8,
......
......@@ -275,6 +275,7 @@ parameter_types! {
// 28 eras in which slashes can be cancelled (7 days).
pub const SlashDeferDuration: staking::EraIndex = 28;
pub const RewardCurve: &'static PiecewiseLinear<'static> = &REWARD_CURVE;
pub const MaxNominatorRewardedPerValidator: u32 = 64;
}
impl staking::Trait for Runtime {
......@@ -292,6 +293,7 @@ impl staking::Trait for Runtime {
type SlashCancelOrigin = collective::EnsureProportionAtLeast<_1, _2, AccountId, CouncilCollective>;
type SessionInterface = Self;
type RewardCurve = RewardCurve;
type MaxNominatorRewardedPerValidator = MaxNominatorRewardedPerValidator;
}
parameter_types! {
......
......@@ -282,6 +282,7 @@ parameter_types! {
pub const BondingDuration: staking::EraIndex = 28;
pub const SlashDeferDuration: staking::EraIndex = 28;
pub const RewardCurve: &'static PiecewiseLinear<'static> = &REWARD_CURVE;
pub const MaxNominatorRewardedPerValidator: u32 = 64;
}
impl staking::Trait for Runtime {
......@@ -299,6 +300,7 @@ impl staking::Trait for Runtime {
type SlashCancelOrigin = collective::EnsureProportionAtLeast<_3, _4, AccountId, CouncilCollective>;
type SessionInterface = Self;
type RewardCurve = RewardCurve;
type MaxNominatorRewardedPerValidator = MaxNominatorRewardedPerValidator;
}
parameter_types! {
......
......@@ -52,6 +52,7 @@ system_rpc_runtime_api = { package = "frame-system-rpc-runtime-api", git = "http
codec = { package = "parity-scale-codec", version = "1.1.0" }
sp-session = { git = "https://github.com/paritytech/substrate", branch = "polkadot-master" }
sp-offchain = { package = "sp-offchain", git = "https://github.com/paritytech/substrate", branch = "polkadot-master" }
prometheus-endpoint = { package = "substrate-prometheus-endpoint", git = "https://github.com/paritytech/substrate", branch = "polkadot-master" }
[features]
default = ["rocksdb"]
......
......@@ -181,7 +181,6 @@ fn staging_testnet_config_genesis() -> polkadot::GenesisConfig {
)).collect::<Vec<_>>(),
}),
staking: Some(polkadot::StakingConfig {
current_era: 0,
validator_count: 50,
minimum_validator_count: 4,
stakers: initial_authorities
......@@ -325,7 +324,6 @@ pub fn testnet_genesis(
)).collect::<Vec<_>>(),
}),
staking: Some(polkadot::StakingConfig {
current_era: 0,
minimum_validator_count: 1,
validator_count: 2,
stakers: initial_authorities.iter()
......
......@@ -40,13 +40,12 @@ pub use sc_executor::NativeExecutionDispatch;
pub use sc_client::{ExecutionStrategy, CallExecutor, Client};
pub use sc_client_api::backend::Backend;
pub use sp_api::{Core as CoreApi, ConstructRuntimeApi, ProvideRuntimeApi, StateBackend};
pub use sp_runtime::traits::HasherFor;
pub use sp_runtime::traits::HashFor;
pub use consensus_common::SelectChain;
pub use polkadot_network::legacy::PolkadotProtocol;
pub use polkadot_primitives::parachain::{CollatorId, ParachainHost};
pub use polkadot_primitives::Block;
pub use sp_core::Blake2Hasher;
pub use sp_runtime::traits::{Block as BlockT, self as runtime_traits};
pub use sp_runtime::traits::{Block as BlockT, self as runtime_traits, BlakeTwo256};
pub use sc_network::specialization::NetworkSpecialization;
pub use chain_spec::ChainSpec;
#[cfg(not(target_os = "unknown"))]
......@@ -54,6 +53,7 @@ pub use consensus::run_validation_worker;
pub use codec::Codec;
pub use polkadot_runtime;
pub use kusama_runtime;
use prometheus_endpoint::Registry;
/// Configuration type that is being used.
///
......@@ -90,7 +90,7 @@ pub trait RuntimeApiCollection<Extrinsic: codec::Codec + Send + Sync + 'static>
+ authority_discovery_primitives::AuthorityDiscoveryApi<Block>
where
Extrinsic: RuntimeExtrinsic,
<Self as sp_api::ApiExt<Block>>::StateBackend: sp_api::StateBackend<Blake2Hasher>,
<Self as sp_api::ApiExt<Block>>::StateBackend: sp_api::StateBackend<BlakeTwo256>,
{}
impl<Api, Extrinsic> RuntimeApiCollection<Extrinsic> for Api
......@@ -108,7 +108,7 @@ where
+ sp_session::SessionKeys<Block>
+ authority_discovery_primitives::AuthorityDiscoveryApi<Block>,
Extrinsic: RuntimeExtrinsic,
<Self as sp_api::ApiExt<Block>>::StateBackend: sp_api::StateBackend<Blake2Hasher>,
<Self as sp_api::ApiExt<Block>>::StateBackend: sp_api::StateBackend<BlakeTwo256>,
{}
pub trait RuntimeExtrinsic: codec::Codec + Send + Sync + 'static
......@@ -152,7 +152,7 @@ macro_rules! new_full_start {
let select_chain = select_chain.take()
.ok_or_else(|| service::Error::SelectChainRequired)?;
let (grandpa_block_import, grandpa_link) =
grandpa::block_import::<_, _, _, Runtime, _>(
grandpa::block_import(
client.clone(), &*client, select_chain
)?;
let justification_import = grandpa_block_import.clone();
......@@ -177,7 +177,10 @@ macro_rules! new_full_start {
})?
.with_rpc_extensions(|builder| -> Result<polkadot_rpc::RpcExtension, _> {
Ok(polkadot_rpc::create_full(builder.client().clone(), builder.pool()))
})?;
})?
.with_prometheus_registry(
Registry::new_custom(Some("polkadot".into()), None)?
);
(builder, import_setup, inherent_data_providers)
}}
......@@ -192,7 +195,7 @@ where
RuntimeApiCollection<Extrinsic, StateBackend = sc_client_api::StateBackendFor<TFullBackend<Block>, Block>>,
Dispatch: NativeExecutionDispatch + 'static,
Extrinsic: RuntimeExtrinsic,
<Runtime::RuntimeApi as sp_api::ApiExt<Block>>::StateBackend: sp_api::StateBackend<Blake2Hasher>,
<Runtime::RuntimeApi as sp_api::ApiExt<Block>>::StateBackend: sp_api::StateBackend<BlakeTwo256>,
{
config.keystore = service::config::KeystoreConfig::InMemory;
Ok(new_full_start!(config, Runtime, Dispatch).0)
......@@ -261,7 +264,7 @@ pub fn new_full<Runtime, Dispatch, Extrinsic>(
Dispatch: NativeExecutionDispatch + 'static,
Extrinsic: RuntimeExtrinsic,
// Rust bug: https://github.com/rust-lang/rust/issues/24159
<Runtime::RuntimeApi as sp_api::ApiExt<Block>>::StateBackend: sp_api::StateBackend<Blake2Hasher>,
<Runtime::RuntimeApi as sp_api::ApiExt<Block>>::StateBackend: sp_api::StateBackend<BlakeTwo256>,
{
use sc_network::Event;
use futures::stream::StreamExt;
......@@ -475,6 +478,7 @@ pub fn new_full<Runtime, Dispatch, Extrinsic>(
on_exit: service.on_exit(),
telemetry_on_connect: Some(service.telemetry_on_connect_stream()),
voting_rule: grandpa::VotingRulesBuilder::default().build(),
prometheus_registry: service.prometheus_registry(),
};
service.spawn_essential_task(
......@@ -529,13 +533,13 @@ pub fn kusama_new_light(
// We can't use service::TLightClient due to
// Rust bug: https://github.com/rust-lang/rust/issues/43580
type TLocalLightClient<Runtime, Dispatch> = Client<
sc_client::light::backend::Backend<sc_client_db::light::LightStorage<Block>, sp_core::Blake2Hasher>,
sc_client::light::backend::Backend<sc_client_db::light::LightStorage<Block>, BlakeTwo256>,
sc_client::light::call_executor::GenesisCallExecutor<
sc_client::light::backend::Backend<sc_client_db::light::LightStorage<Block>, sp_core::Blake2Hasher>,
sc_client::light::backend::Backend<sc_client_db::light::LightStorage<Block>, BlakeTwo256>,
sc_client::LocalCallExecutor<
sc_client::light::backend::Backend<
sc_client_db::light::LightStorage<Block>,
sp_core::Blake2Hasher
BlakeTwo256
>,
sc_executor::NativeExecutor<Dispatch>
>
......@@ -589,7 +593,7 @@ where
let fetch_checker = fetcher
.map(|fetcher| fetcher.checker().clone())
.ok_or_else(|| "Trying to start light import queue without active fetch checker")?;
let grandpa_block_import = grandpa::light_block_import::<_, _, _, Runtime>(
let grandpa_block_import = grandpa::light_block_import(
client.clone(), backend, &*client, Arc::new(fetch_checker)
)?;
......@@ -628,5 +632,8 @@ where
Ok(polkadot_rpc::create_light(builder.client().clone(), remote_blockchain, fetcher, builder.pool()))
})?
.with_prometheus_registry(
Registry::new_custom(Some("polkadot".into()), None)?
)
.build()
}
......@@ -13,5 +13,5 @@ sp-core = { git = "https://github.com/paritytech/substrate", branch = "polkadot-
client = { package = "sc-client", git = "https://github.com/paritytech/substrate", branch = "polkadot-master" }
client-api = { package = "sc-client-api", git = "https://github.com/paritytech/substrate", branch = "polkadot-master" }
parking_lot = "0.10.0"
codec = { package = "parity-scale-codec", version = "1.1.0" }
codec = { package = "parity-scale-codec", version = "1.2.0" }
futures = "0.3.4"
......@@ -33,7 +33,7 @@ use polkadot_primitives::{Hash, Block, BlockId, Header};
use polkadot_primitives::parachain::{
ParachainHost, AttestedCandidate, NEW_HEADS_IDENTIFIER,
};
use runtime_primitives::traits::{DigestFor, HasherFor};
use runtime_primitives::traits::{DigestFor, HashFor};
use futures_timer::Delay;
use txpool_api::{TransactionPool, InPoolTransaction};
......@@ -90,7 +90,7 @@ where
State = sp_api::StateBackendFor<Client, Block>
> + 'static,
// Rust bug: https://github.com/rust-lang/rust/issues/24159
sp_api::StateBackendFor<Client, Block>: sp_api::StateBackend<HasherFor<Block>> + Send,
sp_api::StateBackendFor<Client, Block>: sp_api::StateBackend<HashFor<Block>> + Send,
{
type CreateProposer = Pin<Box<
dyn Future<Output = Result<Self::Proposer, Self::Error>> + Send + 'static
......@@ -142,7 +142,7 @@ impl<Client, TxPool, Backend> consensus::Proposer<Block> for Proposer<Client, Tx
Client::Api: ParachainHost<Block> + BlockBuilderApi<Block> + ApiExt<Block, Error = sp_blockchain::Error>,
Backend: sc_client_api::Backend<Block, State = sp_api::StateBackendFor<Client, Block>> + 'static,
// Rust bug: https://github.com/rust-lang/rust/issues/24159
sp_api::StateBackendFor<Client, Block>: sp_api::StateBackend<HasherFor<Block>> + Send,
sp_api::StateBackendFor<Client, Block>: sp_api::StateBackend<HashFor<Block>> + Send,
{
type Error = Error;
type Transaction = sp_api::TransactionFor<Client, Block>;
......@@ -249,7 +249,7 @@ impl<Client, TxPool, Backend> CreateProposalData<Client, TxPool, Backend> where
Client::Api: ParachainHost<Block> + BlockBuilderApi<Block> + ApiExt<Block, Error = sp_blockchain::Error>,
Backend: sc_client_api::Backend<Block, State = sp_api::StateBackendFor<Client, Block>> + 'static,
// Rust bug: https://github.com/rust-lang/rust/issues/24159
sp_api::StateBackendFor<Client, Block>: sp_api::StateBackend<HasherFor<Block>> + Send,
sp_api::StateBackendFor<Client, Block>: sp_api::StateBackend<HashFor<Block>> + Send,
{
fn propose_with(
mut self,
......
......@@ -41,7 +41,7 @@ use polkadot_primitives::parachain::{
use babe_primitives::BabeApi;
use keystore::KeyStorePtr;
use sp_api::{ApiExt, ProvideRuntimeApi};
use runtime_primitives::traits::HasherFor;
use runtime_primitives::traits::HashFor;
use availability_store::Store as AvailabilityStore;
use log::{warn, error, info, debug};
......@@ -152,7 +152,7 @@ impl<C, N, P, SC, SP> ServiceBuilder<C, N, P, SC, SP> where
SC: SelectChain<Block> + 'static,
SP: Spawn + Send + 'static,
// Rust bug: https://github.com/rust-lang/rust/issues/24159
sp_api::StateBackendFor<P, Block>: sp_api::StateBackend<HasherFor<Block>>,
sp_api::StateBackendFor<P, Block>: sp_api::StateBackend<HashFor<Block>>,
{
/// Build the service - this consists of a handle to it, as well as a background
/// future to be run to completion.
......@@ -275,7 +275,7 @@ impl<C, N, P, SP> ParachainValidationInstances<C, N, P, SP> where
N::BuildTableRouter: Unpin + Send + 'static,
SP: Spawn + Send + 'static,
// Rust bug: https://github.com/rust-lang/rust/issues/24159
sp_api::StateBackendFor<P, Block>: sp_api::StateBackend<HasherFor<Block>>,
sp_api::StateBackendFor<P, Block>: sp_api::StateBackend<HashFor<Block>>,
{
/// Get an attestation table for given parent hash.
///
......
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