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
Branch
avalanche_limit_block_vote_depth
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 19808
Build 39330: Build Difflint-circular-dependencies · build-without-wallet · build-diff · build-debug · build-clang-tidy · build-clang
Build 39329: arc lint + arc unit

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

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

1711

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

1768

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

yes it's the eleventh here

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