lighthouse
lighthouse copied to clipboard
Add tests for Light Client ReqResp interfaces
Description
Add tests for the following light client ReqResp interfaces:
GetLightClientBootstrapLightClientUpdatesByRangeGetLightClientOptimisticUpdateGetLightClientFinalityUpdate
There are some existing tests written on this old branch, which relies on a mock_light_client. This mock is now obsolete due to breaking changes from libp2p and needs to be reworked.
The mock light client approach is a bit maintenance heavy, so we think it would be better to implement symmetric protocols (sending outbound light client requests) within the lighthouse-network crate. See this comment.
Marking this as blocked as this depends on a couple of open PRs:
- #3954
- #3886
- #3849
We could potentially implement integration tests between NetworkBeaconProcessor and BeaconChain - a NetworkBeaconProcessor, make a direction function call to mimic the RPC request, then verify the NetworkMessage response.
This wouldn't cover the NetworkService->Router->BeaconProcessor though, although it's mostly routing logic there, and to test this we'd need to setup libp2p, which probably isn't as high value as testing the NetworkBeaconProcessor and BeaconChain integration, which contains the bulk of the logic.