Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2,525 changes: 967 additions & 1,558 deletions Cargo.lock

Large diffs are not rendered by default.

230 changes: 113 additions & 117 deletions Cargo.toml

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ cd -
```bash
git clone -n https://github.com/paritytech/polkadot.git /tmp/polkadot
cd /tmp/polkadot
git checkout release-v0.9.10
git checkout release-v0.9.11
cargo build --release
cd -
```
Expand Down
130 changes: 65 additions & 65 deletions integration-tests/Cargo.toml

Large diffs are not rendered by default.

34 changes: 17 additions & 17 deletions node/cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,37 +22,37 @@ log = "0.4.8"
structopt = { version = "0.3.8", optional = true }

# primitives
sp-core = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.10" }
sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.10" }
sp-core = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.11" }
sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.11" }

# client dependencies
sc-service = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.10", optional = true }
sc-telemetry = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.10" }
sc-tracing = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.10" }
sc-service = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.11", optional = true }
sc-telemetry = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.11" }
sc-tracing = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.11" }

# node-specific dependencies
node-service = { path = "../service", default-features = false }
node-primitives = { path = "../primitives" }

# CLI-specific dependencies
sc-cli = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.10", optional = true }
try-runtime-cli = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.10", optional = true }
frame-try-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.10", optional = true }
frame-benchmarking-cli = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.10", optional = true }
node-inspect = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.10", optional = true }
sc-cli = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.11", optional = true }
try-runtime-cli = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.11", optional = true }
frame-try-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.11", optional = true }
frame-benchmarking-cli = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.11", optional = true }
node-inspect = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.11", optional = true }

# Cumulus dependencies
cumulus-client-cli = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.10" }
cumulus-client-service = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.10" }
cumulus-primitives-core = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.10" }
cumulus-client-cli = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.11" }
cumulus-client-service = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.11" }
cumulus-primitives-core = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.11" }

# Polkadot dependencies
polkadot-primitives = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.10" }
polkadot-cli = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.10" }
polkadot-parachain = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.10" }
polkadot-primitives = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.11" }
polkadot-cli = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.11" }
polkadot-parachain = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.11" }

[build-dependencies]
substrate-build-script-utils = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.10", optional = true }
substrate-build-script-utils = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.11", optional = true }

[features]
default = [ "wasmtime", "cli" ]
Expand Down
22 changes: 8 additions & 14 deletions node/cli/src/command.rs
Original file line number Diff line number Diff line change
Expand Up @@ -224,16 +224,18 @@ macro_rules! construct_async_run {
let runner = $cli.create_runner($cmd)?;
#[cfg(feature = "with-asgard-runtime")]
return runner.async_run(|$config| {
let $components = crate::service::collator::new_partial::<asgard_runtime::RuntimeApi, AsgardExecutor>(
let $components = crate::service::collator::new_partial::<asgard_runtime::RuntimeApi, AsgardExecutor, _>(
&$config,
crate::service::collator::parachain_build_import_queue,
)?;
let task_manager = $components.task_manager;
{ $( $code )* }.map(|v| (v, task_manager))
});
#[cfg(feature = "with-bifrost-runtime")]
return runner.async_run(|$config| {
let $components = crate::service::collator::new_partial::<bifrost_runtime::RuntimeApi, BifrostExecutor>(
let $components = crate::service::collator::new_partial::<bifrost_runtime::RuntimeApi, BifrostExecutor, _>(
&$config,
crate::service::collator::parachain_build_import_queue,
)?;
let task_manager = $components.task_manager;
{ $( $code )* }.map(|v| (v, task_manager))
Expand Down Expand Up @@ -329,9 +331,9 @@ pub fn run() -> Result<()> {
generate_genesis_block(&config.chain_spec).map_err(|e| format!("{:?}", e))?;
let genesis_state = format!("0x{:?}", HexDisplay::from(&block.header().encode()));

let task_executor = config.task_executor.clone();
let tokio_handle = config.tokio_handle.clone();
let polkadot_config =
SubstrateCli::create_configuration(&polkadot_cli, &polkadot_cli, task_executor)
SubstrateCli::create_configuration(&polkadot_cli, &polkadot_cli, tokio_handle)
.map_err(|err| format!("Relay chain argument error: {}", err))?;

info!("Parachain id: {:?}", id);
Expand Down Expand Up @@ -418,7 +420,7 @@ pub fn run() -> Result<()> {
let polkadot_config = SubstrateCli::create_configuration(
&polkadot_cli,
&polkadot_cli,
config.task_executor.clone(),
config.tokio_handle.clone(),
)
.map_err(|err| format!("Relay chain argument error: {}", err))?;

Expand Down Expand Up @@ -486,7 +488,7 @@ pub fn run() -> Result<()> {
return runner.async_run(|config| {
let registry = config.prometheus_config.as_ref().map(|cfg| &cfg.registry);
let task_manager =
sc_service::TaskManager::new(config.task_executor.clone(), registry)
sc_service::TaskManager::new(config.tokio_handle.clone(), registry)
.map_err(|e| {
sc_cli::Error::Service(sc_service::Error::Prometheus(e))
})?;
Expand Down Expand Up @@ -585,18 +587,10 @@ impl CliConfiguration<Self> for RelayChainCli {
self.base.base.rpc_ws_max_connections()
}

fn rpc_http_threads(&self) -> Result<Option<usize>> {
self.base.base.rpc_http_threads()
}

fn rpc_cors(&self, is_dev: bool) -> Result<Option<Vec<String>>> {
self.base.base.rpc_cors(is_dev)
}

fn telemetry_external_transport(&self) -> Result<Option<sc_service::config::ExtTransport>> {
self.base.base.telemetry_external_transport()
}

fn default_heap_pages(&self) -> Result<Option<u64>> {
self.base.base.default_heap_pages()
}
Expand Down
17 changes: 9 additions & 8 deletions node/inspect/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
[package]
name = "node-inspect"
version = "0.8.0"
authors = ["Jamie <djptux@gmail.com>"]
authors = ["Liebi Technologies <bifrost@liebi.com>"]
edition = "2018"

[dependencies]
codec = { package = "parity-scale-codec", version = "2.0.0" }
derive_more = "0.99"
sc-cli = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.10" }
sc-client-api = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.10" }
sc-service = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.10", default-features = false }
sp-blockchain = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.10" }
sp-core = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.10" }
sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.10" }
structopt = "0.3.8"
sc-cli = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.11" }
sc-client-api = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.11" }
sc-executor = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.11" }
sc-service = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.11", default-features = false }
sp-blockchain = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.11" }
sp-core = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.11" }
sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.11" }
structopt = "0.3.8"
9 changes: 8 additions & 1 deletion node/inspect/src/command.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
use std::str::FromStr;

use sc_cli::{CliConfiguration, ImportParams, Result, SharedParams};
use sc_executor::NativeElseWasmExecutor;
use sc_service::{new_full_client, Configuration, NativeExecutionDispatch};
use sp_runtime::traits::Block;

Expand All @@ -38,7 +39,13 @@ impl InspectCmd {
RA: Send + Sync + 'static,
EX: NativeExecutionDispatch + 'static,
{
let client = new_full_client::<B, RA, EX>(&config, None)?;
let executor = NativeElseWasmExecutor::<EX>::new(
config.wasm_method,
config.default_heap_pages,
config.max_runtime_instances,
);

let client = new_full_client::<B, RA, _>(&config, None, executor)?;
let inspect = Inspector::<B>::new(client);

match &self.command {
Expand Down
51 changes: 50 additions & 1 deletion node/inspect/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ impl<TBlock: Block> PrettyPrinter<TBlock> for DebugPrinter {
fmt: &mut fmt::Formatter,
extrinsic: &TBlock::Extrinsic,
) -> fmt::Result {
writeln!(fmt, " {:?}", extrinsic)?;
writeln!(fmt, " {:#?}", extrinsic)?;
writeln!(fmt, " Bytes: {:?}", HexDisplay::from(&extrinsic.encode()))?;
Ok(())
}
Expand Down Expand Up @@ -269,3 +269,52 @@ impl<Hash: FromStr + Debug, Number: FromStr + Debug> FromStr for ExtrinsicAddres
Ok(Self::Block(block, index))
}
}

#[cfg(test)]
mod tests {
use sp_core::hash::H160 as Hash;

use super::*;

#[test]
fn should_parse_block_strings() {
type BlockAddress = super::BlockAddress<Hash, u64>;

let b0 = BlockAddress::from_str("3BfC20f0B9aFcAcE800D73D2191166FF16540258");
let b1 = BlockAddress::from_str("1234");
let b2 = BlockAddress::from_str("0");
let b3 = BlockAddress::from_str("0x0012345f");

assert_eq!(
b0,
Ok(BlockAddress::Hash("3BfC20f0B9aFcAcE800D73D2191166FF16540258".parse().unwrap()))
);
assert_eq!(b1, Ok(BlockAddress::Number(1234)));
assert_eq!(b2, Ok(BlockAddress::Number(0)));
assert_eq!(b3, Ok(BlockAddress::Bytes(vec![0, 0x12, 0x34, 0x5f])));
}

#[test]
fn should_parse_extrinsic_address() {
type BlockAddress = super::BlockAddress<Hash, u64>;
type ExtrinsicAddress = super::ExtrinsicAddress<Hash, u64>;

let e0 = ExtrinsicAddress::from_str("1234");
let b0 = ExtrinsicAddress::from_str("3BfC20f0B9aFcAcE800D73D2191166FF16540258:5");
let b1 = ExtrinsicAddress::from_str("1234:0");
let b2 = ExtrinsicAddress::from_str("0 0");
let b3 = ExtrinsicAddress::from_str("0x0012345f");

assert_eq!(e0, Err("Extrinsic index missing: example \"5:0\"".into()));
assert_eq!(
b0,
Ok(ExtrinsicAddress::Block(
BlockAddress::Hash("3BfC20f0B9aFcAcE800D73D2191166FF16540258".parse().unwrap()),
5
))
);
assert_eq!(b1, Ok(ExtrinsicAddress::Block(BlockAddress::Number(1234), 0)));
assert_eq!(b2, Ok(ExtrinsicAddress::Block(BlockAddress::Number(0), 0)));
assert_eq!(b3, Ok(ExtrinsicAddress::Bytes(vec![0, 0x12, 0x34, 0x5f])));
}
}
12 changes: 7 additions & 5 deletions node/primitives/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,13 @@ edition = "2018"
[dependencies]
bstringify = "0.1.2"
codec = { package = "parity-scale-codec", version = "2.0.0", default-features = false, features = ["derive"] }
scale-info = { version = "1.0.0", default-features = false, features = ["derive"] }
serde = { version = "1.0.123", optional = true, features = ["derive"] }
frame-system = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.10", default-features = false }
frame-support = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.10", default-features = false }
sp-core = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.10", default-features = false }
sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.10", default-features = false }
sp-std = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.10", default-features = false }
frame-system = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.11", default-features = false }
frame-support = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.11", default-features = false }
sp-core = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.11", default-features = false }
sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.11", default-features = false }
sp-std = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.11", default-features = false }
zenlink-protocol = { version = "*", default-features = false }

[features]
Expand All @@ -21,6 +22,7 @@ std = [
"codec/std",
"frame-system/std",
"frame-support/std",
"scale-info/std",
"serde",
"sp-core/std",
"sp-runtime/std",
Expand Down
5 changes: 3 additions & 2 deletions node/primitives/src/currency.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@

use bstringify::bstringify;
use codec::{Decode, Encode};
use scale_info::TypeInfo;
#[cfg(feature = "std")]
use serde::{Deserialize, Serialize};
use sp_runtime::RuntimeDebug;
Expand Down Expand Up @@ -255,7 +256,7 @@ create_currency_id! {
// Bit 8 : 0 for Pokladot Ecosystem, 1 for Kusama Ecosystem
// Bit 7 : Reserved
// Bit 6 - 1 : The token ID
#[derive(Encode, Decode, Eq, PartialEq, Copy, Clone, RuntimeDebug, PartialOrd, Ord)]
#[derive(Encode, Decode, Eq, PartialEq, Copy, Clone, RuntimeDebug, PartialOrd, Ord, TypeInfo)]
#[cfg_attr(feature = "std", derive(Serialize, Deserialize))]
#[repr(u8)]
pub enum TokenSymbol {
Expand All @@ -277,7 +278,7 @@ impl Default for TokenSymbol {
}

/// Currency ID, it might be extended with more variants in the future.
#[derive(Encode, Decode, Eq, PartialEq, Copy, Clone, RuntimeDebug, PartialOrd, Ord)]
#[derive(Encode, Decode, Eq, PartialEq, Copy, Clone, RuntimeDebug, PartialOrd, Ord, TypeInfo)]
#[cfg_attr(feature = "std", derive(Serialize, Deserialize))]
#[non_exhaustive]
pub enum CurrencyId {
Expand Down
4 changes: 3 additions & 1 deletion node/primitives/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,9 @@ pub type LeasePeriod = BlockNumber;
/// Index used for the child trie
pub type TrieIndex = u32;

#[derive(Encode, Decode, Eq, PartialEq, Copy, Clone, RuntimeDebug, PartialOrd, Ord)]
#[derive(
Encode, Decode, Eq, PartialEq, Copy, Clone, RuntimeDebug, PartialOrd, Ord, scale_info::TypeInfo,
)]
pub enum ExtraFeeName {
SalpContribute,
NoExtraFee,
Expand Down
7 changes: 4 additions & 3 deletions node/primitives/src/xcm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,11 @@
use core::ops::{Add, Mul};

use codec::{Decode, Encode};
use scale_info::TypeInfo;
use sp_std::prelude::*;

/// The type used to represent the xcmp transfer direction
#[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Encode, Decode)]
#[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Encode, Decode, TypeInfo)]
pub enum TransferOriginType {
FromSelf = 0,
FromRelayChain = 1,
Expand Down Expand Up @@ -65,14 +66,14 @@ impl Mul<u64> for XcmBaseWeight {
}

/// represent the transact type
#[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Encode, Decode)]
#[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Encode, Decode, TypeInfo)]
pub enum ParachainTransactType {
Xcm = 0,
Proxy = 1,
}

/// represent the proxy type
#[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Encode, Decode)]
#[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Encode, Decode, TypeInfo)]
pub enum ParachainTransactProxyType {
Primary = 0,
Derived = 1,
Expand Down
20 changes: 10 additions & 10 deletions node/rpc/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,17 @@ edition = "2018"
targets = ["x86_64-unknown-linux-gnu"]

[dependencies]
jsonrpc-core = "15.1.0"
jsonrpc-core = "18.0.0"
node-primitives = { path = "../primitives" }
sc-client-api = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.10" }
sc-rpc-api = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.10" }
sc-rpc = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.10" }
sc-transaction-pool-api = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.10" }
sp-api = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.10" }
sp-block-builder = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.10" }
sp-blockchain = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.10" }
pallet-transaction-payment-rpc = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.10" }
substrate-frame-rpc-system = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.10" }
sc-client-api = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.11" }
sc-rpc-api = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.11" }
sc-rpc = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.11" }
sc-transaction-pool-api = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.11" }
sp-api = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.11" }
sp-block-builder = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.11" }
sp-blockchain = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.11" }
pallet-transaction-payment-rpc = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.11" }
substrate-frame-rpc-system = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.11" }
bifrost-flexible-fee-rpc = { path = "../../pallets/flexible-fee/rpc" }
bifrost-flexible-fee-rpc-runtime-api = { path = "../../pallets/flexible-fee/rpc/runtime-api" }
bifrost-salp-rpc-api = { path = "../../pallets/salp/rpc" }
Expand Down
Loading