Routing module has to deliver separate store to secondary module and have the writing logic. #289
Description
I'm not sure that this issue was discussed, but I looked around but couldn't find this issue.
In ics-26 routing module, IBC module will route packets, handshakes, and datagram to secondary module's handler. However, I found the lack of feature that delivers a separate store for the secondary module and writes this store if handler returns success.
In the current implementation in cosmos-sdk, cosmos-sdk have CacheKVStore and actually this store saves the values in memory and writes these values to the storage if the transaction succeeds. I think that the routing module has to support this feature within their logic. Without this, though the secondary module's handler returns failure, the routing module should deal with a relayed IBC transaction as a success because the receiving sequence should be increased. But in this case, even though the secondary module's handler returns failure, the values saved to the store before returning failure would remain in storage because transaction actually succeeds, and this leftover would make hard to predict errors and fundamentally this is not expected behavior for software developer. If relayed IBC transaction is handled as a failure when the secondary module's handler returns failure, the routing module would stop because the receiving sequence couldn't be increased and this is never recovered without manual chain upgrade. And If a panic occurs in the secondary module's handler, the same case occurs.
So, I suggest adding abstraction for CacheStore and the logic that writes values in the store to storage when the secondary module's handler returns success.
Metadata
Assignees
Labels
Type
Projects
Status
Backlog