This repository has been archived by the owner on Nov 15, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
avoid key collision on child trie and proof on child trie #2209
Closed
Closed
Changes from 1 commit
Commits
Show all changes
142 commits
Select commit
Hold shift + click to select a range
f6c4bb2
Straight forward move of trie related only change from child-trie-soft
cheme 878a7ae
merge backend stuff from old branch, add insertion of child trie root in
cheme a464936
commit before wasm_executor change (we will keep old interface for now:
cheme 4de73d7
tabify
cheme be0e340
Things compile (account change is unoptimized), not for wasm.
cheme 7f3a282
Make SutrieField non public
cheme 4d208db
Compile no std child trie with subtrie query (super costy: do we trust
cheme 6d7f355
Make the single child trie test pass.
cheme 25bcb4c
Proving synch child trie content (TODO it requires deletion tests).
cheme 9eaef35
restore test
cheme 37d9536
Merge branch 'master' into child-trie-soft-min
cheme 67c03a2
Fix test error (wrong vec alloc).
cheme 99dbb5a
tests for no key collision
cheme 3be1802
Merge branch 'master' into child-trie-soft-min
cheme fec73d0
Revert `storage_root` using child, create a variant for it: see
cheme 20d168d
indentation and remove comment
cheme d797bd0
Remove some TODOs, fix compile error
cheme 27096aa
plaindb does not need to be keyspaceddb
cheme 3560acc
Merge branch 'master' into child-trie-soft-min
cheme c3fc432
bump impl_version
cheme 3e417eb
Merge branch 'master' into child-trie-soft-min
cheme 5af490f
fix and 2299
cheme 5a8dddd
Merge branch 'master' into child-trie-soft-min
cheme 8f04f00
Merge branch 'master' into child-trie-soft-min
cheme 8051179
fix keyspace insert and start proof (missing in higher level test case a
cheme 8eac118
remove todo of test
cheme a65f9f2
Merge branch 'master' into child-trie-soft-min
cheme d495ef5
Merge branch 'master' into child-trie-soft-min &
cheme 197d77a
- refactor api, use noderef of read only query (require and additional
cheme 2ea3c89
Remove SubTrieNode struct
cheme 99c45ea
put extension in encoding/decoding properly
cheme 3553ab2
SubTrie struct renaming (and single encode point)
cheme 47984fe
remove contract prefix, and make use of a child trie prefix.
cheme 2bf2d7b
fix for overlay before reverting
cheme bc7165c
fix2 for prefix in overlay
cheme 21c3acf
revert (will probably need two variant, but for rpc pr)
cheme 98b2fc3
break some lines
cheme 432cb10
Merge branch 'master' into child-trie-soft-min
cheme e266dfe
Add module specific seed to generator (accountid is undefined)
cheme 7f64652
Update core/primitives/src/subtrie.rs
cheme 999a26e
Merge branch 'master' into child-trie-soft-min and adapt rpc test
cheme 7bbd681
Merge branch 'child-trie-soft-min' of github.com:cheme/substrate into…
cheme 87f03b7
child trie additional prefix is bad design for primitive, removing it.
cheme f18e002
safer encoding of version.
cheme 0eaeca0
Merge branch 'master' into child-trie-soft-min (untested)
cheme b57319d
missing import
cheme 1f848d2
bump impl version
cheme 403df51
Merge branch 'master' into child-trie-soft-min
cheme 305b60a
Merge branch 'master' into child-trie-soft-min
cheme 423cfb1
correct version
cheme a0ffa31
fix typing
cheme 6e3bed7
Merge branch 'master' into child-trie-soft-min
cheme 7411146
misnamed storage key variables.
cheme 331be51
fix error messages.
cheme bc2935c
remove convenience constructor, remove unneeded pub on field.
cheme 5a87b6a
Merge branch 'master' into child-trie-soft-min
cheme f40400b
minor tweaks before reworking docs
cheme 9bc1ab7
First pass of documentation improvement.
cheme c073b21
do not refer to parent_key when it is ParentTrie:
cheme d15ca49
child trie renaming did exceed 100 character line.
cheme 0736b96
Link github issue for TODOs
cheme 9e0485d
Merge branch 'master' into child-trie-soft-min
cheme 586b50e
comment incorrect variable
cheme 65d7485
Merge branch 'master' into child-trie-soft-min
cheme 95a69b2
Makes child trie instantiation a bisschen more explicit.
cheme d089693
Merge branch 'master' into child-trie-soft-min
cheme ec69ae0
rename fetch and init trie function.
cheme 76ea14d
moved_child is a bad idea, just delete in top, if it is reinserted this
cheme b2050c8
moved map is correct (fix usage of child trie to return option<option<)
cheme 5a0cbe1
Add missing wasm boilerplate.
cheme 6e84810
remove moved_ct from overlay in favor to optional in pending.
cheme 7f5694f
Merge branch 'master' into child-trie-soft-min
cheme 5006d73
Use keyspace for storage_cache.
cheme b85508e
Comment of unsafety of `set_child` if directly exposed.
cheme 0c14777
Merge branch 'master' into child-trie-soft-min
cheme 10c4f58
use named fields.
cheme 453927b
Merge branch 'master' into child-trie-soft-min
cheme 349f9a5
Merge branch 'master' into child-trie-soft-min
cheme fc034fb
Refacto of keyspace to use static creation unique info.
cheme 45cfbd6
put child trie content under their own prefix (with common root with
cheme 4f9717e
Revert to storing keyspace in state approach.
cheme 7cb2d84
invalid asumption for `child_delta_trie_root`.
cheme c821a08
clean unused child storage key relative methods.
cheme c3ba830
Merge branch 'master' into child-trie-soft-min and
cheme acf9641
invalid comment
cheme 0050457
indent and remove deprecated comments/struct
cheme c36b91b
Make top trie write through keyspace db, this is not going fine because
cheme 9d3d9e2
Fix issue: prefixed_key already got the keyspace in prefix.
cheme 3db4da8
Merge branch 'master' into child-trie-soft-min
cheme 4348d70
Address review comment:
cheme 134a4bf
Merge branch 'master' into child-trie-soft-min
cheme 5325621
Restore auth version.
cheme 97118e8
Avoid confusing Option<Option< in result return of overlay.
cheme 0ed7f80
Missing fix from review on testing ext for set child trie (code from
cheme 8a6986a
Use fields for change trie storage.
cheme 7652de9
switch MapTransaction to a struct.
cheme 94c629e
Merge branch 'master' into child-trie-soft-min
cheme 7675740
Apply same encoding for parent root (compatible with implementation of a
cheme 90fba8a
Fix previous cherry pick
cheme d8c58c6
Addressing nits.
cheme 661ba2e
Avoid unused creation of child trie.
cheme 833e9ff
Create child trie id from additional storage state.
cheme 71bda12
update default encoding.
cheme 08b3062
Handle possible switch to multiple trie layer.
cheme 89f3cd5
Remove a redundancy on keyspaceddb instantiation.
cheme 834f52a
actually remove redundancy correctly
cheme 0445228
comment
cheme 75add99
Merge branch 'child-trie-soft-min-old' into child-trie-soft-min
cheme e70edab
Merge branch 'master' into child-trie-soft-min and apply review
cheme b8a0cd4
Merge branch 'master' into child-trie-soft-min
cheme 1514171
Merge branch 'master' into child-trie-soft-min
cheme a7da811
Fix new test cases.
cheme b96c523
Merge branch 'master' into child-trie-soft-min
cheme 865672d
Merge branch 'master' into child-trie-soft-min
cheme b6d7705
bump runtime version
cheme b45344c
Merge branch 'master' into child-trie-soft-min
cheme 517f95c
Merge branch 'master' into child-trie-soft-min
cheme 79a07de
Merge branch 'master' into child-trie-soft-min
cheme a027fb0
Some doc enhancement.
cheme b92655c
ChildRead correctly defined (previous definition was wrong).
cheme 8a875f4
child_trie 'is_updatable_with' to avoid already broken redundancy.
cheme fcd8bdb
fix system bench error.
cheme 3241fc4
Fix client doc rust code.
cheme ecac03b
Merge branch 'master' into child-trie-soft-min
cheme 10369b9
Merge branch 'master' into child-trie-soft-min
cheme 15a2967
Merge branch 'master' into child-trie-soft-min
cheme acc94e4
Merge branch 'master' into child-trie-soft-min
cheme 7d96338
Remove unused method (in favor of assimilate).
cheme ba7bdcb
Merge branch 'child-trie-soft-min' of github.com:cheme/polkadot into …
cheme aacea85
Merge branch 'master' into child-trie-soft-min
cheme 6789641
merge fix.
cheme 2b37160
Rename MapTransaction to StorageContent.
cheme b1183bd
Get subscription stuff from child-deletion branch:
cheme bc5653c
Merge branch 'master' into child-trie-soft-min
cheme 5ecfd19
update to master.
cheme baf89c8
Cast explicitelly for readability.
cheme 0f8bff9
bump spec version.
cheme 5a8576b
Merge branch 'master' into child-trie-soft-min
cheme 045ee32
Merge branch 'master' into child-trie-soft-min
cheme 58e6e41
Fix compilation.
cheme 70555c5
Merge branch 'master' into child-trie-soft-min with conflicts.
cheme 130e5e4
build passing, regression on extrinsics for a set_child (see new TODO).
cheme File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Merge branch 'master' into child-trie-soft-min
- Loading branch information
commit a65f9f2cbb658726830e4dd4a8cdc38423f652ff
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
You are viewing a condensed version of this merge commit. You can view the full changes here.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did use account_db trie_id (see other comments) as keyspace (and as subtrie parent location).
So there is a need for caching SubTrie struct. TODO issue for that ?
There is a possible optimization by putting SubTrie directly at Account_id location, this would only be possible by:
For both point it requires implementing a way to store subtrie with different encoder (and with additional info).
@thiolliere maybe this pr (not sure it will get merged there might be better way of fixing the collision), could be of interest regarding #1882 or #1883 .
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hmm I can also think of another anwser. The
trie_id: Option<&TrieId>
is already an optimisation that says: if there is a trie_id in direct_storage then you have to give me that I won't do the lookup from AccountId, so you can cache it for me.This thoses changes you introduce we can just say: if there is a subtrie associated to the account already then give it I won't do the lookup.
Having subtrie in AccoundInfo seems cool though but not mandatory here.
I don't know in which context this collision can happen I design things without taking this into consideration though. But interesting thanks
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes I see your optim, it is better design (that is the reason why I pinged you :)
without this pr it happens whenever two subtries are similar and content got pruned (for contract it should happen a lot). It only requires that both subtries got same branch path (also content (same proof would be more correct)) to the deleted value.
As long as we use a trie_id as subtrie key from account_id (merging account info and trie info) there is no need to take this into consideration.