Skip to content

fix(ledger): harden leader schedule cache#1453

Merged
wolf31o2 merged 1 commit intomainfrom
fix/leader-cache-feedback
Feb 17, 2026
Merged

fix(ledger): harden leader schedule cache#1453
wolf31o2 merged 1 commit intomainfrom
fix/leader-cache-feedback

Conversation

@wolf31o2
Copy link
Member

@wolf31o2 wolf31o2 commented Feb 17, 2026

Summary by cubic

Hardened the leader schedule cache to avoid races during start/stop and improved leader slot lookup near epoch boundaries to reduce false negatives.

  • Bug Fixes
    • Made scheduleComputeLoop consume a passed computeCh and set e.computeCh to nil on Stop to prevent sends after shutdown.
    • Guarded compute/store paths to no-op when the election is not running.
    • Fixed NextLeaderSlot to handle missing schedules safely and check the next epoch’s cache when near boundaries.
    • Stabilized tests by using atomic currentEpoch and waiting for the initial schedule.
    • Added .worktrees to .gitignore.

Written for commit f5c9e8f. Summary will update on new commits.

Signed-off-by: Chris Gianelloni <wolf31o2@blinklabs.io>
@wolf31o2 wolf31o2 requested a review from a team as a code owner February 17, 2026 18:10
Copy link

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 3 files

@wolf31o2 wolf31o2 merged commit 0a363c9 into main Feb 17, 2026
13 checks passed
@wolf31o2 wolf31o2 deleted the fix/leader-cache-feedback branch February 17, 2026 19:41
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.

2 participants