Commit cc0c54c9 authored by Stanislav Tkach's avatar Stanislav Tkach Committed by Gavin Wood
Browse files

Migrate to the 2018 edition (#273)

parent 620b8610
Pipeline #39104 failed with stages
in 8 minutes and 10 seconds
...@@ -13,7 +13,6 @@ name = "adder" ...@@ -13,7 +13,6 @@ name = "adder"
version = "0.1.0" version = "0.1.0"
dependencies = [ dependencies = [
"parity-codec 3.5.1 (registry+https://github.com/rust-lang/crates.io-index)", "parity-codec 3.5.1 (registry+https://github.com/rust-lang/crates.io-index)",
"parity-codec-derive 3.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
"polkadot-parachain 0.1.0", "polkadot-parachain 0.1.0",
"tiny-keccak 1.4.2 (registry+https://github.com/rust-lang/crates.io-index)", "tiny-keccak 1.4.2 (registry+https://github.com/rust-lang/crates.io-index)",
] ]
...@@ -995,6 +994,15 @@ dependencies = [ ...@@ -995,6 +994,15 @@ dependencies = [
"proc-macro-hack 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", "proc-macro-hack 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)",
] ]
[[package]]
name = "hex-literal"
version = "0.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"hex-literal-impl 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
"proc-macro-hack 0.5.4 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]] [[package]]
name = "hex-literal-impl" name = "hex-literal-impl"
version = "0.1.2" version = "0.1.2"
...@@ -1003,6 +1011,14 @@ dependencies = [ ...@@ -1003,6 +1011,14 @@ dependencies = [
"proc-macro-hack 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", "proc-macro-hack 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)",
] ]
[[package]]
name = "hex-literal-impl"
version = "0.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"proc-macro-hack 0.5.4 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]] [[package]]
name = "hmac" name = "hmac"
version = "0.4.2" version = "0.4.2"
...@@ -2305,7 +2321,6 @@ version = "0.1.0" ...@@ -2305,7 +2321,6 @@ version = "0.1.0"
dependencies = [ dependencies = [
"polkadot-runtime 0.1.0", "polkadot-runtime 0.1.0",
"substrate-executor 2.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-master)", "substrate-executor 2.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-master)",
"substrate-primitives 2.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-master)",
] ]
[[package]] [[package]]
...@@ -2317,7 +2332,6 @@ dependencies = [ ...@@ -2317,7 +2332,6 @@ dependencies = [
"futures 0.1.26 (registry+https://github.com/rust-lang/crates.io-index)", "futures 0.1.26 (registry+https://github.com/rust-lang/crates.io-index)",
"log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)",
"parity-codec 3.5.1 (registry+https://github.com/rust-lang/crates.io-index)", "parity-codec 3.5.1 (registry+https://github.com/rust-lang/crates.io-index)",
"parity-codec-derive 3.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
"parking_lot 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)", "parking_lot 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)",
"polkadot-availability-store 0.1.0", "polkadot-availability-store 0.1.0",
"polkadot-primitives 0.1.0", "polkadot-primitives 0.1.0",
...@@ -2352,7 +2366,6 @@ dependencies = [ ...@@ -2352,7 +2366,6 @@ dependencies = [
"polkadot-parachain 0.1.0", "polkadot-parachain 0.1.0",
"pretty_assertions 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", "pretty_assertions 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)",
"serde 1.0.89 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.89 (registry+https://github.com/rust-lang/crates.io-index)",
"serde_derive 1.0.89 (registry+https://github.com/rust-lang/crates.io-index)",
"sr-primitives 2.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-master)", "sr-primitives 2.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-master)",
"sr-std 2.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-master)", "sr-std 2.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-master)",
"sr-version 2.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-master)", "sr-version 2.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-master)",
...@@ -2366,11 +2379,10 @@ name = "polkadot-runtime" ...@@ -2366,11 +2379,10 @@ name = "polkadot-runtime"
version = "0.1.0" version = "0.1.0"
dependencies = [ dependencies = [
"bitvec 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", "bitvec 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)",
"hex-literal 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", "hex-literal 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
"libsecp256k1 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", "libsecp256k1 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
"log 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)",
"parity-codec 3.5.1 (registry+https://github.com/rust-lang/crates.io-index)", "parity-codec 3.5.1 (registry+https://github.com/rust-lang/crates.io-index)",
"parity-codec-derive 3.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
"polkadot-primitives 0.1.0", "polkadot-primitives 0.1.0",
"rustc-hex 2.0.1 (registry+https://github.com/rust-lang/crates.io-index)", "rustc-hex 2.0.1 (registry+https://github.com/rust-lang/crates.io-index)",
"safe-mix 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "safe-mix 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
...@@ -2413,7 +2425,7 @@ name = "polkadot-service" ...@@ -2413,7 +2425,7 @@ name = "polkadot-service"
version = "0.5.0" version = "0.5.0"
dependencies = [ dependencies = [
"error-chain 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)", "error-chain 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)",
"hex-literal 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", "hex-literal 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
"lazy_static 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "lazy_static 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
"log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)",
"parking_lot 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)", "parking_lot 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)",
...@@ -2444,7 +2456,6 @@ name = "polkadot-statement-table" ...@@ -2444,7 +2456,6 @@ name = "polkadot-statement-table"
version = "0.1.0" version = "0.1.0"
dependencies = [ dependencies = [
"parity-codec 3.5.1 (registry+https://github.com/rust-lang/crates.io-index)", "parity-codec 3.5.1 (registry+https://github.com/rust-lang/crates.io-index)",
"parity-codec-derive 3.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
"polkadot-primitives 0.1.0", "polkadot-primitives 0.1.0",
"substrate-primitives 2.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-master)", "substrate-primitives 2.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-master)",
] ]
...@@ -5072,7 +5083,9 @@ dependencies = [ ...@@ -5072,7 +5083,9 @@ dependencies = [
"checksum heck 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "20564e78d53d2bb135c343b3f47714a56af2061f1c928fdb541dc7b9fdd94205" "checksum heck 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "20564e78d53d2bb135c343b3f47714a56af2061f1c928fdb541dc7b9fdd94205"
"checksum hex 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)" = "805026a5d0141ffc30abb3be3173848ad46a1b1664fe632428479619a3644d77" "checksum hex 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)" = "805026a5d0141ffc30abb3be3173848ad46a1b1664fe632428479619a3644d77"
"checksum hex-literal 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "ddc2928beef125e519d69ae1baa8c37ea2e0d3848545217f6db0179c5eb1d639" "checksum hex-literal 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "ddc2928beef125e519d69ae1baa8c37ea2e0d3848545217f6db0179c5eb1d639"
"checksum hex-literal 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "c3da68162fdd2147e66682e78e729bd77f93b4c99656db058c5782d8c6b6225a"
"checksum hex-literal-impl 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "520870c3213943eb8d7803e80180d12a6c7ceb4ae74602544529d1643dc4ddda" "checksum hex-literal-impl 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "520870c3213943eb8d7803e80180d12a6c7ceb4ae74602544529d1643dc4ddda"
"checksum hex-literal-impl 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "06095d08c7c05760f11a071b3e1d4c5b723761c01bd8d7201c30a9536668a612"
"checksum hmac 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "7a13f4163aa0c5ca1be584aace0e2212b2e41be5478218d4f657f5f778b2ae2a" "checksum hmac 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "7a13f4163aa0c5ca1be584aace0e2212b2e41be5478218d4f657f5f778b2ae2a"
"checksum hmac 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "f127a908633569f208325f86f71255d3363c79721d7f9fe31cd5569908819771" "checksum hmac 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "f127a908633569f208325f86f71255d3363c79721d7f9fe31cd5569908819771"
"checksum hmac-drbg 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "4fe727d41d2eec0a6574d887914347e5ff96a3b87177817e2a9820c5c87fecc2" "checksum hmac-drbg 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "4fe727d41d2eec0a6574d887914347e5ff96a3b87177817e2a9820c5c87fecc2"
......
...@@ -7,9 +7,10 @@ name = "polkadot" ...@@ -7,9 +7,10 @@ name = "polkadot"
version = "0.5.0" version = "0.5.0"
authors = ["Parity Technologies <admin@parity.io>"] authors = ["Parity Technologies <admin@parity.io>"]
build = "build.rs" build = "build.rs"
edition = "2018"
[dependencies] [dependencies]
polkadot-cli = { path = "cli" } cli = { package = "polkadot-cli", path = "cli" }
futures = "0.1" futures = "0.1"
ctrlc = { version = "3.0", features = ["termination"] } ctrlc = { version = "3.0", features = ["termination"] }
......
...@@ -3,6 +3,7 @@ name = "polkadot-availability-store" ...@@ -3,6 +3,7 @@ name = "polkadot-availability-store"
description = "Persistent database for parachain data" description = "Persistent database for parachain data"
version = "0.1.0" version = "0.1.0"
authors = ["Parity Technologies <admin@parity.io>"] authors = ["Parity Technologies <admin@parity.io>"]
edition = "2018"
[dependencies] [dependencies]
polkadot-primitives = { path = "../primitives" } polkadot-primitives = { path = "../primitives" }
......
...@@ -16,22 +16,12 @@ ...@@ -16,22 +16,12 @@
//! Persistent database for parachain data. //! Persistent database for parachain data.
extern crate polkadot_primitives; use parity_codec::{Encode, Decode};
extern crate parking_lot;
extern crate parity_codec as codec;
extern crate substrate_primitives;
extern crate kvdb;
extern crate kvdb_rocksdb;
extern crate kvdb_memorydb;
#[macro_use]
extern crate log;
use codec::{Encode, Decode};
use kvdb::{KeyValueDB, DBTransaction}; use kvdb::{KeyValueDB, DBTransaction};
use kvdb_rocksdb::{Database, DatabaseConfig}; use kvdb_rocksdb::{Database, DatabaseConfig};
use polkadot_primitives::Hash; use polkadot_primitives::Hash;
use polkadot_primitives::parachain::{Id as ParaId, BlockData, Extrinsic}; use polkadot_primitives::parachain::{Id as ParaId, BlockData, Extrinsic};
use log::warn;
use std::collections::HashSet; use std::collections::HashSet;
use std::path::PathBuf; use std::path::PathBuf;
...@@ -101,7 +91,7 @@ impl Store { ...@@ -101,7 +91,7 @@ impl Store {
/// Create a new `Store` in-memory. Useful for tests. /// Create a new `Store` in-memory. Useful for tests.
pub fn new_in_memory() -> Self { pub fn new_in_memory() -> Self {
Store { Store {
inner: Arc::new(::kvdb_memorydb::create(::columns::NUM_COLUMNS)), inner: Arc::new(::kvdb_memorydb::create(columns::NUM_COLUMNS)),
} }
} }
......
...@@ -3,11 +3,12 @@ name = "polkadot-cli" ...@@ -3,11 +3,12 @@ name = "polkadot-cli"
version = "0.5.0" version = "0.5.0"
authors = ["Parity Technologies <admin@parity.io>"] authors = ["Parity Technologies <admin@parity.io>"]
description = "Polkadot node implementation in Rust." description = "Polkadot node implementation in Rust."
edition = "2018"
[dependencies] [dependencies]
log = "0.4.6" log = "0.4.6"
tokio = "0.1.7" tokio = "0.1.7"
futures = "0.1.17" futures = "0.1.17"
exit-future = "0.1" exit-future = "0.1"
substrate-cli = { git = "https://github.com/paritytech/substrate", branch = "polkadot-master" } cli = { package = "substrate-cli", git = "https://github.com/paritytech/substrate", branch = "polkadot-master" }
polkadot-service = { path = "../service" } service = { package = "polkadot-service", path = "../service" }
...@@ -19,16 +19,6 @@ ...@@ -19,16 +19,6 @@
#![warn(missing_docs)] #![warn(missing_docs)]
#![warn(unused_extern_crates)] #![warn(unused_extern_crates)]
extern crate futures;
extern crate tokio;
extern crate substrate_cli as cli;
extern crate polkadot_service as service;
extern crate exit_future;
#[macro_use]
extern crate log;
mod chain_spec; mod chain_spec;
use std::ops::Deref; use std::ops::Deref;
...@@ -36,6 +26,7 @@ use chain_spec::ChainSpec; ...@@ -36,6 +26,7 @@ use chain_spec::ChainSpec;
use futures::Future; use futures::Future;
use tokio::runtime::Runtime; use tokio::runtime::Runtime;
use service::Service as BareService; use service::Service as BareService;
use log::info;
pub use service::{ pub use service::{
Components as ServiceComponents, PolkadotService, CustomConfiguration, ServiceFactory, Factory, Components as ServiceComponents, PolkadotService, CustomConfiguration, ServiceFactory, Factory,
...@@ -127,7 +118,8 @@ fn run_until_exit<T, C, W>( ...@@ -127,7 +118,8 @@ fn run_until_exit<T, C, W>(
let (exit_send, exit) = exit_future::signal(); let (exit_send, exit) = exit_future::signal();
let executor = runtime.executor(); let executor = runtime.executor();
cli::informant::start(&service, exit.clone(), executor.clone()); let informant = cli::informant::build(&service);
executor.spawn(exit.until(informant).map(|_| ()));
let _ = runtime.block_on(worker.work(&*service, executor.clone())); let _ = runtime.block_on(worker.work(&*service, executor.clone()));
exit_send.fire(); exit_send.fire();
......
...@@ -3,14 +3,15 @@ name = "polkadot-collator" ...@@ -3,14 +3,15 @@ name = "polkadot-collator"
version = "0.1.0" version = "0.1.0"
authors = ["Parity Technologies <admin@parity.io>"] authors = ["Parity Technologies <admin@parity.io>"]
description = "Collator node implementation" description = "Collator node implementation"
edition = "2018"
[dependencies] [dependencies]
futures = "0.1.17" futures = "0.1.17"
substrate-client = { git = "https://github.com/paritytech/substrate", branch = "polkadot-master" } client = { package = "substrate-client", git = "https://github.com/paritytech/substrate", branch = "polkadot-master" }
parity-codec = "3.0" parity-codec = "3.0"
substrate-primitives = { git = "https://github.com/paritytech/substrate", branch = "polkadot-master" } primitives = { package = "substrate-primitives", git = "https://github.com/paritytech/substrate", branch = "polkadot-master" }
substrate-consensus-authorities = { git = "https://github.com/paritytech/substrate", branch = "polkadot-master" } consensus_authorities = { package = "substrate-consensus-authorities", git = "https://github.com/paritytech/substrate", branch = "polkadot-master" }
substrate-consensus-common= { git = "https://github.com/paritytech/substrate", branch = "polkadot-master" } consensus_common = { package = "substrate-consensus-common", git = "https://github.com/paritytech/substrate", branch = "polkadot-master" }
polkadot-runtime = { path = "../runtime", version = "0.1" } polkadot-runtime = { path = "../runtime", version = "0.1" }
polkadot-primitives = { path = "../primitives", version = "0.1" } polkadot-primitives = { path = "../primitives", version = "0.1" }
polkadot-cli = { path = "../cli" } polkadot-cli = { path = "../cli" }
...@@ -20,4 +21,4 @@ log = "0.4" ...@@ -20,4 +21,4 @@ log = "0.4"
tokio = "0.1.7" tokio = "0.1.7"
[dev-dependencies] [dev-dependencies]
substrate-keyring = { git = "https://github.com/paritytech/substrate", branch = "polkadot-master" } keyring = { package = "substrate-keyring", git = "https://github.com/paritytech/substrate", branch = "polkadot-master" }
...@@ -44,32 +44,13 @@ ...@@ -44,32 +44,13 @@
//! This crate defines traits which provide context necessary for collation logic //! This crate defines traits which provide context necessary for collation logic
//! to be performed, as the collation logic itself. //! to be performed, as the collation logic itself.
extern crate futures;
extern crate substrate_client as client;
extern crate parity_codec as codec;
extern crate substrate_primitives as primitives;
extern crate substrate_consensus_authorities as consensus_authorities;
extern crate substrate_consensus_common as consensus_common;
extern crate tokio;
extern crate polkadot_cli;
extern crate polkadot_runtime;
extern crate polkadot_primitives;
extern crate polkadot_network;
extern crate polkadot_validation;
#[macro_use]
extern crate log;
#[cfg(test)]
extern crate substrate_keyring as keyring;
use std::collections::HashSet; use std::collections::HashSet;
use std::fmt; use std::fmt;
use std::sync::Arc; use std::sync::Arc;
use std::time::Duration; use std::time::Duration;
use futures::{future, Stream, Future, IntoFuture}; use futures::{future, Stream, Future, IntoFuture};
use log::{info, warn};
use client::BlockchainEvents; use client::BlockchainEvents;
use primitives::{ed25519, Pair}; use primitives::{ed25519, Pair};
use polkadot_primitives::{BlockId, SessionKey, Hash, Block}; use polkadot_primitives::{BlockId, SessionKey, Hash, Block};
......
...@@ -5,8 +5,8 @@ authors = ["Parity Technologies <admin@parity.io>"] ...@@ -5,8 +5,8 @@ authors = ["Parity Technologies <admin@parity.io>"]
edition = "2018" edition = "2018"
[dependencies] [dependencies]
polkadot-primitives = { path = "../primitives" } primitives = { package = "polkadot-primitives", path = "../primitives" }
reed-solomon-erasure = { git = "https://github.com/paritytech/reed-solomon-erasure" } reed_solomon = { package = "reed-solomon-erasure", git = "https://github.com/paritytech/reed-solomon-erasure" }
parity-codec = "3.0" parity-codec = "3.0"
substrate-primitives = { git = "https://github.com/paritytech/substrate", branch = "polkadot-master" } substrate-primitives = { git = "https://github.com/paritytech/substrate", branch = "polkadot-master" }
substrate-trie = { git = "https://github.com/paritytech/substrate", branch = "polkadot-master" } trie = { package = "substrate-trie", git = "https://github.com/paritytech/substrate", branch = "polkadot-master" }
...@@ -24,13 +24,7 @@ ...@@ -24,13 +24,7 @@
//! f is the maximum number of faulty vaildators in the system. //! f is the maximum number of faulty vaildators in the system.
//! The data is coded so any f+1 chunks can be used to reconstruct the full data. //! The data is coded so any f+1 chunks can be used to reconstruct the full data.
extern crate polkadot_primitives as primitives; use parity_codec::{Encode, Decode};
extern crate reed_solomon_erasure as reed_solomon;
extern crate parity_codec as codec;
extern crate substrate_primitives;
extern crate substrate_trie as trie;
use codec::{Encode, Decode};
use reed_solomon::galois_16::{self, ReedSolomon}; use reed_solomon::galois_16::{self, ReedSolomon};
use primitives::{Hash as H256, BlakeTwo256, HashT}; use primitives::{Hash as H256, BlakeTwo256, HashT};
use primitives::parachain::{BlockData, Extrinsic}; use primitives::parachain::{BlockData, Extrinsic};
...@@ -297,7 +291,7 @@ struct ShardInput<'a, I> { ...@@ -297,7 +291,7 @@ struct ShardInput<'a, I> {
cur_shard: Option<(&'a [u8], usize)>, cur_shard: Option<(&'a [u8], usize)>,
} }
impl<'a, I: Iterator<Item=&'a [u8]>> codec::Input for ShardInput<'a, I> { impl<'a, I: Iterator<Item=&'a [u8]>> parity_codec::Input for ShardInput<'a, I> {
fn read(&mut self, into: &mut [u8]) -> usize { fn read(&mut self, into: &mut [u8]) -> usize {
let mut read_bytes = 0; let mut read_bytes = 0;
......
...@@ -3,8 +3,8 @@ name = "polkadot-executor" ...@@ -3,8 +3,8 @@ name = "polkadot-executor"
version = "0.1.0" version = "0.1.0"
authors = ["Parity Technologies <admin@parity.io>"] authors = ["Parity Technologies <admin@parity.io>"]
description = "Polkadot node implementation in Rust." description = "Polkadot node implementation in Rust."
edition = "2018"
[dependencies] [dependencies]
substrate-executor = { git = "https://github.com/paritytech/substrate", branch = "polkadot-master" } substrate-executor = { git = "https://github.com/paritytech/substrate", branch = "polkadot-master" }
substrate-primitives = { git = "https://github.com/paritytech/substrate", branch = "polkadot-master" }
polkadot-runtime = { path = "../runtime" } polkadot-runtime = { path = "../runtime" }
...@@ -17,9 +17,7 @@ ...@@ -17,9 +17,7 @@
//! A `CodeExecutor` specialisation which uses natively compiled runtime when the wasm to be //! A `CodeExecutor` specialisation which uses natively compiled runtime when the wasm to be
//! executed is equivalent to the natively compiled code. //! executed is equivalent to the natively compiled code.
extern crate polkadot_runtime; use substrate_executor::native_executor_instance;
#[macro_use] extern crate substrate_executor;
extern crate substrate_primitives as primitives;
native_executor_instance!( native_executor_instance!(
pub Executor, pub Executor,
......
...@@ -3,15 +3,15 @@ name = "polkadot-network" ...@@ -3,15 +3,15 @@ name = "polkadot-network"
version = "0.1.0" version = "0.1.0"
authors = ["Parity Technologies <admin@parity.io>"] authors = ["Parity Technologies <admin@parity.io>"]
description = "Polkadot-specific networking protocol" description = "Polkadot-specific networking protocol"
edition = "2018"
[dependencies] [dependencies]
arrayvec = "0.4" arrayvec = "0.4"
parking_lot = "0.7.1" parking_lot = "0.7.1"
polkadot-availability-store = { path = "../availability-store" } av_store = { package = "polkadot-availability-store", path = "../availability-store" }
polkadot-validation = { path = "../validation" } polkadot-validation = { path = "../validation" }
polkadot-primitives = { path = "../primitives" } polkadot-primitives = { path = "../primitives" }
parity-codec = "3.0" parity-codec = { version = "3.0", features = ["derive"] }
parity-codec-derive = "3.0"
substrate-network = { git = "https://github.com/paritytech/substrate", branch = "polkadot-master" } substrate-network = { git = "https://github.com/paritytech/substrate", branch = "polkadot-master" }
substrate-primitives = { git = "https://github.com/paritytech/substrate", branch = "polkadot-master" } substrate-primitives = { git = "https://github.com/paritytech/substrate", branch = "polkadot-master" }
sr-primitives = { git = "https://github.com/paritytech/substrate", branch = "polkadot-master" } sr-primitives = { git = "https://github.com/paritytech/substrate", branch = "polkadot-master" }
......
...@@ -16,6 +16,7 @@ ...@@ -16,6 +16,7 @@
//! Bridge between the network and consensus service for getting collations to it. //! Bridge between the network and consensus service for getting collations to it.
use parity_codec::{Encode, Decode};
use polkadot_primitives::Hash; use polkadot_primitives::Hash;
use polkadot_primitives::parachain::{CollatorId, Id as ParaId, Collation}; use polkadot_primitives::parachain::{CollatorId, Id as ParaId, Collation};
use futures::sync::oneshot; use futures::sync::oneshot;
......
...@@ -23,15 +23,16 @@ use substrate_network::consensus_gossip::{ ...@@ -23,15 +23,16 @@ use substrate_network::consensus_gossip::{
}; };
use polkadot_validation::{GenericStatement, SignedStatement}; use polkadot_validation::{GenericStatement, SignedStatement};
use polkadot_primitives::{Block, Hash, SessionKey, parachain::ValidatorIndex}; use polkadot_primitives::{Block, Hash, SessionKey, parachain::ValidatorIndex};
use codec::{Decode, Encode}; use parity_codec::{Decode, Encode};
use std::collections::{HashMap, HashSet}; use std::collections::{HashMap, HashSet};
use std::sync::Arc; use std::sync::Arc;
use parking_lot::RwLock; use parking_lot::RwLock;
use log::warn;
use super::NetworkService; use super::NetworkService;
use router::attestation_topic; use crate::router::attestation_topic;
/// The engine ID of the polkadot attestation system. /// The engine ID of the polkadot attestation system.
pub const POLKADOT_ENGINE_ID: sr_primitives::ConsensusEngineId = [b'd', b'o', b't', b'1']; pub const POLKADOT_ENGINE_ID: sr_primitives::ConsensusEngineId = [b'd', b'o', b't', b'1'];
......
...@@ -19,39 +19,13 @@ ...@@ -19,39 +19,13 @@
//! This manages routing for parachain statements, parachain block and extrinsic data fetching, //! This manages routing for parachain statements, parachain block and extrinsic data fetching,
//! communication between collators and validators, and more. //! communication between collators and validators, and more.
extern crate parity_codec as codec;
extern crate substrate_network;
extern crate substrate_primitives;
extern crate sr_primitives;
extern crate polkadot_validation;
extern crate polkadot_availability_store as av_store;
extern crate polkadot_primitives;
extern crate arrayvec;
extern crate parking_lot;
extern crate tokio;
extern crate exit_future;
extern crate futures;
#[macro_use]
extern crate log;
#[macro_use]
extern crate parity_codec_derive;
#[cfg(test)]
extern crate substrate_client;
#[cfg(test)]
extern crate substrate_keyring;
mod collator_pool; mod collator_pool;
mod local_collations; mod local_collations;
mod router; mod router;
pub mod validation; pub mod validation;
pub mod gossip; pub mod gossip;
use codec::{Decode, Encode}; use parity_codec::{Decode, Encode};
use futures::sync::oneshot; use futures::sync::oneshot;
use polkadot_primitives::{Block, SessionKey, Hash, Header}; use polkadot_primitives::{Block, SessionKey, Hash, Header};
use polkadot_primitives::parachain::{ use polkadot_primitives::parachain::{
...@@ -65,6 +39,7 @@ use substrate_network::StatusMessage as GenericFullStatus; ...@@ -65,6 +39,7 @@ use substrate_network::StatusMessage as GenericFullStatus;
use self::validation::{LiveValidationSessions, RecentValidatorIds, InsertedRecentKey}; use self::validation::{LiveValidationSessions, RecentValidatorIds, InsertedRecentKey};
use self::collator_pool::{CollatorPool, Role, Action}; use self::collator_pool::{CollatorPool, Role, Action};
use self::local_collations::LocalCollations; use self::local_collations::LocalCollations;
use log::{trace, debug, warn};
use std::collections::{HashMap, HashSet}; use std::collections::{HashMap, HashSet};
......
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
use polkadot_primitives::{Hash, SessionKey}; use polkadot_primitives::{Hash, SessionKey};
use collator_pool::Role; use crate::collator_pool::Role;
use std::collections::{HashMap, HashSet}; use std::collections::{HashMap, HashSet};
use std::time::{Duration, Instant}; use std