ICS18: Suggestions to improve spec
Surfaced from Informal Systems IBC Audit of cosmos-sdk hash https://github.com/cosmos/cosmos-sdk/commit/6344d626db1fbdba5e0f67425703c1584021bf5b.
-
[ ] "Datagrams can be submitted individually as single transactions or atomically as a single transaction" writeup could be improved
-
[ ] why are Packets discussed here? But connection and channel and clientstate datagrams are not discussed? (I like the focus on the "normal" operation which is represented by packets, but it should be said that this is just normal operation)
-
[ ] function
pendingDatagramsappears to consist of the following steps (which is somewhat hard to grasp from the code). Perhaps mentioning these steps explicitly would help the reader.- update chain A to most recent header of chain B
- update chain B to most recent header of chain A
- advance all connection handshakes according to diagram in ICS02 (do nothing if in final state)
- advance all channel handshakes according to diagram in ICS03 (do nothing if in final state)
- send packets
- send acknowledgements
- (although mentioned in a comment, no timeouts are handled in the current pseudo code)
-
[ ] It is not clear why
pendingDatagramstransmits all data, and doesn't miss some blocks. -
[ ] Timeout handling is not discussed.
-
[ ] "There are implicit ordering constraints". These constraints need to be made explicit.
-
[ ] "Race conditions": "if two relayers do so, the first transaction will succeed and the second will fail." only if both satisfy the "implicit" ordering constraint that the header need to be installed first. It might be that the first fails, then the header is installed, then the second succeeds.
Yes, thank you, these are all excellent suggestions. I think ICS 18 should be restructured as part of the broader plan in https://github.com/cosmos/ics/issues/468.