Skip to content

fix: send FinishedHeight using safe height when finalized unavailable#72

Open
init4samwise wants to merge 1 commit intomainfrom
samwise/eng-1830-wal-finishedheight-fix
Open

fix: send FinishedHeight using safe height when finalized unavailable#72
init4samwise wants to merge 1 commit intomainfrom
samwise/eng-1830-wal-finishedheight-fix

Conversation

@init4samwise
Copy link

Summary

When the host chain doesn't report finalized blocks (beacon client not synced, checkpoint sync incomplete, or testnet without proper finality reporting), the WAL grows unbounded because FinishedHeight is never sent to reth.

This was observed on Pecorino with the warning:

WARN WAL contains too many blocks and is not getting cleared. That will lead to increased disk space usage. Check that you emit the FinishedHeight event from your ExExes. blocks=177 threshold=128

Root Cause

In update_canon_heights(), FinishedHeight is only sent when finalized_ru_block_hash != genesis_ru_hash. When the host doesn't report finalized blocks, load_finalized_block_heights() returns { host: 0, rollup: 0 }, and FinishedHeight is never sent.

Fix

Add a fallback to use the safe block height for FinishedHeight when finalized blocks aren't available. Safe blocks are unlikely to reorg, making them a reasonable threshold for clearing the WAL.

If there's a reorg beyond the safe block, reth will replay from the WAL as expected.

Closes ENG-1830

When the host chain doesn't report finalized blocks (beacon client not synced,
checkpoint sync incomplete, or testnet without proper finality reporting), the
WAL grows unbounded because FinishedHeight is never sent.

This change adds a fallback to use the safe block height for FinishedHeight
when finalized blocks aren't available. Safe blocks are unlikely to reorg,
making them a reasonable threshold for clearing the WAL.

Closes ENG-1830
@init4samwise init4samwise requested a review from a team as a code owner February 7, 2026 01:28
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