Skip to content

fix state loding logic, do not retry loading missing states with high prio forever#598

Merged
pk910 merged 1 commit intomasterfrom
pk910/fix-state-loading-retry-logic
Mar 4, 2026
Merged

fix state loding logic, do not retry loading missing states with high prio forever#598
pk910 merged 1 commit intomasterfrom
pk910/fix-state-loading-retry-logic

Conversation

@pk910
Copy link
Copy Markdown
Member

@pk910 pk910 commented Mar 4, 2026

Problem: High-priority state requests that fail with 404 keep being sorted first in the loading queue indefinitely. The retry counts grow (30, 370, 740+) but they're still treated as high priority, starving low-priority requests like the epoch 0 synchronizer.

Fix: In the priority sorting (epochcache.go:348-349), high-priority status is now conditional on retryCount <= 3.
After 3 failed attempts, the request is demoted to low priority, allowing other requests to be processed first.

  • Added beaconStateHighPriorityRetryCount = 3 constant in requests.go:22
  • Modified the highPriority condition in the sort comparator to include && retryCount <= beaconStateHighPriorityRetryCount

The existing "probably bad" threshold (beaconStateRetryCount = 10) still applies as a separate layer — requests with >10 retries are sorted last regardless.

@pk910 pk910 enabled auto-merge March 4, 2026 16:22
@pk910 pk910 merged commit 55a346f into master Mar 4, 2026
2 checks passed
@pk910 pk910 deleted the pk910/fix-state-loading-retry-logic branch March 4, 2026 16:31
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