Merge remote-tracking branch 'origin/master' into update-scheduler

This commit is contained in:
Bryan Chen
2020-06-25 11:19:48 +12:00
36 changed files with 423 additions and 343 deletions
+159 -156
View File
File diff suppressed because it is too large Load Diff
+1 -1
View File
@@ -4,7 +4,7 @@ path = "src/main.rs"
[package] [package]
name = "polkadot" name = "polkadot"
version = "0.8.11" version = "0.8.12"
authors = ["Parity Technologies <admin@parity.io>"] authors = ["Parity Technologies <admin@parity.io>"]
edition = "2018" edition = "2018"
+1 -1
View File
@@ -1,7 +1,7 @@
[package] [package]
name = "polkadot-availability-store" name = "polkadot-availability-store"
description = "Persistent database for parachain data" description = "Persistent database for parachain data"
version = "0.8.11" version = "0.8.12"
authors = ["Parity Technologies <admin@parity.io>"] authors = ["Parity Technologies <admin@parity.io>"]
edition = "2018" edition = "2018"
+1 -1
View File
@@ -1,6 +1,6 @@
[package] [package]
name = "polkadot-cli" name = "polkadot-cli"
version = "0.8.11" version = "0.8.12"
authors = ["Parity Technologies <admin@parity.io>"] authors = ["Parity Technologies <admin@parity.io>"]
description = "Polkadot Relay-chain Client Node" description = "Polkadot Relay-chain Client Node"
edition = "2018" edition = "2018"
-3
View File
@@ -128,7 +128,6 @@ pub fn run() -> Result<()> {
authority_discovery_enabled, authority_discovery_enabled,
6000, 6000,
grandpa_pause, grandpa_pause,
None,
).map(|(s, _, _)| s) ).map(|(s, _, _)| s)
}, },
service::KusamaExecutor::native_version().runtime_version service::KusamaExecutor::native_version().runtime_version
@@ -146,7 +145,6 @@ pub fn run() -> Result<()> {
authority_discovery_enabled, authority_discovery_enabled,
6000, 6000,
grandpa_pause, grandpa_pause,
None,
).map(|(s, _, _)| s) ).map(|(s, _, _)| s)
}, },
service::WestendExecutor::native_version().runtime_version service::WestendExecutor::native_version().runtime_version
@@ -164,7 +162,6 @@ pub fn run() -> Result<()> {
authority_discovery_enabled, authority_discovery_enabled,
6000, 6000,
grandpa_pause, grandpa_pause,
None,
).map(|(s, _, _)| s) ).map(|(s, _, _)| s)
}, },
service::PolkadotExecutor::native_version().runtime_version service::PolkadotExecutor::native_version().runtime_version
+1 -1
View File
@@ -1,6 +1,6 @@
[package] [package]
name = "polkadot-collator" name = "polkadot-collator"
version = "0.8.11" version = "0.8.12"
authors = ["Parity Technologies <admin@parity.io>"] authors = ["Parity Technologies <admin@parity.io>"]
description = "Collator node implementation" description = "Collator node implementation"
edition = "2018" edition = "2018"
+18 -26
View File
@@ -50,7 +50,7 @@ use std::sync::Arc;
use std::time::Duration; use std::time::Duration;
use std::pin::Pin; use std::pin::Pin;
use futures::{future, Future, Stream, FutureExt, TryFutureExt, StreamExt, task::Spawn}; use futures::{future, Future, Stream, FutureExt, StreamExt, task::Spawn};
use log::warn; use log::warn;
use sc_client_api::{StateBackend, BlockchainEvents}; use sc_client_api::{StateBackend, BlockchainEvents};
use sp_blockchain::HeaderBackend; use sp_blockchain::HeaderBackend;
@@ -100,24 +100,17 @@ impl Network for polkadot_network::protocol::Service {
} }
} }
/// Error to return when the head data was invalid.
#[derive(Clone, Copy, Debug)]
pub struct InvalidHead;
/// Collation errors. /// Collation errors.
#[derive(Debug)] #[derive(Debug)]
pub enum Error { pub enum Error {
/// Error on the relay-chain side of things. /// Error on the relay-chain side of things.
Polkadot(String), Polkadot(String),
/// Error on the collator side of things.
Collator(InvalidHead),
} }
impl fmt::Display for Error { impl fmt::Display for Error {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match *self { match *self {
Error::Polkadot(ref err) => write!(f, "Polkadot node error: {}", err), Error::Polkadot(ref err) => write!(f, "Polkadot node error: {}", err),
Error::Collator(_) => write!(f, "Collator node error: Invalid head data"),
} }
} }
} }
@@ -147,7 +140,7 @@ pub trait BuildParachainContext {
/// This can be implemented through an externally attached service or a stub. /// This can be implemented through an externally attached service or a stub.
/// This is expected to be a lightweight, shared type like an Arc. /// This is expected to be a lightweight, shared type like an Arc.
pub trait ParachainContext: Clone { pub trait ParachainContext: Clone {
type ProduceCandidate: Future<Output = Result<(BlockData, HeadData), InvalidHead>>; type ProduceCandidate: Future<Output = Option<(BlockData, HeadData)>>;
/// Produce a candidate, given the relay parent hash, the latest ingress queue information /// Produce a candidate, given the relay parent hash, the latest ingress queue information
/// and the last parachain head. /// and the last parachain head.
@@ -167,8 +160,7 @@ pub async fn collate<P>(
local_validation_data: LocalValidationData, local_validation_data: LocalValidationData,
mut para_context: P, mut para_context: P,
key: Arc<CollatorPair>, key: Arc<CollatorPair>,
) ) -> Option<parachain::Collation>
-> Result<parachain::Collation, Error>
where where
P: ParachainContext, P: ParachainContext,
P::ProduceCandidate: Send, P::ProduceCandidate: Send,
@@ -177,7 +169,7 @@ pub async fn collate<P>(
relay_parent, relay_parent,
global_validation, global_validation,
local_validation_data, local_validation_data,
).map_err(Error::Collator).await?; ).await?;
let pov_block = PoVBlock { let pov_block = PoVBlock {
block_data, block_data,
@@ -204,7 +196,7 @@ pub async fn collate<P>(
pov: pov_block, pov: pov_block,
}; };
Ok(collation) Some(collation)
} }
#[cfg(feature = "service-rewr")] #[cfg(feature = "service-rewr")]
@@ -341,8 +333,13 @@ fn build_collator_service<SP, P, C, R, Extrinsic>(
local_validation, local_validation,
parachain_context, parachain_context,
key, key,
).map_ok(move |collation| { ).map(move |collation| {
network.distribute_collation(targets, collation) match collation {
Some(collation) => network.distribute_collation(targets, collation),
None => log::trace!("Skipping collation as `collate` returned `None`"),
}
Ok(())
}); });
future::Either::Right(collation_work) future::Either::Right(collation_work)
@@ -376,7 +373,6 @@ pub async fn start_collator<P>(
para_id: ParaId, para_id: ParaId,
key: Arc<CollatorPair>, key: Arc<CollatorPair>,
config: Configuration, config: Configuration,
informant_prefix: Option<String>,
) -> Result<(), polkadot_service::Error> ) -> Result<(), polkadot_service::Error>
where where
P: 'static + BuildParachainContext, P: 'static + BuildParachainContext,
@@ -397,7 +393,6 @@ where
false, false,
6000, 6000,
None, None,
informant_prefix,
)?; )?;
let spawn_handle = service.spawn_task_handle(); let spawn_handle = service.spawn_task_handle();
build_collator_service( build_collator_service(
@@ -416,7 +411,6 @@ where
false, false,
6000, 6000,
None, None,
informant_prefix,
)?; )?;
let spawn_handle = service.spawn_task_handle(); let spawn_handle = service.spawn_task_handle();
build_collator_service( build_collator_service(
@@ -435,7 +429,6 @@ where
false, false,
6000, 6000,
None, None,
informant_prefix,
)?; )?;
let spawn_handle = service.spawn_task_handle(); let spawn_handle = service.spawn_task_handle();
build_collator_service( build_collator_service(
@@ -470,7 +463,7 @@ mod tests {
struct DummyParachainContext; struct DummyParachainContext;
impl ParachainContext for DummyParachainContext { impl ParachainContext for DummyParachainContext {
type ProduceCandidate = future::Ready<Result<(BlockData, HeadData), InvalidHead>>; type ProduceCandidate = future::Ready<Option<(BlockData, HeadData)>>;
fn produce_candidate( fn produce_candidate(
&mut self, &mut self,
@@ -479,10 +472,10 @@ mod tests {
_local_validation: LocalValidationData, _local_validation: LocalValidationData,
) -> Self::ProduceCandidate { ) -> Self::ProduceCandidate {
// send messages right back. // send messages right back.
future::ok(( future::ready(Some((
BlockData(vec![1, 2, 3, 4, 5,]), BlockData(vec![1, 2, 3, 4, 5,]),
HeadData(vec![9, 9, 9]), HeadData(vec![9, 9, 9]),
)) )))
} }
} }
@@ -501,21 +494,20 @@ mod tests {
} }
} }
// Make sure that the future returned by `start_collator` implementes `Send`. // Make sure that the future returned by `start_collator` implements `Send`.
#[test] #[test]
fn start_collator_is_send() { fn start_collator_is_send() {
fn check_send<T: Send>(_: T) {} fn check_send<T: Send>(_: T) {}
let cli = Cli::from_iter(&["-dev"]); let cli = Cli::from_iter(&["-dev"]);
let task_executor = Arc::new(|_, _| unimplemented!()); let task_executor = |_, _| unimplemented!();
let config = cli.create_configuration(&cli.run.base, task_executor).unwrap(); let config = cli.create_configuration(&cli.run.base, task_executor.into()).unwrap();
check_send(start_collator( check_send(start_collator(
BuildDummyParachainContext, BuildDummyParachainContext,
0.into(), 0.into(),
Arc::new(CollatorPair::generate().0), Arc::new(CollatorPair::generate().0),
config, config,
None,
)); ));
} }
} }
+1 -1
View File
@@ -1,6 +1,6 @@
[package] [package]
name = "polkadot-erasure-coding" name = "polkadot-erasure-coding"
version = "0.8.11" version = "0.8.12"
authors = ["Parity Technologies <admin@parity.io>"] authors = ["Parity Technologies <admin@parity.io>"]
edition = "2018" edition = "2018"
+1 -1
View File
@@ -1,6 +1,6 @@
[package] [package]
name = "polkadot-network" name = "polkadot-network"
version = "0.8.11" version = "0.8.12"
authors = ["Parity Technologies <admin@parity.io>"] authors = ["Parity Technologies <admin@parity.io>"]
description = "Polkadot-specific networking protocol" description = "Polkadot-specific networking protocol"
edition = "2018" edition = "2018"
+1 -1
View File
@@ -1,6 +1,6 @@
[package] [package]
name = "polkadot-network-test" name = "polkadot-network-test"
version = "0.8.11" version = "0.8.12"
license = "GPL-3.0" license = "GPL-3.0"
authors = ["Parity Technologies <admin@parity.io>"] authors = ["Parity Technologies <admin@parity.io>"]
edition = "2018" edition = "2018"
+3 -11
View File
@@ -153,7 +153,7 @@ fn set_prometheus_registry(config: &mut Configuration) -> Result<(), ServiceErro
/// Use this macro if you don't actually need the full service, but just the builder in order to /// Use this macro if you don't actually need the full service, but just the builder in order to
/// be able to perform chain operations. /// be able to perform chain operations.
macro_rules! new_full_start { macro_rules! new_full_start {
($config:expr, $runtime:ty, $executor:ty, $informant_prefix:expr $(,)?) => {{ ($config:expr, $runtime:ty, $executor:ty) => {{
set_prometheus_registry(&mut $config)?; set_prometheus_registry(&mut $config)?;
let mut import_setup = None; let mut import_setup = None;
@@ -162,7 +162,6 @@ macro_rules! new_full_start {
let builder = service::ServiceBuilder::new_full::< let builder = service::ServiceBuilder::new_full::<
Block, $runtime, $executor Block, $runtime, $executor
>($config)? >($config)?
.with_informant_prefix($informant_prefix.unwrap_or_default())?
.with_select_chain(|_, backend| { .with_select_chain(|_, backend| {
Ok(sc_consensus::LongestChain::new(backend.clone())) Ok(sc_consensus::LongestChain::new(backend.clone()))
})? })?
@@ -308,7 +307,6 @@ macro_rules! new_full {
$grandpa_pause:expr, $grandpa_pause:expr,
$runtime:ty, $runtime:ty,
$dispatch:ty, $dispatch:ty,
$informant_prefix:expr $(,)?
) => {{ ) => {{
use sc_client_api::ExecutorProvider; use sc_client_api::ExecutorProvider;
use sp_core::traits::BareCryptoStorePtr; use sp_core::traits::BareCryptoStorePtr;
@@ -321,7 +319,7 @@ macro_rules! new_full {
let name = $config.network.node_name.clone(); let name = $config.network.node_name.clone();
let (builder, mut import_setup, inherent_data_providers, mut rpc_setup) = let (builder, mut import_setup, inherent_data_providers, mut rpc_setup) =
new_full_start!($config, $runtime, $dispatch, $informant_prefix); new_full_start!($config, $runtime, $dispatch);
let service = builder let service = builder
.with_finality_proof_provider(|client, backend| { .with_finality_proof_provider(|client, backend| {
@@ -583,7 +581,7 @@ where
<Runtime::RuntimeApi as sp_api::ApiExt<Block>>::StateBackend: sp_api::StateBackend<BlakeTwo256>, <Runtime::RuntimeApi as sp_api::ApiExt<Block>>::StateBackend: sp_api::StateBackend<BlakeTwo256>,
{ {
config.keystore = service::config::KeystoreConfig::InMemory; config.keystore = service::config::KeystoreConfig::InMemory;
Ok(new_full_start!(config, Runtime, Dispatch, None).0) Ok(new_full_start!(config, Runtime, Dispatch).0)
} }
/// Create a new Polkadot service for a full node. /// Create a new Polkadot service for a full node.
@@ -595,7 +593,6 @@ pub fn polkadot_new_full(
_authority_discovery_enabled: bool, _authority_discovery_enabled: bool,
_slot_duration: u64, _slot_duration: u64,
grandpa_pause: Option<(u32, u32)>, grandpa_pause: Option<(u32, u32)>,
informant_prefix: Option<String>,
) )
-> Result<( -> Result<(
impl AbstractService, impl AbstractService,
@@ -614,7 +611,6 @@ pub fn polkadot_new_full(
grandpa_pause, grandpa_pause,
polkadot_runtime::RuntimeApi, polkadot_runtime::RuntimeApi,
PolkadotExecutor, PolkadotExecutor,
informant_prefix,
); );
Ok((service, client, FullNodeHandles)) Ok((service, client, FullNodeHandles))
@@ -629,7 +625,6 @@ pub fn kusama_new_full(
_authority_discovery_enabled: bool, _authority_discovery_enabled: bool,
_slot_duration: u64, _slot_duration: u64,
grandpa_pause: Option<(u32, u32)>, grandpa_pause: Option<(u32, u32)>,
informant_prefix: Option<String>,
) -> Result<( ) -> Result<(
impl AbstractService, impl AbstractService,
Arc<impl PolkadotClient< Arc<impl PolkadotClient<
@@ -648,7 +643,6 @@ pub fn kusama_new_full(
grandpa_pause, grandpa_pause,
kusama_runtime::RuntimeApi, kusama_runtime::RuntimeApi,
KusamaExecutor, KusamaExecutor,
informant_prefix,
); );
Ok((service, client, FullNodeHandles)) Ok((service, client, FullNodeHandles))
@@ -663,7 +657,6 @@ pub fn westend_new_full(
_authority_discovery_enabled: bool, _authority_discovery_enabled: bool,
_slot_duration: u64, _slot_duration: u64,
grandpa_pause: Option<(u32, u32)>, grandpa_pause: Option<(u32, u32)>,
informant_prefix: Option<String>,
) )
-> Result<( -> Result<(
impl AbstractService, impl AbstractService,
@@ -682,7 +675,6 @@ pub fn westend_new_full(
grandpa_pause, grandpa_pause,
westend_runtime::RuntimeApi, westend_runtime::RuntimeApi,
WestendExecutor, WestendExecutor,
informant_prefix,
); );
Ok((service, client, FullNodeHandles)) Ok((service, client, FullNodeHandles))
+1 -1
View File
@@ -1,6 +1,6 @@
[package] [package]
name = "polkadot-parachain" name = "polkadot-parachain"
version = "0.8.11" version = "0.8.12"
authors = ["Parity Technologies <admin@parity.io>"] authors = ["Parity Technologies <admin@parity.io>"]
description = "Types and utilities for creating and working with parachains" description = "Types and utilities for creating and working with parachains"
edition = "2018" edition = "2018"
@@ -276,6 +276,18 @@ impl sp_externalities::Externalities for ValidationExternalities {
panic!("storage_append: unsupported feature for parachain validation") panic!("storage_append: unsupported feature for parachain validation")
} }
fn storage_start_transaction(&mut self) {
panic!("storage_start_transaction: unsupported feature for parachain validation")
}
fn storage_rollback_transaction(&mut self) -> Result<(), ()> {
panic!("storage_rollback_transaction: unsupported feature for parachain validation")
}
fn storage_commit_transaction(&mut self) -> Result<(), ()> {
panic!("storage_commit_transaction: unsupported feature for parachain validation")
}
fn wipe(&mut self) { fn wipe(&mut self) {
panic!("wipe: unsupported feature for parachain validation") panic!("wipe: unsupported feature for parachain validation")
} }
@@ -1,6 +1,6 @@
[package] [package]
name = "test-parachain-adder" name = "test-parachain-adder"
version = "0.8.11" version = "0.8.12"
authors = ["Parity Technologies <admin@parity.io>"] authors = ["Parity Technologies <admin@parity.io>"]
description = "Test parachain which adds to a number as its state transition" description = "Test parachain which adds to a number as its state transition"
edition = "2018" edition = "2018"
@@ -26,11 +26,9 @@ use primitives::{
Hash, Hash,
parachain::{HeadData, BlockData, Id as ParaId, LocalValidationData, GlobalValidationSchedule}, parachain::{HeadData, BlockData, Id as ParaId, LocalValidationData, GlobalValidationSchedule},
}; };
use collator::{ use collator::{ParachainContext, Network, BuildParachainContext, Cli, SubstrateCli};
InvalidHead, ParachainContext, Network, BuildParachainContext, Cli, SubstrateCli,
};
use parking_lot::Mutex; use parking_lot::Mutex;
use futures::future::{Ready, ok, err, TryFutureExt}; use futures::future::{Ready, ready, TryFutureExt};
const GENESIS: AdderHead = AdderHead { const GENESIS: AdderHead = AdderHead {
number: 0, number: 0,
@@ -55,7 +53,7 @@ struct AdderContext {
/// The parachain context. /// The parachain context.
impl ParachainContext for AdderContext { impl ParachainContext for AdderContext {
type ProduceCandidate = Ready<Result<(BlockData, HeadData), InvalidHead>>; type ProduceCandidate = Ready<Option<(BlockData, HeadData)>>;
fn produce_candidate( fn produce_candidate(
&mut self, &mut self,
@@ -64,9 +62,9 @@ impl ParachainContext for AdderContext {
local_validation: LocalValidationData, local_validation: LocalValidationData,
) -> Self::ProduceCandidate ) -> Self::ProduceCandidate
{ {
let adder_head = match AdderHead::decode(&mut &local_validation.parent_head.0[..]) { let adder_head = match AdderHead::decode(&mut &local_validation.parent_head.0[..]).ok() {
Ok(adder_head) => adder_head, Some(res) => res,
Err(_) => return err(InvalidHead) None => return ready(None),
}; };
let mut db = self.db.lock(); let mut db = self.db.lock();
@@ -94,7 +92,7 @@ impl ParachainContext for AdderContext {
next_head.number, next_body.state.overflowing_add(next_body.add).0); next_head.number, next_body.state.overflowing_add(next_body.add).0);
db.insert(next_head.clone(), next_body); db.insert(next_head.clone(), next_body);
ok((encoded_body, encoded_head)) ready(Some((encoded_body, encoded_head)))
} }
} }
@@ -141,7 +139,6 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
id, id,
key, key,
config, config,
None,
).map_err(|e| e.into()) ).map_err(|e| e.into())
})?; })?;
@@ -1,6 +1,6 @@
[package] [package]
name = "test-parachain-halt" name = "test-parachain-halt"
version = "0.8.11" version = "0.8.12"
authors = ["Parity Technologies <admin@parity.io>"] authors = ["Parity Technologies <admin@parity.io>"]
description = "Test parachain which executes forever" description = "Test parachain which executes forever"
edition = "2018" edition = "2018"
+1 -1
View File
@@ -1,6 +1,6 @@
[package] [package]
name = "polkadot-primitives" name = "polkadot-primitives"
version = "0.8.11" version = "0.8.12"
authors = ["Parity Technologies <admin@parity.io>"] authors = ["Parity Technologies <admin@parity.io>"]
edition = "2018" edition = "2018"
@@ -1 +1,2 @@
book/ book/
*.generated.svg
@@ -3,7 +3,7 @@
The implementers' guide is compiled from several source files with [mdBook](https://github.com/rust-lang/mdBook). To view it live, locally, from the repo root: The implementers' guide is compiled from several source files with [mdBook](https://github.com/rust-lang/mdBook). To view it live, locally, from the repo root:
```sh ```sh
cargo install mdbook mdbook-linkcheck cargo install mdbook mdbook-linkcheck mdbook-graphviz
mdbook serve roadmap/implementors-guide mdbook serve roadmap/implementors-guide
open http://localhost:3000 open http://localhost:3000
``` ```
@@ -5,5 +5,8 @@ multilingual = false
src = "src" src = "src"
title = "The Polkadot Parachain Host Implementers' Guide" title = "The Polkadot Parachain Host Implementers' Guide"
[preprocessor.graphviz]
command = "mdbook-graphviz"
[output.html] [output.html]
[output.linkcheck] [output.linkcheck]
@@ -2,25 +2,22 @@
Our Parachain Host includes a blockchain known as the relay-chain. A blockchain is a Directed Acyclic Graph (DAG) of state transitions, where every block can be considered to be the head of a linked-list (known as a "chain" or "fork") with a cumulative state which is determined by applying the state transition of each block in turn. All paths through the DAG terminate at the Genesis Block. In fact, the blockchain is a tree, since each block can have only one parent. Our Parachain Host includes a blockchain known as the relay-chain. A blockchain is a Directed Acyclic Graph (DAG) of state transitions, where every block can be considered to be the head of a linked-list (known as a "chain" or "fork") with a cumulative state which is determined by applying the state transition of each block in turn. All paths through the DAG terminate at the Genesis Block. In fact, the blockchain is a tree, since each block can have only one parent.
```text ```dot process
+----------------+ +----------------+ digraph {
| Block 4 | | Block 5 | node [shape=box];
+----------------+ +----------------+ genesis [label = Genesis]
\ / b1 [label = "Block 1"]
V V b2 [label = "Block 2"]
+---------------+ b3 [label = "Block 3"]
| Block 3 | b4 [label = "Block 4"]
+---------------+ b5 [label = "Block 5"]
|
V b5 -> b3
+----------------+ +----------------+ b4 -> b3
| Block 1 | | Block 2 | b3 -> b1
+----------------+ +----------------+ b2 -> genesis
\ / b1 -> genesis
V V }
+----------------+
| Genesis |
+----------------+
``` ```
A blockchain network is comprised of nodes. These nodes each have a view of many different forks of a blockchain and must decide which forks to follow and what actions to take based on the forks of the chain that they are aware of. A blockchain network is comprised of nodes. These nodes each have a view of many different forks of a blockchain and must decide which forks to follow and what actions to take based on the forks of the chain that they are aware of.
@@ -34,26 +31,16 @@ The first category of questions will be addressed by the Runtime, which defines
The second category of questions addressed by Node-side behavior. Node-side behavior defines all activities that a node undertakes, given its view of the blockchain/block-DAG. Node-side behavior can take into account all or many of the forks of the blockchain, and only conditionally undertake certain activities based on which forks it is aware of, as well as the state of the head of those forks. The second category of questions addressed by Node-side behavior. Node-side behavior defines all activities that a node undertakes, given its view of the blockchain/block-DAG. Node-side behavior can take into account all or many of the forks of the blockchain, and only conditionally undertake certain activities based on which forks it is aware of, as well as the state of the head of those forks.
```text ```dot process
digraph G {
Runtime [shape=box]
"Node" [shape=box margin=0.5]
Transport [shape=rectangle width=5]
__________________________________ Runtime -> "Node" [dir=both label="Runtime API"]
/ \
| Runtime | "Node" -> Transport [penwidth=1]
| | }
\_________(Runtime API )___________/
| ^
V |
+----------------------------------------------+
| |
| Node |
| |
| |
+----------------------------------------------+
+ +
| |
--------------------+ +------------------------
Transport
------------------------------------------------
``` ```
@@ -60,61 +60,46 @@ Reiterating the lifecycle of a candidate:
It is also important to take note of the fact that the relay-chain is extended by BABE, which is a forkful algorithm. That means that different block authors can be chosen at the same time, and may not be building on the same block parent. Furthermore, the set of validators is not fixed, nor is the set of parachains. And even with the same set of validators and parachains, the validators' assignments to parachains is flexible. This means that the architecture proposed in the next chapters must deal with the variability and multiplicity of the network state. It is also important to take note of the fact that the relay-chain is extended by BABE, which is a forkful algorithm. That means that different block authors can be chosen at the same time, and may not be building on the same block parent. Furthermore, the set of validators is not fixed, nor is the set of parachains. And even with the same set of validators and parachains, the validators' assignments to parachains is flexible. This means that the architecture proposed in the next chapters must deal with the variability and multiplicity of the network state.
```text
....... Validator Group 1 .......... ```dot process
. . digraph {
. (Validator 4) . rca [label = "Relay Block A" shape=rectangle]
. (Validator 1) (Validator 2) . rcb [label = "Relay Block B" shape=rectangle]
. (Validator 5) . rcc [label = "Relay Block C" shape=rectangle]
. .
..........Building on C ........... ........ Validator Group 2 ...........
+----------------------+ . .
| Relay Block C | . (Validator 7) .
+----------------------+ . ( Validator 3) (Validator 6) .
\ . .
\ ......... Building on B .............
\
+----------------------+
| Relay Block B |
+----------------------+
|
+----------------------+
| Relay Block A |
+----------------------+
vg1 [label =<<b>Validator Group 1</b><br/><br/><font point-size="10">(Validator 4)<br/>(Validator 1) (Validator 2)<br/>(Validator 5)</font>>]
vg2 [label =<<b>Validator Group 2</b><br/><br/><font point-size="10">(Validator 7)<br/>(Validator 3) (Validator 6)</font>>]
rcb -> rca
rcc -> rcb
vg1 -> rcc [label="Building on C" style=dashed arrowhead=none]
vg2 -> rcb [label="Building on B" style=dashed arrowhead=none]
}
``` ```
In this example, group 1 has received block C while the others have not due to network asynchrony. Now, a validator from group 2 may be able to build another block on top of B, called C'. Assume that afterwards, some validators become aware of both C and C', while others remain only aware of one. In this example, group 1 has received block C while the others have not due to network asynchrony. Now, a validator from group 2 may be able to build another block on top of B, called C'. Assume that afterwards, some validators become aware of both C and C', while others remain only aware of one.
```text ```dot process
....... Validator Group 1 .......... ........ Validator Group 2 ........... digraph {
. . . . rca [label = "Relay Block A" shape=rectangle]
. (Validator 4) (Validator 1) . . (Validator 7) (Validator 6) . rcb [label = "Relay Block B" shape=rectangle]
. . . . rcc [label = "Relay Block C" shape=rectangle]
.......... Building on C .......... ......... Building on C' ............. rcc_prime [label = "Relay Block C'" shape=rectangle]
vg1 [label =<<b>Validator Group 1</b><br/><br/><font point-size="10">(Validator 4) (Validator 1)</font>>]
vg2 [label =<<b>Validator Group 2</b><br/><br/><font point-size="10">(Validator 7) (Validator 6)</font>>]
vg3 [label =<<b>Validator Group 3</b><br/><br/><font point-size="10">(Validator 2) (Validator 3)<br/>(Validator 5)</font>>]
....... Validator Group 3 .......... rcb -> rca
. . rcc -> rcb
. (Validator 2) (Validator 3) . rcc_prime -> rcb
. (Validator 5) .
. .
....... Building on C and C' .......
+----------------------+ +----------------------+ vg1 -> rcc [style=dashed arrowhead=none]
| Relay Block C | | Relay Block C' | vg2 -> rcc_prime [style=dashed arrowhead=none]
+----------------------+ +----------------------+ vg3 -> rcc_prime [style=dashed arrowhead=none]
\ / vg3 -> rcc [style=dashed arrowhead=none]
\ / }
\ /
+----------------------+
| Relay Block B |
+----------------------+
|
+----------------------+
| Relay Block A |
+----------------------+
``` ```
Those validators that are aware of many competing heads must be aware of the work happening on each one. They may contribute to some or a full extent on both. It is possible that due to network asynchrony two forks may grow in parallel for some time, although in the absence of an adversarial network this is unlikely in the case where there are validators who are aware of both chain heads. Those validators that are aware of many competing heads must be aware of the work happening on each one. They may contribute to some or a full extent on both. It is possible that due to network asynchrony two forks may grow in parallel for some time, although in the absence of an adversarial network this is unlikely in the case where there are validators who are aware of both chain heads.
+1 -1
View File
@@ -1,6 +1,6 @@
[package] [package]
name = "polkadot-rpc" name = "polkadot-rpc"
version = "0.8.11" version = "0.8.12"
authors = ["Parity Technologies <admin@parity.io>"] authors = ["Parity Technologies <admin@parity.io>"]
edition = "2018" edition = "2018"
+1 -1
View File
@@ -1,6 +1,6 @@
[package] [package]
name = "polkadot-runtime-common" name = "polkadot-runtime-common"
version = "0.8.11" version = "0.8.12"
authors = ["Parity Technologies <admin@parity.io>"] authors = ["Parity Technologies <admin@parity.io>"]
edition = "2018" edition = "2018"
+1 -1
View File
@@ -1,6 +1,6 @@
[package] [package]
name = "kusama-runtime" name = "kusama-runtime"
version = "0.8.11" version = "0.8.12"
authors = ["Parity Technologies <admin@parity.io>"] authors = ["Parity Technologies <admin@parity.io>"]
edition = "2018" edition = "2018"
build = "build.rs" build = "build.rs"
+53 -7
View File
@@ -86,7 +86,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion {
spec_name: create_runtime_str!("kusama"), spec_name: create_runtime_str!("kusama"),
impl_name: create_runtime_str!("parity-kusama"), impl_name: create_runtime_str!("parity-kusama"),
authoring_version: 2, authoring_version: 2,
spec_version: 2011, spec_version: 2012,
impl_version: 0, impl_version: 0,
apis: RUNTIME_API_VERSIONS, apis: RUNTIME_API_VERSIONS,
transaction_version: 1, transaction_version: 1,
@@ -268,11 +268,16 @@ impl session::historical::Trait for Runtime {
type FullIdentificationOf = staking::ExposureOf<Runtime>; type FullIdentificationOf = staking::ExposureOf<Runtime>;
} }
// TODO #6469: This shouldn't be static, but a lazily cached value, not built unless needed, and
// re-built in case input parameters have changed. The `ideal_stake` should be determined by the
// amount of parachain slots being bid on: this should be around `(75 - 25.min(slots / 4))%`.
pallet_staking_reward_curve::build! { pallet_staking_reward_curve::build! {
const REWARD_CURVE: PiecewiseLinear<'static> = curve!( const REWARD_CURVE: PiecewiseLinear<'static> = curve!(
min_inflation: 0_025_000, min_inflation: 0_025_000,
max_inflation: 0_100_000, max_inflation: 0_100_000,
ideal_stake: 0_500_000, // 3:2:1 staked : parachains : float.
// while there's no parachains, then this is 75% staked : 25% float.
ideal_stake: 0_750_000,
falloff: 0_050_000, falloff: 0_050_000,
max_piece_count: 40, max_piece_count: 40,
test_precision: 0_005_000, test_precision: 0_005_000,
@@ -608,7 +613,7 @@ impl<LocalCall> system::offchain::CreateSignedTransaction<LocalCall> for Runtime
system::CheckSpecVersion::<Runtime>::new(), system::CheckSpecVersion::<Runtime>::new(),
system::CheckTxVersion::<Runtime>::new(), system::CheckTxVersion::<Runtime>::new(),
system::CheckGenesis::<Runtime>::new(), system::CheckGenesis::<Runtime>::new(),
system::CheckEra::<Runtime>::from(generic::Era::mortal(period, current_block)), system::CheckMortality::<Runtime>::from(generic::Era::mortal(period, current_block)),
system::CheckNonce::<Runtime>::from(nonce), system::CheckNonce::<Runtime>::from(nonce),
system::CheckWeight::<Runtime>::new(), system::CheckWeight::<Runtime>::new(),
transaction_payment::ChargeTransactionPayment::<Runtime>::from(tip), transaction_payment::ChargeTransactionPayment::<Runtime>::from(tip),
@@ -803,9 +808,50 @@ impl InstanceFilter<Call> for ProxyType {
fn filter(&self, c: &Call) -> bool { fn filter(&self, c: &Call) -> bool {
match self { match self {
ProxyType::Any => true, ProxyType::Any => true,
ProxyType::NonTransfer => !matches!(c, ProxyType::NonTransfer => matches!(c,
Call::Balances(..) | Call::Vesting(vesting::Call::vested_transfer(..)) Call::System(..) |
| Call::Indices(indices::Call::transfer(..)) Call::Babe(..) |
Call::Timestamp(..) |
Call::Indices(indices::Call::claim(..)) |
Call::Indices(indices::Call::free(..)) |
Call::Indices(indices::Call::freeze(..)) |
// Specifically omitting Indices `transfer`, `force_transfer`
// Specifically omitting the entire Balances pallet
Call::Authorship(..) |
Call::Staking(..) |
Call::Offences(..) |
Call::Session(..) |
Call::FinalityTracker(..) |
Call::Grandpa(..) |
Call::ImOnline(..) |
Call::AuthorityDiscovery(..) |
Call::Democracy(..) |
Call::Council(..) |
Call::TechnicalCommittee(..) |
Call::ElectionsPhragmen(..) |
Call::TechnicalMembership(..) |
Call::Treasury(..) |
Call::Claims(..) |
Call::Parachains(..) |
Call::Attestations(..) |
Call::Slots(..) |
Call::Registrar(..) |
Call::Utility(..) |
Call::Identity(..) |
Call::Society(..) |
Call::Recovery(recovery::Call::as_recovered(..)) |
Call::Recovery(recovery::Call::vouch_recovery(..)) |
Call::Recovery(recovery::Call::claim_recovery(..)) |
Call::Recovery(recovery::Call::close_recovery(..)) |
Call::Recovery(recovery::Call::remove_recovery(..)) |
Call::Recovery(recovery::Call::cancel_recovered(..)) |
// Specifically omitting Recovery `create_recovery`, `initiate_recovery`
Call::Vesting(vesting::Call::vest(..)) |
Call::Vesting(vesting::Call::vest_other(..)) |
// Specifically omitting Vesting `vested_transfer`, and `force_vested_transfer`
Call::Scheduler(..) |
Call::Proxy(..) |
Call::Multisig(..)
), ),
ProxyType::Governance => matches!(c, ProxyType::Governance => matches!(c,
Call::Democracy(..) | Call::Council(..) | Call::TechnicalCommittee(..) Call::Democracy(..) | Call::Council(..) | Call::TechnicalCommittee(..)
@@ -928,7 +974,7 @@ pub type SignedExtra = (
system::CheckSpecVersion<Runtime>, system::CheckSpecVersion<Runtime>,
system::CheckTxVersion<Runtime>, system::CheckTxVersion<Runtime>,
system::CheckGenesis<Runtime>, system::CheckGenesis<Runtime>,
system::CheckEra<Runtime>, system::CheckMortality<Runtime>,
system::CheckNonce<Runtime>, system::CheckNonce<Runtime>,
system::CheckWeight<Runtime>, system::CheckWeight<Runtime>,
transaction_payment::ChargeTransactionPayment<Runtime>, transaction_payment::ChargeTransactionPayment<Runtime>,
+1 -1
View File
@@ -1,6 +1,6 @@
[package] [package]
name = "polkadot-runtime" name = "polkadot-runtime"
version = "0.8.11" version = "0.8.12"
authors = ["Parity Technologies <admin@parity.io>"] authors = ["Parity Technologies <admin@parity.io>"]
edition = "2018" edition = "2018"
build = "build.rs" build = "build.rs"
+46 -7
View File
@@ -91,7 +91,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion {
spec_name: create_runtime_str!("polkadot"), spec_name: create_runtime_str!("polkadot"),
impl_name: create_runtime_str!("parity-polkadot"), impl_name: create_runtime_str!("parity-polkadot"),
authoring_version: 0, authoring_version: 0,
spec_version: 11, spec_version: 12,
impl_version: 0, impl_version: 0,
apis: RUNTIME_API_VERSIONS, apis: RUNTIME_API_VERSIONS,
transaction_version: 0, transaction_version: 0,
@@ -290,11 +290,16 @@ impl session::historical::Trait for Runtime {
type FullIdentificationOf = staking::ExposureOf<Runtime>; type FullIdentificationOf = staking::ExposureOf<Runtime>;
} }
// TODO #6469: This shouldn't be static, but a lazily cached value, not built unless needed, and
// re-built in case input parameters have changed. The `ideal_stake` should be determined by the
// amount of parachain slots being bid on: this should be around `(75 - 25.min(slots / 4))%`.
pallet_staking_reward_curve::build! { pallet_staking_reward_curve::build! {
const REWARD_CURVE: PiecewiseLinear<'static> = curve!( const REWARD_CURVE: PiecewiseLinear<'static> = curve!(
min_inflation: 0_025_000, min_inflation: 0_025_000,
max_inflation: 0_100_000, max_inflation: 0_100_000,
ideal_stake: 0_500_000, // 3:2:1 staked : parachains : float.
// while there's no parachains, then this is 75% staked : 25% float.
ideal_stake: 0_750_000,
falloff: 0_050_000, falloff: 0_050_000,
max_piece_count: 40, max_piece_count: 40,
test_precision: 0_005_000, test_precision: 0_005_000,
@@ -655,7 +660,7 @@ impl<LocalCall> system::offchain::CreateSignedTransaction<LocalCall> for Runtime
system::CheckSpecVersion::<Runtime>::new(), system::CheckSpecVersion::<Runtime>::new(),
system::CheckTxVersion::<Runtime>::new(), system::CheckTxVersion::<Runtime>::new(),
system::CheckGenesis::<Runtime>::new(), system::CheckGenesis::<Runtime>::new(),
system::CheckEra::<Runtime>::from(generic::Era::mortal(period, current_block)), system::CheckMortality::<Runtime>::from(generic::Era::mortal(period, current_block)),
system::CheckNonce::<Runtime>::from(nonce), system::CheckNonce::<Runtime>::from(nonce),
system::CheckWeight::<Runtime>::new(), system::CheckWeight::<Runtime>::new(),
transaction_payment::ChargeTransactionPayment::<Runtime>::from(tip), transaction_payment::ChargeTransactionPayment::<Runtime>::from(tip),
@@ -787,9 +792,43 @@ impl InstanceFilter<Call> for ProxyType {
fn filter(&self, c: &Call) -> bool { fn filter(&self, c: &Call) -> bool {
match self { match self {
ProxyType::Any => true, ProxyType::Any => true,
ProxyType::NonTransfer => !matches!(c, ProxyType::NonTransfer => matches!(c,
Call::Balances(..) | Call::Vesting(vesting::Call::vested_transfer(..)) Call::System(..) |
| Call::Indices(indices::Call::transfer(..)) Call::Scheduler(..) |
Call::Babe(..) |
Call::Timestamp(..) |
Call::Indices(indices::Call::claim(..)) |
Call::Indices(indices::Call::free(..)) |
Call::Indices(indices::Call::freeze(..)) |
// Specifically omitting Indices `transfer`, `force_transfer`
// Specifically omitting the entire Balances pallet
Call::Authorship(..) |
Call::Staking(..) |
Call::Offences(..) |
Call::Session(..) |
Call::FinalityTracker(..) |
Call::Grandpa(..) |
Call::ImOnline(..) |
Call::AuthorityDiscovery(..) |
Call::Democracy(..) |
Call::Council(..) |
Call::TechnicalCommittee(..) |
Call::ElectionsPhragmen(..) |
Call::TechnicalMembership(..) |
Call::Treasury(..) |
Call::Parachains(..) |
Call::Attestations(..) |
Call::Slots(..) |
Call::Registrar(..) |
Call::Claims(..) |
Call::Vesting(vesting::Call::vest(..)) |
Call::Vesting(vesting::Call::vest_other(..)) |
// Specifically omitting Vesting `vested_transfer`, and `force_vested_transfer`
Call::Utility(..) |
// Specifically omitting Sudo pallet
Call::Identity(..) |
Call::Proxy(..) |
Call::Multisig(..)
), ),
ProxyType::Governance => matches!(c, ProxyType::Governance => matches!(c,
Call::Democracy(..) | Call::Council(..) | Call::TechnicalCommittee(..) Call::Democracy(..) | Call::Council(..) | Call::TechnicalCommittee(..)
@@ -912,7 +951,7 @@ pub type SignedExtra = (
system::CheckSpecVersion<Runtime>, system::CheckSpecVersion<Runtime>,
system::CheckTxVersion<Runtime>, system::CheckTxVersion<Runtime>,
system::CheckGenesis<Runtime>, system::CheckGenesis<Runtime>,
system::CheckEra<Runtime>, system::CheckMortality<Runtime>,
system::CheckNonce<Runtime>, system::CheckNonce<Runtime>,
system::CheckWeight<Runtime>, system::CheckWeight<Runtime>,
transaction_payment::ChargeTransactionPayment<Runtime>, transaction_payment::ChargeTransactionPayment<Runtime>,
+1 -1
View File
@@ -1,6 +1,6 @@
[package] [package]
name = "polkadot-test-runtime" name = "polkadot-test-runtime"
version = "0.8.11" version = "0.8.12"
authors = ["Parity Technologies <admin@parity.io>"] authors = ["Parity Technologies <admin@parity.io>"]
edition = "2018" edition = "2018"
build = "build.rs" build = "build.rs"
+2 -2
View File
@@ -401,7 +401,7 @@ impl<LocalCall> system::offchain::CreateSignedTransaction<LocalCall> for Runtime
system::CheckSpecVersion::<Runtime>::new(), system::CheckSpecVersion::<Runtime>::new(),
system::CheckTxVersion::<Runtime>::new(), system::CheckTxVersion::<Runtime>::new(),
system::CheckGenesis::<Runtime>::new(), system::CheckGenesis::<Runtime>::new(),
system::CheckEra::<Runtime>::from(generic::Era::mortal(period, current_block)), system::CheckMortality::<Runtime>::from(generic::Era::mortal(period, current_block)),
system::CheckNonce::<Runtime>::from(nonce), system::CheckNonce::<Runtime>::from(nonce),
system::CheckWeight::<Runtime>::new(), system::CheckWeight::<Runtime>::new(),
transaction_payment::ChargeTransactionPayment::<Runtime>::from(tip), transaction_payment::ChargeTransactionPayment::<Runtime>::from(tip),
@@ -545,7 +545,7 @@ pub type SignedExtra = (
system::CheckSpecVersion<Runtime>, system::CheckSpecVersion<Runtime>,
system::CheckTxVersion<Runtime>, system::CheckTxVersion<Runtime>,
system::CheckGenesis<Runtime>, system::CheckGenesis<Runtime>,
system::CheckEra<Runtime>, system::CheckMortality<Runtime>,
system::CheckNonce<Runtime>, system::CheckNonce<Runtime>,
system::CheckWeight<Runtime>, system::CheckWeight<Runtime>,
transaction_payment::ChargeTransactionPayment::<Runtime>, transaction_payment::ChargeTransactionPayment::<Runtime>,
+1 -1
View File
@@ -1,6 +1,6 @@
[package] [package]
name = "westend-runtime" name = "westend-runtime"
version = "0.8.11" version = "0.8.12"
authors = ["Parity Technologies <admin@parity.io>"] authors = ["Parity Technologies <admin@parity.io>"]
edition = "2018" edition = "2018"
build = "build.rs" build = "build.rs"
+39 -5
View File
@@ -82,7 +82,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion {
spec_name: create_runtime_str!("westend"), spec_name: create_runtime_str!("westend"),
impl_name: create_runtime_str!("parity-westend"), impl_name: create_runtime_str!("parity-westend"),
authoring_version: 2, authoring_version: 2,
spec_version: 31, spec_version: 32,
impl_version: 0, impl_version: 0,
apis: RUNTIME_API_VERSIONS, apis: RUNTIME_API_VERSIONS,
transaction_version: 1, transaction_version: 1,
@@ -443,7 +443,7 @@ impl<LocalCall> system::offchain::CreateSignedTransaction<LocalCall> for Runtime
system::CheckSpecVersion::<Runtime>::new(), system::CheckSpecVersion::<Runtime>::new(),
system::CheckTxVersion::<Runtime>::new(), system::CheckTxVersion::<Runtime>::new(),
system::CheckGenesis::<Runtime>::new(), system::CheckGenesis::<Runtime>::new(),
system::CheckEra::<Runtime>::from(generic::Era::mortal(period, current_block)), system::CheckMortality::<Runtime>::from(generic::Era::mortal(period, current_block)),
system::CheckNonce::<Runtime>::from(nonce), system::CheckNonce::<Runtime>::from(nonce),
system::CheckWeight::<Runtime>::new(), system::CheckWeight::<Runtime>::new(),
transaction_payment::ChargeTransactionPayment::<Runtime>::from(tip), transaction_payment::ChargeTransactionPayment::<Runtime>::from(tip),
@@ -590,8 +590,42 @@ impl InstanceFilter<Call> for ProxyType {
fn filter(&self, c: &Call) -> bool { fn filter(&self, c: &Call) -> bool {
match self { match self {
ProxyType::Any => true, ProxyType::Any => true,
ProxyType::NonTransfer => !matches!(c, ProxyType::NonTransfer => matches!(c,
Call::Balances(..) | Call::Indices(indices::Call::transfer(..)) Call::System(..) |
Call::Babe(..) |
Call::Timestamp(..) |
Call::Indices(indices::Call::claim(..)) |
Call::Indices(indices::Call::free(..)) |
Call::Indices(indices::Call::freeze(..)) |
// Specifically omitting Indices `transfer`, `force_transfer`
// Specifically omitting the entire Balances pallet
Call::Authorship(..) |
Call::Staking(..) |
Call::Offences(..) |
Call::Session(..) |
Call::FinalityTracker(..) |
Call::Grandpa(..) |
Call::ImOnline(..) |
Call::AuthorityDiscovery(..) |
Call::Parachains(..) |
Call::Attestations(..) |
Call::Registrar(..) |
Call::Utility(..) |
Call::Identity(..) |
Call::Recovery(recovery::Call::as_recovered(..)) |
Call::Recovery(recovery::Call::vouch_recovery(..)) |
Call::Recovery(recovery::Call::claim_recovery(..)) |
Call::Recovery(recovery::Call::close_recovery(..)) |
Call::Recovery(recovery::Call::remove_recovery(..)) |
Call::Recovery(recovery::Call::cancel_recovered(..)) |
// Specifically omitting Recovery `create_recovery`, `initiate_recovery`
Call::Vesting(vesting::Call::vest(..)) |
Call::Vesting(vesting::Call::vest_other(..)) |
// Specifically omitting Vesting `vested_transfer`, and `force_vested_transfer`
Call::Scheduler(..) |
// Specifically omitting Sudo pallet
Call::Proxy(..) |
Call::Multisig(..)
), ),
ProxyType::Staking => matches!(c, ProxyType::Staking => matches!(c,
Call::Staking(..) | Call::Utility(utility::Call::batch(..)) Call::Staking(..) | Call::Utility(utility::Call::batch(..))
@@ -701,7 +735,7 @@ pub type SignedExtra = (
system::CheckSpecVersion<Runtime>, system::CheckSpecVersion<Runtime>,
system::CheckTxVersion<Runtime>, system::CheckTxVersion<Runtime>,
system::CheckGenesis<Runtime>, system::CheckGenesis<Runtime>,
system::CheckEra<Runtime>, system::CheckMortality<Runtime>,
system::CheckNonce<Runtime>, system::CheckNonce<Runtime>,
system::CheckWeight<Runtime>, system::CheckWeight<Runtime>,
transaction_payment::ChargeTransactionPayment<Runtime>, transaction_payment::ChargeTransactionPayment<Runtime>,
+1 -1
View File
@@ -1,6 +1,6 @@
[package] [package]
name = "polkadot-service" name = "polkadot-service"
version = "0.8.11" version = "0.8.12"
authors = ["Parity Technologies <admin@parity.io>"] authors = ["Parity Technologies <admin@parity.io>"]
edition = "2018" edition = "2018"
+3 -11
View File
@@ -149,7 +149,7 @@ fn set_prometheus_registry(config: &mut Configuration) -> Result<(), ServiceErro
/// Use this macro if you don't actually need the full service, but just the builder in order to /// Use this macro if you don't actually need the full service, but just the builder in order to
/// be able to perform chain operations. /// be able to perform chain operations.
macro_rules! new_full_start { macro_rules! new_full_start {
($config:expr, $runtime:ty, $executor:ty, $informant_prefix:expr $(,)?) => {{ ($config:expr, $runtime:ty, $executor:ty) => {{
set_prometheus_registry(&mut $config)?; set_prometheus_registry(&mut $config)?;
let mut import_setup = None; let mut import_setup = None;
@@ -158,7 +158,6 @@ macro_rules! new_full_start {
let builder = service::ServiceBuilder::new_full::< let builder = service::ServiceBuilder::new_full::<
Block, $runtime, $executor Block, $runtime, $executor
>($config)? >($config)?
.with_informant_prefix($informant_prefix.unwrap_or_default())?
.with_select_chain(|_, backend| { .with_select_chain(|_, backend| {
Ok(sc_consensus::LongestChain::new(backend.clone())) Ok(sc_consensus::LongestChain::new(backend.clone()))
})? })?
@@ -276,7 +275,6 @@ macro_rules! new_full {
$grandpa_pause:expr, $grandpa_pause:expr,
$runtime:ty, $runtime:ty,
$dispatch:ty, $dispatch:ty,
$informant_prefix:expr $(,)?
) => {{ ) => {{
use sc_network::Event; use sc_network::Event;
use sc_client_api::ExecutorProvider; use sc_client_api::ExecutorProvider;
@@ -298,7 +296,7 @@ macro_rules! new_full {
let slot_duration = $slot_duration; let slot_duration = $slot_duration;
let (builder, mut import_setup, inherent_data_providers, mut rpc_setup) = let (builder, mut import_setup, inherent_data_providers, mut rpc_setup) =
new_full_start!($config, $runtime, $dispatch, $informant_prefix); new_full_start!($config, $runtime, $dispatch);
let service = builder let service = builder
.with_finality_proof_provider(|client, backend| { .with_finality_proof_provider(|client, backend| {
@@ -649,7 +647,7 @@ where
<Runtime::RuntimeApi as sp_api::ApiExt<Block>>::StateBackend: sp_api::StateBackend<BlakeTwo256>, <Runtime::RuntimeApi as sp_api::ApiExt<Block>>::StateBackend: sp_api::StateBackend<BlakeTwo256>,
{ {
config.keystore = service::config::KeystoreConfig::InMemory; config.keystore = service::config::KeystoreConfig::InMemory;
Ok(new_full_start!(config, Runtime, Dispatch, None).0) Ok(new_full_start!(config, Runtime, Dispatch).0)
} }
/// Create a new Polkadot service for a full node. /// Create a new Polkadot service for a full node.
@@ -661,7 +659,6 @@ pub fn polkadot_new_full(
authority_discovery_enabled: bool, authority_discovery_enabled: bool,
slot_duration: u64, slot_duration: u64,
grandpa_pause: Option<(u32, u32)>, grandpa_pause: Option<(u32, u32)>,
informant_prefix: Option<String>,
) )
-> Result<( -> Result<(
impl AbstractService, impl AbstractService,
@@ -682,7 +679,6 @@ pub fn polkadot_new_full(
grandpa_pause, grandpa_pause,
polkadot_runtime::RuntimeApi, polkadot_runtime::RuntimeApi,
PolkadotExecutor, PolkadotExecutor,
informant_prefix,
); );
Ok((service, client, handles)) Ok((service, client, handles))
@@ -697,7 +693,6 @@ pub fn kusama_new_full(
authority_discovery_enabled: bool, authority_discovery_enabled: bool,
slot_duration: u64, slot_duration: u64,
grandpa_pause: Option<(u32, u32)>, grandpa_pause: Option<(u32, u32)>,
informant_prefix: Option<String>,
) -> Result<( ) -> Result<(
impl AbstractService, impl AbstractService,
Arc<impl PolkadotClient< Arc<impl PolkadotClient<
@@ -718,7 +713,6 @@ pub fn kusama_new_full(
grandpa_pause, grandpa_pause,
kusama_runtime::RuntimeApi, kusama_runtime::RuntimeApi,
KusamaExecutor, KusamaExecutor,
informant_prefix,
); );
Ok((service, client, handles)) Ok((service, client, handles))
@@ -733,7 +727,6 @@ pub fn westend_new_full(
authority_discovery_enabled: bool, authority_discovery_enabled: bool,
slot_duration: u64, slot_duration: u64,
grandpa_pause: Option<(u32, u32)>, grandpa_pause: Option<(u32, u32)>,
informant_prefix: Option<String>,
) )
-> Result<( -> Result<(
impl AbstractService, impl AbstractService,
@@ -754,7 +747,6 @@ pub fn westend_new_full(
grandpa_pause, grandpa_pause,
westend_runtime::RuntimeApi, westend_runtime::RuntimeApi,
WestendExecutor, WestendExecutor,
informant_prefix,
); );
Ok((service, client, handles)) Ok((service, client, handles))
+1 -1
View File
@@ -1,6 +1,6 @@
[package] [package]
name = "polkadot-statement-table" name = "polkadot-statement-table"
version = "0.8.11" version = "0.8.12"
authors = ["Parity Technologies <admin@parity.io>"] authors = ["Parity Technologies <admin@parity.io>"]
edition = "2018" edition = "2018"
+1 -1
View File
@@ -1,6 +1,6 @@
[package] [package]
name = "polkadot-validation" name = "polkadot-validation"
version = "0.8.11" version = "0.8.12"
authors = ["Parity Technologies <admin@parity.io>"] authors = ["Parity Technologies <admin@parity.io>"]
edition = "2018" edition = "2018"