Skip to content
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

feat: allow custom HostFunctionsProvider in MerkleProof #1158

Merged
merged 6 commits into from
Apr 8, 2024

Conversation

Farhad-Shabani
Copy link
Member

@Farhad-Shabani Farhad-Shabani commented Apr 6, 2024

Closes: #1147

Integration tests: informalsystems/basecoin-rs#174


PR author checklist:

  • Added changelog entry, using unclog.
  • Linked to GitHub issue.
  • Updated code comments and documentation (e.g., docs/).
  • Tagged one reviewer who will be the one responsible for shepherding this PR.

Reviewer checklist:

  • Reviewed Files changed in the GitHub PR explorer.
  • Manually tested (in case integration/unit/mock tests are absent).

Copy link

codecov bot commented Apr 6, 2024

Codecov Report

Attention: Patch coverage is 41.42857% with 41 lines in your changes are missing coverage. Please review.

Project coverage is 63.79%. Comparing base (91bee67) to head (fdab306).

Files Patch % Lines
...lients/ics07-tendermint/src/client_state/common.rs 0.00% 27 Missing ⚠️
ibc-core/ics23-commitment/types/src/merkle.rs 0.00% 13 Missing ⚠️
ibc-clients/ics07-tendermint/types/src/header.rs 85.71% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1158      +/-   ##
==========================================
+ Coverage   63.76%   63.79%   +0.03%     
==========================================
  Files         219      219              
  Lines       21387    21391       +4     
==========================================
+ Hits        13638    13647       +9     
+ Misses       7749     7744       -5     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@Farhad-Shabani
Copy link
Member Author

Hey @mina86, See please changes in this PR meet your requirements?

This follows a similar approach we took for enabling a custom Tendermint Verifier. Meaning that, so far, we've been using a concrete HostFunctionsManager (as seen with the ProdVerifier), with this, you now have the option to introduce your custom object that implements the HostFunctionsProvider. However, admittedly, this requires defining a similar ClientState wrapper type on your end and implementing the ClientState traits using standalone functions under the ibc-client-tendermint crate. Following that, you should be able to inject your custom HostFunctionsManager here (same as the way a custom Tendermint verifier can be passed).

Note that to enable the ClientState newtype to be generic over the HostFunctionsProvider (And even perhaps over the TmVerifier), we need to devise a thoughtful solution that involves making adjustments in upstream libraries such as tendermint-rs and ics23 (like this), ensuring relevant changes keep the ibc-derive working, and as well, won’t cause disruptions for other users.

Therefore, take this as an interim solution. Let us know your thoughts. Happy to help in any way we can.

Copy link
Contributor

@mina86 mina86 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This appears to be sufficient for our needs.

ibc-clients/ics07-tendermint/types/src/header.rs Outdated Show resolved Hide resolved
@Farhad-Shabani Farhad-Shabani added this to the 0.52.0 milestone Apr 8, 2024
@Farhad-Shabani Farhad-Shabani added this pull request to the merge queue Apr 8, 2024
Merged via the queue into main with commit f7a3c2b Apr 8, 2024
18 checks passed
@Farhad-Shabani Farhad-Shabani deleted the farhad/allow-HostFunctionProvider branch April 8, 2024 20:38
mina86 pushed a commit to mina86/ibc-rs that referenced this pull request Apr 19, 2024
)

* feat: allow HostFunctionsProvider in MerkleProof

* nit: consistent generic name H

* feat: use hash_with<H> for hashing validator sets

* fix: make verify_upgrade_client func generic over HostFunctionsProvider

* chore: add changelog
Farhad-Shabani added a commit that referenced this pull request Sep 9, 2024
* feat: allow HostFunctionsProvider in MerkleProof

* nit: consistent generic name H

* feat: use hash_with<H> for hashing validator sets

* fix: make verify_upgrade_client func generic over HostFunctionsProvider

* chore: add changelog
mina86 pushed a commit to mina86/ibc-rs that referenced this pull request Oct 4, 2024
)

* feat: allow HostFunctionsProvider in MerkleProof

* nit: consistent generic name H

* feat: use hash_with<H> for hashing validator sets

* fix: make verify_upgrade_client func generic over HostFunctionsProvider

* chore: add changelog
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

FR: Allow customising HostFunctionsProvider in MerkleProof
3 participants