diff --git a/CHANGELOG.md b/CHANGELOG.md index 5aa57e9b6748..119e1ce21d8e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -57,6 +57,8 @@ - [#6234](https://github.com/ChainSafe/forest/pull/6234) Support `input` as an alias for `data` in `eth_call` and `eth_estimateGas` RPC methods. +- [#6235](https://github.com/ChainSafe/forest/pull/6235) Fixed a potential deadlock in chain follower when handling fork(s). + ## Forest v0.30.2 "Garuda" This is a non-mandatory release that brings important enhancements to Forest's tooling capabilities, Ethereum RPC compatibility, and F3 integration. diff --git a/src/chain_sync/chain_follower.rs b/src/chain_sync/chain_follower.rs index a6341b8ea953..fd958ee4eee7 100644 --- a/src/chain_sync/chain_follower.rs +++ b/src/chain_sync/chain_follower.rs @@ -584,7 +584,7 @@ impl SyncStateMachine { chains } - fn is_validated(&self, tipset: &FullTipset) -> bool { + fn is_parent_validated(&self, tipset: &FullTipset) -> bool { let db = self.cs.blockstore(); self.stateless_mode || db.has(tipset.parent_state()).unwrap_or(false) } @@ -605,7 +605,7 @@ impl SyncStateMachine { } else if parent_ts.epoch() >= head_ts.epoch() { false } else { - self.is_validated(&parent_ts) + self.is_parent_validated(tipset) } } else { false @@ -711,7 +711,7 @@ impl SyncStateMachine { } fn mark_validated_tipset(&mut self, tipset: Arc, is_proposed_head: bool) { - if !self.is_validated(&tipset) { + if !self.is_parent_validated(&tipset) { tracing::error!(epoch = %tipset.epoch(), tsk = %tipset.key(), "Tipset must be validated"); return; }