This repository has been archived by the owner on Nov 15, 2023. It is now read-only.
Babe: bad epoch index with skipped epochs and warp sync #13135
Merged
Merged
Changes from 7 commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
6df123d
Detect and correct epoch-index for skipped epochs
davxy 0b7cf3e
Code refactory
davxy 24c9c73
Epoch index should be also be fixed for secondary claims with VRF
davxy 5501bcd
Fix typo
davxy 7117e94
Make clippy happy
davxy 30ada17
Fix typo
davxy bdc3e40
Merge branch 'master' into babe-epoch-index-correction
davxy 404ed0f
Trigger pipeline
davxy File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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
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 don't know that much about consensus code, but we're making a clone just to get some index? can't we just get it without cloning epoch?
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.
See here #13135 (comment)
In short, what you say is true but:
the full clone is done to have a method that has "some generic sense", i.e. give me the epoch that corresponds to this
slot
with mostly the same data as the current one.A method that just returns an index and a slot should be something like:
epoch_index_and_start_slot_for_slot
. I find it more hacky and difficult for an user to understand why this method exists and why should be called on another epoch instance that has a different epoch index than the one that is returned.