-
Notifications
You must be signed in to change notification settings - Fork 326
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
MBT for ICS03 #701
MBT for ICS03 #701
Conversation
7d59b32
to
6c7ee61
Compare
Codecov Report
@@ Coverage Diff @@
## master informalsystems/hermes#701 +/- ##
=========================================
+ Coverage 13.6% 44.7% +31.0%
=========================================
Files 69 151 +82
Lines 3752 9905 +6153
Branches 1374 0 -1374
=========================================
+ Hits 513 4429 +3916
- Misses 2618 5476 +2858
+ Partials 621 0 -621
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work, Vitor!
I am really happy to see MBT finally coming to IBC-rs:)
What's particularly valuable here is that you've managed to integrate TLC as an MBT backend, so in the future we will be able to have two backends for MBT: Apalache and TLC.
From my side everything looks good:
- contrary to the previous PR on ICS02, this is now a complete setup, allowing to add more tests via TLA+,
- The Rust code in
executor
also seem to provide a good basis to simplify writing unit tests, - The TLA+ model also looks quite concise and at the same time extensible, e.g. to support multiple chains, or other ICSs.
While this PR does pollute the sources a bit with static test files, those are going to be removed when we release the combination of MBT-core + MBT-Rust. And also this PR is a good foundation for the MBT-Rust plugin, we are going to reuse there a lot of ideas from the PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. I ignored the TLA+ and json files, and beside those there are not many modifications. I'm curious: why did TLC replace Apalache?
I will open an issue to discuss how we plan to maintain this code in the face of upcoming modifications to the modules.
- `MaxClientsPerChain = 1`, indicating that at most 1 client per chain will be created | ||
- `MaxClientHeight = 2`, indicating that clients will reach at most height 2 | ||
|
||
- `ChainIds = {"chain-A", "chain-B"}`, indicating that two chains, `chain-A` and `chain-B`, will be created |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit, but I'd suggest the same improvement as before 5d6bf08
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The change in 5d6bf08 was reverted because the model doesn't know about revisions. Also, when generating the actual ChainId
on the Rust side, we would get "chain-A-0-0"
:
https://github.com/informalsystems/ibc-rs/blob/3e513dbfd96fca6de0b2507bab5baff936b9864d/modules/tests/executor/mod.rs#L96-L98
Because we found a way to automate the generation of those |
impressive work! I ran all tests with coverage and we are in general > 80% coverage for the ICS02 and ICS03 handlers :) I was trying to figure out how to increase that. For example there is a case where an update - just saw the new issue cosmos/ibc-rs#29 that is along the exact same lines. |
Yes, the model already considers this case. It should be enough to change |
Towards: cosmos/ibc-rs#30
Closes: #633
Description
Following #601, this is another step towards cosmos/ibc-rs#30.
This PR also closes #633 by storing all consensus states (heights in the TLA+ model), not just the latest one as before.
The number of added lines is scary but roughly 3K of them are from the test files automatically generated 😄 (these files don't need to be reviewed)
(BTW, I've noticed that the implementation distinguishes between
ConnectionNotFound
andUninitializedConnection
, although these errors are returned in the same situation (when the connection does not exist).)For contributor use:
docs/
) and code comments.Files changed
in the Github PR explorer.