Skip to content

fix(engine): defer backfill action while persistence is active#23271

Open
ArshLabs wants to merge 1 commit intoparadigmxyz:mainfrom
ArshLabs:fix/defer-backfill-action-during-persistence
Open

fix(engine): defer backfill action while persistence is active#23271
ArshLabs wants to merge 1 commit intoparadigmxyz:mainfrom
ArshLabs:fix/defer-backfill-action-during-persistence

Conversation

@ArshLabs
Copy link
Copy Markdown

Summary

This change prevents backfill escalation signals from being dropped while persistence is active.

When a disconnected downloaded block triggers a backfill action during persistence, the action is now deferred and emitted as soon as persistence completes and backfill is idle.

Root Cause

Tree events can request backfill from disconnected downloaded blocks.

That request is forwarded to event emission, but the backfill event path previously returned early if persistence was in progress, which dropped the signal at that moment.

Changes

  • add a deferred backfill slot in engine tree handler state
  • defer BackfillAction emission while persistence is active instead of dropping it
  • flush deferred backfill action in the run loop once persistence and backfill are both idle
  • add a regression test covering defer-then-emit behavior

Why this is safe

Backfill and persistence are already mutually exclusive. The new behavior keeps that contract and only changes handling from drop to deferred handoff.

Testing

  • cargo build -p reth-engine-tree
  • cargo test -p reth-engine-tree --lib test_backfill_action_deferred_while_persistence_active
  • cargo +nightly fmt --check

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Backlog

Development

Successfully merging this pull request may close these issues.

1 participant