Skip to content
This repository was archived by the owner on Nov 15, 2023. It is now read-only.
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
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/target/
**/*.rs.bk
*.swp
polkadot-runtime/wasm/target/
executor/wasm/target/
polkadot/runtime/wasm/target/
substrate/executor/wasm/target/
**/._*
54 changes: 29 additions & 25 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,38 +1,42 @@
[[bin]]
name = "polkadot"
path = "polkadot/src/main.rs"

[package]
name = "polkadot"
version = "0.1.0"
authors = ["Parity Technologies <[email protected]>"]

[dependencies]
error-chain = "0.11"
polkadot-cli = { path = "polkadot-cli", version = "0.1" }
polkadot-network = { path = "network" }
polkadot-cli = { path = "polkadot/cli" }
polkadot-network = { path = "polkadot/network" }

[workspace]
members = [
"client",
"codec",
"environmental",
"executor",
"network",
"polkadot-candidate-agreement",
"polkadot-cli",
"polkadot-collator",
"polkadot-executor",
"polkadot-runtime",
"polkadot-primitives",
"polkadot-validator",
"primitives",
"rpc",
"rpc-servers",
"runtime-io",
"runtime-std",
"serializer",
"state-machine",
"substrate/client",
"substrate/codec",
"substrate/environmental",
"substrate/executor",
"polkadot/network",
"polkadot/candidate-agreement",
"polkadot/cli",
"polkadot/collator",
"polkadot/executor",
"polkadot/runtime",
"polkadot/primitives",
"polkadot/validator",
"substrate/primitives",
"substrate/rpc",
"substrate/rpc-servers",
"substrate/runtime-io",
"substrate/runtime-std",
"substrate/serializer",
"substrate/state-machine",
]
exclude = [
"executor/wasm",
"polkadot-runtime/wasm",
"pwasm-alloc",
"pwasm-libc",
"substrate/executor/wasm",
"polkadot/runtime/wasm",
"substrate/pwasm-alloc",
"substrate/pwasm-libc",
]
24 changes: 0 additions & 24 deletions polkadot-cli/Cargo.toml

This file was deleted.

17 changes: 0 additions & 17 deletions polkadot-executor/Cargo.toml

This file was deleted.

18 changes: 0 additions & 18 deletions polkadot-runtime/Cargo.toml

This file was deleted.

24 changes: 0 additions & 24 deletions polkadot-runtime/wasm/Cargo.toml

This file was deleted.

11 changes: 0 additions & 11 deletions polkadot-validator/Cargo.toml

This file was deleted.

24 changes: 24 additions & 0 deletions polkadot/cli/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
[package]
name = "polkadot-cli"
version = "0.1.0"
authors = ["Parity Technologies <[email protected]>"]
description = "Polkadot node implementation in Rust."

[dependencies]
clap = { version = "2.27", features = ["yaml"] }
env_logger = "0.4"
error-chain = "0.11"
log = "0.3"
hex-literal = "0.1"
triehash = "0.1"
ed25519 = { path = "../../substrate/ed25519" }
substrate-client = { path = "../../substrate/client" }
substrate-codec = { path = "../../substrate/codec" }
substrate-runtime-io = { path = "../../substrate/runtime-io" }
substrate-state-machine = { path = "../../substrate/state-machine" }
substrate-executor = { path = "../../substrate/executor" }
substrate-primitives = { path = "../../substrate/primitives" }
substrate-rpc-servers = { path = "../../substrate/rpc-servers" }
polkadot-primitives = { path = "../primitives" }
polkadot-executor = { path = "../executor" }
polkadot-runtime = { path = "../runtime" }
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions polkadot-collator/Cargo.toml → polkadot/collator/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@ authors = ["Parity Technologies <[email protected]>"]
description = "Abstract collation logic"

[dependencies]
substrate-primitives = { path = "../primitives", version = "0.1" }
polkadot-primitives = { path = "../polkadot-primitives", version = "0.1" }
futures = "0.1.17"
substrate-primitives = { path = "../../substrate/primitives", version = "0.1" }
polkadot-primitives = { path = "../primitives", version = "0.1" }
17 changes: 17 additions & 0 deletions polkadot/executor/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
[package]
name = "polkadot-executor"
version = "0.1.0"
authors = ["Parity Technologies <[email protected]>"]
description = "Polkadot node implementation in Rust."

[dependencies]
hex-literal = "0.1"
triehash = { version = "0.1" }
ed25519 = { path = "../../substrate/ed25519" }
substrate-codec = { path = "../../substrate/codec" }
substrate-runtime-io = { path = "../../substrate/runtime-io" }
substrate-state-machine = { path = "../../substrate/state-machine" }
substrate-executor = { path = "../../substrate/executor" }
substrate-primitives = { path = "../../substrate/primitives" }
polkadot-primitives = { path = "../primitives" }
polkadot-runtime = { path = "../runtime" }
10 changes: 5 additions & 5 deletions polkadot-executor/src/lib.rs → polkadot/executor/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ impl NativeExecutionDispatch for LocalNativeExecutionDispatch {
fn native_equivalent() -> &'static [u8] {
// WARNING!!! This assumes that the runtime was built *before* the main project. Until we
// get a proper build script, this must be strictly adhered to or things will go wrong.
include_bytes!("../../polkadot-runtime/wasm/target/wasm32-unknown-unknown/release/polkadot_runtime.compact.wasm")
include_bytes!("../../runtime/wasm/target/wasm32-unknown-unknown/release/polkadot_runtime.compact.wasm")
}

fn dispatch(method: &str, data: &[u8]) -> Option<Vec<u8>> {
Expand All @@ -67,8 +67,8 @@ mod tests {
UncheckedTransaction, Function, AccountId};
use ed25519::Pair;

const BLOATY_CODE: &[u8] = include_bytes!("../../polkadot-runtime/wasm/target/wasm32-unknown-unknown/release/polkadot_runtime.wasm");
const COMPACT_CODE: &[u8] = include_bytes!("../../polkadot-runtime/wasm/target/wasm32-unknown-unknown/release/polkadot_runtime.compact.wasm");
const BLOATY_CODE: &[u8] = include_bytes!("../../runtime/wasm/target/wasm32-unknown-unknown/release/polkadot_runtime.wasm");
const COMPACT_CODE: &[u8] = include_bytes!("../../runtime/wasm/target/wasm32-unknown-unknown/release/polkadot_runtime.compact.wasm");

// TODO: move into own crate.
macro_rules! map {
Expand Down Expand Up @@ -289,7 +289,7 @@ mod tests {
twox_128(&one.to_keyed_vec(b"sta:bal:")).to_vec() => vec![68u8, 0, 0, 0, 0, 0, 0, 0]
], };

let foreign_code = include_bytes!("../../polkadot-runtime/wasm/target/wasm32-unknown-unknown/release/polkadot_runtime.wasm");
let foreign_code = include_bytes!("../../runtime/wasm/target/wasm32-unknown-unknown/release/polkadot_runtime.wasm");
let r = WasmExecutor.call(&mut t, &foreign_code[..], "execute_transaction", &vec![].join(&Header::from_block_number(1u64)).join(&tx()));
assert!(r.is_err());
}
Expand All @@ -303,7 +303,7 @@ mod tests {
twox_128(&one.to_keyed_vec(b"sta:bal:")).to_vec() => vec![111u8, 0, 0, 0, 0, 0, 0, 0]
], };

let foreign_code = include_bytes!("../../polkadot-runtime/wasm/target/wasm32-unknown-unknown/release/polkadot_runtime.compact.wasm");
let foreign_code = include_bytes!("../../runtime/wasm/target/wasm32-unknown-unknown/release/polkadot_runtime.compact.wasm");
let r = WasmExecutor.call(&mut t, &foreign_code[..], "execute_transaction", &vec![].join(&Header::from_block_number(1u64)).join(&tx()));
assert!(r.is_ok());

Expand Down
14 changes: 7 additions & 7 deletions network/Cargo.toml → polkadot/network/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,6 @@ authors = ["Parity Technologies <[email protected]>"]
[lib]

[dependencies]
ethcore-network = { git = "https://github.com/paritytech/parity.git" }
ethcore-io = { git = "https://github.com/paritytech/parity.git" }
substrate-primitives = { path = "../primitives" }
substrate-client = { path = "../client" }
substrate-state-machine = { path = "../state-machine" }
substrate-serializer = { path = "../serializer" }
log = "0.3"
env_logger = "0.4"
rand = "0.3"
Expand All @@ -27,4 +21,10 @@ bitflags = "1.0"
serde = "1.0"
serde_derive = "1.0"
serde_json = "1.0"
polkadot-primitives = { path = "../polkadot-primitives" }
ethcore-network = { git = "https://github.com/paritytech/parity.git" }
ethcore-io = { git = "https://github.com/paritytech/parity.git" }
substrate-primitives = { path = "../../substrate/primitives" }
substrate-client = { path = "../../substrate/client" }
substrate-state-machine = { path = "../../substrate/state-machine" }
substrate-serializer = { path = "../../substrate/serializer" }
polkadot-primitives = { path = "../primitives" }
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ authors = ["Parity Technologies <[email protected]>"]
[dependencies]
serde = { version = "1.0", default_features = false }
serde_derive = { version = "1.0", optional = true }
substrate-codec = { path = "../codec", default_features = false }
substrate-primitives = { path = "../primitives", default_features = false }
substrate-runtime-std = { path = "../runtime-std", default_features = false }
substrate-codec = { path = "../../substrate/codec", default_features = false }
substrate-primitives = { path = "../../substrate/primitives", default_features = false }
substrate-runtime-std = { path = "../../substrate/runtime-std", default_features = false }

[dev-dependencies]
substrate-serializer = { path = "../serializer" }
substrate-serializer = { path = "../../substrate/serializer" }
pretty_assertions = "0.4"

[features]
Expand Down
25 changes: 25 additions & 0 deletions polkadot/runtime/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
[package]
name = "polkadot-runtime"
version = "0.1.0"
authors = ["Parity Technologies <[email protected]>"]

[dependencies]
rustc-hex = "1.0"
hex-literal = "0.1.0"
log = { version = "0.3", optional = true }
substrate-codec = { path = "../../substrate/codec" }
substrate-runtime-std = { path = "../../substrate/runtime-std" }
substrate-runtime-io = { path = "../../substrate/runtime-io" }
substrate-primitives = { path = "../../substrate/primitives" }
polkadot-primitives = { path = "../primitives" }

[features]
default = ["std"]
std = [
"substrate-codec/std",
"substrate-runtime-std/std",
"substrate-runtime-io/std",
"substrate-primitives/std",
"polkadot-primitives/std",
"log"
]
File renamed without changes.
30 changes: 30 additions & 0 deletions polkadot/runtime/wasm/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
[package]
name = "polkadot-runtime"
version = "0.1.0"
authors = ["Parity Technologies <[email protected]>"]

[lib]
crate-type = ["cdylib"]

[dependencies]
substrate-codec = { path = "../../../substrate/codec", default-features = false }
substrate-runtime-std = { path = "../../../substrate/runtime-std", default-features = false }
substrate-runtime-io = { path = "../../../substrate/runtime-io", default-features = false }
substrate-primitives = { path = "../../../substrate/primitives", default-features = false }
polkadot-primitives = { path = "../../primitives", default-features = false }

[features]
default = []
std = [
"substrate-codec/std",
"substrate-runtime-io/std",
"substrate-runtime-std/std",
"substrate-primitives/std",
"polkadot-primitives/std"
]

[profile.release]
panic = "abort"

[workspace]
members = []
File renamed without changes.
Binary file not shown.
Binary file not shown.
File renamed without changes.
11 changes: 11 additions & 0 deletions polkadot/validator/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
[package]
name = "polkadot-validator"
version = "0.1.0"
authors = ["Parity Technologies <[email protected]>"]

[dependencies]
error-chain = "0.11"
serde = "1.0"
substrate-primitives = { path = "../../substrate/primitives" }
substrate-serializer = { path = "../../substrate/serializer" }
polkadot-primitives = { path = "../primitives" }
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 0 additions & 4 deletions executor/src/lib.rs → substrate/executor/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,6 @@ extern crate rustc_hex;
extern crate triehash;
#[macro_use] extern crate log;

#[cfg(test)]
#[macro_use]
extern crate hex_literal;

#[macro_use]
extern crate error_chain;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ pub trait NativeExecutionDispatch {
/// A generic `CodeExecutor` implementation that uses a delegate to determine wasm code equivalence
/// and dispatch to native code when possible, falling back on `WasmExecutor` when not.
pub struct NativeExecutor<D: NativeExecutionDispatch + Sync + Send> {
/// Dummy field to avoid the compiler complaining about us not using `D`.
pub _dummy: ::std::marker::PhantomData<D>,
}

Expand Down
Loading