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
Lint
Lint Not Applicable
Unit
Tests Not Applicable

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