vegaprotocol / data-node

A rich API server for Vega Protocol
https://vega.xyz
Other
3 stars 1 forks source link

Use of rankingEvents to determine existence of nodes in an epoch is unstable #627

Closed wwestgarth closed 2 years ago

wwestgarth commented 2 years ago

Problem encountered

In this commit a change was made to use the presence of rankingData for an epoch to determine whether a node existed in that epoch. This is so that when nodes announce themselves, they don't suddenly appear in the epoch data for the past.

The problem is that there is a small amount of time between the data-node receiving a new epoch event, and it receiving the ranking-data events for that epoch where if you asks for a node list, it may be incomplete.

The rankingData probably isn't the most robust way to determine when a node exist from. We should instead add an epochSeq field to the ValidatorUpdate event so that when a node joins or leaves, this event will tell us exactly for which epoch that happened in.

Observed behaviour

Sometimes node disappear when quering all nodes if done on an epoch boundary.

Expected behaviour

All nodes should always be reported if the exist.

Additional context

Add any other context about the problem here including; system version numbers, components affected.

Definition of Done

ℹ️ Not every issue will need every item checked, however, every item on this list should be properly considered and actioned to meet the DoD.

Before Merging

After Merging