Add support for ext_trie_blake2_256_verify_proof host functions#2221
Open
x3c41a wants to merge 1 commit intosmol-dot:mainfrom
Open
Add support for ext_trie_blake2_256_verify_proof host functions#2221x3c41a wants to merge 1 commit intosmol-dot:mainfrom
x3c41a wants to merge 1 commit intosmol-dot:mainfrom
Conversation
Implement ext_trie_blake2_256_verify_proof_version_1 and _version_2 which were previously stubbed with host_fn_not_implemented!(). These host functions are needed by runtimes that perform Merkle proof verification, such as Polkadot Bulletin Chain's pallet-transaction-storage. The implementation uses smoldot's existing proof_decode module to decode and verify the proof, then looks up the key and compares against the expected value. For state version V1 (version_2 only), hashed storage values (>= 33 bytes) are handled by comparing blake2b hashes.
e74b774 to
8b546d7
Compare
tomaka
approved these changes
Mar 21, 2026
Contributor
tomaka
left a comment
There was a problem hiding this comment.
Looks good, thank you!
If you've tried that it works, then it's good to go.
|
|
||
| ### Added | ||
|
|
||
| - Add support for the `ext_trie_blake2_256_verify_proof_version_1` and `ext_trie_blake2_256_verify_proof_version_2` host functions. These are used by runtimes that perform Merkle proof verification (e.g. Polkadot Bulletin Chain's `pallet-transaction-storage`). |
Contributor
There was a problem hiding this comment.
Suggested change
| - Add support for the `ext_trie_blake2_256_verify_proof_version_1` and `ext_trie_blake2_256_verify_proof_version_2` host functions. These are used by runtimes that perform Merkle proof verification (e.g. Polkadot Bulletin Chain's `pallet-transaction-storage`). | |
| - Add support for the `ext_trie_blake2_256_verify_proof_version_1` and `ext_trie_blake2_256_verify_proof_version_2` host functions. ([#2221](https://github.com/smol-dot/smoldot/pull/2221)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Implemented
ext_trie_blake2_256_verify_proof_version_1and_version_2host functionsUses the existing
proof_decodemodule to decode and verify the Merkle proof, look up the key, and compare against the expected value. Handles state version V1 where values >= 33 bytes are stored as blake2b hashes.Motivation
Chopsticks uses smoldot for WASM execution and fails on runtimes that call these host functions (e.g. Polkadot Bulletin Chain's
pallet-transaction-storage).Reference issue - paritytech/polkadot-bulletin-chain#341