Skip to content

state query for single node fetches all megapool details #1023

@jshufro

Description

@jshufro

createNetworkStateForNode is used in smart node to query the state of the network for a single node operator in many of its low-touch tasks.

However, it appears to query the state for every single node's megapool details:

state.MegapoolValidatorGlobalIndex, err = rpstate.GetAllMegapoolValidators(m.rp, contracts)

This causes a large amount of wasted work in the rocketpool_node daemon.

The code is also not particularly DRY. I recommend refactoring so that createNetworkStateForNode and createNetworkState share an implementation, and pass through an optional list of nodes for which to query the state (empty or nil list means all)

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