-
Notifications
You must be signed in to change notification settings - Fork 668
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(state-sync): fix issue when untracking and then tracking a shard (#…
…12773) `should_catch_up_shard()` was recently modified to not catch up a shard that we tracked in the previous epoch, because we can just continue applying chunks for it. But `get_should_apply_chunk()` was not aware of this, and didn't properly handle this. In the simplest case, there was no bug, but there would have been a bug if the list of shards we don't currently track but will track in the next epoch contains some shards we used to track and some we didn't. Because in that case, when we apply the first block of the epoch, we mark it as not caught up, but then `get_should_apply_chunk()` treats all these shard IDs equally when deciding what chunks to apply, and just doesn't apply any non-tracked shards. So fix it by consolidating some logic in `EpochManager::cared_about_shard_prev_epoch_from_prev_block()` (similar to the other cares_about_shard* fns there), and then also checking this value in `get_should_apply_chunk()` to get logic consistent with `should_catch_up_shard()`
- Loading branch information
1 parent
532d157
commit 618ef69
Showing
5 changed files
with
222 additions
and
59 deletions.
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
Oops, something went wrong.