Page MenuHomePhabricator

[avalanche] Make sure AlreadyHaveProof always returns true for the local proof
ClosedPublic

Authored by sdulfari on Aug 15 2022, 22:09.

Details

Summary

It's possible to restart a node with a valid local proof and have that node
receive its own proof from another source before it attempts to register it
which creates two ProofRefs that are not equal (different pointers) but have
the same proofid. This leads to unexpected behaviors.

This patch does not fix the bigger root cause issue, which is mixed
responsibilities between the processor and peer manager. That will require
broader consideration and significantly more development time to do properly.
In the mean time, we can fix the behavior.

Depends on D11857

Test Plan
ninja check check-functional

Test changes fail without the node changes:

git checkout HEAD~ net_processing.cpp rpc/avalanche.cpp
ninja bitcoind bitcoin-cli
test/functional/test_runner.py abc_rpc_getavalancheinfo

Event Timeline

Fabien added a subscriber: Fabien.
Fabien added inline comments.
src/rpc/avalanche.cpp
61

nit: can be a static function to avoid duplication

This revision is now accepted and ready to land.Aug 16 2022, 07:43