This repository was 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
Load sync states from the chain spec on the light client #7329
Closed
Closed
Changes from all commits
Commits
Show all changes
33 commits
Select commit
Hold shift + click to select a range
d3e8c97
Initial draft
expenses 1eb1297
Add an iterator that helps us get most items
expenses a118cea
Merge remote-tracking branch 'origin/master' into ashley-improve-sync…
expenses ccfb11d
Revert changes to grandpa
expenses b3e8f09
Merge remote-tracking branch 'origin/master' into ashley-improve-sync…
expenses 35a580a
Change fields to just be the grandpa authority set and babe epoch cha…
expenses a8f0966
Only use the fields we need from the shared authority set
expenses 833c007
Made a start at getting the sync state to load in substrate
expenses bad0a28
Add info to panic
expenses 96c1748
babe: example code to filter epoch changes tree
andresilva 3e7391b
babe: don't try to prune epoch changes tree to avoid unknown headers
andresilva 14cc62a
Merge remote-tracking branch 'origin/master' into ashley-improve-sync…
expenses b2b0860
Filter before saving
expenses 447b676
Merge remote-tracking branch 'origin/master' into ashley-improve-sync…
expenses fdd282f
Switch to RPC call
expenses 32c12ed
Merge remote-tracking branch 'origin/master' into ashley-improve-sync…
expenses 6a5db06
Merge branch 'ashley-improve-sync-state' into ashley-improve-sync-sta…
expenses 186e248
Merge remote-tracking branch 'origin/master' into ashley-improve-sync…
expenses a7f607e
Reset flaming fir network
ddorgan 40f19e2
Merge remote-tracking branch 'origin/dd-flamingfir-9' into ashley-imp…
expenses 7f28aa9
Revert "Only use the fields we need from the shared authority set"
expenses 5dd7405
Merge branch 'ashley-improve-sync-state' into HEAD
expenses 6e7855b
Merge remote-tracking branch 'origin/master' into ashley-improve-sync…
expenses 81ac0ab
Add babe_finalized_block_weight from `ashley-improve-sync-state-WIP-l…
expenses aac528b
Merge branch 'ashley-improve-sync-state' into ashley-improve-sync-sta…
expenses 3dd9357
Add sync state to flaming-fir.json
expenses 136231b
Fix rpc test
expenses d94adf1
Move sync state rpc stuff into sc-sync-state-rpc
expenses d56cafc
Merge remote-tracking branch 'origin/master' into ashley-improve-sync…
expenses 9a842ea
Merge branch 'ashley-improve-sync-state' into ashley-improve-sync-sta…
expenses a9b22d4
Update sync state
expenses 76afda0
Comment out CHT creation
expenses f14c1d9
Merge remote-tracking branch 'origin/master' into HEAD
expenses 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 |
|---|---|---|
|
|
@@ -110,7 +110,7 @@ pub(crate) fn write_epoch_changes<Block: BlockT, F, R>( | |
| } | ||
|
|
||
| /// Write the cumulative chain-weight of a block ot aux storage. | ||
| pub(crate) fn write_block_weight<H: Encode, F, R>( | ||
| pub fn write_block_weight<H: Encode, F, R>( | ||
|
Contributor
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. why not have a specific 'load_snapshot_state' method that is also public but makes it clear that in should not be use lighty? |
||
| block_hash: H, | ||
| block_weight: BabeBlockWeight, | ||
| write_aux: F, | ||
|
|
||
This file contains hidden or 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 |
|---|---|---|
|
|
@@ -1275,10 +1275,12 @@ impl<Block, Client, Inner> BlockImport<Block> for BabeBlockImport<Block, Client, | |
| // used by pruning may not know about the block that is being | ||
| // imported. | ||
| let prune_and_import = || { | ||
| /* | ||
|
Contributor
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. Wonder if light pruning method from https://github.com/paritytech/substrate/pull/6851/files would work here, really just a wild guess. |
||
| prune_finalized( | ||
| self.client.clone(), | ||
| &mut epoch_changes, | ||
| )?; | ||
| */ | ||
|
|
||
| epoch_changes.import( | ||
| descendent_query(&*self.client), | ||
|
|
@@ -1415,10 +1417,12 @@ pub fn block_import<Client, Block: BlockT, I>( | |
| // NOTE: this isn't entirely necessary, but since we didn't use to prune the | ||
| // epoch tree it is useful as a migration, so that nodes prune long trees on | ||
| // startup rather than waiting until importing the next epoch change block. | ||
| /* | ||
| prune_finalized( | ||
| client.clone(), | ||
| &mut epoch_changes.lock(), | ||
| )?; | ||
| */ | ||
|
|
||
| let import = BabeBlockImport::new( | ||
| client, | ||
|
|
||
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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.
I wonder if modifying tree_route to not fail on missing parent may be better, or if it could break some assumption and make existing code unsecure.