-
Notifications
You must be signed in to change notification settings - Fork 96
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
imp: make custom Validation/ExecutionContext
under ICS-07 usable by any light clients
#1166
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1166 +/- ##
=======================================
Coverage 63.79% 63.79%
=======================================
Files 219 219
Lines 21391 21389 -2
=======================================
- Hits 13647 13646 -1
+ Misses 7744 7743 -1 ☔ View full report in Codecov by Sentry. |
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; just some nits and a question on my end.
/// [`ExtClientValidationContext`] and [`ClientExecutionContext`] | ||
pub trait ExtClientExecutionContext: ExtClientValidationContext + ClientExecutionContext {} | ||
|
||
impl<T> ExtClientExecutionContext for T where T: ExtClientValidationContext + ClientExecutionContext {} |
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.
As far as I can tell, based off of how this trait is being used, it's essentially a trait alias for any types that implement ExtClientValidationContext
and ClientExecutionContext
. Is that an appropriate way to think about this?
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.
Right. Updated the docstring: d4e66c2
Hope it's more clear now.
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 👍
I added some comments.
.changelog/unreleased/breaking-changes/1163-make-ics07-custom-context-traits-portable.md
Outdated
Show resolved
Hide resolved
/// In order to wire up the custom verifier, the `verify_client_message` method | ||
/// on the `ClientStateValidation` trait must be implemented. The simplest way | ||
/// to do this is to import and call the standalone `verify_client_message` | ||
/// function located in the `ibc::clients::tendermint::client_state` module, | ||
/// passing in your custom verifier type as its `verifier` parameter. The rest | ||
/// of the methods in the `ClientStateValidation` trait can be implemented by | ||
/// importing and calling their analogous standalone version from the | ||
/// `tendermint::client_state` module, unless bespoke logic is desired for any | ||
/// of those functions. |
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 am reading this, but the short context makes it a bit confusing. Can we add an example (less than 10 lines) in a codeblock here?
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.
Very spot-on comment! I have been trying to add an example and realized we really don't need to be maintaining TmVerifier
. Everywhere we can simply use tendermint_light_client_verifier::Verifier
as the trait bound.
Co-authored-by: Rano | Ranadeep <[email protected]> Signed-off-by: Farhad Shabani <[email protected]>
… any light clients (#1166) * imp: move TmValidation/ExecutionContext into ICS-02 for general usage * chore: add changelog * review: rename context.rs to verifier.rs * review: better docstring for ExtClientExecutionContext * fix: apply review comments * nit: update changelog Co-authored-by: Rano | Ranadeep <[email protected]> Signed-off-by: Farhad Shabani <[email protected]> --------- Signed-off-by: Farhad Shabani <[email protected]> Co-authored-by: Rano | Ranadeep <[email protected]>
Closes: #1163
Step before: #1167
PR author checklist:
unclog
.docs/
).Reviewer checklist:
Files changed
in the GitHub PR explorer.