Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

Commit

Permalink
Merge branch 'master' into dp/make-CallExecutors-generic-over-hasher-…
Browse files Browse the repository at this point in the history
…and-rlpcodec

* master:
  Revert "Install llvm-tools-preview component (#643)" (#644)
  Revert "fix wasm executor compile error (#631)" (#642)
  Fetch parity-common dependencies from crates (#617)
  limit retry count in OnDemand (#513)
  Minor refactor for staking module (#659)
  • Loading branch information
dvdplm committed Sep 5, 2018
2 parents 1c0b385 + 5a480d9 commit 4922db4
Show file tree
Hide file tree
Showing 24 changed files with 509 additions and 452 deletions.
425 changes: 204 additions & 221 deletions Cargo.lock

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,6 @@ build it. Ensure you have Rust and the support software installed:
curl https://sh.rustup.rs -sSf | sh
rustup update nightly
rustup target add wasm32-unknown-unknown --toolchain nightly
rustup component add llvm-tools-preview --toolchain=nightly
rustup update stable
cargo install --git https://github.com/alexcrichton/wasm-gc
sudo apt install cmake pkg-config libssl-dev git
Expand Down
2 changes: 1 addition & 1 deletion demo/cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ error-chain = "0.12"
hex-literal = "0.1"
log = "0.3"
tokio = "0.1.7"
triehash = { git = "https://github.com/paritytech/parity-common" }
triehash = "0.2"
substrate-client = { path = "../../substrate/client" }
substrate-codec = { path = "../../substrate/codec" }
substrate-extrinsic-pool = { path = "../../substrate/extrinsic-pool" }
Expand Down
2 changes: 1 addition & 1 deletion demo/executor/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ description = "Substrate Demo node implementation in Rust."

[dependencies]
hex-literal = "0.1"
triehash = { git = "https://github.com/paritytech/parity-common" }
triehash = "0.2"
ed25519 = { path = "../../substrate/ed25519" }
substrate-codec = { path = "../../substrate/codec" }
substrate-runtime-io = { path = "../../substrate/runtime-io" }
Expand Down
120 changes: 47 additions & 73 deletions demo/runtime/wasm/Cargo.lock

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion scripts/init.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ if [ -z $CI_PROJECT_NAME ] ; then
fi

rustup target add wasm32-unknown-unknown --toolchain nightly
rustup component add llvm-tools-preview --toolchain=nightly

# Install wasm-gc. It's useful for stripping slimming down wasm binaries.
command -v wasm-gc || \
Expand Down
8 changes: 4 additions & 4 deletions substrate/client/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ error-chain = "0.12"
fnv = "1.0"
log = "0.3"
parking_lot = "0.4"
triehash = "0.2"
hex-literal = "0.1"
futures = "0.1.17"
ed25519 = { path = "../ed25519" }
Expand All @@ -23,10 +24,9 @@ substrate-runtime-primitives = { path = "../runtime/primitives" }
substrate-state-machine = { path = "../state-machine" }
substrate-keyring = { path = "../../substrate/keyring" }
substrate-telemetry = { path = "../telemetry" }
hashdb = { git = "https://github.com/paritytech/parity-common" }
patricia-trie = { git = "https://github.com/paritytech/parity-common" }
rlp = { git = "https://github.com/paritytech/parity-common", default-features = false }
triehash = { git = "https://github.com/paritytech/parity-common" }
hashdb = "0.2.1"
patricia-trie = "0.2.1"
rlp = "0.2.4"

[dev-dependencies]
substrate-test-client = { path = "../test-client" }
10 changes: 5 additions & 5 deletions substrate/client/db/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ authors = ["Parity Technologies <[email protected]>"]
[dependencies]
parking_lot = "0.4"
log = "0.3"
kvdb = { git = "https://github.com/paritytech/parity-common" }
kvdb-rocksdb = { git = "https://github.com/paritytech/parity-common" }
hashdb = { git = "https://github.com/paritytech/parity-common" }
memorydb = { git = "https://github.com/paritytech/parity-common" }
kvdb = "0.1"
kvdb-rocksdb = "0.1.3"
hashdb = "0.2.1"
memorydb = "0.2.1"
substrate-primitives = { path = "../../../substrate/primitives" }
substrate-runtime-primitives = { path = "../../../substrate/runtime/primitives" }
substrate-client = { path = "../../../substrate/client" }
Expand All @@ -21,4 +21,4 @@ substrate-executor = { path = "../../../substrate/executor" }
substrate-state-db = { path = "../../../substrate/state-db" }

[dev-dependencies]
kvdb-memorydb = { git = "https://github.com/paritytech/parity-common" }
kvdb-memorydb = "0.1"
1 change: 1 addition & 0 deletions substrate/client/src/light/backend.rs
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,7 @@ impl<Block, S, F, H, C> StateBackend<H, C> for OnDemandState<Block, S, F>
block: self.block,
header: header.expect("if block above guarantees that header is_some(); qed"),
key: key.to_vec(),
retry_count: None,
})
.into_future().wait()
}
Expand Down
1 change: 1 addition & 0 deletions substrate/client/src/light/blockchain.rs
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ impl<S, F, Block> BlockchainHeaderBackend<Block> for Blockchain<S, F> where Bloc
.remote_header(RemoteHeaderRequest {
cht_root: self.storage.cht_root(cht::SIZE, number)?,
block: number,
retry_count: None,
})
.into_future().wait()
.map(Some)
Expand Down
2 changes: 2 additions & 0 deletions substrate/client/src/light/call_executor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ where
header: block_header,
method: method.into(),
call_data: call_data.to_vec(),
retry_count: None,
}).into_future().wait()
}

Expand Down Expand Up @@ -173,6 +174,7 @@ mod tests {
},
method: "authorities".into(),
call_data: vec![],
retry_count: None,
}, remote_execution_proof).unwrap();
}
}
10 changes: 10 additions & 0 deletions substrate/client/src/light/fetcher.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ pub struct RemoteCallRequest<Header: HeaderT> {
pub method: String,
/// Call data.
pub call_data: Vec<u8>,
/// Number of times to retry request. None means that default RETRY_COUNT is used.
pub retry_count: Option<usize>,
}

/// Remote canonical header request.
Expand All @@ -52,6 +54,8 @@ pub struct RemoteHeaderRequest<Header: HeaderT> {
pub cht_root: Header::Hash,
/// Number of the header to query.
pub block: Header::Number,
/// Number of times to retry request. None means that default RETRY_COUNT is used.
pub retry_count: Option<usize>,
}

/// Remote storage read request.
Expand All @@ -63,6 +67,8 @@ pub struct RemoteReadRequest<Header: HeaderT> {
pub header: Header,
/// Storage key to read.
pub key: Vec<u8>,
/// Number of times to retry request. None means that default RETRY_COUNT is used.
pub retry_count: Option<usize>,
}

/// Light client data fetcher. Implementations of this trait must check if remote data
Expand Down Expand Up @@ -264,6 +270,7 @@ pub mod tests {
block: remote_block_header.hash(),
header: remote_block_header,
key: b":auth:len".to_vec(),
retry_count: None,
}, remote_read_proof).unwrap().unwrap()[0], authorities_len as u8);
}

Expand All @@ -273,6 +280,7 @@ pub mod tests {
assert_eq!((&local_checker as &FetchChecker<Block>).check_header_proof(&RemoteHeaderRequest::<Header> {
cht_root: local_cht_root,
block: 1,
retry_count: None,
}, Some(remote_block_header.clone()), remote_header_proof).unwrap(), remote_block_header);
}

Expand All @@ -283,6 +291,7 @@ pub mod tests {
assert!((&local_checker as &FetchChecker<Block>).check_header_proof(&RemoteHeaderRequest::<Header> {
cht_root: Default::default(),
block: 1,
retry_count: None,
}, Some(remote_block_header.clone()), remote_header_proof).is_err());
}

Expand All @@ -293,6 +302,7 @@ pub mod tests {
assert!((&local_checker as &FetchChecker<Block>).check_header_proof(&RemoteHeaderRequest::<Header> {
cht_root: local_cht_root,
block: 1,
retry_count: None,
}, Some(remote_block_header.clone()), remote_header_proof).is_err());
}
}
4 changes: 2 additions & 2 deletions substrate/executor/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@ serde = "1.0"
serde_derive = "1.0"
wasmi = "0.4"
byteorder = "1.1"
triehash = { git = "https://github.com/paritytech/parity-common" }
triehash = "0.2"
twox-hash = "1.1.0"
lazy_static = "1.0"
parking_lot = "*"
log = "0.3"
hashdb = { git = "https://github.com/paritytech/parity-common" }
hashdb = "0.2.1"
tiny-keccak = "1.4"

[dev-dependencies]
Expand Down
29 changes: 15 additions & 14 deletions substrate/executor/wasm/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion substrate/keystore/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ version = "0.1.0"
authors = ["Parity Technologies <[email protected]>"]

[dependencies]
parity-crypto = { git = "https://github.com/paritytech/parity-common", default_features = false }
parity-crypto = { version = "0.1", default_features = false }
ed25519 = { path = "../ed25519" }
error-chain = "0.12"
hex = "0.3"
Expand Down
2 changes: 1 addition & 1 deletion substrate/network-libp2p/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,6 @@ unsigned-varint = { version = "0.2", features = ["codec"] }

[dev-dependencies]
assert_matches = "1.2"
parity-bytes = { git = "https://github.com/paritytech/parity-common" }
parity-bytes = "0.1"
ethcore-io = { git = "https://github.com/paritytech/parity.git" }
ethcore-logger = { git = "https://github.com/paritytech/parity.git" }
Loading

0 comments on commit 4922db4

Please sign in to comment.