HomePhabricator

[avalanche] Orphan the conflicting proofs rather than ignoring them

Description

[avalanche] Orphan the conflicting proofs rather than ignoring them

Summary:
A new proof with conflicting utxos is currently discarded entirely. This might be an otherwise valid proof, and it might become valid in the future if the peers containing the conflicting utxos are invalidated.

This diff adds such conflicting proofs to the orphan pool. As a consequence:

  • It makes it easy for the processor to determine if a proof has been accepted (in the proof pool), rejected (in the orphan pool), or invalidated (in neither of these).
  • It makes it possible to retrieve a conflicting proof very easily from its proof id using the a simple PeerManager::getProof() call, that can be used to fix the actual O(n²) that occurs on the proof vote. This will be done in a follow-up.

Ref T1854.

Depends on D10383.

Test Plan:

ninja all check-all

Reviewers: #bitcoin_abc, deadalnix

Reviewed By: #bitcoin_abc, deadalnix

Subscribers: deadalnix

Maniphest Tasks: T1854

Differential Revision: https://reviews.bitcoinabc.org/D10377

Details

Provenance
FabienAuthored on Oct 21 2021, 15:43
FabienPushed on Oct 27 2021, 07:21
Reviewer
Restricted Project
Differential Revision
D10377: [avalanche] Orphan the conflicting proofs rather than ignoring them
Parents
rABC9fb3623e16e1: [avalanche] Refactor the vote records to inv extraction loop
Branches
Unknown
Tags
Unknown
Tasks
Restricted Maniphest Task