HomePhabricator

[backport#15402] Prevent callback overruns in InvalidateBlock and…

Description

[backport#15402] Prevent callback overruns in InvalidateBlock and RewindBlockIndex

Summary:
https://github.com/bitcoin/bitcoin/pull/15402/commits/9ce9c37004440d6a329874dbf66b51666d497dcb


This thing has been merged (D4803) and reverted (D4959) before. Seems to be working correctly now, with the lock to m_cs_chainstate in ActivateBestChain having a corresponding one in UnwindBlock.

Concludes backport of Core PR15402

Test Plan:

cmake -GNinja -DCMAKE_BUILD_TYPE=Debug
ninja check check-functional

also

build without this patch, invalidate block #6 or similarly deep, see that bitcoind memory usage just keeps going up, even past 30% on my 16GB machine. build with this patch and do the same, memory usage stays steady at ~12% no matter how far you disconnect blocks.

Reviewers: #bitcoin_abc, jasonbcox, deadalnix

Reviewed By: #bitcoin_abc, jasonbcox, deadalnix

Subscribers: jasonbcox

Differential Revision: https://reviews.bitcoinabc.org/D7213

Details

Provenance
Pieter Wuille <pieter.wuille@gmail.com>Authored on Feb 14 2019, 01:17
majcostaCommitted on Aug 21 2020, 15:06
majcostaPushed on Aug 21 2020, 15:06
Reviewer
Restricted Project
Differential Revision
D7213: [backport#15402] Prevent callback overruns in InvalidateBlock and RewindBlockIndex
Parents
rABC32bbcb69bd36: build: Skip i686 build by default in gitian
Branches
Unknown
Tags
Unknown