Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix nil pointer panic & make system routines more resilient against panics #220

Merged
merged 2 commits into from
Jan 21, 2025

Conversation

pk910
Copy link
Member

@pk910 pk910 commented Jan 21, 2025

Fix for a nil pointer panic from the system contract indexers when processing requests before the validator set is fully loaded:

time="2025-01-21T14:53:15Z" level=error msg="uncaught panic in WithdrawalIndexer.runWithdrawalIndexerLoop subroutine: runtime error: invalid memory address or nil pointer dereference, stack: goroutine 4901 [running]:
runtime/debug.Stack()\n\t/opt/hostedtoolcache/go/1.22.10/x64/src/runtime/debug/stack.go:24 +0x5e
github.com/ethpandaops/dora/utils.HandleSubroutinePanic({0x1502234, 0x2a})
  /home/runner/work/dora/dora/utils/process.go:20 +0xe5\npanic({0x1352e00?, 0x363fe30?})\n\t/opt/hostedtoolcache/go/1.22.10/x64/src/runtime/panic.go:770 +0x132
github.com/ethpandaops/dora/indexer/execution.(*WithdrawalIndexer).parseRequestLog(0xc0088fd3b0, 0xc009d780b0, 0xc00c354a88)
  /home/runner/work/dora/dora/indexer/execution/withdrawal_indexer.go:175 +0x1ee
github.com/ethpandaops/dora/indexer/execution.(*WithdrawalIndexer).processRecentTx(0xc0088fd3b0, 0xc009d780b0, 0xc00a21c1c0, 0xc0101ac508, {0xea, 0xdd, 0xb5, 0xdc, 0x21, 0xab, ...}, ...)
  /home/runner/work/dora/dora/indexer/execution/withdrawal_indexer.go:133 +0x90
github.com/ethpandaops/dora/indexer/execution.(*contractIndexer[...]).processRecentBlocksForFork(0x2d625c0, 0xc00c354a80)
  /home/runner/work/dora/dora/indexer/execution/contract_indexer.go:517 +0xfa3
github.com/ethpandaops/dora/indexer/execution.(*contractIndexer[...]).processRecentBlocks(0x2d625c0)
  /home/runner/work/dora/dora/indexer/execution/contract_indexer.go:345 +0x89
github.com/ethpandaops/dora/indexer/execution.(*contractIndexer[...]).runContractIndexer(0x2d625c0)
  /home/runner/work/dora/dora/indexer/execution/contract_indexer.go:132 +0xb1
github.com/ethpandaops/dora/indexer/execution.(*WithdrawalIndexer).runWithdrawalIndexerLoop(0xc0088fd3b0)
  /home/runner/work/dora/dora/indexer/execution/withdrawal_indexer.go:100 +0x85
created by github.com/ethpandaops/dora/indexer/execution.NewWithdrawalIndexer in goroutine 1
  /home/runner/work/dora/dora/indexer/execution/withdrawal_indexer.go:82 +0x4d6
" error="runtime error: invalid memory address or nil pointer dereference"

This PR also add an automatic restart for important system routines on panics.

@pk910 pk910 merged commit dbc8579 into master Jan 21, 2025
1 check passed
@pk910 pk910 deleted the pk910/fix-nil-pointer-in-contract-indexer branch January 21, 2025 15:20
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