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
Branch
d1987-2
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 3743
Build 5561: Bitcoin ABC Buildbot (legacy)
Build 5560: arc lint + arc unit

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.