Description
Summary
x/ibc/02-client
should be as modular as possible and not rely on needing to know a ClientType
in order to execute custom logic or it should at least provide some default type which is modular enough to use for the majority of use cases. Requiring every new client to update code in 02-client
is not practical and limiting to use cases. Any IBC application should be able to define their own client without needing to modify 02-client
code in a similar fashion that any SDK application can define their own custom ante handler logic without needing to modify the SDK ante handler code.
Problem Definition
Currently, when constructing a client that isn't TM based or a localhost, code needs to be added to 02-client
to define a ClientType
and add custom logic to handle that client type. This may be fine for the first few clients, but what if you have 5, 10, 15 different clients? In this case, you might as well have all clients live as a subpkg in 02-client
.
Proposal
From my limited understanding, a lot of the custom logic can be packaged into a single interface call and the responsibility pushed onto the client developer. For example, the switch in x/ibc/02-client/handler.go
is essentially requiring custom logic to create a new client state based on the client type. This could be modified into an interface call by adding
GetClientState(chainID string, height uint64) ClientState
to MsgCreateClient
For Admin Use
- Not duplicate issue
- Appropriate labels applied
- Appropriate contributors tagged
- Contributor assigned/self-assigned
Activity