Files
lighthouse/beacon_node/lighthouse_network/Cargo.toml
Mac L 7bfcc03520 Reduce eth2 dependency space (#8524)
Remove certain dependencies from `eth2`, and feature-gate others which are only used by certain endpoints.

| Removed | Optional | Dev only |
| -------- | -------- | -------- |
| `either` `enr` `libp2p-identity` `multiaddr` | `protoarray` `eth2_keystore` `eip_3076` `zeroize` `reqwest-eventsource` `futures` `futures-util` | `rand` `test_random_derive` |

This is done by adding an `events` feature which enables the events endpoint and its associated dependencies.
The `lighthouse` feature also enables its associated dependencies making them optional.

The networking-adjacent dependencies were removed by just having certain fields use a `String` instead of an explicit network type. This means the user should handle conversion at the call site instead. This is a bit spicy, but I believe `PeerId`, `Enr` and `Multiaddr` are easily converted to and from `String`s so I think it's fine and reduces our dependency space by a lot. The alternative is to feature gate these types behind a `network` feature instead.


Co-Authored-By: Mac L <mjladson@pm.me>
2025-12-08 05:37:23 +00:00

82 lines
2.0 KiB
TOML

[package]
name = "lighthouse_network"
version = "0.2.0"
authors = ["Sigma Prime <contact@sigmaprime.io>"]
edition = { workspace = true }
autotests = false
[features]
libp2p-websocket = []
[dependencies]
alloy-primitives = { workspace = true }
alloy-rlp = { workspace = true }
bytes = { workspace = true }
delay_map = { workspace = true }
directory = { workspace = true }
dirs = { workspace = true }
discv5 = { workspace = true }
either = { workspace = true }
eth2 = { workspace = true, features = ["lighthouse"] }
ethereum_ssz = { workspace = true }
ethereum_ssz_derive = { workspace = true }
fnv = { workspace = true }
futures = { workspace = true }
gossipsub = { workspace = true }
hex = { workspace = true }
itertools = { workspace = true }
libp2p-mplex = "0.43"
lighthouse_version = { workspace = true }
local-ip-address = "0.6"
logging = { workspace = true }
lru = { workspace = true }
lru_cache = { workspace = true }
metrics = { workspace = true }
network_utils = { workspace = true }
parking_lot = { workspace = true }
prometheus-client = "0.23.0"
rand = { workspace = true }
regex = { workspace = true }
serde = { workspace = true }
sha2 = { workspace = true }
smallvec = { workspace = true }
snap = { workspace = true }
ssz_types = { workspace = true }
strum = { workspace = true }
superstruct = { workspace = true }
task_executor = { workspace = true }
tokio = { workspace = true }
tokio-util = { workspace = true }
tracing = { workspace = true }
tracing-subscriber = { workspace = true }
types = { workspace = true }
unsigned-varint = { version = "0.8", features = ["codec"] }
[dependencies.libp2p]
version = "0.56"
default-features = false
features = [
"identify",
"yamux",
"noise",
"dns",
"tcp",
"tokio",
"plaintext",
"secp256k1",
"macros",
"metrics",
"quic",
"upnp",
]
[dev-dependencies]
async-channel = { workspace = true }
logging = { workspace = true }
proptest = { workspace = true }
tempfile = { workspace = true }
[[test]]
name = "lighthouse_network_tests"
path = "tests/main.rs"