Files
lighthouse/common/eth2/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

38 lines
1.2 KiB
TOML

[package]
name = "eth2"
version = "0.1.0"
authors = ["Paul Hauner <paul@paulhauner.com>"]
edition = { workspace = true }
[features]
default = []
lighthouse = ["proto_array", "eth2_keystore", "eip_3076", "zeroize"]
events = ["reqwest-eventsource", "futures", "futures-util"]
[dependencies]
context_deserialize = { workspace = true }
educe = { workspace = true }
eip_3076 = { workspace = true, optional = true }
eth2_keystore = { workspace = true, optional = true }
ethereum_serde_utils = { workspace = true }
ethereum_ssz = { workspace = true }
ethereum_ssz_derive = { workspace = true }
futures = { workspace = true, optional = true }
futures-util = { version = "0.3.8", optional = true }
mediatype = "0.19.13"
pretty_reqwest_error = { workspace = true }
proto_array = { workspace = true, optional = true }
reqwest = { workspace = true }
reqwest-eventsource = { version = "0.6.0", optional = true }
sensitive_url = { workspace = true }
serde = { workspace = true }
serde_json = { workspace = true }
ssz_types = { workspace = true }
types = { workspace = true }
zeroize = { workspace = true, optional = true }
[dev-dependencies]
rand = { workspace = true }
test_random_derive = { path = "../../common/test_random_derive" }
tokio = { workspace = true }