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

Make child tries work properly #743

Merged
merged 14 commits into from
Jun 15, 2023
Merged

Conversation

tomaka
Copy link
Contributor

@tomaka tomaka commented Jun 14, 2023

cc #166

This PR updates the child tries implementation after w3f/polkadot-spec#648 (comment)

It moves all the child-trie-related handling that was in host.rs to runtime_host.rs where it is more appropriate. I initially thought that host.rs could provide a reasonable abstraction, but it actually makes more sense to do everything in runtime_host.rs and let host.rs generate events that map precisely to the functions that the runtime calls.

It also makes sure to recalculate the root hash of every child trie before calculating the main trie hash. This is in line with what is explained in w3f/polkadot-spec#577

The test in #722 works on top of this PR.

I'm going to do a documentation pass on this PR before merging it, as there might be several comments that are no longer accurate.

@tomaka tomaka added this pull request to the merge queue Jun 15, 2023
Merged via the queue into smol-dot:main with commit 252f5e7 Jun 15, 2023
@tomaka tomaka deleted the child-tries-to-host branch June 15, 2023 09:03
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 this pull request may close these issues.

1 participant