ibc
ibc copied to clipboard
ICS-2: `ClientType` is not defined and confusing
The type ClientType
is not clearly defined in ICS-2, and seems to play 2 different roles.
On the one hand, it is the type of the value stored at "clients/{identifier}/clientType"
in the provableStore
(see ICS-24 table). Given how it's meant to be used, I would expect it to be a well-defined type (as opposed to an opaque data structure). For example, in ibc-go, ClientType
is a string.
On the other hand, the reader can gather that it is an object that is expected to have the methods such as initialise()
, checkValidityAndUpdateState()
, and checkMisbehaviourAndUpdateState()
. I was able to figure that out by looking at how it is used in the code snippets, and then link it to the text that says
Client types MUST define a method to initialise a client state with a provided consensus state, writing to internal state as appropriate. [the
initialise
method]
It wasn't immediately clear to me that the quote above referred to the ClientType
type.
Given this, what is ClientType
supposed to be: the former or the latter?
Finally, we should also ensure that the ClientType
value "07-tendermint"
that ibc-go uses to identify the Tendermint client is documented somewhere.