Skip to content

Commit 8cd278d

Browse files
authored
A0-3422: Fix major sync finalization problems (#1469)
# Description There was a race making finalization sometimes stop if it fell too far behind the head of the imported chain, this works around that problem. It also slows down some requests, to lower the amount of log spamming during major sync (still spammy tho). ## Type of change - Bug fix (non-breaking change which fixes an issue) # Checklist:
1 parent 14b840f commit 8cd278d

2 files changed

Lines changed: 5 additions & 3 deletions

File tree

finality-aleph/src/sync/handler/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -435,7 +435,7 @@ where
435435
header: J::Header,
436436
) -> Result<(), <Self as HandlerTypes>::Error> {
437437
if let Err(e) = self.forest.update_body(&header) {
438-
if matches!(e, ForestError::TooNew) {
438+
if matches!(e, ForestError::TooNew | ForestError::ParentNotImported) {
439439
self.missed_import_data
440440
.update(header.id().number(), &self.chain_status)
441441
.map_err(Error::ChainStatus)?;

finality-aleph/src/sync/service.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -133,8 +133,10 @@ where
133133
target: LOG_TARGET,
134134
"Initiating a request for highest justified block {:?}.", block_id
135135
);
136-
self.tasks
137-
.schedule_in(RequestTask::new_highest_justified(block_id), Duration::ZERO);
136+
self.tasks.schedule_in(
137+
RequestTask::new_highest_justified(block_id),
138+
Duration::from_millis(200),
139+
);
138140
}
139141

140142
fn request_block(&mut self, block_id: BlockIdFor<J>) {

0 commit comments

Comments
 (0)