Page MenuHomePhabricator

[avalanche] Cleanup dangling proofs
ClosedPublic

Authored by Fabien on Jun 23 2022, 12:32.

Details

Reviewers
sdulfari
Group Reviewers
Restricted Project
Commits
rABC80b91691e44b: [avalanche] Cleanup dangling proofs
Summary

This removes the proofs attached to dangling peers, i.e. the peers with no node that have been registered for some time. This means that we will discard the proof if no node claimed it or if they disconnected. This will also sink the conflicting pool as the proofs will be pulled back to valid, and eventually cleanup up the same way if no node attached to it as well.
The callsite for this method will be added in a follow up with the associated functional tests.

Test Plan
ninja check-avalanche

Diff Detail

Repository
rABC Bitcoin ABC
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

Fabien requested review of this revision.Jun 23 2022, 12:32
sdulfari added inline comments.
src/avalanche/peermanager.cpp
796 ↗(On Diff #34102)

Can't you just rejectProof() here? Why collect danglingProofIds?

src/avalanche/peermanager.cpp
796 ↗(On Diff #34102)

I don't want to erase the items while looping over them

This revision is now accepted and ready to land.Jun 24 2022, 15:15
This revision was automatically updated to reflect the committed changes.