paradigmxyz / op-rs

Apache License 2.0
34 stars 4 forks source link

fix(net): Parameterize Discovery Config #69

Closed refcell closed 1 week ago

refcell commented 2 weeks ago

Description

The net crate in op-rs provides a service that drives the two components in consensus-layer networking: block gossip and peer discovery. To build the network driver service, the NetworkDriverBuilder exposes a with_gossip_config method that's used to configure the libp2p Swarm which drives block gossip. The config passed here is the full libp2p behaviour config. If unset, the default config is used.

While the gossip component of the network service is fully configurable in this way, the discovery service is not. This ticket is to update the NetworkDriverBuilder to expose a with_disc_config method that accepts a discv5::Config. If a ListenConfig is provided with a discv5::Config, it should overwrite the discv5::Config.listen_config on the Config.

GrapeBaBa commented 2 weeks ago

Make sense, let me take it

refcell commented 2 weeks ago

Make sense, let me take it

Awesome thanks - let me know if anything doesn't make sense.