Page MenuHomePhabricator

[avalanche] Fix downloading proofs from peers that just inv'ed us
ClosedPublic

Authored by Fabien on Jul 20 2021, 14:43.

Details

Reviewers
PiRK
Group Reviewers
Restricted Project
Maniphest Tasks
Restricted Maniphest Task
Commits
rABC74fec65ca4ce: [avalanche] Fix downloading proofs from peers that just inv'ed us
Summary

There are rules to prevent any peer from requesting any proof for download:
1/ The proof must have been known for a long time, or
2/ The proof should have been recently inv'ed to the peer

There is a missing piece of code for the rule 2. A peer is allowed to request a proof immediately if he received an avahello message but not an inv message containing the proof id. This is the case for example when a node send a proof manually via the sendavalancheproof RPC.

This diff closes the gap and adds a test for this behavior. This comes in conflict with the broadcast test which needs a small adaptation.

Ref T1611.

Test Plan
ninja all check-all

Diff Detail

Repository
rABC Bitcoin ABC
Branch
avalanche_recent_inv_sendavalancheproof
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 16230
Build 32329: Build Diffbuild-without-wallet · build-clang-tidy · build-debug · build-clang · lint-circular-dependencies · build-diff
Build 32328: arc lint + arc unit