Page MenuHomePhabricator

[avalanche] Don't poll blocks who are ancestors of a vote finalized block
ClosedPublic

Authored by Fabien on Aug 12 2022, 12:09.

Details

Summary

Once a block has been voted on and finalized, there is no point polling
its ancestors anymore.
Test is added to check the ancestors are removed from the polls, and
also that a block from a forked chain is still polled, so invalidating a
block manually is still possible if needed and won't interfere.

Test Plan
ninja all check-all

Diff Detail

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

Event Timeline

Fabien requested review of this revision.Aug 12 2022, 12:09
sdulfari requested changes to this revision.Aug 12 2022, 16:26
sdulfari added a subscriber: sdulfari.
sdulfari added inline comments.
src/avalanche/test/processor_tests.cpp
1703 ↗(On Diff #34632)

If the tenth block was finalized shouldn't there be 9 left to poll?

1711 ↗(On Diff #34632)

This loop is confusing. The comment says ancestors but i starts at 11. Just make i the actual index.

1768 ↗(On Diff #34632)

Nit since prior votes were unknown

This revision now requires changes to proceed.Aug 12 2022, 16:26
src/avalanche/test/processor_tests.cpp
1703 ↗(On Diff #34632)

yes it's the eleventh here

This revision is now accepted and ready to land.Aug 12 2022, 16:48