HomePhabricator

[avalanche] Make the orphan pool only accept proofs that have valid but…

Description

[avalanche] Make the orphan pool only accept proofs that have valid but immature utxos

Summary:
Unlike transactions in the mempool, there is no real benefit to holding onto proofs with missing UTXOs. Since we already enforce UTXO age on the order of weeks, it's reasonable to expect users generating proofs to have UTXOs with confirmations.
This patch modifies the orphan pool to only track proofs that will be valid in the future, but have immature UTXOs. This also simplifies the logic considerably, so there are fewer edge cases to consider, making the orphan pool much easier to reason about.
A simple eviction-by-score mechanism can now be adopted to limit the pool size since the score can no longer be spoofed by claiming missing UTXOs.

Test Plan:

ninja check-avalanche check-functional-extended

Reviewers: #bitcoin_abc, Fabien

Reviewed By: #bitcoin_abc, Fabien

Subscribers: Fabien

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

Details

Provenance
sdulfariAuthored on Jun 22 2022, 23:03
sdulfariPushed on Jul 8 2022, 16:31
Reviewer
Restricted Project
Differential Revision
D11669: [avalanche] Make the orphan pool only accept proofs that have valid but immature utxos
Parents
rABCcdbcaa14daa3: [Chronik] Add `BlockHash` struct wrapping `Sha256d` to avoid mixing kinds of…
Branches
Unknown
Tags
Unknown