Skip to content

fix(checkpoint): count checkpoint signatures once per checkpoint#85

Merged
minhd-vu merged 1 commit into
mainfrom
fix/checkpoint-signature-overcounting
Jun 11, 2026
Merged

fix(checkpoint): count checkpoint signatures once per checkpoint#85
minhd-vu merged 1 commit into
mainfrom
fix/checkpoint-signature-overcounting

Conversation

@minhd-vu

Copy link
Copy Markdown
Collaborator

Description

Checkpoint signatures are republished on every poll cycle, but refreshCheckpoint only scanned the newest block window and returned early when it found no NewHeaderBlock event. Between checkpoints that left the stored entry at Seen=false, so the observer re-incremented missed_checkpoint_signature (and signed_checkpoint) every poll until the next checkpoint, inflating the counters by roughly the checkpoint-interval / poll-interval ratio.

Track the last counted checkpoint via prevCheckpointID and, on the not-new path, mark the stored entry seen (as a fresh copy, since the previous pointer may still be in flight in an observer goroutine) so it is no longer counted on republish. The not-new path also skips the block/transaction lookups and signature recovery it no longer needs.

Add provider/rpc_test.go covering the dedup state machine across poll cycles, including the once-per-checkpoint regression.

Jira / Linear Tickets

Testing

  • Test A
  • Test B

Checkpoint signatures are republished on every poll cycle, but
refreshCheckpoint only scanned the newest block window and returned
early when it found no NewHeaderBlock event. Between checkpoints that
left the stored entry at Seen=false, so the observer re-incremented
missed_checkpoint_signature (and signed_checkpoint) every poll until
the next checkpoint, inflating the counters by roughly the
checkpoint-interval / poll-interval ratio.

Track the last counted checkpoint via prevCheckpointID and, on the
not-new path, mark the stored entry seen (as a fresh copy, since the
previous pointer may still be in flight in an observer goroutine) so it
is no longer counted on republish. The not-new path also skips the
block/transaction lookups and signature recovery it no longer needs.

Add provider/rpc_test.go covering the dedup state machine across poll
cycles, including the once-per-checkpoint regression.
@sonarqubecloud

Copy link
Copy Markdown

@minhd-vu minhd-vu merged commit 704b1c6 into main Jun 11, 2026
5 of 6 checks passed
@minhd-vu minhd-vu deleted the fix/checkpoint-signature-overcounting branch June 11, 2026 15:32
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