Pick a flood's channels without copying the peer list A flood picked its channels by copying every peer into a deque, shuffling the whole list with the random pool and cutting it down to the fanout, and the principal representative floods sorted every known representative into a multimap for each vote. The channel container now draws the fanout in one pass over the peers by reservoir sampling, uniform among the channels that pass the filter, with no copy and no state between calls. The floods that leave principal representatives out sample twice the fanout and keep the first candidates that are not principal, checked outside the channel lock because the crawler holds its own lock while it asks the container for peers. A sample is shuffled before it is returned, since its slots keep the walk order of the first channels, and keeping the front of an unshuffled sample would favour the oldest connections. The crawler hands the floods its principal channels straight from its index, and the ordered list it still builds for the solicitor and RPC sorts a vector instead of filling a multimap. The targets benchmark measures the sampler now. Tests pin a sample's size, filter and order, and that a sample without principal representatives leaves them out and picks fairly among the rest. Both fairness tests fail on a sample left in walk order.
__________
Type: commit
Hash: bd4761040e799749e3fa815f37a57d1021790413
Created: today
__________
gr0v1ty/nano-node:bd4761040e799749e3fa815f37a57d1021790413
| Test Case | Status | Duration | Median Deviation | Log | Graph |
|---|