chore: rm generic array dep from discv4 (#19140)

This commit is contained in:
Matthias Seitz
2025-10-21 21:18:45 +02:00
committed by GitHub
parent 563ae0d30b
commit 2c086f0ed3
3 changed files with 1 additions and 7 deletions

2
Cargo.lock generated
View File

@@ -4013,7 +4013,6 @@ version = "0.14.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a"
dependencies = [
"serde",
"typenum",
"version_check",
"zeroize",
@@ -7739,7 +7738,6 @@ dependencies = [
"assert_matches",
"discv5",
"enr",
"generic-array",
"itertools 0.14.0",
"parking_lot",
"rand 0.8.5",

View File

@@ -35,7 +35,6 @@ tracing.workspace = true
thiserror.workspace = true
parking_lot.workspace = true
rand_08 = { workspace = true, optional = true }
generic-array.workspace = true
serde = { workspace = true, optional = true }
itertools.workspace = true
@@ -53,7 +52,6 @@ serde = [
"alloy-primitives/serde",
"discv5/serde",
"enr/serde",
"generic-array/serde",
"parking_lot/serde",
"rand_08?/serde",
"secp256k1/serde",

View File

@@ -1,5 +1,4 @@
use alloy_primitives::keccak256;
use generic_array::GenericArray;
use reth_network_peers::{NodeRecord, PeerId};
/// The key type for the table.
@@ -15,8 +14,7 @@ impl From<PeerId> for NodeKey {
impl From<NodeKey> for discv5::Key<NodeKey> {
fn from(value: NodeKey) -> Self {
let hash = keccak256(value.0.as_slice());
let hash = *GenericArray::from_slice(hash.as_slice());
Self::new_raw(value, hash)
Self::new_raw(value, hash.0.into())
}
}