hermes icon indicating copy to clipboard operation
hermes copied to clipboard

`Height` should be a trait, and the concrete type an associated type of `ClientDef`

Open plafer opened this issue 2 years ago • 0 comments

ICS-2 treats Height as an opaque type defined by a client type, while ICS-7 describes the Height as we currently know it. We currently assume that all clients will use the tendermint height definition, which is incorrect.

We are already seeing problems related to this (this issue).

We should then define a trait for Height (ICS2Height below) with the operations as described in ICS-2, and modify ClientDef as

trait ClientDef {
    type Height: ICS2Height;
    ...

I haven't thought through all the implications of this change, but ideally our types should look somewhat like this.

plafer avatar Jun 24 '22 15:06 plafer