polkadot-spec
polkadot-spec copied to clipboard
Corner cases about child tries are unexplained
Some questions are in my opinion not really clear in the spec:
- What happens if the runtime calls the
ext_storage_get_version_1orext_storage_read_version_1host 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_1host 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 achild_storage_keythat is in fact not a child trie? I assume that this is the equivalent of a runtime panic?
Fixed in #554
Test coverage in https://github.com/w3f/polkadot-tests/pull/241, should be merged, soon
I don't see how https://github.com/w3f/polkadot-spec/pull/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.
I would say that the first two points are now covered by https://github.com/w3f/polkadot-spec/issues/577 and https://github.com/w3f/polkadot-spec/issues/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?