Open crocodile-dentist opened 6 months ago
Instead of augmenting the state with an additional field, I think it's better to just pass PeerSelectionCounters
to the actions as an argument. This will be enough to make sure things are not reevaluated, and we don't clutter the state with extra cache-like fields.
A few monitoring activities (eg. jobPromoteColdPeer, etc) performed by the peer selection governor make a call to peerSelectionStateToCounters function whose result is used directly for tracing purposes. The main governor loop is again recalculating all results. PeerSelectionState record could be augmented with PeerSelectionCounters record, so that the results from the monitoring job could be re-used.