Skip to content

fix(logpoller): replay lower boundary revalidation#603

Merged
jadepark-dev merged 6 commits intomainfrom
fix/replay-boundary-validation
Feb 16, 2026
Merged

fix(logpoller): replay lower boundary revalidation#603
jadepark-dev merged 6 commits intomainfrom
fix/replay-boundary-validation

Conversation

@jadepark-dev
Copy link
Copy Markdown
Collaborator

No description provided.

@jadepark-dev jadepark-dev marked this pull request as ready for review February 16, 2026 12:22
@jadepark-dev jadepark-dev requested a review from a team as a code owner February 16, 2026 12:22
Copilot AI review requested due to automatic review settings February 16, 2026 12:22
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates TON logpoller replay handling to revalidate the replay lower boundary (the stored prevBlock, i.e., fromBlock-1) during override application so replays are rejected if that boundary was pruned after the original Replay() request.

Changes:

  • Revalidate fromBlock-1 (or fromBlock when fromBlock==1) in applyReplayOverride() instead of revalidating fromBlock.
  • Adjust existing replay override tests to match the new validation target (prevBlock).
  • Add a new test case for the “prevBlock pruned between request and override” scenario.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
pkg/logpoller/replay.go Changes replay override revalidation to validate prevBlock (lower boundary) to better handle pruning between request and override.
pkg/logpoller/replay_test.go Updates comments/expectations for new validation behavior and adds a new rejection-path test.
Comments suppressed due to low confidence (1)

pkg/logpoller/replay.go:147

  • applyReplayOverride clears the replay state on validation failure after releasing the replay mutex. Since Replay() can be called concurrently while this validation is in-flight (and keeps status Pending), a newer replay request can be overwritten by clearReplayRequest(). Consider re-checking that the in-memory replay request still matches the validated fromBlock (and/or a request ID) before clearing, or downgrade status back to Requested when the request has changed so the newer request is not lost.
	_, err := lp.lookupRequestedReplayBlock(ctx, blockToValidate, currentMasterchainBlock)
	if err != nil {
		lp.lggr.Warnw("replay rejected", "error", err, "fromBlock", fromBlock)
		lp.clearReplayRequest()
		return blockRange, 0

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread pkg/logpoller/replay_test.go Outdated
Comment thread pkg/logpoller/replay_test.go
ogtownsend
ogtownsend previously approved these changes Feb 16, 2026
@jadepark-dev jadepark-dev merged commit 5683924 into main Feb 16, 2026
38 of 41 checks passed
@jadepark-dev jadepark-dev deleted the fix/replay-boundary-validation branch February 16, 2026 17:09
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.

4 participants