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.6k
Inner hashing of value in state trie (chainspec versioning). #8931
Closed
Closed
Changes from all commits
Commits
Show all changes
142 commits
Select commit
Hold shift + click to select a range
e026ea6
starting
cheme 5b1c550
Updated from other branch.
cheme 7e98291
setting flag
cheme 5d3a1b2
flag in storage struct
cheme 4256a40
fix flagging to access and insert.
cheme 5bb0b68
added todo to fix
cheme 7081864
also missing serialize meta to storage proof
cheme 3f1ee83
extract meta.
cheme 1bbdf35
Isolate old trie layout.
cheme e5feabf
failing test that requires storing in meta when old hash scheme is used.
cheme aa78ed6
old hash compatibility
cheme 045b097
Db migrate.
cheme 79a43dd
runing tests with both states when interesting.
cheme aa2e5c3
fix chain spec test with serde default.
cheme 91bd0aa
export state (missing trie function).
cheme 183b7b5
Pending using new branch, lacking genericity on layout resolution.
cheme 8511a40
extract and set global meta
cheme 270ed28
Update to branch 4
cheme b838e7e
fix iterator with root flag (no longer insert node).
cheme 30742b7
fix trie root hashing of root
cheme c620869
complete basic backend.
cheme a3b1039
Remove old_hash meta from proof that do not use inner_hashing.
cheme 693e38b
fix trie test for empty (force layout on empty deltas).
cheme 6e89b3a
Root update fix.
cheme c14e11c
Merge branch 'master' into state-update4
cheme f568794
debug on meta
cheme fb0ea03
Use trie key iteration that do not include value in proofs.
cheme cd98390
switch default test ext to use inner hash.
cheme 5ab0c01
small integration test, and fix tx cache mgmt in ext.
cheme 99ef85c
Proof scenario at state-machine level.
cheme 4d6aee8
trace for db upgrade
cheme 791acae
try different param
cheme b51eaa4
act more like iter_from.
cheme 715b1a5
Bigger batches.
cheme 3cdb0ed
Update trie dependency.
cheme ae1454f
drafting codec changes and refact
cheme c807f44
before removing unused branch no value alt hashing.
cheme a70ce70
alt hashing only for branch with value.
cheme 11f0d5a
fix trie tests
cheme cf0f0df
Hash of value include the encoded size.
cheme b721733
removing fields(broken)
cheme 2f8360f
fix trie_stream to also include value length in inner hash.
cheme 76b6d7a
triedbmut only using alt type if inner hashing.
cheme cfa0ecd
trie_stream to also only use alt hashing type when actually alt hashing.
cheme 60f7012
Refactor meta state, logic should work with change of trie treshold.
cheme 40ec2f7
Remove NoMeta variant.
cheme 204f51f
Remove state_hashed trigger specific functions.
cheme b62cdf5
pending switching to using threshold, new storage root api does not
cheme 74fb9c8
refactoring to use state from backend (not possible payload changes).
cheme 97a1aa6
Applying from previous state
cheme f4849a2
Remove default from storage, genesis need a special build.
cheme 4eabbde
rem empty space
cheme 18abb6e
Merge branch 'master' into state-update4-refact
cheme ae627f6
Catch problem: when using triedb with default: we should not revert
cheme 4706814
fix compilation
cheme 09d5cf6
Right logic to avoid switch on reencode when default layout.
cheme 906cd48
Clean up some todos
cheme 662eabe
remove trie meta from root upstream
cheme 17ac7cb
Merge branch 'master' into state-update4-refact
cheme ac0e019
update upstream and fix benches.
cheme 7e73a70
split some long lines.
cheme 3498d17
Merge branch 'master' into state-update4-refact
cheme 934021c
UPdate trie crate to work with new design.
cheme 1e40e6d
Finish update to refactored upstream.
cheme 602723e
update to latest triedb changes.
cheme 66ee72d
Clean up.
cheme 23c5db3
fix executor test.
cheme 03d93b2
rust fmt from master.
cheme b13ebd0
Merge branch 'master' into state-update4
cheme 93aaa4c
rust format.
cheme 66c832e
Merge branch 'master' into state-update4
cheme 89eba2b
Merge branch 'master' into state-update4
cheme 1e02c01
rustfmt
cheme 50ca652
alt hashing as trie backend parameter.
cheme bd394d5
initial config usage, needs global changes to use dedicated primitive
cheme 250ad02
update tests and remove state threshold key.
cheme b85b173
Base types for state versioning.
cheme 08e1f4b
Partial changes.
cheme 8f2eaea
fixes
cheme 46d78d0
finish switching, chainspec new issue to get genesis without
cheme cb0cc70
partial change (if not removing param, keep chainspec util).
cheme 7265bc2
pending
cheme 2e77b5a
pending TODO check state_version needed for Genesisbuild runtime trait.
cheme a036fdb
before restoring version param for build storage only
cheme c38f36e
No state for genesis storage building.
cheme 472addd
Revert test to use old method (less frame breakage).
cheme a6359b4
fix some tests.
cheme db0769e
default state version from proof to V0
cheme dc47bfb
storage proof estimate size fix
cheme bc95929
fix test trie to use right hashing
cheme b8430c6
fixes
cheme 5b1fab8
network test with migration.
cheme 1770305
wrong approach: only work for block import but not production.
cheme 4c48881
Merge branch 'master' into state-update4-migration
cheme 5371a09
fix warnings
cheme edfcfd5
cargo format.
cheme 5828a5b
migration digest definition
cheme 96223d7
check migration state and added todos
cheme f3a861d
tooling digest a bit.
cheme 503270a
guard in_mem against migration (state_versions inner field is
cheme 96aa053
fix
cheme d33dbc7
fix for empty
cheme 5b0d745
Merge branch 'master' into state-update4-migration
cheme 85e72b9
update trie dep
cheme 8ffd9e2
to revert
cheme c57a828
simplify (migrate from backend and inject payload if needed.
cheme b69ea5f
useless unsafe
cheme c2d9fef
to test
cheme 94c1f6c
Revert "to test"
cheme 7805fa7
fix state display
cheme 1dd52ab
quick additional logging
cheme 7898e49
Merge branch 'master' into state-update4
cheme a48970f
fix
cheme a5e6858
TODO about fundamental design issue
cheme 2178698
Remove migration related code.
cheme f04c0d9
bench to default trie and continue removing migration methods.
cheme bd03fdc
clean test api
cheme da50711
fix tests.
cheme c09ee87
Merge branch 'master' into state-update4-migration2
cheme 2b3b0f6
Merge branch 'state-update4-migration2' into state-update4
cheme e18c2d5
rust fmt
cheme 8847b90
remove unused emplace_ref
cheme 869e533
Revert "remove unused emplace_ref"
cheme b6590b2
minor change and remove unused code.
cheme b695af5
move state version for light client to blockchain struct
cheme 7db873e
Revert "move state version for light client to blockchain struct"
cheme 889b1a4
remove comment
cheme 0d91882
rem TODO
cheme ae4bdcb
remove todos
cheme 2c7e248
New trie code does update value on change.
cheme 3c529da
switch sp-trie code.
cheme 57324ae
clean old impl
cheme 0cbb7f1
fix tests
cheme 8dcc344
Merge branch 'master' into state-update4
cheme 091f348
update trie_db crate
cheme 0765151
clean
cheme c5a3548
cargo fmt
cheme 83e5553
encoding of storage proof with default state version of 0 length
cheme 4384ee6
use a single byte.
cheme 1d6aa2f
Fix comment on first byte (not a dead header).
cheme 03841c6
Merge branch 'master' into state-update4
cheme 70a3a32
Merge branch 'master' into state-update4
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
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -94,9 +94,8 @@ where | |
I: IntoIterator<Item = ClientResult<Option<Header::Hash>>>, | ||
{ | ||
use sp_trie::TrieConfiguration; | ||
Ok(sp_trie::trie_types::Layout::<Hasher>::trie_root(build_pairs::<Header, I>( | ||
cht_size, cht_num, hashes, | ||
)?)) | ||
Ok(sp_trie::Layout::<Hasher>::default() | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Note that default layout is not the trie with inner hashing, but old behavior which remains unchanged for cht, extrinsic root, and others. |
||
.trie_root(build_pairs::<Header, I>(cht_size, cht_num, hashes)?)) | ||
} | ||
|
||
/// Build CHT-based header proof. | ||
|
@@ -117,7 +116,9 @@ where | |
.into_iter() | ||
.map(|(k, v)| (k, Some(v))) | ||
.collect::<Vec<_>>(); | ||
let storage = InMemoryBackend::<Hasher>::default().update(vec![(None, transaction)]); | ||
// No inner hashing for cht. | ||
let backend: InMemoryBackend<Hasher> = sp_runtime::StateVersion::V0.into(); | ||
let storage = backend.update(vec![(None, transaction)]); | ||
let trie_storage = storage | ||
.as_trie_backend() | ||
.expect("InMemoryState::as_trie_backend always returns Some; qed"); | ||
|
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
Oops, something went wrong.
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.
In most bench and test, I did use
default
which is the inner hashed version of trie.