Skip to content

SyncStatus() can silently fail and return empty result #34

@lucasmt

Description

@lucasmt

The SyncStatus() function on chain_container.go can return an empty SyncStatus{} result, both directly in line 335 and via the call to c.vn.SyncStatus() in line 337:

func (c *simpleChainContainer) SyncStatus(ctx context.Context) (*eth.SyncStatus, error) {
if c.vn == nil {
if c.log != nil {
c.log.Warn("SyncStatus: virtual node not initialized")
}
return &eth.SyncStatus{}, nil
}
st, err := c.vn.SyncStatus(ctx)
if err != nil {
return nil, err
}
return st, nil
}

The function is called in a few places in the codebase, but they don't seem to check for the case when the return value is empty. This could cause the exceptional empty value to be processed like a valid status result.

Status

Fixed in PR #19543.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions