From 649adf5ea66acbbe9fb152e015efb1586d1447bd Mon Sep 17 00:00:00 2001 From: Matthias Seitz Date: Sat, 7 Dec 2024 13:10:25 +0100 Subject: [PATCH] chore: make reth-network-peers risc compatible --- .github/assets/check_rv32imac.sh | 1 + Cargo.lock | 8 ++++---- Cargo.toml | 2 +- crates/net/peers/Cargo.toml | 9 +++++---- crates/net/peers/src/lib.rs | 3 ++- 5 files changed, 13 insertions(+), 10 deletions(-) diff --git a/.github/assets/check_rv32imac.sh b/.github/assets/check_rv32imac.sh index ab1151bfb0ca..075ffb6dc40b 100755 --- a/.github/assets/check_rv32imac.sh +++ b/.github/assets/check_rv32imac.sh @@ -8,6 +8,7 @@ crates_to_check=( reth-ethereum-primitives reth-primitives-traits reth-optimism-forks + reth-network-peers # reth-evm # reth-primitives # reth-optimism-chainspec diff --git a/Cargo.lock b/Cargo.lock index fb3910d40e57..7ee2e9b6d478 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -428,9 +428,9 @@ dependencies = [ [[package]] name = "alloy-rlp" -version = "0.3.9" +version = "0.3.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da0822426598f95e45dd1ea32a738dac057529a709ee645fcc516ffa4cbde08f" +checksum = "f542548a609dca89fcd72b3b9f355928cf844d4363c5eed9c5273a3dd225e097" dependencies = [ "alloy-rlp-derive", "arrayvec", @@ -439,9 +439,9 @@ dependencies = [ [[package]] name = "alloy-rlp-derive" -version = "0.3.9" +version = "0.3.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b09cae092c27b6f1bde952653a22708691802e57bfef4a2973b80bea21efd3f" +checksum = "5a833d97bf8a5f0f878daf2c8451fff7de7f9de38baa5a45d936ec718d81255a" dependencies = [ "proc-macro2", "quote", diff --git a/Cargo.toml b/Cargo.toml index 650be8337b5e..142b00290b9a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -432,7 +432,7 @@ revm-primitives = { version = "14.0.0", default-features = false } alloy-chains = { version = "0.1.32", default-features = false } alloy-dyn-abi = "0.8.11" alloy-primitives = { version = "0.8.11", default-features = false } -alloy-rlp = { version = "0.3.4", default-features = false } +alloy-rlp = { version = "0.3.10", default-features = false } alloy-sol-types = "0.8.11" alloy-trie = { version = "0.7", default-features = false } diff --git a/crates/net/peers/Cargo.toml b/crates/net/peers/Cargo.toml index 4cfc0aee3d6f..9e7ccc3084de 100644 --- a/crates/net/peers/Cargo.toml +++ b/crates/net/peers/Cargo.toml @@ -15,8 +15,8 @@ workspace = true # eth alloy-primitives = { workspace = true, features = ["rlp"] } -alloy-rlp = { workspace = true, features = ["derive"] } -enr.workspace = true +alloy-rlp = { workspace = true, features = ["derive", "core-net", "core-error"] } +enr = { workspace = true, optional = true } # crypto @@ -32,6 +32,7 @@ alloy-primitives = { workspace = true, features = ["rand"] } rand.workspace = true secp256k1 = { workspace = true, features = ["rand"] } serde_json.workspace = true +enr.workspace = true tokio = { workspace = true, features = ["net", "macros", "rt"] } [features] @@ -42,7 +43,7 @@ std = [ "secp256k1?/std", "serde_with/std", "thiserror/std", - "url/std" + "url/std", ] secp256k1 = ["dep:secp256k1", "enr/secp256k1"] -net = ["dep:tokio", "tokio?/net"] +net = ["std", "dep:tokio", "tokio?/net"] diff --git a/crates/net/peers/src/lib.rs b/crates/net/peers/src/lib.rs index 3e2777c2df89..a8bf51da2eef 100644 --- a/crates/net/peers/src/lib.rs +++ b/crates/net/peers/src/lib.rs @@ -64,6 +64,7 @@ use alloy_primitives::B512; use core::str::FromStr; // Re-export PeerId for ease of use. +#[cfg(feature = "secp256k1")] pub use enr::Enr; /// Alias for a peer identifier @@ -115,8 +116,8 @@ pub fn id2pk(id: PeerId) -> Result { pub enum AnyNode { /// An "enode:" peer with full ip NodeRecord(NodeRecord), - #[cfg(feature = "secp256k1")] /// An "enr:" peer + #[cfg(feature = "secp256k1")] Enr(Enr), /// An incomplete "enode" with only a peer id PeerId(PeerId),