revert: remove GetVerifiedNonceForEpoch regression from PR #73#74
Merged
revert: remove GetVerifiedNonceForEpoch regression from PR #73#74
Conversation
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
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
GetNonceForEpochwithGetVerifiedNonceForEpoch— a function that streams all ~2.1M blocks from Shelley genesis on every uncached nonce lookup, making the bot unable to calculate leader schedulesscheduleNonceMatcheswhich was called on every new block past stability window, every cached schedule lookup, and every epoch in backfill — each triggering a full chain replaywithQuerydeadlock in localquery.go whereconnClosedchannel was never closed ifNewConnection()failed, causing the context-timeout path to hang foreverbackfillSchedulesusingepoch-1for nonce lookupWhat 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 ./...— cleango vet ./...— cleango test ./...— pass/leaderlog,/nonce,/nextblockrespond in seconds not minutes🤖 Generated with Claude Code