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

trie: missing trie node types #2374

Closed
qdm12 opened this issue Mar 14, 2022 · 7 comments
Closed

trie: missing trie node types #2374

qdm12 opened this issue Mar 14, 2022 · 7 comments

Comments

@qdm12
Copy link
Contributor

qdm12 commented Mar 14, 2022

Task summary

https://github.com/paritytech/substrate/blob/ded44948e2d5a398abcb4e342b0513cb690961bb/primitives/trie/src/node_header.rs#L85-L107

we only implement leaf, branch without value and branch with value types, so it appears some types are missing.

Source comment

@noot
Copy link
Contributor

noot commented Mar 14, 2022

which types are missing? HashedValueLeaf and HashedValueBranch? also do we actually need these types? the gossamer trie doesn't need to be the exact same as the substrate one

@seunlanlege
Copy link

the gossamer trie doesn't need to be the exact same as the substrate one

any reason for this?

@danforbes
Copy link
Contributor

@noot - are you able to provide an answer to Seun's question above?

@noot
Copy link
Contributor

noot commented Mar 20, 2022

@seunlanlege @danforbes what I meant was that the implementation doesn't need to match in terms of exact types and the way it's implemented, as long as both implementations match the specification and result in the same merkle value for the same input. in general I think the less we reference substrate the better, and we definitely shouldn't blindly copy types or functions from substrate without understanding what they do.

@danforbes
Copy link
Contributor

That makes sense. I agree that we don't need to use the same naming conventions and internal structures as Substrate; I'm unclear as to whether or not Gossamer's trie implementation is missing certain types of nodes, etc that inform part of the trie's actual specification.

@noot
Copy link
Contributor

noot commented Mar 21, 2022

turns out this is related to #2392 - the new types are for state trie version 1, not the state trie version 0 (what's currently implemented)

@noot
Copy link
Contributor

noot commented Mar 21, 2022

closing in favour of #2418

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

4 participants