mirror of
https://github.com/paradigmxyz/reth.git
synced 2026-04-30 03:01:58 -04:00
feat(engine): require VALID latest FCU status before pruning (#3954)
This commit is contained in:
@@ -1710,10 +1710,15 @@ where
|
|||||||
// we're pending if both engine messages and sync events are pending (fully drained)
|
// we're pending if both engine messages and sync events are pending (fully drained)
|
||||||
let is_pending = engine_messages_pending && sync_pending;
|
let is_pending = engine_messages_pending && sync_pending;
|
||||||
|
|
||||||
// check prune events if pipeline is idle AND (pruning is running and we need to
|
// Poll prune controller if all conditions are met:
|
||||||
// prioritize checking its events OR no engine and sync messages are pending and we may
|
// 1. Pipeline is idle
|
||||||
// start pruning)
|
// 2. Pruning is running and we need to prioritize checking its events OR no engine and
|
||||||
if this.sync.is_pipeline_idle() && (this.is_prune_active() || is_pending) {
|
// sync messages are pending and we may start pruning
|
||||||
|
// 3. Latest FCU status is VALID
|
||||||
|
if this.sync.is_pipeline_idle() &&
|
||||||
|
(this.is_prune_active() || is_pending) &&
|
||||||
|
this.forkchoice_state_tracker.is_latest_valid()
|
||||||
|
{
|
||||||
if let Some(ref mut prune) = this.prune {
|
if let Some(ref mut prune) = this.prune {
|
||||||
match prune.poll(cx, this.blockchain.canonical_tip().number) {
|
match prune.poll(cx, this.blockchain.canonical_tip().number) {
|
||||||
Poll::Ready(prune_event) => {
|
Poll::Ready(prune_event) => {
|
||||||
|
|||||||
Reference in New Issue
Block a user