kernel: De-globalize signature cache
Summary:
Move its ownership to the ChainstateManager class.
Next to simplifying usage of the kernel library by no longer requiring
manual setup of the cache prior to using validation code, it also slims
down the amount of memory allocated by BasicTestingSetup.
Use this opportunity to make SignatureCache RAII styled
Co-authored-by: Ryan Ofsky <ryan@ofsky.org>
This concludes backport of core#30141
https://github.com/bitcoin/bitcoin/pull/30141/commits/606a7ab862470413ced400aa68a94fd37c8ad3d3
Depends on D18859
Test Plan: ninja all check-all bitcoin-fuzzers
Reviewers: #bitcoin_abc, Fabien
Reviewed By: #bitcoin_abc, Fabien
Subscribers: Fabien
Differential Revision: https://reviews.bitcoinabc.org/D18860