Skip to content

Fix nil pointers by returning errors instead of logging#1019

Open
thomaspanf wants to merge 1 commit intomasterfrom
fix-submission-logs
Open

Fix nil pointers by returning errors instead of logging#1019
thomaspanf wants to merge 1 commit intomasterfrom
fix-submission-logs

Conversation

@thomaspanf
Copy link
Member

This PR resolves a handful of nil pointers caused by missing fmt.Errorf statements, allowing the task to gracefully exit if the beacon node goes offline.

2026/02/24 21:35:57 WARNING: Primary Beacon client disconnected (Could not get beacon block data: Get "http://100.68.178.27:5052/eth/v2/beacon/blocks/2448518": dial tcp 100.68.178.27:5052: i/o timeout), using fallback...
An error occurred while searching for the withdrawn balance: no Beacon clients were ready
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x28 pc=0x135f6ad]

goroutine 1859 [running]:
github.com/rocket-pool/smartnode/rocketpool/watchtower.(*submitNetworkBalances).getMegapoolBalanceDetails(0xc0008382a0, {0x39, 0x92, 0x10, 0xe2, 0x72, 0xd3, 0xa9, 0x61, 0x0, ...}, ...)
	/home/tpan/dev/smartnode/rocketpool/watchtower/submit-network-balances.go:543 +0x56d
github.com/rocket-pool/smartnode/rocketpool/watchtower.(*submitNetworkBalances).getNetworkBalances.func2()
	/home/tpan/dev/smartnode/rocketpool/watchtower/submit-network-balances.go:398 +0x1c8
golang.org/x/sync/errgroup.(*Group).Go.func1()
	/home/tpan/go/pkg/mod/golang.org/x/sync@v0.16.0/errgroup/errgroup.go:93 +0x50
created by golang.org/x/sync/errgroup.(*Group).Go in goroutine 1647
	/home/tpan/go/pkg/mod/golang.org/x/sync@v0.16.0/errgroup/errgroup.go:78 +0x95

Steps to reproduce:

  1. Run the balance submissions watchtower task
  2. Disconnect your beacon node while getMegapoolBalanceDetails is looping over every megapool validator

A similar issue is present in a handful of other spots:

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.

1 participant