20 std::vector<NodeEvictionCandidate> eviction_candidates;
22 eviction_candidates.push_back({
23 fuzzed_data_provider.ConsumeIntegral<
NodeId>(),
24 std::chrono::seconds{fuzzed_data_provider.ConsumeIntegral<int64_t>()},
25 std::chrono::microseconds{fuzzed_data_provider.ConsumeIntegral<int64_t>()},
26 std::chrono::seconds{fuzzed_data_provider.ConsumeIntegral<int64_t>()},
27 std::chrono::seconds{fuzzed_data_provider.ConsumeIntegral<int64_t>()},
28 fuzzed_data_provider.ConsumeBool(),
29 fuzzed_data_provider.ConsumeBool(),
30 fuzzed_data_provider.ConsumeBool(),
31 fuzzed_data_provider.ConsumeIntegral<uint64_t>(),
32 fuzzed_data_provider.ConsumeBool(),
33 fuzzed_data_provider.ConsumeBool(),
35 fuzzed_data_provider.ConsumeBool(),
41 const std::vector<NodeEvictionCandidate> eviction_candidates_copy = eviction_candidates;
42 const std::optional<NodeId> node_to_evict =
SelectNodeToEvict(std::move(eviction_candidates));
44 assert(std::any_of(eviction_candidates_copy.begin(), eviction_candidates_copy.end(), [&node_to_evict](
const NodeEvictionCandidate& eviction_candidate) {
return *node_to_evict == eviction_candidate.id; }));
#define LIMITED_WHILE(condition, limit)
Can be used to limit a theoretically unbounded loop.
FUZZ_TARGET(node_eviction)
constexpr ConnectionType ALL_CONNECTION_TYPES[]
constexpr auto ALL_NETWORKS
std::optional< NodeId > SelectNodeToEvict(std::vector< NodeEvictionCandidate > &&vEvictionCandidates)
Select an inbound peer to evict after filtering out (protecting) peers having distinct, difficult-to-forge characteristics.