Skip to content

fix(sequencer): raise backfillMaxDepth to cover the reth v2.10.1 unpersisted window - #49

Open
panos-xyz wants to merge 1 commit into
mainfrom
fix/backfill-max-depth-reth-v2.10
Open

panos-xyz wants to merge 1 commit into
mainfrom
fix/backfill-max-depth-reth-v2.10

Conversation

@panos-xyz

Copy link
Copy Markdown

Summary

backfillMaxDepth bounds how far the execution layer's head may have regressed when a parent-not-found triggers a replay. #45 raised it to 32 for reth v2.5.2. morph-reth is moving to reth v2.10.1 (morph-l2/morph-reth#229), where the persistence defaults changed again. The ceiling is still persistence_backpressure_threshold + memory_block_buffer_target:

reth persistence_threshold memory_block_buffer_target backpressure_threshold max gap
v2.5.2 7 5 16 21
v2.10.1 50 5 100 105

At 32, a crash on v2.10.1 defaults that loses 33–105 blocks makes recovery a no-op: nothing is applied, the node logs Backfill refused: gap exceeds backfillMaxDepth, and it stops catching up.

State masking, which v2.10.1 enables by default (30 blocks), does not add to the ceiling. Masked blocks stay in the in-memory canonical chain and count against the backpressure threshold, and a restart after a crash unwinds to the start of the masked suffix.

Changes

  • backfillMaxDepth 32 → 128. Covers the v2.10.1 ceiling with margin.
  • backfillCacheCapacity 64 → 256. Keeps the cache at twice the depth, as before.
  • TestStateV2_Backfill_DepthBoundary gets a case for the 105-block v2.10.1 ceiling, and the constant's comment records the new numbers and the state-masking behaviour.

Memory: once a node has caught up, the same *BlockV2 objects are already held by recentBlocks (capacity 1000), so the larger cache retains no extra blocks. During blocksync only this cache holds them, which is at most 256 × 720 KiB = 180 MiB if every block is full.

Verification

  • go test ./sequencer/... -race -count=1 — pass

  • go vet ./sequencer/..., go build ./... — clean

  • The new case is a genuine regression test. Against the old value it fails with

    depth 105: backfill refused, want success: gap exceeds backfillMaxDepth: head 100 up to block 205, limit 32
    
  • The 105-block ceiling comes from reading the reth v2.10.1 source (crates/engine/primitives/src/config.rs, crates/engine/tree/src/tree/mod.rs, crates/node/builder/src/launch/common.rs). It has not been reproduced with a live crash.

Not addressed here

A deployment that tunes the EL above 128 (for example --engine.persistence-backpressure-threshold 512) still disables recovery and gets the explicit refusal log, the same limitation described in #45.

morph-l2/morph needs a tendermint dependency bump in node/go.mod to pick this up.

Follow-up to #43 and #45.

https://claude.ai/code/session_01UaJCgZJEQM11Ymk1kqg62A

…rsisted window

reth v2.10.1 raises the default persistence_backpressure_threshold to 100.
With memory_block_buffer_target at 5, a crash can regress the EL head by up
to 105 blocks, above the current limit of 32. A gap that wide is refused
outright and the node stops catching up.

Raise backfillMaxDepth to 128 and backfillCacheCapacity to 256. State masking
does not add to the ceiling: masked blocks stay in memory and count against
the backpressure threshold, and a restart after a crash unwinds to the start
of the masked suffix.

Claude-Session: https://claude.ai/code/session_01UaJCgZJEQM11Ymk1kqg62A
@panos-xyz
panos-xyz requested review from a team and dylanCai9 November 9, 2026 16:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant