Skip to content

Commit

Permalink
Fix Sync Wait to wait until forest enters follow mode (#3660)
Browse files Browse the repository at this point in the history
  • Loading branch information
sudo-shashank authored Nov 7, 2023
1 parent b483f72 commit 2847589
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@

### Fixed

- [#3540](https://github.com/ChainSafe/forest/issues/3540) Fix forest-cli sync
wait to ensure that Forest is in the follow mode.

## Forest v0.15.2 "Defenestration"

### Breaking
Expand Down
9 changes: 8 additions & 1 deletion src/chain_sync/chain_muxer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -916,7 +916,14 @@ where
metrics::FOLLOW_NETWORK_ERRORS.inc();
self.state = ChainMuxerState::Idle;
}
Poll::Pending => return Poll::Pending,
Poll::Pending => {
let tp_tracker = self.worker_state.clone();
tp_tracker
.write()
.set_stage(crate::chain_sync::SyncStage::Complete);

return Poll::Pending;
}
},
}
}
Expand Down
1 change: 0 additions & 1 deletion src/chain_sync/tipset_syncer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -773,7 +773,6 @@ async fn sync_tipset_range<DB: Blockstore + Sync + Send + 'static>(
tracker.write().error(why.to_string());
return Err(why);
};
tracker.write().set_stage(SyncStage::Complete);

// At this point the head is synced and it can be set in the store as the
// heaviest
Expand Down

0 comments on commit 2847589

Please sign in to comment.