Unverified Commit 0a7d04d0 authored by Gavin Wood's avatar Gavin Wood Committed by GitHub
Browse files

Reduce Westend deposit requirements (#1341)

* Switch branch

* Return chain ops parts in new_chain_ops

* Remove where param from new_chain_ops

* Add task manager to new_chain_ops return

* Revert branch switch

* Revert "Revert branch switch"

This reverts commit 7c7900c0.

* network/test/src/lib: Adjust network worker polling

Companion for https://github.com/paritytech/substrate/pull/6552

.

* Fix adder parachain

* Fix collator tests

* Revert branch switch

* Bump everything

- Remove old migration code
- Reduce deposit requried for westend

* Reapply fixes

* Bump locl

* Fix for #6550

* Fix message
Co-authored-by: default avatarAshley Ruglys <ashley.ruglys@gmail.com>
Co-authored-by: default avatarMax Inden <mail@max-inden.de>
parent aeb79d47
Pipeline #99261 passed with stages
in 23 minutes and 47 seconds
This diff is collapsed.
......@@ -4,7 +4,7 @@ path = "src/main.rs"
[package]
name = "polkadot"
version = "0.8.13"
version = "0.8.14"
authors = ["Parity Technologies <admin@parity.io>"]
edition = "2018"
......
[package]
name = "polkadot-availability-store"
description = "Persistent database for parachain data"
version = "0.8.13"
version = "0.8.14"
authors = ["Parity Technologies <admin@parity.io>"]
edition = "2018"
......
[package]
name = "polkadot-cli"
version = "0.8.13"
version = "0.8.14"
authors = ["Parity Technologies <admin@parity.io>"]
description = "Polkadot Relay-chain Client Node"
edition = "2018"
......
......@@ -30,19 +30,19 @@ fn get_exec_name() -> Option<String> {
}
impl SubstrateCli for Cli {
fn impl_name() -> &'static str { "Parity Polkadot" }
fn impl_name() -> String { "Parity Polkadot".into() }
fn impl_version() -> &'static str { env!("SUBSTRATE_CLI_IMPL_VERSION") }
fn impl_version() -> String { env!("SUBSTRATE_CLI_IMPL_VERSION").into() }
fn description() -> &'static str { env!("CARGO_PKG_DESCRIPTION") }
fn description() -> String { env!("CARGO_PKG_DESCRIPTION").into() }
fn author() -> &'static str { env!("CARGO_PKG_AUTHORS") }
fn author() -> String { env!("CARGO_PKG_AUTHORS").into() }
fn support_url() -> &'static str { "https://github.com/paritytech/polkadot/issues/new" }
fn support_url() -> String { "https://github.com/paritytech/polkadot/issues/new".into() }
fn copyright_start_year() -> i32 { 2017 }
fn executable_name() -> &'static str { "polkadot" }
fn executable_name() -> String { "polkadot".into() }
fn load_spec(&self, id: &str) -> std::result::Result<Box<dyn sc_service::ChainSpec>, String> {
let id = if id == "" {
......
[package]
name = "polkadot-collator"
version = "0.8.13"
version = "0.8.14"
authors = ["Parity Technologies <admin@parity.io>"]
description = "Collator node implementation"
edition = "2018"
......
......@@ -373,12 +373,15 @@ fn build_collator_service<P, C, R, Extrinsic>(
/// Async function that will run the collator node with the given `RelayChainContext` and `ParachainContext`
/// built by the given `BuildParachainContext` and arguments to the underlying polkadot node.
pub async fn start_collator<P>(
pub fn start_collator<P>(
build_parachain_context: P,
para_id: ParaId,
key: Arc<CollatorPair>,
config: Configuration,
) -> Result<(), polkadot_service::Error>
) -> Result<
(Pin<Box<dyn Future<Output = ()> + Send>>, sc_service::TaskManager),
polkadot_service::Error
>
where
P: 'static + BuildParachainContext,
P::ParachainContext: Send + 'static,
......@@ -400,14 +403,15 @@ where
None,
)?;
let spawn_handle = task_manager.spawn_handle();
build_collator_service(
let future = build_collator_service(
spawn_handle,
handlers,
client,
para_id,
key,
build_parachain_context
)?.await;
)?;
Ok((future.boxed(), task_manager))
} else if config.chain_spec.is_westend() {
let (task_manager, client, handlers) = service::westend_new_full(
config,
......@@ -418,14 +422,15 @@ where
None,
)?;
let spawn_handle = task_manager.spawn_handle();
build_collator_service(
let future = build_collator_service(
spawn_handle,
handlers,
client,
para_id,
key,
build_parachain_context
)?.await;
)?;
Ok((future.boxed(), task_manager))
} else {
let (task_manager, client, handles) = service::polkadot_new_full(
config,
......@@ -436,17 +441,16 @@ where
None,
)?;
let spawn_handle = task_manager.spawn_handle();
build_collator_service(
let future = build_collator_service(
spawn_handle,
handles,
client,
para_id,
key,
build_parachain_context,
)?.await;
build_parachain_context
)?;
Ok((future.boxed(), task_manager))
}
Ok(())
}
#[cfg(not(feature = "service-rewr"))]
......@@ -506,7 +510,7 @@ mod tests {
fn check_send<T: Send>(_: T) {}
let cli = Cli::from_iter(&["-dev"]);
let task_executor = |_, _| unimplemented!();
let task_executor = |_, _| {};
let config = cli.create_configuration(&cli.run.base, task_executor.into()).unwrap();
check_send(start_collator(
......
[package]
name = "polkadot-erasure-coding"
version = "0.8.13"
version = "0.8.14"
authors = ["Parity Technologies <admin@parity.io>"]
edition = "2018"
......
[package]
name = "polkadot-network"
version = "0.8.13"
version = "0.8.14"
authors = ["Parity Technologies <admin@parity.io>"]
description = "Polkadot-specific networking protocol"
edition = "2018"
......
[package]
name = "polkadot-network-test"
version = "0.8.13"
version = "0.8.14"
license = "GPL-3.0"
authors = ["Parity Technologies <admin@parity.io>"]
edition = "2018"
......
......@@ -758,13 +758,13 @@ pub trait TestNetFactory: Sized {
futures::executor::block_on(futures::future::poll_fn::<(), _>(|cx| self.poll_until_idle(cx)));
}
/// Polls the testnet. Processes all the pending actions and returns `NotReady`.
/// Polls the testnet. Processes all the pending actions.
fn poll(&mut self, cx: &mut FutureContext) {
self.mut_peers(|peers| {
for peer in peers {
trace!(target: "sync", "-- Polling {}", peer.id());
if let Poll::Ready(res) = Pin::new(&mut peer.network).poll(cx) {
res.unwrap();
if let Poll::Ready(()) = peer.network.poll_unpin(cx) {
panic!("NetworkWorker has terminated unexpectedly.")
}
trace!(target: "sync", "-- Polling complete {}", peer.id());
......
......@@ -31,6 +31,7 @@ sc-chain-spec = { git = "https://github.com/paritytech/substrate", branch = "mas
sc-executor = { git = "https://github.com/paritytech/substrate", branch = "master" }
sc-consensus = { git = "https://github.com/paritytech/substrate", branch = "master" }
sc-network = { git = "https://github.com/paritytech/substrate", branch = "master" }
sp-trie = { git = "https://github.com/paritytech/substrate", branch = "master" }
consensus_common = { package = "sp-consensus", git = "https://github.com/paritytech/substrate", branch = "master" }
grandpa = { package = "sc-finality-grandpa", git = "https://github.com/paritytech/substrate", branch = "master" }
grandpa_primitives = { package = "sp-finality-grandpa", git = "https://github.com/paritytech/substrate", branch = "master" }
......
......@@ -34,10 +34,11 @@ use polkadot_subsystem::{
Subsystem, SubsystemContext, SpawnedSubsystem,
messages::{CandidateValidationMessage, CandidateBackingMessage},
};
use sp_trie::PrefixedMemoryDB;
pub use service::{
Role, PruningMode, TransactionPoolOptions, Error, RuntimeGenesis,
TFullClient, TLightClient, TFullBackend, TLightBackend, TFullCallExecutor, TLightCallExecutor,
Configuration, ChainSpec, ServiceBuilderCommand, ServiceComponents, TaskManager,
Configuration, ChainSpec, ServiceComponents, TaskManager,
};
pub use service::config::{DatabaseConfig, PrometheusConfig};
pub use sc_executor::NativeExecutionDispatch;
......@@ -576,18 +577,25 @@ macro_rules! new_light {
}
/// Builds a new object suitable for chain operations.
pub fn new_chain_ops<Runtime, Dispatch, Extrinsic>(mut config: Configuration)
-> Result<impl ServiceBuilderCommand<Block=Block>, ServiceError>
pub fn new_chain_ops<Runtime, Dispatch, Extrinsic>(mut config: Configuration) -> Result<
(
Arc<service::TFullClient<Block, Runtime, Dispatch>>,
Arc<TFullBackend<Block>>,
consensus_common::import_queue::BasicQueue<Block, PrefixedMemoryDB<BlakeTwo256>>,
TaskManager,
),
ServiceError
>
where
Runtime: ConstructRuntimeApi<Block, service::TFullClient<Block, Runtime, Dispatch>> + Send + Sync + 'static,
Runtime::RuntimeApi:
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<BlakeTwo256>,
{
config.keystore = service::config::KeystoreConfig::InMemory;
Ok(new_full_start!(config, Runtime, Dispatch).0)
let (builder, _, _, _) = new_full_start!(config, Runtime, Dispatch);
Ok(builder.to_chain_ops_parts())
}
/// Create a new Polkadot service for a full node.
......
[package]
name = "polkadot-parachain"
version = "0.8.13"
version = "0.8.14"
authors = ["Parity Technologies <admin@parity.io>"]
description = "Types and utilities for creating and working with parachains"
edition = "2018"
......
[package]
name = "test-parachain-adder"
version = "0.8.13"
version = "0.8.14"
authors = ["Parity Technologies <admin@parity.io>"]
description = "Test parachain which adds to a number as its state transition"
edition = "2018"
......
......@@ -28,7 +28,7 @@ use primitives::{
};
use collator::{ParachainContext, Network, BuildParachainContext, Cli, SubstrateCli};
use parking_lot::Mutex;
use futures::future::{Ready, ready, TryFutureExt};
use futures::future::{Ready, ready, FutureExt};
const GENESIS: AdderHead = AdderHead {
number: 0,
......@@ -135,12 +135,14 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
let cli = Cli::from_iter(&["-dev"]);
let runner = cli.create_runner(&cli.run.base)?;
runner.async_run(|config| {
collator::start_collator(
let (future, task_manager) = collator::start_collator(
context,
id,
key,
config,
).map_err(|e| e.into())
)?;
Ok((future.map(Ok), task_manager))
})?;
Ok(())
......
[package]
name = "test-parachain-halt"
version = "0.8.13"
version = "0.8.14"
authors = ["Parity Technologies <admin@parity.io>"]
description = "Test parachain which executes forever"
edition = "2018"
......
[package]
name = "polkadot-primitives"
version = "0.8.13"
version = "0.8.14"
authors = ["Parity Technologies <admin@parity.io>"]
edition = "2018"
......
[package]
name = "polkadot-rpc"
version = "0.8.13"
version = "0.8.14"
authors = ["Parity Technologies <admin@parity.io>"]
edition = "2018"
......
[package]
name = "polkadot-runtime-common"
version = "0.8.13"
version = "0.8.14"
authors = ["Parity Technologies <admin@parity.io>"]
edition = "2018"
......
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