Publish ssz_types (and deps) to crates.io (#468)

* Rename `hashing` crate to `eth2_hashing`

* Add license, desc to eth2_hashing Cargo.toml

* Remove merkle root from eth2 hashing

* Remove old benches folder (zombied from old branch)

* Add docs to eth2_hashing

* Prepare tree_hash for publishing on crates.io

* Update deps to use crates.io instead of paths

* Update all crates to pull ssz from crates.io

* Remove cached_tree_hash, add patches to manifest

* Fix compile error in benches

* Remove unused code

* Fix fake_crypto compile error
This commit is contained in:
Paul Hauner
2019-08-08 11:39:47 +10:00
committed by GitHub
parent 88e89f9ab2
commit 8cfa36fedd
87 changed files with 205 additions and 2643 deletions

View File

@@ -3,7 +3,6 @@ extern crate lazy_static;
use criterion::Criterion;
use criterion::{black_box, criterion_group, criterion_main, Benchmark};
use tree_hash::TreeHash;
use types::test_utils::{generate_deterministic_keypairs, TestingBeaconStateBuilder};
use types::{BeaconState, EthSpec, Keypair, MainnetEthSpec, MinimalEthSpec};
@@ -36,7 +35,12 @@ fn bench_suite<T: EthSpec>(c: &mut Criterion, spec_desc: &str, validator_count:
Benchmark::new("genesis_state", move |b| {
b.iter_batched_ref(
|| state.clone(),
|state| black_box(state.tree_hash_root()),
// Note: `state.canonical_root()` uses whatever `tree_hash` that the `types` crate
// uses, which is not necessarily this crate. If you want to ensure that types is
// using this local version of `tree_hash`, ensure you add a workspace-level
// [dependency
// patch](https://doc.rust-lang.org/cargo/reference/manifest.html#the-patch-section).
|state| black_box(state.canonical_root()),
criterion::BatchSize::SmallInput,
)
})