Skip to content

PLEX-2794 N-09 fix inconsistent head snapshots#438

Open
dhaidashenko wants to merge 1 commit intofix/PLEX-2793-N-08-ensure-heads-not-nilfrom
fix/PLEX-2794-N-09-inconsistent-head-snapshots
Open

PLEX-2794 N-09 fix inconsistent head snapshots#438
dhaidashenko wants to merge 1 commit intofix/PLEX-2793-N-08-ensure-heads-not-nilfrom
fix/PLEX-2794-N-09-inconsistent-head-snapshots

Conversation

@dhaidashenko
Copy link
Copy Markdown
Contributor

Problem

The pollAndSaveLogs function derives on-chain status from latestBlocks and latestSafeBlock, but those helpers only clamp zero values and never verify the basic ordering finalized <= safe <= latest before the numbers are used and persisted. The resulting latestFinalizedBlockNumber drives the finalized backfill bound lastSafeBackfillBlock := latestFinalizedBlockNumber - 1, and the finalized / safe values are written into block checkpoints during getUnfinalizedLogs. If the poller observes a self-inconsistent head tuple, it can make poor control-flow decisions such as attempting out-of-range backfills or persisting inflated confirmation metadata that later feeds confirmed-read cutoffs through withConfs.

Fix

Use blocks with higher confidence if their block number is higher to guarantee latest >= safe >= finalized.

@github-actions
Copy link
Copy Markdown
Contributor

✅ API Diff Results - No breaking changes


📄 View full apidiff report

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