cosmos / ibc-rs

Rust implementation of the Inter-Blockchain Communication (IBC) protocol.
Apache License 2.0
199 stars 79 forks source link

Implement MBT for ICS04 Channel handlers #30

Closed andrey-kuprianov closed 1 year ago

andrey-kuprianov commented 3 years ago

We need to initiate model-based testing for IBC-rs; while initially IBC client handlers (ICS02) have been chosen for that, we have decided to do it for ICS04 Channel handlers instead; see the explanation below.

The goal is to complement the current manual tests for channel handlers with MBT-based ones, such that model-based tests will be able to explore unexpected corner cases.

We can split the work here in multiple parts, as follows:

Bugs found with MBT:

andrey-kuprianov commented 3 years ago

We have figured out that client handlers are too primitive to throw the heavy MBT machinery at them; e.g. the CreateClient handler is only incrementing one counter, so no real logic to test.

Considering that now the Channel handlers are coming to completeness, we are shifting focus to them. They have quite non-trivial implementation, that deserves thorough testing; see e.g. the ChanOpenTry handler.

The corresponding TLA+ model is also non-trivial, so this seems to be a good match for MBT.

plafer commented 1 year ago

Closing this as stale; we should reformulate these issues when we address #148 (and our correctness strategy in general).