Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Establish an interface the Endpoint type can use to interact with light client modules #4807

Open
3 tasks
colin-axner opened this issue Oct 4, 2023 · 0 comments
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

Comments

@colin-axner
Copy link
Contributor

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:

  • TestChain
  • off chain light clients (light client modules)

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

  • Not duplicate issue
  • Appropriate labels applied
  • Appropriate contributors tagged/assigned
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
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
Projects
Status: Backlog 🕐
Development

No branches or pull requests

1 participant