Skip to content

Commit

Permalink
release is coming (#697)
Browse files Browse the repository at this point in the history
* update ethereum-types and uint changelogs

* purge parity-util-mem

* cargo set-version --bump minor -p kvdb

* cargo set-version --bump patch -p uint

* cargo set-version --bump patch -p ethereum-types

* kvdb-rocksdb: rm unused path field

* kvdb-rocksdb: rm unused method

* update kvdb&co

* rm extra newline
  • Loading branch information
ordian committed Nov 29, 2022
1 parent 806ca48 commit c41d51d
Show file tree
Hide file tree
Showing 33 changed files with 33 additions and 1,794 deletions.
2 changes: 0 additions & 2 deletions Cargo.toml
Expand Up @@ -10,9 +10,7 @@ members = [
"rlp",
"rlp-derive",
"uint",
"parity-util-mem",
"primitive-types",
"ethereum-types",
"ethbloom",
"parity-util-mem/derive"
]
3 changes: 3 additions & 0 deletions ethereum-types/CHANGELOG.md
Expand Up @@ -6,6 +6,9 @@ The format is based on [Keep a Changelog].

## [Unreleased]

## [0.14.1] - 2022-11-29
- Added `if_ethbloom` conditional macro. [#682](https://github.com/paritytech/parity-common/pull/682)

## [0.14.0] - 2022-09-20
- Updated `fixed-hash` to 0.8. [#680](https://github.com/paritytech/parity-common/pull/680)
- Updated `primitive-types` to 0.12. [#680](https://github.com/paritytech/parity-common/pull/680)
Expand Down
2 changes: 1 addition & 1 deletion ethereum-types/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "ethereum-types"
version = "0.14.0"
version = "0.14.1"
authors = ["Parity Technologies <admin@parity.io>"]
license = "MIT OR Apache-2.0"
homepage = "https://github.com/paritytech/parity-common"
Expand Down
3 changes: 3 additions & 0 deletions kvdb-memorydb/CHANGELOG.md
Expand Up @@ -6,6 +6,9 @@ The format is based on [Keep a Changelog].

## [Unreleased]

## [0.13.0] - 2022-11-29
- Removed `parity-util-mem` support. [#696](https://github.com/paritytech/parity-common/pull/696)

## [0.12.0] - 2022-09-20
### Breaking
- Updated `kvdb` to 0.12. [662](https://github.com/paritytech/parity-common/pull/662)
Expand Down
6 changes: 3 additions & 3 deletions kvdb-memorydb/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "kvdb-memorydb"
version = "0.12.0"
version = "0.13.0"
authors = ["Parity Technologies <admin@parity.io>"]
repository = "https://github.com/paritytech/parity-common"
description = "A key-value in-memory database that implements the `KeyValueDB` trait"
Expand All @@ -10,10 +10,10 @@ rust-version = "1.56.1"

[dependencies]
parking_lot = "0.12.0"
kvdb = { version = "0.12", path = "../kvdb" }
kvdb = { version = "0.13", path = "../kvdb" }

[dev-dependencies]
kvdb-shared-tests = { path = "../kvdb-shared-tests", version = "0.10" }
kvdb-shared-tests = { path = "../kvdb-shared-tests", version = "0.11" }

[features]
default = []
3 changes: 3 additions & 0 deletions kvdb-rocksdb/CHANGELOG.md
Expand Up @@ -6,6 +6,9 @@ The format is based on [Keep a Changelog].

## [Unreleased]

## [0.17.0] - 2022-11-29
- Removed `parity-util-mem` support. [#696](https://github.com/paritytech/parity-common/pull/696)

## [0.16.0] - 2022-09-20
- Removed `owning_ref` from dependencies :tada:. [#662](https://github.com/paritytech/parity-common/pull/662)
- No longer attempt to repair on `open`. [#667](https://github.com/paritytech/parity-common/pull/667)
Expand Down
7 changes: 3 additions & 4 deletions kvdb-rocksdb/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "kvdb-rocksdb"
version = "0.16.0"
version = "0.17.0"
authors = ["Parity Technologies <admin@parity.io>"]
repository = "https://github.com/paritytech/parity-common"
description = "kvdb implementation backed by RocksDB"
Expand All @@ -14,8 +14,7 @@ harness = false

[dependencies]
smallvec = "1.0.0"
kvdb = { path = "../kvdb", version = "0.12" }
log = "0.4.8"
kvdb = { path = "../kvdb", version = "0.13" }
num_cpus = "1.10.1"
parking_lot = "0.12.0"
regex = "1.3.1"
Expand All @@ -36,7 +35,7 @@ version = "0.19.0"
alloc_counter = "0.0.4"
criterion = "0.4"
ethereum-types = { path = "../ethereum-types" }
kvdb-shared-tests = { path = "../kvdb-shared-tests", version = "0.10" }
kvdb-shared-tests = { path = "../kvdb-shared-tests", version = "0.11" }
rand = "0.8.0"
tempfile = "3.1.0"
keccak-hash = { path = "../keccak-hash" }
Expand Down
47 changes: 0 additions & 47 deletions kvdb-rocksdb/src/lib.rs
Expand Up @@ -21,7 +21,6 @@ use rocksdb::{
};

use kvdb::{DBKeyValue, DBOp, DBTransaction, DBValue, KeyValueDB};
use log::warn;

#[cfg(target_os = "linux")]
use regex::Regex;
Expand Down Expand Up @@ -258,30 +257,12 @@ impl DBAndColumns {
.cf_handle(&name)
.ok_or_else(|| other_io_err(format!("invalid column name: {name}")))
}

fn static_property_or_warn(&self, col: usize, prop: &str) -> usize {
let cf = match self.cf(col) {
Ok(cf) => cf,
Err(_) => {
warn!("RocksDB column index out of range: {}", col);
return 0
},
};
match self.db.property_int_value_cf(cf, prop) {
Ok(Some(v)) => v as usize,
_ => {
warn!("Cannot read expected static property of RocksDb database: {}", prop);
0
},
}
}
}

/// Key-Value database.
pub struct Database {
inner: DBAndColumns,
config: DatabaseConfig,
path: PathBuf,
opts: Options,
write_opts: WriteOptions,
read_opts: ReadOptions,
Expand Down Expand Up @@ -372,7 +353,6 @@ impl Database {
Ok(Database {
inner: DBAndColumns { db, column_names },
config: config.clone(),
path: path.as_ref().to_owned(),
opts,
read_opts,
write_opts,
Expand Down Expand Up @@ -757,33 +737,6 @@ mod tests {
Ok(())
}

#[test]
fn mem_tables_size() {
let tempdir = TempfileBuilder::new().prefix("").tempdir().unwrap();

let config = DatabaseConfig {
max_open_files: 512,
memory_budget: HashMap::new(),
compaction: CompactionProfile::default(),
columns: 11,
keep_log_file_num: 1,
enable_statistics: false,
secondary: None,
max_total_wal_size: None,
create_if_missing: true,
};

let db = Database::open(&config, tempdir.path().to_str().unwrap()).unwrap();

let mut batch = db.transaction();
for i in 0u32..10000u32 {
batch.put(i / 1000 + 1, &i.to_le_bytes(), &(i * 17).to_le_bytes());
}
db.write(batch).unwrap();

assert!(db.inner.static_property_or_warn(0, "rocksdb.cur-size-all-mem-tables") > 512);
}

#[test]
#[cfg(target_os = "linux")]
fn df_to_rotational() {
Expand Down
3 changes: 3 additions & 0 deletions kvdb-shared-tests/CHANGELOG.md
Expand Up @@ -6,6 +6,9 @@ The format is based on [Keep a Changelog].

## [Unreleased]

## [0.11.0] - 2022-11-29
- Removed `parity-util-mem` support. [#696](https://github.com/paritytech/parity-common/pull/696)

## [0.10.0] - 2022-09-20
### Breaking
- Migrated to 2021 edition, enforcing MSRV of `1.56.1`. [#601](https://github.com/paritytech/parity-common/pull/601)
Expand Down
4 changes: 2 additions & 2 deletions kvdb-shared-tests/Cargo.toml
@@ -1,11 +1,11 @@
[package]
name = "kvdb-shared-tests"
version = "0.10.0"
version = "0.11.0"
authors = ["Parity Technologies <admin@parity.io>"]
edition = "2021"
rust-version = "1.56.1"
description = "Shared tests for kvdb functionality, to be executed against actual implementations"
license = "MIT OR Apache-2.0"

[dependencies]
kvdb = { path = "../kvdb", version = "0.12" }
kvdb = { path = "../kvdb", version = "0.13" }
4 changes: 4 additions & 0 deletions kvdb/CHANGELOG.md
Expand Up @@ -6,6 +6,10 @@ The format is based on [Keep a Changelog].

## [Unreleased]


## [0.13.0] - 2022-11-29
- Removed `parity-util-mem` support. [#696](https://github.com/paritytech/parity-common/pull/696)

## [0.12.0] - 2022-09-20
### Breaking
- Removed `fn restore` from `KeyValueDB` trait. [#662](https://github.com/paritytech/parity-common/pull/662)
Expand Down
2 changes: 1 addition & 1 deletion kvdb/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "kvdb"
version = "0.12.0"
version = "0.13.0"
authors = ["Parity Technologies <admin@parity.io>"]
repository = "https://github.com/paritytech/parity-common"
description = "Generic key-value trait"
Expand Down
92 changes: 0 additions & 92 deletions parity-util-mem/CHANGELOG.md

This file was deleted.

56 changes: 0 additions & 56 deletions parity-util-mem/Cargo.toml

This file was deleted.

0 comments on commit c41d51d

Please sign in to comment.