Skip to content

fix: P0 correctness bugs (halt detection, hangs, panic, docs) - #57

Merged
auricom merged 11 commits into
mainfrom
recur/caramel-omelet
Oct 20, 2026
Merged

auricom merged 11 commits into
mainfrom
recur/caramel-omelet

Conversation

@auricom

@auricom auricom commented Oct 20, 2026 •

Copy link
Copy Markdown
Collaborator

Fixes the remaining P0 issues from the optimization roadmap (#53). The fifth P0 issue, #35 (Celestia auth token), was already fixed on main by #55, so this PR no longer touches the Celestia client.

Changes

#34: time_since_last_block never grows on a halted chain

pkg/exporters/drift/drift.go reset the gauge on every successful poll, so a halt alert could never fire.

  • The gauge is now reset only when the reference height goes up (lastHeight). A flat or decreasing height leaves it alone.
  • Removed the extra reset that ran once per full node.

#36: process hangs when one exporter fails; --duration exits 1

  • pkg/metrics/server.go now uses errgroup.WithContext. When one exporter fails, the HTTP server and the other exporters stop, and the process exits instead of staying up as a zombie.
  • cmd/monitor.go now treats context.DeadlineExceeded (from --duration) as a clean exit.

#37: verifier panic at shutdown

pkg/exporters/verifier/verifier.go no longer closes blockQueue. Workers exit on ctx.Done(). This removes a send-on-closed-channel panic that delayed re-queue goroutines could trigger.

#38: README documented flags and modes that don't exist

Tests

New tests for each fix:

  • drift_test.go: fails on the old code.
  • server_test.go: reproduces the hang without the fix.
  • verifier_test.go: workers stop on cancel.

Results, after merging the latest main (#55, #56):

  • go test -race ./... passes.
  • golangci-lint v2.15.0 reports 0 issues.
  • gofmt -l reports nothing.

Note

The drift test uses real 1s polls with about 0.3–0.5s of slack. If it turns flaky in CI, the follow-up is to inject the ticker.

Fixes #34
Fixes #36
Fixes #37
Fixes #38

🤖 Generated with Claude Code

auricom and others added 10 commits October 20, 2026 11:47
Fixes #38

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Fixes #35

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…vances

Fixes #34

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
… panic at shutdown

Fixes #37

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…adline as clean exit

Fixes #36

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Oct 20, 2026 •

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration
  • Configuration used: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: f59a922e-62e4-4641-be87-d4d8e69be62d
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

# Conflicts:
#	internal/clients/celestia/client_test.go
@auricom auricom changed the title fix: P0 correctness bugs (halt detection, Celestia auth, hangs, panic, docs) fix: P0 correctness bugs (halt detection, hangs, panic, docs) Oct 20, 2026
@auricom
auricom merged commit eeb8416 into main Oct 20, 2026
4 checks passed
@auricom
auricom deleted the recur/caramel-omelet branch October 20, 2026 10:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment