Skip to content

fix(aggregator): guard nil subscription in SubscribeToNewTasksV3 error goroutine - #2294

Open
Sertug17 wants to merge 1 commit into
yetanotherco:testnetfrom
Sertug17:fix/nil-subscription-panic-avs-subscriber
Open

fix(aggregator): guard nil subscription in SubscribeToNewTasksV3 error goroutine#2294
Sertug17 wants to merge 1 commit into
yetanotherco:testnetfrom
Sertug17:fix/nil-subscription-panic-avs-subscriber

Conversation

@Sertug17

Copy link
Copy Markdown

Closes #2293

Problem

When the primary RPC WebSocket subscription fails on startup but the fallback succeeds, the error-handling goroutine called sub.Err() on a nil event.Subscription interface causing an immediate nil pointer dereference panic that crashes the aggregator.

Fix

Introduce nilSafeErrCh() which returns a never-sending channel when the subscription is nil. The select statement in the goroutine now degrades gracefully instead of panicking. The channel variable is also refreshed after each successful resubscription so the fix stays effective for the lifetime of the goroutine.

Reproduction

  1. Start aggregator with primary RPC unreachable, fallback reachable
  2. SubscribeToNewTasksV3Retryable returns (nil, err) for main
  3. Error goroutine starts → sub.Err() panics immediately

…r goroutine

When the primary RPC WebSocket subscription fails on startup but the fallback
succeeds, the error-handling goroutine called sub.Err() on a nil event.Subscription
interface, causing an immediate nil pointer dereference panic.

Introduce nilSafeErrCh() which returns a never-sending channel when the
subscription is nil, so the select statement in the goroutine degrades
gracefully instead of panicking.

Resubscription after a recovered error now also updates the local channel
variable (subErrCh / subFallbackErrCh) so the fix stays effective throughout
the lifetime of the goroutine.

Fixes yetanotherco#2293
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.

[Bug] Nil pointer panic in SubscribeToNewTasksV3 error handling goroutine when primary RPC subscription fails

2 participants