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

FR: Allow customising HostFunctionsProvider in MerkleProof #1147

Closed
mina86 opened this issue Mar 31, 2024 · 0 comments · Fixed by #1158
Closed

FR: Allow customising HostFunctionsProvider in MerkleProof #1147

mina86 opened this issue Mar 31, 2024 · 0 comments · Fixed by #1158
Milestone

Comments

@mina86
Copy link
Contributor

mina86 commented Mar 31, 2024

Feature Summary

At the moment MerkleProof hard-codes ics23::HostFunctionsManager as
generic argument to ics23::verify_membership and
ics23::verify_non_membership functions. That manager implements all
necessary methods using crates.

However, on platforms where syscalls are provided for calculating
hashes this is wasteful and in fact may lead to program failure due
execution time limits.

I’m specifically talking about Solana. We're hitting compute units
limits when trying to verify proofs. Solana offers syscalls for hash
functions which execute naively by the runtime and thus consume less
compute units. But as described above there’s no way for us to use
those syscalls in ibc-rs since it just assumes HostFunctionsManager.

Proposal

Make MerkleProof proof generic on the ics23::HostFunctionsProvider and
expose that configuration to the users of deliver function. I don’t
know what’s the best option of achieving that to be honest.

@mina86 mina86 changed the title FR: Allow customising HostFunctionsProvider in MerklePRoof FR: Allow customising HostFunctionsProvider in MerkleProof Apr 2, 2024
@github-project-automation github-project-automation bot moved this to 📥 To Do in ibc-rs Apr 2, 2024
@Farhad-Shabani Farhad-Shabani added this to the 0.52.0 milestone Apr 8, 2024
@github-project-automation github-project-automation bot moved this from 📥 To Do to ✅ Done in ibc-rs Apr 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants