Skip to content

Fix nil pointer panic in deposits page#603

Merged
barnabasbusa merged 1 commit intomasterfrom
fix/deposits-nil-validator-panic
Mar 11, 2026
Merged

Fix nil pointer panic in deposits page#603
barnabasbusa merged 1 commit intomasterfrom
fix/deposits-nil-validator-panic

Conversation

@barnabasbusa
Copy link
Collaborator

@barnabasbusa barnabasbusa commented Mar 11, 2026

Fixing:

URL: /validators/deposits?v=transactions
  Time: 2026-03-11 11:38:32.422113953 +0000 UTC m=+941.757111511
  Version: git-2f8fe15

  Error:
  page call 59 panic: runtime error: invalid memory address or nil pointer dereference

  Stack Trace:
  goroutine 4846 [running]:
  runtime/debug.Stack()
      /opt/hostedtoolcache/go/1.25.8/arm64/src/runtime/debug/stack.go:26 +0x64
  github.com/ethpandaops/dora/services.(*FrontendCacheService).processPageCall.func1.1()
      /home/runner/work/dora/dora/services/frontendcache.go:166 +0x90
  panic({0x20b15c0?, 0x5a62ac0?})
      /opt/hostedtoolcache/go/1.25.8/arm64/src/runtime/panic.go:783 +0x120
  github.com/ethpandaops/dora/handlers.buildDepositsPageData({0x46c6da0, 0x400277a0f0}, 0xffffffffffffffff?, 0x32, {0x4002af73fb, 0xc})
      /home/runner/work/dora/dora/handlers/deposits.go:185 +0x7f0
  github.com/ethpandaops/dora/handlers.getDepositsPageData.func1(0x4003195f20)
      /home/runner/work/dora/dora/handlers/deposits.go:73 +0x2c
  github.com/ethpandaops/dora/services.(*FrontendCacheService).processPageCall.func1(0x4002ae4600?)
      /home/runner/work/dora/dora/services/frontendcache.go:211 +0x2a4
  created by github.com/ethpandaops/dora/services.(*FrontendCacheService).processPageCall in goroutine 4656
      /home/runner/work/dora/dora/services/frontendcache.go:160 +0x2dc

Summary

  • GetValidatorByIndex can return nil even when the validator index is known (e.g. during sync), but all three call sites in buildDepositsPageData dereferenced it without a nil check, causing a panic on /validators/deposits?v=transactions
  • Added nil guard to all three locations, falling back to "Deposited" status (consistent with the existing fallback when the validator index isn't found)

Test plan

  • Visit /validators/deposits?v=transactions during initial sync when validator state may be incomplete
  • Verify no panic occurs and deposits show "Deposited" status for validators not yet loaded

🤖 Generated with Claude Code

GetValidatorByIndex can return nil even when the validator index is
known (e.g. during sync). All three call sites in buildDepositsPageData
dereferenced the result without a nil check, causing a panic on the
/validators/deposits page.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@barnabasbusa barnabasbusa merged commit e3c08ba into master Mar 11, 2026
2 checks passed
@barnabasbusa barnabasbusa deleted the fix/deposits-nil-validator-panic branch March 11, 2026 11:49
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