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

Update trie spec #477

Closed
lamafab opened this issue Feb 17, 2022 · 1 comment
Closed

Update trie spec #477

lamafab opened this issue Feb 17, 2022 · 1 comment
Assignees
Labels
specification Additions and Updates to the Specification

Comments

@lamafab
Copy link
Contributor

lamafab commented Feb 17, 2022

From Emeric:

There is a change in the header: two new variants. And so two new node types
Not exactly new node type, existing type but with hash of value stored instead of value
I am also not sure to what extent proof were specified. This does change a bit compact proof (which are used by cumulus and one rpc), but I don't think this is part of the spec
Out of trie scope, it changes one host function to chose which trie/state version should be applied, that is an additional parameter on 'storage_root'.

On the trie crate it is paritytech/trie#142 which allow storing value out of the node.
The encoding scheme is compatible with the existing one as long as it is only reading (the header allows both old and new behavior, with value always in a trie node or with value bigger than a hash stored as an external node).
In substrate it is paritytech/substrate#9732, the same codec code change is used and there is an additional 'state_version' (the new parameter of the host function) in the that indicate if the new behavior should be use when modifying the state.
There is a third PR that focus on runtime change to run a migration (paritytech/substrate#10073).

@lamafab lamafab added the specification Additions and Updates to the Specification label Feb 17, 2022
@lamafab lamafab self-assigned this Feb 17, 2022
@lamafab
Copy link
Contributor Author

lamafab commented Mar 4, 2022

Implemented in #478

@lamafab lamafab closed this as completed Mar 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
specification Additions and Updates to the Specification
Projects
None yet
Development

No branches or pull requests

1 participant