lighthouse icon indicating copy to clipboard operation
lighthouse copied to clipboard

Add tests for Light Client ReqResp interfaces

Open jimmygchen opened this issue 2 years ago • 2 comments

Description

Add tests for the following light client ReqResp interfaces:

  • GetLightClientBootstrap
  • LightClientUpdatesByRange
  • GetLightClientOptimisticUpdate
  • GetLightClientFinalityUpdate

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.

jimmygchen avatar Nov 21 '23 05:11 jimmygchen

Marking this as blocked as this depends on a couple of open PRs:

  • #3954
  • #3886
  • #3849

jimmygchen avatar Nov 21 '23 05:11 jimmygchen

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.

jimmygchen avatar Apr 09 '24 12:04 jimmygchen