You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The proof verification code, especially related to ClientState verification, is currently confusing and incomplete. The following 3 points should make the code better:
Use more meaningful variable names.
For example, it is unclear which ClientStatethis client_state variable this variable refers to: the ClientState of A on B, or the ClientState of B on A? A convention should be adopted and followed consistently in all functions, be it using "host" vs "other", or "a" and "b" to distinguish between the 2 chains.
There should be a specific Proof struct for each relevant context (e.g. ConnectionOpenTry proofs, ConnectionOpenAck proofs, etc). Consider the suggestions already made here.
Currently, if the ClientState is not included in the MsgConnectionOpenTry, the msg verification can still succeed (see here). We should instead add a method to the context, say verify_self_client_state(client_state), and let the chain decide if it wants to do that extra verification, and how.
Note: this was originally added so that chains that don't need the extra ClientState verification can simply not include one in the message and still succeed in opening a connection.
The proof verification code, especially related to
ClientState
verification, is currently confusing and incomplete. The following 3 points should make the code better:ClientState
thisclient_state
variable this variable refers to: the ClientState of A on B, or the ClientState of B on A? A convention should be adopted and followed consistently in all functions, be it using "host" vs "other", or "a" and "b" to distinguish between the 2 chains.Proof
struct for each relevant context (e.g.ConnectionOpenTry
proofs,ConnectionOpenAck
proofs, etc). Consider the suggestions already made here.ClientState
is not included in theMsgConnectionOpenTry
, the msg verification can still succeed (see here). We should instead add a method to the context, sayverify_self_client_state(client_state)
, and let the chain decide if it wants to do that extra verification, and how.ClientState
verification can simply not include one in the message and still succeed in opening a connection.This issue comes out of a discussion with @ancazamfir and @hu55a1n1.
Sub-issues:
The text was updated successfully, but these errors were encountered: