Page MenuHomePhabricator

[avalanche] Account for the avalanche outbound when checking for outbound eviction
ClosedPublic

Authored by Fabien on Jul 26 2022, 15:33.

Details

Summary

Periodically the node checks if there is more outbound that the maximum configured and evict any extra. The count of extra outbound did not take into account the avalanche outbounds and will evict way too early. This diff fixes this issue and add a unit test for the GetExtraFullOutboundCount() method.

Test Plan
ninja all check-all

Diff Detail

Repository
rABC Bitcoin ABC
Branch
avalanche_outbound_eviction
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 19725
Build 39169: Build Diffbuild-diff · build-debug · build-without-wallet · lint-circular-dependencies · build-clang-tidy · build-clang
Build 39168: arc lint + arc unit

Event Timeline

Fabien requested review of this revision.Jul 26 2022, 15:33
sdulfari added a subscriber: sdulfari.
sdulfari added inline comments.
src/test/net_tests.cpp
1008

Nit: Instead of hand picking values, just loop through some reasonable values and calculate the expected count from those.

This revision is now accepted and ready to land.Jul 26 2022, 15:42
src/test/net_tests.cpp
1008

Using computed values here will likely make the test less readable, I'll go ahead with this version