HomePhabricator

[avalanche] Drop stale votes and stale proofs

Description

[avalanche] Drop stale votes and stale proofs

Summary:
When Avalanche votes become stale, drop them. The caller (net_processing) can
decide what to do with an item that had its vote dropped. This patch handles
the stale proof case and leaves the stale block case to future work.

A stale proof is dropped from all proof pools and is not rejected. Peers
polling for this proof will get an UNKNOWN response. The rationale behind this
is stale proofs cannot be assumed to be rejected. It's possible that the proof
will eventually be accepted by the network in the future. It's better to wait
and see if a peer will share this proof with us later and vote again.

Stale blocks are not yet handled in any meaningful way and will be in a future
patch. While not ideal, it's safe to fallback on Nakamoto consensus for now.
Any blocks mined on top of a stale block or as a competing chaintip will kick
off new Avalanche votes, allowing the network to reconcile. This case should be
very rare since nodes propagate blocks aggressively.

Test Plan:

ninja check-functional

Reviewers: #bitcoin_abc, deadalnix

Reviewed By: #bitcoin_abc, deadalnix

Subscribers: deadalnix

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

Details

Provenance
sdulfariAuthored on May 24 2022, 23:35
sdulfariPushed on May 30 2022, 22:35
Reviewer
Restricted Project
Differential Revision
D11524: [avalanche] Drop stale votes and stale proofs
Parents
rABCe54e32f36cb7: [avalanche] Extract proof reception logic out of the avaproof message handling
Branches
Unknown
Tags
Unknown