Page MenuHomePhabricator

Fixed a bug where an invalidated or parked block would have child state applied to it even when its parent block is not invalidated or parked.
ClosedPublic

Authored by jasonbcox on Nov 1 2018, 17:07.

Details

Summary

Discovered while debugging parked chain behavior. I noticed the BlockStatus had unexpected combinations of state. With a chain A->B->C (tip):

parkblock(blockB) produces: A (no state change) -> B (parked, parked-parent) -> C (parked-parent)
Expected is: A (no state change) -> B (parked) -> C (parked-parent)

invalidateblock(blockB) produces: A (no state change) -> B (invalid, invalid-parent) -> C (invalid-parent)
Expected is: A (no state change) -> B (invalid) -> C (invalid-parent)

Test Plan

test_runner.py abc-parkedchain

Diff Detail

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

Event Timeline

This change is actually incorporated into this backport: D1977, so is unnecessary as long as that change gets in soon.

Then again, I don't think it's a good assumption to think D1977 will go through a quick review. This fix may be necessary in the short term.

This revision is now accepted and ready to land.Nov 2 2018, 17:23
This revision was automatically updated to reflect the committed changes.