avoid calls to WeightForSet for the same activeset
dshulyak opened this issue · comments
Dmitry Shulyak commented
we compute and cache weight for every unique activeset. but when we start a node, we ask peers for all missed ballots layer by layer.
if we receive them at the same time code will try to compute WeightForSet for each ballot individually. if the number of simulateneously processed ballots is large it may trigger huge memory allocation.
the solution should be to compute WeightForSet only for the first ballot, and the rest should subscribe and wait until that computation has finished.