-
Notifications
You must be signed in to change notification settings - Fork 829
Description
In turbine we prefetch staked nodes map for both epochs, and pick which one to use based on the slot in the shred we are looking at. Here we could apply a similar logic but instead of having 2 maps and trying to pick the correct one, we could have one map which stores the maximum of the stakes in the two epochs (current + next). This way we might admit slightly more nodes than strictly necessary, but we will never get confused about who can / can not connect. We can then update the map when root bank clears the epoch boundary. To avoid nodes with zero stake getting stuck in the map for the entire epoch, we could hold 2 maps, and only compute maximum when root bank is < 32 slots away from the boundary. This way nodes aquiring stake have ample time to connect, and we will not disconnect anyone too early.
Originally posted by @alexpyattaev in #8836 (comment)