aboutsummaryrefslogtreecommitdiff
path: root/libbitcoinconsensus.pc.in
diff options
context:
space:
mode:
authorMacroFake <falke.marco@gmail.com>2022-04-28 12:13:59 +0200
committerMacroFake <falke.marco@gmail.com>2022-04-28 12:14:06 +0200
commitb51e60f91472da5216116626afc032acd5616e85 (patch)
tree9fcf4b4b6781d7c6fb3d332e289a217725ec6e75 /libbitcoinconsensus.pc.in
parent9446de160f37ccf9d639960f38bc1e4337b0c5f7 (diff)
parent7ab07e033237d6ea179a6a2c76575ed6bd01a670 (diff)
Merge bitcoin/bitcoin#22564: refactor: Move mutable globals cleared in `::UnloadBlockIndex` to `BlockManager`
7ab07e033237d6ea179a6a2c76575ed6bd01a670 validation: Prune UnloadBlockIndex and callees (Carl Dong) 7d99d725cdb5428ed25dc07c2d7fddf420da7786 validation: No mempool clearing in UnloadBlockIndex (Carl Dong) 572d8319272ae84a81d6bfd53dd9685585697f65 Clear {versionbits,warning}cache in ~Chainstatemanager (Carl Dong) eca4ca4d60599c9dbdd4e03a73beb33e9b44655a style-only: Use std::clamp for check_ratio, rename (Carl Dong) fe96a2e4bd87768df8001eb4117926a0977d876e style-only: Use for instead of when loading Chainstate (Carl Dong) 5921b863e39e5c3997895ffee1c87159e37a5d6f init: Reset mempool and chainman via reconstruction (Carl Dong) 6e747e80e7094df0b5bee1eed57e57e82015d0ee validation: default initialize and guard chainman members (Anthony Towns) 98f4bdae81804de17f125bd7c2cd8a48e850a6d2 refactor: Convert warningcache to std::array (Carl Dong) Pull request description: Fixes #22964 ----- This is a small part of the work to accomplish what I described in 972c5166ee685447a6d4bf5e501b07a0871fba85: ``` Over time, we should probably move these mutable global state variables into ChainstateManager or CChainState so it's easier to reason about their lifecycles. ``` `::UnloadBlockIndex` manually resets a subset of our mutable globals in addition to unloading the `ChainstateManager` and clearing the mempool. The need for this manual reset (AFAICT) arises out of the fact that many of these globals are closely related to the block index (hence `::UnloadBlockIndex`), and need to be reset with it. I've shot this "manual reset" gun at my foot several times while doing the de-globalize chainman work. Thankfully, now that we have a `BlockManager` class that owns the block index, these globals should be moved under that class so that they can live and die with the block index. These moves, along with making the block index non-heap-based, eliminates: 1. https://github.com/bitcoin/bitcoin/commit/3585b521392c5b2c855c3ba6dc9b7d2a171b3710 The need to reason about when we need to manually call `::UnloadBlockIndex` (this decision can at times seem almost arbitrary) 2. https://github.com/bitcoin/bitcoin/commit/f741623c25455c20bff9eb1ddd10a4ac84dc5655 The need to have an `::UnloadBlockIndex` or explicit `~ChainstateManager` at all ACKs for top commit: MarcoFalke: ACK 7ab07e033237d6ea179a6a2c76575ed6bd01a670 👘 ajtowns: ACK 7ab07e033237d6ea179a6a2c76575ed6bd01a670 ryanofsky: Code review ACK 7ab07e033237d6ea179a6a2c76575ed6bd01a670. This all looks good and simplifies things nicely. I left some minor suggestions below but feel free to ignore. Tree-SHA512: a36ee3fc122ce0b4e8d1c432662d7009df06264b724b793252978a1e409dde7a7ef1f78b9ade3f8bfb5388213f10ae2d058d57a7a46ae563e9034d7d33a52b69
Diffstat (limited to 'libbitcoinconsensus.pc.in')
0 files changed, 0 insertions, 0 deletions