Establish an interface the Endpoint type can use to interact with light client modules #4807
Labels
needs discussion
Issues that need discussion before they can be worked on
testing
Testing package and unit/integration tests
type: dependency management
Relating to managing the ibc dependency graph
Milestone
Summary
Generate an interface that light client modules can implement which allows them to plug into the Endpoint type in the testing pkg
Problem Definition
The endpoint type in the testing pkg requires interacting with two types to fulfill its logic:
It uses the TestChain to generate proof and submit msgs. It uses the off chain light clients to generate initial client and consensus states (there may be another piece of functionality required)
The endpoint currently relies on concrete types to fulfill this logic (a more standardized interface for test chain is needed in the future as well).
An endpoint contains several types, but the two that will likely vary are its underlying chain (test chain) and the client config which represents a counterparty chain type. For this reason it makes more sense to generate an interface for each of these types (as they are distinct). I considered establishing an interface for the endpoint itself, but it defeats the purpose of this type as you'd need to make an endpoint for a very specific combination (wasm client submitting msgs to tendermint chain for example)
Initially a switch statement was added to account for a variety of client types, but this was an incomplete implementation and mostly a placeholder for a better solution. This approach has proved to be the incorrect direction as it requires the testing pkg and subsequently ibc-go to import the light client types. Ideally, light client modules are built on top of ibc-go and the ibc-go module does not need to import these types
Proposal
Establish an interface that light client implementations can implement which allows them to utilize the existing Endpoint structure. This interface will likely require returning client and consensus states for the initial client creation. The interface should be establish in a way that the solo machine and wasm client can plug into. The solo machine may require a TestChain interface the Endpoint structure can use before its type import can be removed from the testing pkg
I've left off the exact proposal of the interface for now, as I think it'll be easier to see what it should be once the wasm client uses a mock vm for all its various unit testing scenarios
For Admin Use
The text was updated successfully, but these errors were encountered: