Skip to content

Commit

Permalink
Merge branch 'master' into ao-type-metadata
Browse files Browse the repository at this point in the history
* master: (56 commits)
  primitive-types: add no_std support for serde feature (#385)
  Add Rocksdb Secondary Instance Api (#384)
  kvdb-rocksdb: update rocksdb to 0.14 (#379)
  prepare releases for a few crates (#382)
  uint: fix UB in uint::from_big_endian (#381)
  Fix limit prefix delete case (#368)
  Add arbitrary trait implementation (#378)
  kvdb-rocksdb: optimize and rename iter_from_prefix  (#365)
  bump parity-util-mem (#376)
  parity-util-mem: fix for windows (#375)
  keccak-hash: fix bench and add one for range (#372)
  [parity-crypto] Release 0.6.1 (#373)
  keccak-hash: bump version to 0.5.1 (#371)
  keccak-hash: add keccak256_range and keccak512_range functions (#370)
  Allow pubkey recovery for all-zero messages (#369)
  Delete by prefix operator in kvdb (#360)
  kvdb: no overlay (#313)
  Ban duplicates of parity-uil-mem from being linked into the same program (#363)
  Use correct license ID (#362)
  Memtest example for Rocksdb (#349)
  ...
  • Loading branch information
ordian committed May 5, 2020
2 parents fea273c + 371f17f commit dc92ac3
Show file tree
Hide file tree
Showing 169 changed files with 3,132 additions and 2,598 deletions.
26 changes: 16 additions & 10 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,23 @@ matrix:
rust: stable
before_script:
- rustup component add rustfmt
- os: linux
rust: beta
- os: linux
rust: nightly
script:
- cargo check --all --benches
- cargo check --workspace --benches
- os: linux
rust: stable
install:
- cargo install cross
script:
- cross test --target=aarch64-linux-android -p parity-util-mem
- os: osx
osx_image: xcode11.2
osx_image: xcode11.3
addons:
chrome: stable
firefox: latest
install:
- curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.1/install.sh | sh
- curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.3/install.sh | sh
- source ~/.nvm/nvm.sh
- nvm install --lts
- npm install -g chromedriver
Expand All @@ -32,12 +36,11 @@ matrix:
install:
- curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh
script:
- if [ "$TRAVIS_RUST_VERSION" == "stable" ] && [ "$TRAVIS_OS_NAME" == "linux" ]; then
- if [ "$TRAVIS_OS_NAME" == "linux" ]; then
cargo fmt -- --check;
fi
- cargo check --all --tests
- cargo build --all
- cargo test --all --exclude uint --exclude fixed-hash
- cargo check --workspace --tests --benches
- cargo test --workspace --exclude uint --exclude fixed-hash --exclude parity-crypto
- if [ "$TRAVIS_RUST_VERSION" == "nightly" ]; then
cd contract-address/ && cargo test --features=external_doc && cd ..;
fi
Expand All @@ -48,11 +51,14 @@ script:
- cd keccak-hash/ && cargo test --no-default-features && cd ..
- cd plain_hasher/ && cargo test --no-default-features && cargo check --benches && cd ..
- cd parity-bytes/ && cargo test --no-default-features && cd ..
- cd parity-crypto/ && cargo test --all-features && cd ..
- cd parity-util-mem/ && cargo test --features=estimate-heapsize && cd ..
- cd parity-util-mem/ && cargo test --features=jemalloc-global && cd ..
- cd parity-util-mem/ && cargo test --features=mimalloc-global && cd ..
- cd parity-util-mem/ && cargo test --no-default-features --features=dlmalloc-global && cd ..
- cd primitive-types/ && cargo test --all-features && cd ..
- cd primitive-types/ && cargo test --no-default-features --features=serde_no_std && cd ..
- cd rlp/ && cargo test --no-default-features && cargo check --benches && cd ..
- cd triehash/ && cargo check --benches && cd ..
- cd kvdb-web/ && wasm-pack test --headless --chrome --firefox && cd ..
- cd kvdb-web/ && wasm-pack test --headless --firefox && cd ..

2 changes: 2 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ members = [
"parity-path",
"plain_hasher",
"rlp",
"rlp-derive",
"runtime",
"transaction-pool",
"trace-time",
"triehash",
Expand Down
674 changes: 0 additions & 674 deletions LICENSE

This file was deleted.

File renamed without changes.
2 changes: 1 addition & 1 deletion rlp/LICENSE-MIT → LICENSE-MIT
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright (c) 2015-2017 Parity Technologies
Copyright (c) 2015-2020 Parity Technologies

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

[travis-image]: https://travis-ci.org/paritytech/parity-common.svg?branch=master
[travis-url]: https://travis-ci.org/paritytech/parity-common
[appveyor-image]: https://ci.appveyor.com/api/projects/status/github/paritytech/parity-common/branch/master?svg=true
[appveyor-image]: https://ci.appveyor.com/api/projects/status/github/paritytech/parity-common?branch=master&svg=true
[appveyor-url]: https://ci.appveyor.com/project/paritytech/parity-common/branch/master

# parity-common
Expand Down
2 changes: 2 additions & 0 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,6 @@ test_script:
- cd fixed-hash/ && cargo test --all-features && cd ..
- cd uint/ && cargo test --features=std,quickcheck --release && cd ..
- cd plain_hasher/ && cargo test --no-default-features && cd ..
- cd parity-util-mem/ && cargo test --no-default-features && cd ..
- cd parity-util-mem/ && cargo test --features=estimate-heapsize && cd ..
- cd parity-util-mem/ && cargo test && cd ..
4 changes: 4 additions & 0 deletions contract-address/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,7 @@ The format is based on [Keep a Changelog].
[Keep a Changelog]: http://keepachangelog.com/en/1.0.0/

## [Unreleased]

## [0.9.0] - 2020-03-16
- License changed from MIT to dual MIT/Apache2. [#342](https://github.com/paritytech/parity-common/pull/342)
- Updated dependencies. [#361](https://github.com/paritytech/parity-common/pull/361)
8 changes: 4 additions & 4 deletions contract-address/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
[package]
name = "contract-address"
version = "0.3.0"
version = "0.4.0"
authors = ["Parity Technologies <admin@parity.io>"]
license = "MIT"
license = "MIT OR Apache-2.0"
homepage = "https://github.com/paritytech/parity-common"
repository = "https://github.com/paritytech/parity-common"
description = "A utility crate to create an ethereum contract address"
Expand All @@ -11,9 +11,9 @@ edition = "2018"
readme = "README.md"

[dependencies]
ethereum-types = { version = "0.8.0", path = "../ethereum-types" }
ethereum-types = { version = "0.9.0", path = "../ethereum-types" }
rlp = { version = "0.4", path = "../rlp" }
keccak-hash = { version = "0.4", path = "../keccak-hash", default-features = false }
keccak-hash = { version = "0.5", path = "../keccak-hash", default-features = false }

[features]
default = []
Expand Down
22 changes: 7 additions & 15 deletions contract-address/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,18 +1,10 @@
// Copyright 2019 Parity Technologies (UK) Ltd.
// This file is part of Parity Ethereum.

// Parity Ethereum is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.

// Parity Ethereum is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.

// You should have received a copy of the GNU General Public License
// along with Parity Ethereum. If not, see <http://www.gnu.org/licenses/>.
// Copyright 2020 Parity Technologies
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to those terms.

#![cfg_attr(feature = "external_doc", feature(external_doc))]
#![cfg_attr(feature = "external_doc", doc(include = "../README.md"))]
Expand Down
11 changes: 9 additions & 2 deletions ethbloom/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,18 @@
# Changelog

The format is based on [Keep a Changelog].
The format is based on [Keep a Changelog].

[Keep a Changelog]: http://keepachangelog.com/en/1.0.0/

## [Unreleased]

## [0.9.1] - 2020-04-27
- Added `arbitrary` feature. [#378](https://github.com/paritytech/parity-common/pull/378)

## [0.9.0] - 2020-03-16
- Removed `libc` feature. [#317](https://github.com/paritytech/parity-common/pull/317)
- License changed from MIT to dual MIT/Apache2. [#342](https://github.com/paritytech/parity-common/pull/342)

## [0.8.1] - 2019-10-24
### Dependencies
- Updated dependencies (https://github.com/paritytech/parity-common/pull/239)
- Updated dependencies. [#239](https://github.com/paritytech/parity-common/pull/239)
10 changes: 5 additions & 5 deletions ethbloom/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
[package]
name = "ethbloom"
version = "0.8.1"
version = "0.9.1"
authors = ["Parity Technologies <admin@parity.io>"]
description = "Ethereum bloom filter"
license = "MIT"
license = "MIT OR Apache-2.0"
documentation = "https://docs.rs/ethbloom"
homepage = "https://github.com/paritytech/parity-common"
repository = "https://github.com/paritytech/parity-common"
Expand All @@ -12,7 +12,7 @@ edition = "2018"
[dependencies]
tiny-keccak = { version = "2.0", features = ["keccak"] }
crunchy = { version = "0.2.2", default-features = false, features = ["limit_256"] }
fixed-hash = { path = "../fixed-hash", version = "0.5", default-features = false }
fixed-hash = { path = "../fixed-hash", version = "0.6", default-features = false }
impl-serde = { path = "../primitive-types/impls/serde", version = "0.3", default-features = false, optional = true }
impl-rlp = { path = "../primitive-types/impls/rlp", version = "0.2", default-features = false }

Expand All @@ -22,11 +22,11 @@ rand = "0.7.2"
hex-literal = "0.2.1"

[features]
default = ["std", "serialize", "libc", "rustc-hex"]
default = ["std", "serialize", "rustc-hex"]
std = ["fixed-hash/std", "crunchy/std"]
serialize = ["std", "impl-serde"]
libc = ["fixed-hash/libc"]
rustc-hex = ["fixed-hash/rustc-hex"]
arbitrary = ["fixed-hash/arbitrary"]

[[bench]]
name = "bloom"
Expand Down
8 changes: 8 additions & 0 deletions ethbloom/benches/bloom.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
// Copyright 2020 Parity Technologies
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to those terms.

use criterion::{criterion_group, criterion_main, Criterion};
use ethbloom::{Bloom, Input};
use hex_literal::hex;
Expand Down
8 changes: 8 additions & 0 deletions ethbloom/benches/unrolling.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
// Copyright 2020 Parity Technologies
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to those terms.

use criterion::{criterion_group, criterion_main, Criterion};
use crunchy::unroll;
use rand::RngCore;
Expand Down
77 changes: 41 additions & 36 deletions ethbloom/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,45 +1,50 @@
// Copyright 2020 Parity Technologies
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to those terms.

//!
//! ```rust
//! extern crate ethbloom;
//! #[macro_use] extern crate hex_literal;
//! ```
//! use hex_literal::hex;
//! use ethbloom::{Bloom, Input};
//!
//! fn main() {
//! use std::str::FromStr;
//! let bloom = Bloom::from_str(
//! "00000000000000000000000000000000\
//! 00000000100000000000000000000000\
//! 00000000000000000000000000000000\
//! 00000000000000000000000000000000\
//! 00000000000000000000000000000000\
//! 00000000000000000000000000000000\
//! 00000002020000000000000000000000\
//! 00000000000000000000000800000000\
//! 10000000000000000000000000000000\
//! 00000000000000000000001000000000\
//! 00000000000000000000000000000000\
//! 00000000000000000000000000000000\
//! 00000000000000000000000000000000\
//! 00000000000000000000000000000000\
//! 00000000000000000000000000000000\
//! 00000000000000000000000000000000"
//! ).unwrap();
//! let address = hex!("ef2d6d194084c2de36e0dabfce45d046b37d1106");
//! let topic = hex!("02c69be41d0b7e40352fc85be1cd65eb03d40ef8427a0ca4596b1ead9a00e9fc");
//! use std::str::FromStr;
//! let bloom = Bloom::from_str(
//! "00000000000000000000000000000000\
//! 00000000100000000000000000000000\
//! 00000000000000000000000000000000\
//! 00000000000000000000000000000000\
//! 00000000000000000000000000000000\
//! 00000000000000000000000000000000\
//! 00000002020000000000000000000000\
//! 00000000000000000000000800000000\
//! 10000000000000000000000000000000\
//! 00000000000000000000001000000000\
//! 00000000000000000000000000000000\
//! 00000000000000000000000000000000\
//! 00000000000000000000000000000000\
//! 00000000000000000000000000000000\
//! 00000000000000000000000000000000\
//! 00000000000000000000000000000000"
//! ).unwrap();
//! let address = hex!("ef2d6d194084c2de36e0dabfce45d046b37d1106");
//! let topic = hex!("02c69be41d0b7e40352fc85be1cd65eb03d40ef8427a0ca4596b1ead9a00e9fc");
//!
//! let mut my_bloom = Bloom::default();
//! assert!(!my_bloom.contains_input(Input::Raw(&address)));
//! assert!(!my_bloom.contains_input(Input::Raw(&topic)));
//! let mut my_bloom = Bloom::default();
//! assert!(!my_bloom.contains_input(Input::Raw(&address)));
//! assert!(!my_bloom.contains_input(Input::Raw(&topic)));
//!
//! my_bloom.accrue(Input::Raw(&address));
//! assert!(my_bloom.contains_input(Input::Raw(&address)));
//! assert!(!my_bloom.contains_input(Input::Raw(&topic)));
//! my_bloom.accrue(Input::Raw(&address));
//! assert!(my_bloom.contains_input(Input::Raw(&address)));
//! assert!(!my_bloom.contains_input(Input::Raw(&topic)));
//!
//! my_bloom.accrue(Input::Raw(&topic));
//! assert!(my_bloom.contains_input(Input::Raw(&address)));
//! assert!(my_bloom.contains_input(Input::Raw(&topic)));
//! assert_eq!(my_bloom, bloom);
//! }
//! my_bloom.accrue(Input::Raw(&topic));
//! assert!(my_bloom.contains_input(Input::Raw(&address)));
//! assert!(my_bloom.contains_input(Input::Raw(&topic)));
//! assert_eq!(my_bloom, bloom);
//! ```
//!
Expand Down
12 changes: 10 additions & 2 deletions ethereum-types/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,17 @@
# Changelog

The format is based on [Keep a Changelog].
The format is based on [Keep a Changelog].

[Keep a Changelog]: http://keepachangelog.com/en/1.0.0/

## [Unreleased]

## [0.9.1] - 2020-04-27
- Added `arbitrary` feature. [#378](https://github.com/paritytech/parity-common/pull/378)

## [0.9.0] - 2020-03-16
- License changed from MIT to dual MIT/Apache2. [#342](https://github.com/paritytech/parity-common/pull/342)
- Updated dependencies. [#361](https://github.com/paritytech/parity-common/pull/361)

### Added
- uint error type is re-exported (https://github.com/paritytech/parity-common/pull/244)
- Uint error type is re-exported. [#244](https://github.com/paritytech/parity-common/pull/244)
11 changes: 6 additions & 5 deletions ethereum-types/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
[package]
name = "ethereum-types"
version = "0.8.0"
version = "0.9.1"
authors = ["Parity Technologies <admin@parity.io>"]
license = "MIT"
license = "MIT OR Apache-2.0"
homepage = "https://github.com/paritytech/parity-common"
description = "Ethereum types"
edition = "2018"

[dependencies]
ethbloom = { path = "../ethbloom", version = "0.8", default-features = false }
fixed-hash = { path = "../fixed-hash", version = "0.5", default-features = false, features = ["byteorder", "rustc-hex"] }
ethbloom = { path = "../ethbloom", version = "0.9", default-features = false }
fixed-hash = { path = "../fixed-hash", version = "0.6", default-features = false, features = ["byteorder", "rustc-hex"] }
uint-crate = { path = "../uint", package = "uint", version = "0.8", default-features = false }
primitive-types = { path = "../primitive-types", version = "0.6", features = ["rlp", "byteorder", "rustc-hex"], default-features = false }
primitive-types = { path = "../primitive-types", version = "0.7", features = ["rlp", "byteorder", "rustc-hex"], default-features = false }
impl-serde = { path = "../primitive-types/impls/serde", version = "0.3.0", default-features = false, optional = true }
impl-rlp = { path = "../primitive-types/impls/rlp", version = "0.2", default-features = false }

Expand All @@ -22,3 +22,4 @@ serde_json = "1.0.41"
default = ["std", "serialize"]
std = ["uint-crate/std", "fixed-hash/std", "ethbloom/std", "primitive-types/std"]
serialize = ["std", "impl-serde", "primitive-types/serde", "ethbloom/serialize"]
arbitrary = ["ethbloom/arbitrary", "fixed-hash/arbitrary", "uint-crate/arbitrary"]
8 changes: 8 additions & 0 deletions ethereum-types/src/hash.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
// Copyright 2020 Parity Technologies
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to those terms.

use crate::{U128, U256, U512, U64};
use fixed_hash::*;
use impl_rlp::impl_fixed_hash_rlp;
Expand Down
8 changes: 8 additions & 0 deletions ethereum-types/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
// Copyright 2020 Parity Technologies
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to those terms.

#![cfg_attr(not(feature = "std"), no_std)]

mod hash;
Expand Down
8 changes: 8 additions & 0 deletions ethereum-types/src/uint.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
// Copyright 2020 Parity Technologies
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to those terms.

use impl_rlp::impl_uint_rlp;
#[cfg(feature = "serialize")]
use impl_serde::impl_uint_serde;
Expand Down
Loading

0 comments on commit dc92ac3

Please sign in to comment.