fix nil pointer panic in check_consensus_sync_status#157
Open
yperbasis wants to merge 1 commit intoethpandaops:masterfrom
Open
fix nil pointer panic in check_consensus_sync_status#157yperbasis wants to merge 1 commit intoethpandaops:masterfrom
yperbasis wants to merge 1 commit intoethpandaops:masterfrom
Conversation
When GetNodeSyncStatus returns an error, syncStatus is nil, but getClientInfo dereferences it unconditionally. This causes a panic when a consensus client is temporarily unreachable (e.g. during initial network bootstrap before genesis). The execution sync status task already handles this correctly with a nil guard; apply the same pattern here. Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
qu0b
approved these changes
Apr 11, 2026
qu0b
reviewed
Apr 11, 2026
| Optimistic: syncStatus.IsOptimistic, | ||
| SyncHead: syncStatus.HeadSlot, | ||
| SyncDistance: syncStatus.SyncDistance, | ||
| Name: client.Config.Name, |
Member
There was a problem hiding this comment.
Consider setting variables explicitly rather than letting golang use defaults here:
if syncStatus == nil {
// RPC failed - return skeletal info without dereferencing
return &ClientInfo{
Name: client.Config.Name,
Synchronizing: true, // Sentinel: we don't know, assume unhealthy
SyncHead: 0,
SyncDistance: 0,
}
} 1d5b002 to
4321d7d
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
check_consensus_sync_statuswhenGetNodeSyncStatusreturns an errorsyncStatusisnil, butgetClientInfodereferences it unconditionally — causing a paniccheck_execution_sync_statustask already has this nil guard; this applies the same patternPanic trace from CI
Observed in Erigon CI glamsterdam Kurtosis tests: https://github.com/erigontech/erigon/actions/runs/24228480466/job/70734695754
Test plan
check_consensus_sync_statusno longer panics when a CL client is unreachable during startupClientInfofor failed clients hasNamepopulated and sync fields zeroed