Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

Handle child trie key in change trie #2622

Closed
cheme opened this issue May 17, 2019 · 3 comments · Fixed by #3122
Closed

Handle child trie key in change trie #2622

cheme opened this issue May 17, 2019 · 3 comments · Fixed by #3122
Assignees
Labels
J0-enhancement An additional feature request.

Comments

@cheme
Copy link
Contributor

cheme commented May 17, 2019

Change tries as described in #628 store extrinsic index for a key change.
In the case of a child trie child key change, the root parent trie key will be include in change trie but not the key in the child trie, making the information a bit less relevant.

I wonder if child trie key could benefit from the same mechanism. I see two options:

  • put all in change_trie (change trie will replace key by (option<parent_key>, key).
  • create a change_trie per child trie and manage multiple change trie

the second option looks the most promising to me but I am not very familiar with change trie, @svyatonik maybe you have a good idea.

Also it seems to me that this should be optional per child trie (iirc the change trie is optional).

There is also the question of the proof for child change trie.

@cheme cheme added the J0-enhancement An additional feature request. label May 17, 2019
@svyatonik
Copy link
Contributor

To support multiple changes tries we need to include root of every CT into block' digest then. Probably not the best idea? I'm not sure- how many child tries could be there.

@cheme
Copy link
Contributor Author

cheme commented May 20, 2019

Should putting child change trie root in parent change trie solve this root in digest issue (you still have to pack multiple change trie content but you got a single root in block digest)?
How many child tries depends on usage from runtime so I think we can also assume many (a lot). And that will be the case if contracts are use in runtime (one per contract with one kv changed in block).

@svyatonik
Copy link
Contributor

I don't see how it could help. IMO option (1) is more viable than the second one.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
J0-enhancement An additional feature request.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants