Page MenuHomePhabricator

[avalanche] Erase the avalanche nodes that get disconnected
ClosedPublic

Authored by Fabien on Apr 4 2022, 19:47.

Details

Summary

Right now only the nodes that failed to get queried after an attempt are removed from the avalanche datastructure. That means that there is no mechanims for removing nodes that never get selected for polling or are pending a proof should they get disconnected.

This diff addresses this issue by having the avalanche processor implementing the NetEventsInterface and allowing the CConnman to take several of these interfaces. By doing so the processor gets notified on each node disconnection via the FinalizeNode method and can handle the node removal properly.

This design would benefit from being turned into a proper notification handler with a register/unregister interface, but this is out of scope for this diff.

Depends on D11300 and D11301 (prevent reverse lock on shutdown).

Test Plan

With Clang and Debug:

ninja all check-all

Run the ASAN and TSAN builds.

Diff Detail

Repository
rABC Bitcoin ABC
Branch
avalanche_delete_disconnected_nodes
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 18725
Build 37241: Build Diffbuild-diff · lint-circular-dependencies · build-debug · build-without-wallet · build-clang-tidy · build-clang
Build 37240: arc lint + arc unit

Event Timeline

Fabien requested review of this revision.Apr 4 2022, 19:47
tyler-smith added a subscriber: tyler-smith.

Nice, this looks a good way to catch-all cleanup all disconnections.

This revision is now accepted and ready to land.Apr 6 2022, 06:32