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 1 commit
Commits
Show all changes
75 commits
Select commit Hold shift + click to select a range
fa071ff
Adding first rough ouline of the repository structure
gnunicorn Nov 10, 2019
b2b48ed
Remove old CI stuff
gnunicorn Nov 10, 2019
c0556ea
add title
gnunicorn Nov 10, 2019
425814d
formatting fixes
gnunicorn Nov 10, 2019
4f7d22e
move node-exits job's script to scripts dir
TriplEight Nov 10, 2019
b3c4d8b
Move docs into subdir
gnunicorn Nov 10, 2019
7887f7b
move to bin
gnunicorn Nov 10, 2019
09000f3
move maintainence scripts, configs and helpers into its own dir
gnunicorn Nov 10, 2019
eea9398
add .local to ignore
gnunicorn Nov 10, 2019
a4e451c
move core->client
gnunicorn Nov 10, 2019
bd9cee1
start up 'test' area
gnunicorn Nov 11, 2019
b18dac0
move test client
gnunicorn Nov 11, 2019
a925eea
move test runtime
gnunicorn Nov 11, 2019
8c10e12
make test move compile
gnunicorn Nov 11, 2019
95d9981
Add dependencies rule enforcement.
tomusdrw Nov 11, 2019
0c1814e
Merge branch 'the-big-reorg' of github.com:paritytech/substrate into …
tomusdrw Nov 11, 2019
c1eb318
Fix indexing.
tomusdrw Nov 11, 2019
26004a7
Update docs to reflect latest changes
gnunicorn Nov 11, 2019
72e690e
Merge remote-tracking branch 'origin/master' into the-big-reorg
gnunicorn Nov 11, 2019
d9ffec8
Moving /srml->/paint
gnunicorn Nov 11, 2019
3266289
update docs
gnunicorn Nov 11, 2019
e04b4fc
move client/sr-* -> primitives/
gnunicorn Nov 11, 2019
ddd0ffb
clean old readme
gnunicorn Nov 11, 2019
83de634
remove old broken code in rhd
gnunicorn Nov 11, 2019
1fd17a8
update lock
gnunicorn Nov 11, 2019
733c0f6
Step 1.
tomusdrw Nov 11, 2019
6adf9af
Merge branch 'the-big-reorg' of github.com:paritytech/substrate into …
tomusdrw Nov 11, 2019
5080d91
Merge branch 'master' into the-big-reorg
tomusdrw Nov 11, 2019
367819e
starting to untangle client
gnunicorn Nov 11, 2019
1b28184
Fix after merge.
tomusdrw Nov 11, 2019
1a64595
start splitting out client interfaces
gnunicorn Nov 11, 2019
c82823c
Fix the fix.
tomusdrw Nov 11, 2019
8964125
Merge branch 'the-big-reorg' of github.com:paritytech/substrate into …
gnunicorn Nov 11, 2019
c103b78
move children and blockchain interfaces
gnunicorn Nov 11, 2019
a60c537
Move trie and state-machine to primitives.
tomusdrw Nov 11, 2019
a1984de
Fix WASM builds.
tomusdrw Nov 11, 2019
1ab7ac7
fixing broken imports
gnunicorn Nov 11, 2019
5cbd18d
Merge branch 'the-big-reorg' of github.com:paritytech/substrate into …
gnunicorn Nov 11, 2019
bc02c35
more interface moves
gnunicorn Nov 11, 2019
f75cfba
move backend and light to interfaces
gnunicorn Nov 12, 2019
f10ee92
move CallExecutor
gnunicorn Nov 12, 2019
224f318
move cli off client
gnunicorn Nov 12, 2019
9c3752d
moving around more interfaces
gnunicorn Nov 12, 2019
4738b9d
re-add consensus crates into the mix
gnunicorn Nov 12, 2019
2cd3316
fix subkey path
gnunicorn Nov 12, 2019
cab5727
relieve client from executor
gnunicorn Nov 12, 2019
ee8bed2
starting to pull out client from grandpa
gnunicorn Nov 12, 2019
2285766
move is_decendent_of out of client
gnunicorn Nov 12, 2019
7376b51
grandpa still depends on client directly
gnunicorn Nov 12, 2019
d288ec0
lemme tests pass
gnunicorn Nov 13, 2019
f0d7d20
Merge branch 'master' into the-big-reorg
tomusdrw Nov 13, 2019
5e60373
rename srml->paint
gnunicorn Nov 13, 2019
9fe4663
Make it compile.
tomusdrw Nov 13, 2019
87c8a75
rename interfaces->client-api
gnunicorn Nov 13, 2019
9b27c66
Merge branch 'the-big-reorg' of github.com:paritytech/substrate into …
gnunicorn Nov 13, 2019
1feec16
Move keyring to primitives.
tomusdrw Nov 13, 2019
9fab2ba
fixup libp2p dep
gnunicorn Nov 13, 2019
946b624
Merge branch 'the-big-reorg' of github.com:paritytech/substrate into …
tomusdrw Nov 13, 2019
0c7a49d
fix broken use
gnunicorn Nov 13, 2019
97d78bb
Merge branch 'the-big-reorg' of github.com:paritytech/substrate into …
tomusdrw Nov 13, 2019
58a3fe1
allow dependency enforcement to fail
gnunicorn Nov 13, 2019
c32b70d
Merge branch 'the-big-reorg' of github.com:paritytech/substrate into …
tomusdrw Nov 13, 2019
48dba8f
Merge branch 'master' into the-big-reorg
tomusdrw Nov 14, 2019
62edb89
move fork-tree
gnunicorn Nov 14, 2019
44effe4
Moving wasm-builder
gnunicorn Nov 14, 2019
191fa20
make env
gnunicorn Nov 14, 2019
b3a7e1f
move build-script-utils
gnunicorn Nov 14, 2019
fb5fc06
Merge branch 'master' into the-big-reorg
tomusdrw Nov 14, 2019
8fb157e
fixup broken crate depdencies and names
gnunicorn Nov 14, 2019
444d41e
fix imports for authority discovery
gnunicorn Nov 14, 2019
be9be03
fix typo
gnunicorn Nov 14, 2019
7b68eda
update cargo.lock
gnunicorn Nov 14, 2019
cc85b0b
fixing imports
gnunicorn Nov 14, 2019
9e849bc
Fix paths and add missing crates
bkchr Nov 14, 2019
a94ed57
re-add missing crates
gnunicorn Nov 14, 2019
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
Prev Previous commit
Next Next commit
Merge remote-tracking branch 'origin/master' into the-big-reorg
  • Loading branch information
gnunicorn committed Nov 11, 2019
commit 72e690e5e9b574cb0bec5dbcf6f95a69d52aba4a
2 changes: 1 addition & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ tab_width=4
end_of_line=lf
charset=utf-8
trim_trailing_whitespace=true
max_line_length=120
max_line_length=100
insert_final_newline=true

[*.yml]
Expand Down
1,093 changes: 599 additions & 494 deletions Cargo.lock

Large diffs are not rendered by default.

22 changes: 18 additions & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ members = [
"client/rpc",
"client/rpc/primitives",
"client/rpc-servers",
"client/runtime-interface",
"client/runtime-interface/proc-macro",
"client/runtime-interface/test-wasm",
"client/serializer",
"client/service",
"client/service/test",
Expand All @@ -43,17 +46,18 @@ members = [
"client/sr-version",
"client/state-machine",
"client/telemetry",
"test/utils/client",
"test/utils/runtime",
"test/utils/runtime/client",
"client/transaction-pool",
"client/transaction-pool/graph",
"client/trie",
"client/utils/fork-tree",
"client/utils/wasm-builder",
"client/utils/wasm-builder-runner",
"client/wasm-interface",

# SRML

"srml/support",
"srml/support/rpc",
"srml/support/procedural",
"srml/support/procedural/tools",
"srml/support/procedural/tools/derive",
Expand Down Expand Up @@ -94,6 +98,9 @@ members = [
"srml/transaction-payment/rpc",
"srml/utility",
"srml/evm",

# BIN

"bin/node/cli",
"bin/node/executor",
"bin/node/primitives",
Expand All @@ -103,10 +110,17 @@ members = [
"bin/node/testing",
"bin/node-template",
"bin/subkey",

# TEST HELPERS

"test/utils/client",
"test/utils/runtime",
"test/utils/runtime/client",
"test/utils/chain-spec-builder",

# TESTS
]

[profile.release]
# Substrate runtime requires unwinding.
panic = "unwind"

2 changes: 1 addition & 1 deletion bin/node-template/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@ aura-primitives = { package = "substrate-consensus-aura-primitives", path = "../
grandpa = { package = "substrate-finality-grandpa", path = "../../client/finality-grandpa" }
grandpa-primitives = { package = "substrate-finality-grandpa-primitives", path = "../../client/finality-grandpa/primitives" }
substrate-client = { path = "../../client/client" }
basic-authorship = { package = "substrate-basic-authorship", path = "../../client/basic-authorship" }
runtime = { package = "node-template-runtime", path = "runtime" }
sr-primitives = { path = "../../client/sr-primitives" }
basic-authorship = { package = "substrate-basic-authorship", path = "../../client/basic-authorship"}

[build-dependencies]
vergen = "3.0.4"
Expand Down
1 change: 0 additions & 1 deletion bin/node-template/runtime/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -349,7 +349,6 @@ impl_runtime_apis! {

impl substrate_session::SessionKeys<Block> for Runtime {
fn generate_session_keys(seed: Option<Vec<u8>>) -> Vec<u8> {
let seed = seed.as_ref().map(|s| rstd::str::from_utf8(&s).expect("Seed is an utf8 string"));
opaque::SessionKeys::generate(seed)
}
}
Expand Down
1 change: 1 addition & 0 deletions bin/node-template/src/service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ use substrate_executor::native_executor_instance;
pub use substrate_executor::NativeExecutor;
use aura_primitives::sr25519::{AuthorityPair as AuraPair};
use grandpa::{self, FinalityProofProvider as GrandpaFinalityProofProvider};
use basic_authorship;

// Our native executor instance.
native_executor_instance!(
Expand Down
2 changes: 1 addition & 1 deletion bin/node/cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ babe-primitives = { package = "substrate-consensus-babe-primitives", path = "../
grandpa_primitives = { package = "substrate-finality-grandpa-primitives", path = "../../../client/finality-grandpa/primitives" }

# core dependencies
sr-io = { path = "../../../client/sr-io" }
runtime-io = { package = "sr-io", path = "../../../client/sr-io" }
client = { package = "substrate-client", path = "../../../client/client" }
inherents = { package = "substrate-inherents", path = "../../../client/inherents" }
chain-spec = { package = "substrate-chain-spec", path = "../../../client/chain-spec" }
Expand Down
2 changes: 1 addition & 1 deletion bin/node/cli/src/factory_impl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ fn sign<RA: RuntimeAdapter>(
let payload = (xt.function, extra.clone(), additional_signed);
let signature = payload.using_encoded(|b| {
if b.len() > 256 {
key.sign(&sr_io::blake2_256(b))
key.sign(&runtime_io::hashing::blake2_256(b))
} else {
key.sign(b)
}
Expand Down
4 changes: 2 additions & 2 deletions bin/node/cli/src/service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -390,7 +390,7 @@ mod tests {
origin: BlockOrigin::File,
justification: Vec::new(),
internal_justification: Vec::new(),
finalized: true,
finalized: false,
body: Some(block.extrinsics),
header: block.header,
auxiliary: Vec::new(),
Expand Down Expand Up @@ -520,7 +520,7 @@ mod tests {
justification: None,
post_digests: vec![item],
body: Some(new_body),
finalized: true,
finalized: false,
auxiliary: Vec::new(),
fork_choice: ForkChoiceStrategy::LongestChain,
allow_missing_state: false,
Expand Down
2 changes: 0 additions & 2 deletions bin/node/runtime/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -698,8 +698,6 @@ impl_runtime_apis! {

impl substrate_session::SessionKeys<Block> for Runtime {
fn generate_session_keys(seed: Option<Vec<u8>>) -> Vec<u8> {
let seed = seed.as_ref().map(|s| rstd::str::from_utf8(&s)
.expect("Seed is an utf8 string"));
SessionKeys::generate(seed)
}
}
Expand Down
2 changes: 1 addition & 1 deletion bin/node/testing/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ node-primitives = { path = "../primitives" }
node-runtime = { path = "../runtime" }
codec = { package = "parity-scale-codec", version = "1.0.0" }
primitives = { package = "substrate-primitives", path = "../../../client/primitives" }
sr-io = { path = "../../../client/sr-io" }
runtime-io = { package = "sr-io", path = "../../../client/sr-io" }
sr-primitives = { path = "../../../client/sr-primitives" }
runtime_support = { package = "srml-support", path = "../../../srml/support" }
session = { package = "srml-session", path = "../../../srml/session" }
Expand Down
2 changes: 1 addition & 1 deletion bin/node/testing/src/keyring.rs
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ pub fn sign(xt: CheckedExtrinsic, version: u32, genesis_hash: [u8; 32]) -> Unche
let key = AccountKeyring::from_account_id(&signed).unwrap();
let signature = payload.using_encoded(|b| {
if b.len() > 256 {
key.sign(&sr_io::blake2_256(b))
key.sign(&runtime_io::hashing::blake2_256(b))
} else {
key.sign(b)
}
Expand Down
15 changes: 8 additions & 7 deletions client/application-crypto/src/ed25519.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@

use crate::{RuntimePublic, KeyTypeId};

use rstd::vec::Vec;

pub use primitives::ed25519::*;

mod app {
Expand All @@ -29,28 +31,27 @@ mod app {
}
}

pub use app::Public as AppPublic;
pub use app::Signature as AppSignature;
pub use app::{Public as AppPublic, Signature as AppSignature};
#[cfg(feature = "full_crypto")]
pub use app::Pair as AppPair;

impl RuntimePublic for Public {
type Signature = Signature;

fn all(key_type: KeyTypeId) -> crate::Vec<Self> {
runtime_io::ed25519_public_keys(key_type)
runtime_io::crypto::ed25519_public_keys(key_type)
}

fn generate_pair(key_type: KeyTypeId, seed: Option<&str>) -> Self {
runtime_io::ed25519_generate(key_type, seed)
fn generate_pair(key_type: KeyTypeId, seed: Option<Vec<u8>>) -> Self {
runtime_io::crypto::ed25519_generate(key_type, seed)
}

fn sign<M: AsRef<[u8]>>(&self, key_type: KeyTypeId, msg: &M) -> Option<Self::Signature> {
runtime_io::ed25519_sign(key_type, self, msg.as_ref())
runtime_io::crypto::ed25519_sign(key_type, self, msg.as_ref())
}

fn verify<M: AsRef<[u8]>>(&self, msg: &M, signature: &Self::Signature) -> bool {
runtime_io::ed25519_verify(&signature, msg.as_ref(), self)
runtime_io::crypto::ed25519_verify(&signature, msg.as_ref(), self)
}
}

Expand Down
2 changes: 1 addition & 1 deletion client/application-crypto/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@ macro_rules! app_crypto_public_common {
<$public as $crate::RuntimePublic>::all($key_type).into_iter().map(Self).collect()
}

fn generate_pair(seed: Option<&str>) -> Self {
fn generate_pair(seed: Option<$crate::Vec<u8>>) -> Self {
Self(<$public as $crate::RuntimePublic>::generate_pair($key_type, seed))
}

Expand Down
15 changes: 8 additions & 7 deletions client/application-crypto/src/sr25519.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@

use crate::{RuntimePublic, KeyTypeId};

use rstd::vec::Vec;

pub use primitives::sr25519::*;

mod app {
Expand All @@ -29,28 +31,27 @@ mod app {
}
}

pub use app::Public as AppPublic;
pub use app::Signature as AppSignature;
pub use app::{Public as AppPublic, Signature as AppSignature};
#[cfg(feature = "full_crypto")]
pub use app::Pair as AppPair;

impl RuntimePublic for Public {
type Signature = Signature;

fn all(key_type: KeyTypeId) -> crate::Vec<Self> {
runtime_io::sr25519_public_keys(key_type)
runtime_io::crypto::sr25519_public_keys(key_type)
}

fn generate_pair(key_type: KeyTypeId, seed: Option<&str>) -> Self {
runtime_io::sr25519_generate(key_type, seed)
fn generate_pair(key_type: KeyTypeId, seed: Option<Vec<u8>>) -> Self {
runtime_io::crypto::sr25519_generate(key_type, seed)
}

fn sign<M: AsRef<[u8]>>(&self, key_type: KeyTypeId, msg: &M) -> Option<Self::Signature> {
runtime_io::sr25519_sign(key_type, self, msg.as_ref())
runtime_io::crypto::sr25519_sign(key_type, self, msg.as_ref())
}

fn verify<M: AsRef<[u8]>>(&self, msg: &M, signature: &Self::Signature) -> bool {
runtime_io::sr25519_verify(&signature, msg.as_ref(), self)
runtime_io::crypto::sr25519_verify(&signature, msg.as_ref(), self)
}
}

Expand Down
15 changes: 10 additions & 5 deletions client/application-crypto/src/traits.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ use primitives::crypto::Pair;

use codec::Codec;
use primitives::crypto::{KeyTypeId, CryptoType, IsWrappedBy, Public};
use rstd::fmt::Debug;
use rstd::{fmt::Debug, vec::Vec};

/// An application-specific key.
pub trait AppKey: 'static + Send + Sync + Sized + CryptoType + Clone {
Expand Down Expand Up @@ -88,10 +88,13 @@ pub trait RuntimePublic: Sized {
/// Returns all public keys for the given key type in the keystore.
fn all(key_type: KeyTypeId) -> crate::Vec<Self>;

/// Generate a public/private pair for the given key type and store it in the keystore.
/// Generate a public/private pair for the given key type with an optional `seed` and
/// store it in the keystore.
///
/// The `seed` needs to be valid utf8.
///
/// Returns the generated public key.
fn generate_pair(key_type: KeyTypeId, seed: Option<&str>) -> Self;
fn generate_pair(key_type: KeyTypeId, seed: Option<Vec<u8>>) -> Self;

/// Sign the given message with the corresponding private key of this public key.
///
Expand All @@ -116,10 +119,12 @@ pub trait RuntimeAppPublic: Sized {
/// Returns all public keys for this application in the keystore.
fn all() -> crate::Vec<Self>;

/// Generate a public/private pair and store it in the keystore.
/// Generate a public/private pair with an optional `seed` and store it in the keystore.
///
/// The `seed` needs to be valid utf8.
///
/// Returns the generated public key.
fn generate_pair(seed: Option<&str>) -> Self;
fn generate_pair(seed: Option<Vec<u8>>) -> Self;

/// Sign the given message with the corresponding private key of this public key.
///
Expand Down
17 changes: 9 additions & 8 deletions client/executor/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ wasmi = "0.5.1"
parity-wasm = "0.40.3"
lazy_static = "1.4.0"
wasm-interface = { package = "substrate-wasm-interface", path = "../wasm-interface" }
runtime-interface = { package = "substrate-runtime-interface", path = "../runtime-interface" }
externalities = { package = "substrate-externalities", path = "../externalities" }
parking_lot = "0.9.0"
log = "0.4.8"
Expand Down Expand Up @@ -46,12 +47,12 @@ test-case = "0.3.3"
default = []
wasm-extern-trace = []
wasmtime = [
"cranelift-codegen",
"cranelift-entity",
"cranelift-frontend",
"cranelift-native",
"cranelift-wasm",
"wasmtime-environ",
"wasmtime-jit",
"wasmtime-runtime",
"cranelift-codegen",
"cranelift-entity",
"cranelift-frontend",
"cranelift-native",
"cranelift-wasm",
"wasmtime-environ",
"wasmtime-jit",
"wasmtime-runtime",
]
Loading
You are viewing a condensed version of this merge commit. You can view the full changes here.