ouroboros-network icon indicating copy to clipboard operation
ouroboros-network copied to clipboard

Introduce PeerSelectionCounters in PeerSelectionState record

Open crocodile-dentist opened this issue 1 year ago • 1 comments

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.

crocodile-dentist avatar Apr 22 '24 10:04 crocodile-dentist

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.

coot avatar May 11 '24 20:05 coot