Skip to content

[SharovBot] execution: make ValidateChain non-blocking to fix flaky timeout - #21431

Open
erigon-copilot[bot] wants to merge 2 commits into
mainfrom
erigon-copilot/fix-validate-chain-flaky-timeout
Open

[SharovBot] execution: make ValidateChain non-blocking to fix flaky timeout#21431
erigon-copilot[bot] wants to merge 2 commits into
mainfrom
erigon-copilot/fix-validate-chain-flaky-timeout

Conversation

@erigon-copilot

Copy link
Copy Markdown
Contributor

Summary

  • ValidateChain blocked synchronously while holding the semaphore. Under -race on CI, executing high-gas blocks (228M gas) took long enough for the HTTP client timeout to fire, producing a non-retryable error in RetryEngine and causing context deadline exceeded failures in TestInvalidReceiptHashHighMgas.
  • Spawn validation work in a background goroutine (using bacgroundCtx) and return ExecutionStatusBusy when the caller's context is cancelled, matching the existing UpdateForkChoice async pattern in forkchoice.go.
  • Subsequent retries pick up the cached result from validHashes, so no work is lost.

Test plan

  • Ran TestInvalidReceiptHashHighMgas 10 consecutive times with -race flag — all passed
  • go build ./... passes with no errors
  • No test files modified

🤖 Generated with Claude Code

ValidateChain blocked synchronously while holding the semaphore.
Under -race on CI, executing high-gas blocks took long enough for
the HTTP client timeout to fire, producing a non-retryable error
in RetryEngine and causing "context deadline exceeded" failures.

Spawn validation work in a background goroutine (using bacgroundCtx)
and return ExecutionStatusBusy when the caller's context is cancelled,
matching the existing UpdateForkChoice async pattern. Subsequent
retries pick up the cached result from validHashes.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

Co-authored-by: Giulio Rebuffo <giulio.rebuffo@gmail.com>
@erigon-copilot
erigon-copilot Bot requested review from mh0lt and yperbasis as code owners May 26, 2026 21:57
@yperbasis yperbasis added this to the 3.6.0 milestone May 28, 2026
@yperbasis yperbasis modified the milestones: 3.6.0, 3.7.0, 3.8.0 Jun 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants