Skip to content

fix: start from current STH/checkpoint when no saved index exists#92

Open
gnana997 wants to merge 1 commit intod-Rickyy-b:static-ctfrom
certwatch-app:fix/recovery-index-condition
Open

fix: start from current STH/checkpoint when no saved index exists#92
gnana997 wants to merge 1 commit intod-Rickyy-b:static-ctfrom
certwatch-app:fix/recovery-index-condition

Conversation

@gnana997
Copy link

@gnana997 gnana997 commented Feb 3, 2026

Problem

When recovery is enabled but no saved index exists (first run or new log), the worker would start from index 0 and attempt to download billions of historical certificates.

In runTiledWorker, the condition w.ctIndex >= 0 is always true for uint64, so it never fetched the current checkpoint.

In runStandardWorker, if recovery was enabled, it used whatever ctIndex was set (including 0) without checking if it was a valid saved value.

Solution

Check w.ctIndex > 0 to determine if a valid saved index exists. If no saved index exists, fetch the current STH/checkpoint and start from there.

@gnana997 gnana997 changed the base branch from master to static-ct February 3, 2026 07:39
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