Create network_utils crate (#7761)

Anchor currently depends on `lighthouse_network` for a few types and utilities that live within. As we use our own libp2p behaviours, we actually do not use the core logic in that crate. This makes us transitively depend on a bunch of unneeded crates (even a whole separate libp2p if the versions mismatch!)


  Move things we require into it's own lightweight crate.


Co-Authored-By: Daniel Knopik <daniel@dknopik.de>
This commit is contained in:
Daniel Knopik
2025-09-10 14:59:24 +02:00
committed by GitHub
parent caa1df6fc3
commit ee1b6bc81b
42 changed files with 198 additions and 169 deletions

View File

@@ -18,6 +18,7 @@ fork_choice = { workspace = true }
futures = { workspace = true }
hex = { workspace = true }
logging = { workspace = true }
network_utils = { workspace = true }
reqwest = { workspace = true }
sensitive_url = { workspace = true }
serde_json = { workspace = true }
@@ -25,4 +26,3 @@ task_executor = { workspace = true }
tempfile = { workspace = true }
tokio = { workspace = true }
types = { workspace = true }
unused_port = { workspace = true }

View File

@@ -1,10 +1,10 @@
use ethers_providers::{Http, Provider};
use execution_layer::DEFAULT_JWT_FILE;
use network_utils::unused_port::unused_tcp4_port;
use sensitive_url::SensitiveUrl;
use std::path::PathBuf;
use std::process::Child;
use tempfile::TempDir;
use unused_port::unused_tcp4_port;
pub const KEYSTORE_PASSWORD: &str = "testpwd";
pub const ACCOUNT1: &str = "7b8C3a386C0eea54693fFB0DA17373ffC9228139";

View File

@@ -1,11 +1,11 @@
use crate::build_utils;
use crate::execution_engine::GenericExecutionEngine;
use crate::genesis_json::geth_genesis_json;
use network_utils::unused_port::unused_tcp4_port;
use std::path::{Path, PathBuf};
use std::process::{Child, Command, Output};
use std::{env, fs};
use tempfile::TempDir;
use unused_port::unused_tcp4_port;
const GETH_BRANCH: &str = "master";
const GETH_REPO_URL: &str = "https://github.com/ethereum/go-ethereum";

View File

@@ -1,12 +1,12 @@
use crate::build_utils;
use crate::execution_engine::GenericExecutionEngine;
use crate::genesis_json::nethermind_genesis_json;
use network_utils::unused_port::unused_tcp4_port;
use std::env;
use std::fs;
use std::path::{Path, PathBuf};
use std::process::{Child, Command, Output};
use tempfile::TempDir;
use unused_port::unused_tcp4_port;
/// We've pinned the Nethermind version since our method of using the `master` branch to
/// find the latest tag isn't working. It appears Nethermind don't always tag on `master`.