mirror of
https://github.com/sigp/lighthouse.git
synced 2026-04-19 05:48:31 +00:00
Simplify hashing in shuffling (#6483)
* Simplify hashing in shuffling * Fix benchmark deps * Check benchmarks when linting
This commit is contained in:
@@ -18,4 +18,3 @@ fixed_bytes = { workspace = true }
|
||||
|
||||
[features]
|
||||
arbitrary = ["alloy-primitives/arbitrary"]
|
||||
getrandom = ["alloy-primitives/getrandom"]
|
||||
|
||||
@@ -45,7 +45,7 @@ impl Buf {
|
||||
|
||||
/// Hash the entire buffer.
|
||||
fn hash(&self) -> Hash256 {
|
||||
Hash256::from_slice(&hash_fixed(&self.0))
|
||||
Hash256::from(hash_fixed(&self.0))
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@ name = "benches"
|
||||
harness = false
|
||||
|
||||
[dependencies]
|
||||
alloy-primitives = { workspace = true, features = ["rlp", "getrandom"] }
|
||||
alloy-primitives = { workspace = true }
|
||||
merkle_proof = { workspace = true }
|
||||
bls = { workspace = true, features = ["arbitrary"] }
|
||||
kzg = { workspace = true }
|
||||
|
||||
@@ -78,7 +78,7 @@ fn all_benches(c: &mut Criterion) {
|
||||
|| (bytes.clone(), spec.clone()),
|
||||
|(bytes, spec)| {
|
||||
let state: BeaconState<MainnetEthSpec> =
|
||||
BeaconState::from_ssz_bytes(&bytes, &spec).expect("should decode");
|
||||
BeaconState::from_ssz_bytes(bytes, spec).expect("should decode");
|
||||
black_box(state)
|
||||
},
|
||||
BatchSize::SmallInput,
|
||||
|
||||
Reference in New Issue
Block a user