Skip to content

revert: remove GetVerifiedNonceForEpoch regression from PR #73#74

Merged
wcatz merged 1 commit intomasterfrom
revert/pr73-verified-nonce-regression
Feb 12, 2026
Merged

revert: remove GetVerifiedNonceForEpoch regression from PR #73#74
wcatz merged 1 commit intomasterfrom
revert/pr73-verified-nonce-regression

Conversation

@wcatz
Copy link
Copy Markdown
Owner

@wcatz wcatz commented Feb 12, 2026

Summary

  • Reverts PR Fix/pr71 coderabbit issues #73 which replaced all GetNonceForEpoch with GetVerifiedNonceForEpoch — a function that streams all ~2.1M blocks from Shelley genesis on every uncached nonce lookup, making the bot unable to calculate leader schedules
  • Removes scheduleNonceMatches which was called on every new block past stability window, every cached schedule lookup, and every epoch in backfill — each triggering a full chain replay
  • Fixes withQuery deadlock in localquery.go where connClosed channel was never closed if NewConnection() failed, causing the context-timeout path to hang forever
  • Keeps the one correct fix from PR Fix/pr71 coderabbit issues #73: backfillSchedules using epoch-1 for nonce lookup

What broke

PR #73 turned every fast DB lookup (~ms) into a full genesis-to-tip chain replay (~minutes). On pod restart with empty in-memory cache, every command (/leaderlog, /nonce, /nextblock) and every auto-trigger hung or timed out.

Test plan

  • go build ./... — clean
  • go vet ./... — clean
  • go test ./... — pass
  • Deploy and verify /leaderlog, /nonce, /nextblock respond in seconds not minutes

🤖 Generated with Claude Code

 regression)

PR #73 replaced all GetNonceForEpoch calls with GetVerifiedNonceForEpoch,
which recomputes nonces by streaming all ~2.1M blocks from Shelley genesis
on every uncached lookup. This made the bot unable to calculate leader
schedules — every nonce lookup either timed out or took minutes.

Changes:
- Revert all GetVerifiedNonceForEpoch -> GetNonceForEpoch (trust DB cache)
- Remove GetVerifiedNonceForEpoch function entirely
- Remove scheduleNonceMatches (called GetVerifiedNonceForEpoch on hot paths)
- Remove verifiedNonces in-memory cache (no longer needed)
- Keep backfillSchedules epoch-1 fix from PR #73 (correct bug fix)
- Fix withQuery deadlock: move close(connClosed) to top-level defer so it
  always fires even if NewConnection fails

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@wcatz wcatz merged commit b1c4fbb into master Feb 12, 2026
1 check passed
@wcatz wcatz deleted the revert/pr73-verified-nonce-regression branch February 12, 2026 16:09
wcatz added a commit that referenced this pull request Feb 18, 2026
 regression) (#74)

PR #73 replaced all GetNonceForEpoch calls with GetVerifiedNonceForEpoch,
which recomputes nonces by streaming all ~2.1M blocks from Shelley genesis
on every uncached lookup. This made the bot unable to calculate leader
schedules — every nonce lookup either timed out or took minutes.

Changes:
- Revert all GetVerifiedNonceForEpoch -> GetNonceForEpoch (trust DB cache)
- Remove GetVerifiedNonceForEpoch function entirely
- Remove scheduleNonceMatches (called GetVerifiedNonceForEpoch on hot paths)
- Remove verifiedNonces in-memory cache (no longer needed)
- Keep backfillSchedules epoch-1 fix from PR #73 (correct bug fix)
- Fix withQuery deadlock: move close(connClosed) to top-level defer so it
  always fires even if NewConnection fails

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
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