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

Corner cases about child tries are unexplained #540

Open
tomaka opened this issue Oct 4, 2022 · 4 comments
Open

Corner cases about child tries are unexplained #540

tomaka opened this issue Oct 4, 2022 · 4 comments
Assignees

Comments

@tomaka
Copy link
Collaborator

tomaka commented Oct 4, 2022

Some questions are in my opinion not really clear in the spec:

  • What happens if the runtime calls the ext_storage_get_version_1 or ext_storage_read_version_1 host function with a key K, where K is in fact a child trie? As far as I understand, this would return the trie root hash of the child trie, but this isn't really clear in the spec.
  • What happens if the runtime calls the ext_storage_set_version_1 host function with a key K, where K is in fact a child trie? I assume that it destroys the child trie, but this isn't really clear.
  • What happens if the runtime calls any of the ext_default_child_storage_* host functions with a child_storage_key that is in fact not a child trie? I assume that this is the equivalent of a runtime panic?
@lamafab
Copy link
Contributor

lamafab commented Oct 17, 2022

Fixed in #554

@lamafab lamafab closed this as completed Oct 17, 2022
@lamafab
Copy link
Contributor

lamafab commented Oct 17, 2022

Test coverage in w3f/polkadot-tests#241, should be merged, soon

@tomaka
Copy link
Collaborator Author

tomaka commented Oct 20, 2022

I don't see how #554 covers any of the questions that I've raised, and I don't see any answer to them in the spec.

For some reason I don't have a "reopen" button, but if I had one I'd reopen the issue.

@lamafab lamafab reopened this Nov 7, 2022
@tomaka
Copy link
Collaborator Author

tomaka commented Nov 7, 2022

I would say that the first two points are now covered by #577 and #575

Only remains:

What happens if the runtime calls any of the ext_default_child_storage_* host functions with a child_storage_key that is in fact not a child trie? I assume that this is the equivalent of a runtime panic?

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

No branches or pull requests

2 participants