-
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
Fix overflow when ctx.host_current_height().revision_height < ctx.host_chain_history_size()
#686
Conversation
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.
Nice find, Vitor! I had two minor remarks.
Co-authored-by: Adi Seredinschi <[email protected]>
…bc-rs into vitor/overflow
Codecov Report
@@ Coverage Diff @@
## master informalsystems/hermes#686 +/- ##
=========================================
+ Coverage 13.6% 44.2% +30.5%
=========================================
Files 69 150 +81
Lines 3752 9776 +6024
Branches 1374 0 -1374
=========================================
+ Hits 513 4325 +3812
- Misses 2618 5451 +2833
+ Partials 621 0 -621
Continue to review full report at Codecov.
|
The test that was commented out is expecting a However, before this, we're already checking if the height is stale here: https://github.com/informalsystems/ibc-rs/blob/vitor/overflow/modules/src/ics03_connection/handler/verify.rs#L200-L203 If the height is not stale, then the consensus state must exist, in which case the error |
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.
I'm thinking that the tests for connection open ack were relying on wrong behaviour since they started failing with this PR. I tried to fix them in 4da1d34 but there's one (now commented out) I didn't figure out how.
That may well be. Tried to consolidate tests in that module recently, but there's still some work to be done. Your improvements definitely help!
I agree with your analysis. To summarize: in conn open try & ack handlers there are two verifications on the field
I think the first verification is more of a fail-fast. While the second verification is a pre-check as part of the whole ensemble of proof verification. I agree there is some redundancy there. I would suggest to open an issue documenting this, but I wouldn't fix things with a panic (we have no panics in the modules yet, and not sure if it's a good idea to fix it like that). |
I opened https://github.com/informalsystems/ibc-rs/issues/698. Once this PR gets merged, I'll update the links there to not point to my branch. |
I've updated cosmos/ibc-rs#33. @adizere please confirm that it reflects the discussion here. Regarding |
…st_chain_history_size()` (informalsystems#686) * Add MockContext::host_oldest_height * Update CHANGELOG * Fix conn open ack tests Co-authored-by: Adi Seredinschi <[email protected]> * Remove MockContext::host_chain_history_size * Fix clippy Co-authored-by: Adi Seredinschi <[email protected]>
Closes: #685
Description
For contributor use:
docs/
) and code comments.Files changed
in the Github PR explorer.