sigp / lighthouse

Ethereum consensus client in Rust
https://lighthouse.sigmaprime.io/
Apache License 2.0
2.9k stars 736 forks source link

Modularize or Simplify the eth2 crate #6452

Open AgeManning opened 1 day ago

AgeManning commented 1 day ago

Description

The common/eth2 crate appears to import the whole world. Other crates that depend on eth2 are compiling and building libp2p and a whole host of other things.

It would be great if we could significantly reduce the dependency chain here. Either by splitting up some of the structs or removing unnecessary imports.

dapplion commented 19 hours ago

I remember asking myself this when doing some PoC a long time ago that depended on common/eth2

dapplion commented 19 hours ago

The dependency on libp2p is only for these types

use lighthouse_network::{types::SyncState, PeerInfo};
use lighthouse_network::{ConnectionDirection, Enr, Multiaddr, PeerConnectionStatus};
use lighthouse_network::PeerId;