Fix key collision for child trie (#4162)
* In progress, runtime io must switch to future proof root + child_specific (unique id) + u32 type. * Switch interface, sr-io seems ok, rpc could use similar interface to sr-io, genesis json broken if there is child trie in existing encoding genesis. * test from previous implementation. * fix proving test. * Restore Keyspacedb from other branch, only apply to child trie. * Removing unneeded child_info from child root (child info are stored if things changed, otherwhise the root does not change). * Switch rpc to use same format as ext: more future proof. * use root from child info for trie backend essence. * Breaking long lines. * Update doc and clean pr a bit. * fix error type * Restore removed doc on merge and update sr-io doc. * Switch child storage api to use directly unique id, if managed id where to be put in place, the api will change at this time. * Clean deprecated host interface from child. * Removing assertion on child info (can fail depending on root memoization). * merging child info in the overlay when possible. * child iteration by prefix using child_info. * Using ChainInfo in frame support. ChainInfo gets redesign to avoid buffers allocation on every calls. * Add length of root to the data of child info. * comments * Encode compact. * Remove child info with root. * Fix try_update condition. * Comment Ext child root caching. * Replace tuples by struct with field * remove StorageTuple alias. * Fix doc tests, and remove StorageOverlay and ChildStorageOverlay aliases.
Showing
- substrate/bin/node/executor/src/lib.rs 103 additions, 82 deletionssubstrate/bin/node/executor/src/lib.rs
- substrate/bin/node/testing/src/client.rs 1 addition, 1 deletionsubstrate/bin/node/testing/src/client.rs
- substrate/client/api/src/backend.rs 2 additions, 2 deletionssubstrate/client/api/src/backend.rs
- substrate/client/api/src/light.rs 6 additions, 1 deletionsubstrate/client/api/src/light.rs
- substrate/client/chain-spec/src/chain_spec.rs 58 additions, 25 deletionssubstrate/client/chain-spec/src/chain_spec.rs
- substrate/client/db/src/lib.rs 70 additions, 27 deletionssubstrate/client/db/src/lib.rs
- substrate/client/db/src/storage_cache.rs 53 additions, 16 deletionssubstrate/client/db/src/storage_cache.rs
- substrate/client/executor/src/deprecated_host_interface.rs 0 additions, 133 deletionssubstrate/client/executor/src/deprecated_host_interface.rs
- substrate/client/executor/src/integration_tests/mod.rs 10 additions, 4 deletionssubstrate/client/executor/src/integration_tests/mod.rs
- substrate/client/finality-grandpa/src/tests.rs 1 addition, 1 deletionsubstrate/client/finality-grandpa/src/tests.rs
- substrate/client/network/src/chain.rs 5 additions, 2 deletionssubstrate/client/network/src/chain.rs
- substrate/client/network/src/protocol.rs 35 additions, 17 deletionssubstrate/client/network/src/protocol.rs
- substrate/client/network/src/protocol/light_dispatch.rs 10 additions, 1 deletionsubstrate/client/network/src/protocol/light_dispatch.rs
- substrate/client/network/src/protocol/message.rs 5 additions, 0 deletionssubstrate/client/network/src/protocol/message.rs
- substrate/client/rpc-api/src/state/mod.rs 8 additions, 0 deletionssubstrate/client/rpc-api/src/state/mod.rs
- substrate/client/rpc/src/state/mod.rs 27 additions, 5 deletionssubstrate/client/rpc/src/state/mod.rs
- substrate/client/rpc/src/state/state_full.rs 30 additions, 5 deletionssubstrate/client/rpc/src/state/state_full.rs
- substrate/client/rpc/src/state/state_light.rs 9 additions, 1 deletionsubstrate/client/rpc/src/state/state_light.rs
- substrate/client/rpc/src/state/tests.rs 34 additions, 9 deletionssubstrate/client/rpc/src/state/tests.rs
- substrate/client/src/cht.rs 2 additions, 2 deletionssubstrate/client/src/cht.rs
Please register or sign in to comment