update most of the dependencies (#1946)

* update tiny-keccak to 0.2

* update deps except bitvec and shared_memory

* fix some warning after futures upgrade

* remove useless package rename caused by bug in cargo-upgrade

* revert parity-util-mem *

* remove unused import

* cargo update

* remove all renames on parity-scale-codec

* remove the leftovers

* remove unused dep
This commit is contained in:
Andronik Ordian
2020-11-17 11:16:31 +01:00
committed by GitHub
parent 2a25eacb22
commit 0a8a607a58
91 changed files with 1413 additions and 1310 deletions
+8 -8
View File
@@ -9,23 +9,23 @@ edition = "2018"
# note: special care is taken to avoid inclusion of `sp-io` externals when compiling
# this crate for WASM. This is critical to avoid forcing all parachain WASM into implementing
# various unnecessary Substrate-specific endpoints.
codec = { package = "parity-scale-codec", version = "1.3.4", default-features = false, features = [ "derive" ] }
parity-scale-codec = { version = "1.3.5", default-features = false, features = [ "derive" ] }
sp-std = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
sp-core = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
sp-wasm-interface = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
polkadot-core-primitives = { path = "../core-primitives", default-features = false }
derive_more = { version = "0.99.11" }
derive_more = "0.99.11"
# all optional crates.
thiserror = { version = "1.0.21", optional = true }
serde = { version = "1.0.102", default-features = false, features = [ "derive" ], optional = true }
thiserror = { version = "1.0.22", optional = true }
serde = { version = "1.0.117", default-features = false, features = [ "derive" ], optional = true }
sp-externalities = { git = "https://github.com/paritytech/substrate", branch = "master", optional = true }
sc-executor = { git = "https://github.com/paritytech/substrate", branch = "master", optional = true }
sp-io = { git = "https://github.com/paritytech/substrate", branch = "master", optional = true }
parking_lot = { version = "0.10.0", optional = true }
log = { version = "0.4.8", optional = true }
futures = { version = "0.3.4", optional = true }
parking_lot = { version = "0.11.0", optional = true }
log = { version = "0.4.11", optional = true }
futures = { version = "0.3.8", optional = true }
[target.'cfg(not(any(target_os = "android", target_os = "unknown")))'.dependencies]
shared_memory = { version = "0.10.0", optional = true }
@@ -34,7 +34,7 @@ shared_memory = { version = "0.10.0", optional = true }
default = ["std"]
wasm-api = []
std = [
"codec/std",
"parity-scale-codec/std",
"thiserror",
"serde/std",
"sp-std/std",
+4 -4
View File
@@ -19,7 +19,7 @@
use sp_std::vec::Vec;
use codec::{Encode, Decode, CompactAs};
use parity_scale_codec::{Encode, Decode, CompactAs};
use sp_core::{RuntimeDebug, TypeId};
#[cfg(feature = "std")]
@@ -147,12 +147,12 @@ pub trait AccountIdConversion<AccountId>: Sized {
// TODO: Remove all of this, move sp-runtime::AccountIdConversion to own crate and and use that.
// #360
struct TrailingZeroInput<'a>(&'a [u8]);
impl<'a> codec::Input for TrailingZeroInput<'a> {
fn remaining_len(&mut self) -> Result<Option<usize>, codec::Error> {
impl<'a> parity_scale_codec::Input for TrailingZeroInput<'a> {
fn remaining_len(&mut self) -> Result<Option<usize>, parity_scale_codec::Error> {
Ok(None)
}
fn read(&mut self, into: &mut [u8]) -> Result<(), codec::Error> {
fn read(&mut self, into: &mut [u8]) -> Result<(), parity_scale_codec::Error> {
let len = into.len().min(self.0.len());
into[..len].copy_from_slice(&self.0[..len]);
for i in &mut into[len..] {
+1 -1
View File
@@ -26,7 +26,7 @@ pub unsafe fn load_params(params: *const u8, len: usize)
{
let mut slice = sp_std::slice::from_raw_parts(params, len);
codec::Decode::decode(&mut slice).expect("Invalid input data")
parity_scale_codec::Decode::decode(&mut slice).expect("Invalid input data")
}
/// Allocate the validation result in memory, getting the return-pointer back.
+1 -1
View File
@@ -22,7 +22,7 @@
use std::{any::{TypeId, Any}, path::PathBuf};
use crate::primitives::{ValidationParams, ValidationResult};
use codec::{Decode, Encode};
use parity_scale_codec::{Decode, Encode};
use sp_core::{storage::{ChildInfo, TrackedStorageKey}, traits::{CallInWasm, SpawnNamed}};
use sp_externalities::Extensions;
use sp_wasm_interface::HostFunctions as _;
@@ -17,7 +17,7 @@
#![cfg(not(any(target_os = "android", target_os = "unknown")))]
use std::{process, env, sync::Arc, sync::atomic, path::PathBuf};
use codec::{Decode, Encode};
use parity_scale_codec::{Decode, Encode};
use crate::primitives::{ValidationParams, ValidationResult};
use super::{
validate_candidate_internal, ValidationError, InvalidCandidate, InternalError,
@@ -6,8 +6,8 @@ description = "Integration tests using the test-parachains"
edition = "2018"
[dependencies]
tiny-keccak = "1.5.0"
codec = { package = "parity-scale-codec", version = "1.3.4", default-features = false, features = ["derive"] }
tiny-keccak = "2.0.2"
parity-scale-codec = { version = "1.3.5", default-features = false, features = ["derive"] }
parachain = { package = "polkadot-parachain", path = ".." }
adder = { package = "test-parachain-adder", path = "adder" }
@@ -8,9 +8,9 @@ build = "build.rs"
[dependencies]
parachain = { package = "polkadot-parachain", path = "../../", default-features = false, features = [ "wasm-api" ] }
codec = { package = "parity-scale-codec", version = "1.3.4", default-features = false, features = ["derive"] }
parity-scale-codec = { version = "1.3.5", default-features = false, features = ["derive"] }
sp-std = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
tiny-keccak = "1.5.0"
tiny-keccak = { version = "2.0.2", features = ["keccak"] }
dlmalloc = { version = "0.1.3", features = [ "global" ] }
# We need to make sure the global allocator is disabled until we have support of full substrate externalities
@@ -10,11 +10,11 @@ name = "adder-collator"
path = "src/main.rs"
[dependencies]
codec = { package = "parity-scale-codec", version = "1.3.4", default-features = false, features = ["derive"] }
futures = "0.3.4"
parity-scale-codec = { version = "1.3.5", default-features = false, features = ["derive"] }
futures = "0.3.8"
futures-timer = "3.0.2"
log = "0.4.8"
structopt = "0.3.8"
log = "0.4.11"
structopt = "0.3.20"
test-parachain-adder = { path = ".." }
polkadot-primitives = { path = "../../../../primitives" }
@@ -21,7 +21,7 @@ use test_parachain_adder::{hash_state, BlockData, HeadData, execute};
use futures_timer::Delay;
use polkadot_primitives::v1::{PoV, CollatorId, CollatorPair};
use polkadot_node_primitives::{Collation, CollatorFn};
use codec::{Encode, Decode};
use parity_scale_codec::{Encode, Decode};
use sp_core::Pair;
/// The amount we add when producing a new block.
@@ -168,7 +168,7 @@ mod tests {
use futures::executor::block_on;
use polkadot_parachain::{primitives::ValidationParams, wasm_executor::IsolationStrategy};
use polkadot_primitives::v1::{ValidationData, PersistedValidationData};
use codec::Decode;
use parity_scale_codec::Decode;
#[test]
fn collator_works() {
@@ -20,7 +20,8 @@
#![cfg_attr(not(feature = "std"), feature(core_intrinsics, lang_items, core_panic_info, alloc_error_handler))]
use codec::{Encode, Decode};
use parity_scale_codec::{Encode, Decode};
use tiny_keccak::{Hasher as _, Keccak};
#[cfg(not(feature = "std"))]
mod wasm_validation;
@@ -33,6 +34,14 @@ static ALLOC: dlmalloc::GlobalDlmalloc = dlmalloc::GlobalDlmalloc;
#[cfg(feature = "std")]
include!(concat!(env!("OUT_DIR"), "/wasm_binary.rs"));
fn keccak256(input: &[u8]) -> [u8; 32] {
let mut out = [0u8; 32];
let mut keccak256 = Keccak::v256();
keccak256.update(input);
keccak256.finalize(&mut out);
out
}
/// Wasm binary unwrapped. If built with `BUILD_DUMMY_WASM_BINARY`, the function panics.
#[cfg(feature = "std")]
pub fn wasm_binary_unwrap() -> &'static [u8] {
@@ -53,7 +62,7 @@ pub struct HeadData {
impl HeadData {
pub fn hash(&self) -> [u8; 32] {
tiny_keccak::keccak256(&self.encode())
keccak256(&self.encode())
}
}
@@ -67,7 +76,7 @@ pub struct BlockData {
}
pub fn hash_state(state: u64) -> [u8; 32] {
tiny_keccak::keccak256(state.encode().as_slice())
keccak256(state.encode().as_slice())
}
/// Start state mismatched with parent header's state hash.
@@ -20,7 +20,7 @@ use crate::{HeadData, BlockData};
use core::panic;
use sp_std::vec::Vec;
use parachain::primitives::{ValidationResult, HeadData as GenericHeadData};
use codec::{Encode, Decode};
use parity_scale_codec::{Encode, Decode};
#[no_mangle]
pub extern "C" fn validate_block(params: *const u8, len: usize) -> u64 {
@@ -31,7 +31,7 @@ pub extern "C" fn validate_block(params: *const u8, len: usize) -> u64 {
let block_data = BlockData::decode(&mut &params.block_data.0[..])
.expect("invalid block data format.");
let parent_hash = tiny_keccak::keccak256(&params.parent_head.0[..]);
let parent_hash = crate::keccak256(&params.parent_head.0[..]);
let new_head = crate::execute(parent_hash, parent_head, &block_data).expect("Executes block");
parachain::write_result(
@@ -27,7 +27,7 @@ use parachain::{
},
wasm_executor::{ValidationPool, IsolationStrategy}
};
use codec::{Decode, Encode};
use parity_scale_codec::{Decode, Encode};
use adder::{HeadData, BlockData, hash_state};
fn isolation_strategy() -> IsolationStrategy {