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
Add child tries support in host.rs #167
Merged
Merged
Conversation
This file contains 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
twiggy diff reportDifference in .wasm size before and after this pull request.
|
…storage_read_version_1, ext_default_child_storage_exists_version_1
…ild_storage_root_version_2
…ld_storage_clear_version_1
…fault_child_storage_clear_prefix_version_2
Note that the design of child tries is a complete clusterfuck full of unspecified corner cases. |
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.
cc #166
This PR is the first step towards support for child tries in the VM.
While in Substrate child tries support is I believe handled by the "storage layer", in smoldot I prefer to make things clear and explicit.
For example, if the Wasm code reads the storage key
:child_storage:default:foo
, I don't emit aExternalStorageGet
variant but instead aExternalStorageRoot
variant with "foo" as the trie. Similarly, if the Wasm code callsext_storage_next_key_version_1
with:child_storage:default:foo
, I emit aExternalStorageNextChildTrie
variant.Only default child storages are supported, as this is the only kind of child tries that exist at the moment (and in the foreseeable future).
After this PR, child tries don't work yet. There is a lot of effort remaining to implement support for them especially in
runtime_host.rs
(which is the code that handles the storage diff while the call is in progress, including things like storage transactions). However, this PR does a big chunk of the work by designing an API for them.