-
Notifications
You must be signed in to change notification settings - Fork 332
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
ICS07: Add verification method for client update handler #1321
Conversation
…formalsystems/ibc-rs into Check-Header-And-Update-State
…formalsystems/ibc-rs into Check-Header-And-Update-State
Signed-off-by: Thane Thomson <connect@thanethomson.com>
…rait Signed-off-by: Thane Thomson <connect@thanethomson.com>
Signed-off-by: Thane Thomson <connect@thanethomson.com>
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.
It looks good from my side for this PR. Will open a different issue to discuss and fix the client specific store.
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.
LGTM, thank you so much for all the work, @cezarad @thanethomson and @ancazamfir!
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 team, thank you everyone for your patience and perseverence with this PR!
Note that I changed the "closing" issue associated to this PR. I think we can keep the changelog as it is.
use crate::timestamp::ZERO_DURATION; | ||
use std::ops::Add; |
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.
One last concern: should we scrub this PR for std
?
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.
It's in tests, which we will run with std
, so it doesn't really matter whether we import from std
or core
, but in this case it wouldn't hurt to just import from core
for consistency.
…tems#1321) * bla * on going * ongoing * on going * on going * timestamp default changed from none to now * failed ping pong - signs * Update context.rs * bla * blabla * fixed test client_update_ping_pong * fmt + clippy * Update context.rs * Update context.rs * remove comments * Update host.rs * Update to tendermint-rs v0.20.0 * Update changelog * Fix tendermint-rs version in changelog * Update predicates.rs * Update context.rs * tests * tendermint stuff in * Update Cargo.toml * clippy + fmt * moved predicates into ics07 header.rs * Adapted to latest TM changes * Fixed MockHeader test * Fmt & clippy * Removed irrelevant file * Bit more cleanup * fixed tests * upgraded to new error model * fmt * errors and timestamp changes * Fix error notation and formatting Signed-off-by: Thane Thomson <connect@thanethomson.com> * Upgrade to tendermint-rs master Signed-off-by: Thane Thomson <connect@thanethomson.com> * Use tendermint-rs from branch thane/ibc-1252 Signed-off-by: Thane Thomson <connect@thanethomson.com> * Refactor ICS07 update handler to reuse light client verifier This commit makes use of the latest code from informalsystems/tendermint-rs#960 in order to reuse the light client's verification predicates instead of reimplementing them in the `ibc` crate. Signed-off-by: Thane Thomson <connect@thanethomson.com> * Update Cargo.lock to address zeroize issue Signed-off-by: Thane Thomson <connect@thanethomson.com> * Bump tendermint-light-client dep to v0.22.0 for ibc module Signed-off-by: Thane Thomson <connect@thanethomson.com> * Refactor to accommodate new context API Signed-off-by: Thane Thomson <connect@thanethomson.com> * Fix missing import Signed-off-by: Thane Thomson <connect@thanethomson.com> * Fix imports Signed-off-by: Thane Thomson <connect@thanethomson.com> * Fix error check in test Signed-off-by: Thane Thomson <connect@thanethomson.com> * Output debug version of error Signed-off-by: Thane Thomson <connect@thanethomson.com> * Remove test as per informalsystems#1321 (comment) Signed-off-by: Thane Thomson <connect@thanethomson.com> * Address comments from Adi Signed-off-by: Thane Thomson <connect@thanethomson.com> * Cosmetic tweaks Signed-off-by: Thane Thomson <connect@thanethomson.com> * Add revision number check Signed-off-by: Thane Thomson <connect@thanethomson.com> * Fix broken test Signed-off-by: Thane Thomson <connect@thanethomson.com> * Check incoming header height against chain ID version from client state Signed-off-by: Thane Thomson <connect@thanethomson.com> * Add revision_number consistency check when deserializing header Signed-off-by: Thane Thomson <connect@thanethomson.com> * Clarify MismatchedRevisions error message Signed-off-by: Thane Thomson <connect@thanethomson.com> * Add changelog entries Signed-off-by: Thane Thomson <connect@thanethomson.com> * Commented import no longer necessary Signed-off-by: Thane Thomson <connect@thanethomson.com> * Add in-the-middle monotonicity checks Signed-off-by: Thane Thomson <connect@thanethomson.com> * Fix broken dep tree relating to Prometheus Signed-off-by: Thane Thomson <connect@thanethomson.com> * Move next/prev consensus state search functionality to ClientReader trait Signed-off-by: Thane Thomson <connect@thanethomson.com> * Move impl of prev/next to the specific implementation and simplify signatures * Disable `tendermint-light-client` default features, ie. RPC client, std and color-eyre * Apply suggestions from code review * Fix compilation * Cleanup BTreeMap import * Always show underlying reason in ics07_tendermint errors * Update modules/src/ics02_client/handler/update_client.rs * Fix compilation Co-authored-by: cezarad <cezara@informal.systems> Co-authored-by: Romain Ruetschi <romain@informal.systems> Co-authored-by: cezarad <9439384+cezarad@users.noreply.github.com> Co-authored-by: Adi Seredinschi <adi@informal.systems> Co-authored-by: Anca Zamfir <zamfiranca@gmail.com>
* bla * on going * ongoing * on going * on going * timestamp default changed from none to now * failed ping pong - signs * Update context.rs * bla * blabla * fixed test client_update_ping_pong * fmt + clippy * Update context.rs * Update context.rs * remove comments * Update host.rs * Update to tendermint-rs v0.20.0 * Update changelog * Fix tendermint-rs version in changelog * Update predicates.rs * Update context.rs * tests * tendermint stuff in * Update Cargo.toml * clippy + fmt * moved predicates into ics07 header.rs * Adapted to latest TM changes * Fixed MockHeader test * Fmt & clippy * Removed irrelevant file * Bit more cleanup * fixed tests * upgraded to new error model * fmt * errors and timestamp changes * Fix error notation and formatting Signed-off-by: Thane Thomson <connect@thanethomson.com> * Upgrade to tendermint-rs master Signed-off-by: Thane Thomson <connect@thanethomson.com> * Use tendermint-rs from branch thane/ibc-1252 Signed-off-by: Thane Thomson <connect@thanethomson.com> * Refactor ICS07 update handler to reuse light client verifier This commit makes use of the latest code from informalsystems/tendermint-rs#960 in order to reuse the light client's verification predicates instead of reimplementing them in the `ibc` crate. Signed-off-by: Thane Thomson <connect@thanethomson.com> * Update Cargo.lock to address zeroize issue Signed-off-by: Thane Thomson <connect@thanethomson.com> * Bump tendermint-light-client dep to v0.22.0 for ibc module Signed-off-by: Thane Thomson <connect@thanethomson.com> * Refactor to accommodate new context API Signed-off-by: Thane Thomson <connect@thanethomson.com> * Fix missing import Signed-off-by: Thane Thomson <connect@thanethomson.com> * Fix imports Signed-off-by: Thane Thomson <connect@thanethomson.com> * Fix error check in test Signed-off-by: Thane Thomson <connect@thanethomson.com> * Output debug version of error Signed-off-by: Thane Thomson <connect@thanethomson.com> * Remove test as per informalsystems/hermes#1321 (comment) Signed-off-by: Thane Thomson <connect@thanethomson.com> * Address comments from Adi Signed-off-by: Thane Thomson <connect@thanethomson.com> * Cosmetic tweaks Signed-off-by: Thane Thomson <connect@thanethomson.com> * Add revision number check Signed-off-by: Thane Thomson <connect@thanethomson.com> * Fix broken test Signed-off-by: Thane Thomson <connect@thanethomson.com> * Check incoming header height against chain ID version from client state Signed-off-by: Thane Thomson <connect@thanethomson.com> * Add revision_number consistency check when deserializing header Signed-off-by: Thane Thomson <connect@thanethomson.com> * Clarify MismatchedRevisions error message Signed-off-by: Thane Thomson <connect@thanethomson.com> * Add changelog entries Signed-off-by: Thane Thomson <connect@thanethomson.com> * Commented import no longer necessary Signed-off-by: Thane Thomson <connect@thanethomson.com> * Add in-the-middle monotonicity checks Signed-off-by: Thane Thomson <connect@thanethomson.com> * Fix broken dep tree relating to Prometheus Signed-off-by: Thane Thomson <connect@thanethomson.com> * Move next/prev consensus state search functionality to ClientReader trait Signed-off-by: Thane Thomson <connect@thanethomson.com> * Move impl of prev/next to the specific implementation and simplify signatures * Disable `tendermint-light-client` default features, ie. RPC client, std and color-eyre * Apply suggestions from code review * Fix compilation * Cleanup BTreeMap import * Always show underlying reason in ics07_tendermint errors * Update modules/src/ics02_client/handler/update_client.rs * Fix compilation Co-authored-by: cezarad <cezara@informal.systems> Co-authored-by: Romain Ruetschi <romain@informal.systems> Co-authored-by: cezarad <9439384+cezarad@users.noreply.github.com> Co-authored-by: Adi Seredinschi <adi@informal.systems> Co-authored-by: Anca Zamfir <zamfiranca@gmail.com>
Closes cosmos/ibc-rs#71
Builds on and replaces #1252 with the following changes:
tendermint-light-client
crate in implementing ICS07.flex-error
integration.For contributor use:
unclog
.docs/
) and code comments.Files changed
in the Github PR explorer.