Skip to content

Conversation

@pawanjay176
Copy link
Member

Issue Addressed

N/A

Proposed Changes

The eth2 which contains our http api client crate depends on the lighthouse_network crate for some networking types.
This is completely unnecessary imo because we can just return strings/serde_json::Value types for the networking types.
These types don't require us using any of the functions on the type structs. They just exist for some typing.

This is an enormous source of pain for any dependency that pulls the eth2 crate for using a BeaconNodeHttpClient because importing lighthouse_network pulls in a bunch of other dependencies that just bloats the dep tree.

I don't see any reason why the networking related types cannot be represented as String or json values. Let me know if that is not the case.

Todo

  • Test all affected endpoints

@AgeManning
Copy link
Member

The same as this? #6452

@pawanjay176
Copy link
Member Author

Yeah there's already work being done on this. I'm closing this for now

mergify bot pushed a commit that referenced this pull request Mar 14, 2025
- #6452 (partially)


  Remove dependencies on `store` and `lighthouse_network`  from `eth2`. This was achieved as follows:

- depend on `enr` and `multiaddr` directly instead of using `lighthouse_network`'s reexports.
- make `lighthouse_network` responsible for converting between API and internal types.
- in two cases, remove complex internal types and use the generic `serde_json::Value` instead - this is not ideal, but should be fine for now, as this affects two internal non-spec endpoints which are meant for debugging, unstable, and subject to change without notice anyway. Inspired by #6679. The alternative is to move all relevant types to `eth2` or `types` instead - what do you think?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants