Page MenuHomePhabricator

[avalanche] Use the number nodes from which we've received avaproofs as a criterion for quorum readiness
ClosedPublic

Authored by Fabien on Jun 9 2022, 17:00.

Details

Summary

This maintains a count of the successful compact proofs exchanges and enforce a minimum quantity of node that sent avaproofs message before the quorum is considered valid.
This is a best effort to give confidence that our proof set is in par with the other nodes from the network before we start polling.
The threshold is put to 8: because we need at least 8 nodes in our quorum to have converging votes there is no point using a lower value. This means that 1 out of 8 outbounds should be honest for us to get a good set of proofs.

Test Plan
ninja all check-all

Diff Detail

Repository
rABC Bitcoin ABC
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

Don't count during IBD, lower the threshold

Make naming more consistent and improve comments

Fabien published this revision for review.Jun 11 2022, 19:53
sdulfari requested changes to this revision.Jun 12 2022, 05:34
sdulfari added a subscriber: sdulfari.
sdulfari added inline comments.
src/avalanche/avalanche.h
77 ↗(On Diff #33983)

Maybe COUNT instead of NUMBER? It's a bit more self-explanatory this way.

src/avalanche/peermanager.h
227 ↗(On Diff #33983)

To help differentiate this API from the sister one in Processor, maybe name this latchAvaproofsSent()? This makes the return value more intuitive.

src/avalanche/processor.cpp
292 ↗(On Diff #33983)

non-negative

843 ↗(On Diff #33983)

Make a comment why proofs received during IBD do not count. Update the diff summary with more context if necessary.

test/functional/abc_p2p_avalanche_quorum.py
31 ↗(On Diff #33983)

Nit: This can be 8 and can stay that way even if we bump the default higher. This should make the test slightly faster.

127 ↗(On Diff #33983)

This and the above comment no longer make sense with the reference to "half" since there are more than two peers in the quorum now.

This revision now requires changes to proceed.Jun 12 2022, 05:34
test/functional/abc_p2p_avalanche_quorum.py
127 ↗(On Diff #33983)

This is still valid, each peers is worth half the minimum score for the quorum to be considered valid (-avaminquorumstake)

Feedback and more renaming to make it clear we are counting nodes and not message

This revision is now accepted and ready to land.Jun 12 2022, 17:17

Consider renaming the actual Diff to reflect that it's a count of nodes.

(also, singular of criteria should be "criterion")

Something such as: "Use the number of nodes from which we've received avaproofs as a criterion for quorum readiness"

Fabien retitled this revision from [avalanche] Use the number of received avaproofs as a criteria for quorum readiness to [avalanche] Use the number nodes that sent avaproofs as a criterion for quorum readiness.Jun 13 2022, 06:21
Fabien retitled this revision from [avalanche] Use the number nodes that sent avaproofs as a criterion for quorum readiness to [avalanche] Use the number nodes from which we received avaproofs as a criterion for quorum readiness.
Fabien retitled this revision from [avalanche] Use the number nodes from which we received avaproofs as a criterion for quorum readiness to [avalanche] Use the number nodes from which we've received avaproofs as a criterion for quorum readiness.