feat(chain)!: Use a more granular state machine for IBD#1095
Open
Davidson-Souza wants to merge 1 commit into
Open
feat(chain)!: Use a more granular state machine for IBD#1095Davidson-Souza wants to merge 1 commit into
Davidson-Souza wants to merge 1 commit into
Conversation
11 tasks
jaoleal
reviewed
May 27, 2026
lorenzolfm
reviewed
May 27, 2026
a8866cc to
5a48287
Compare
Member
Author
|
Pushed 5a48287:
|
Member
|
I think pub enum IBDSate {
HeaderSync(u32), // header height
BlockDownload(u32), // block height
Backfill(u32), // backfill height
Done,
}Or maybe even: pub enum IBDSate {
HeaderSync(u32), // header height
BlockDownload(u32), // block height
Done { backfill: Option<u32> },
} |
Member
Author
Backfill is harder because it uses a partial chainstate instead of the regular one. We would need to propagate progress back to the node and into the chain to know that. The others are fine. |
Member
Author
|
Actually, is this really needed? You can get this from already existing methods. Edit: if this was a notification it would make more sense |
Instead of just true/false, this commit tells where we are on IBD. It can either be DownloadingHeaders, DowloadingBlocks or Done.
5a48287 to
9dd47cb
Compare
Member
Author
|
Fixed a typo with the enum name. |
| @@ -130,7 +116,7 @@ impl<T: ChainStore> ChainStateBuilder<T> { | |||
| } | |||
|
|
|||
| /// Enable or disable Initial Block Download (IBD) mode. | |||
Collaborator
There was a problem hiding this comment.
I think this comment needs to be changed, because now it sets the IBD status.
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Description and Notes
Related to #1089
Instead of just true/false, this commit tells where we are on IBD. It can either be
DownloadingHeaders,DownloadingBlocksorDone.