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

Commit

Permalink
Update to latest Substrate master (#615)
Browse files Browse the repository at this point in the history
* Update to latest Substrate master

* Remove unneeded patch + warning

* Update `Cargo.lock`

* Fix tests

* Update again
  • Loading branch information
bkchr authored and gavofyork committed Nov 26, 2019
1 parent 578fcb8 commit 89f762c
Show file tree
Hide file tree
Showing 7 changed files with 176 additions and 199 deletions.
350 changes: 162 additions & 188 deletions Cargo.lock

Large diffs are not rendered by default.

3 changes: 0 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,3 @@ maintenance = { status = "actively-developed" }
[profile.release]
# Polkadot runtime requires unwinding.
panic = "unwind"

[patch.crates-io]
zstd-sys = { git = "https://github.com/bkchr/zstd-rs.git", branch = "bkchr-export-include-paths2" }
6 changes: 3 additions & 3 deletions availability-store/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@ parking_lot = "0.9.0"
log = "0.4.8"
codec = { package = "parity-scale-codec", version = "1.1.0", default-features = false, features = ["derive"] }
substrate-primitives = { git = "https://github.com/paritytech/substrate", branch = "polkadot-master" }
kvdb = { git = "https://github.com/paritytech/parity-common", rev="b0317f649ab2c665b7987b8475878fc4d2e1f81d" }
kvdb-rocksdb = { git = "https://github.com/paritytech/parity-common", rev="b0317f649ab2c665b7987b8475878fc4d2e1f81d" }
kvdb-memorydb = { git = "https://github.com/paritytech/parity-common", rev="b0317f649ab2c665b7987b8475878fc4d2e1f81d" }
kvdb = { git = "https://github.com/paritytech/parity-common", rev="03a2ba08f47f4af4219280e660a1ea92cb8896bd" }
kvdb-rocksdb = { git = "https://github.com/paritytech/parity-common", rev="03a2ba08f47f4af4219280e660a1ea92cb8896bd" }
kvdb-memorydb = { git = "https://github.com/paritytech/parity-common", rev="03a2ba08f47f4af4219280e660a1ea92cb8896bd" }
10 changes: 9 additions & 1 deletion availability-store/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,15 @@ impl Store {
/// Create a new `Store` with given config on disk.
pub fn new(config: Config) -> io::Result<Self> {
let mut db_config = DatabaseConfig::with_columns(Some(columns::NUM_COLUMNS));
db_config.memory_budget = config.cache_size;

if let Some(cache_size) = config.cache_size {
let mut memory_budget = std::collections::HashMap::new();
for i in 0..columns::NUM_COLUMNS {
memory_budget.insert(Some(i), cache_size / columns::NUM_COLUMNS as usize);
}

db_config.memory_budget = memory_budget;
}

let path = config.path.to_str().ok_or_else(|| io::Error::new(
io::ErrorKind::Other,
Expand Down
2 changes: 0 additions & 2 deletions cli/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,5 @@ fn run_until_exit<T, SC, B, CE, W>(
let _ = runtime.block_on(future);
let _ = exit_send.send(());

use futures01::Future;

Ok(())
}
2 changes: 1 addition & 1 deletion runtime/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ libsecp256k1 = "0.3.2"
tiny-keccak = "1.5.0"
keyring = { package = "substrate-keyring", git = "https://github.com/paritytech/substrate", branch = "polkadot-master" }
substrate-trie = { git = "https://github.com/paritytech/substrate", branch = "polkadot-master" }
trie-db = "0.16.0"
trie-db = "0.15.2"
serde_json = "1.0.41"

[build-dependencies]
Expand Down
2 changes: 1 addition & 1 deletion runtime/src/parachains.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2035,7 +2035,7 @@ mod tests {

#[test]
fn empty_trie_root_const_is_blake2_hashed_null_node() {
let hashed_null_node = <NodeCodec<Blake2Hasher> as trie_db::NodeCodec>::hashed_null_node();
let hashed_null_node = <NodeCodec<Blake2Hasher> as trie_db::NodeCodec<_>>::hashed_null_node();
assert_eq!(hashed_null_node, EMPTY_TRIE_ROOT.into())
}
}

0 comments on commit 89f762c

Please sign in to comment.