This is a backport of [[https://github.com/bitcoin/bitcoin/pull/19077 | core#19077]] [7/26]
https://github.com/bitcoin/bitcoin/pull/19077/commits/a0de83372be83f59015cd3d61af2303b74fb64b5
Depends on D10546
Note: this uncomments the previously unused member vars `m_mock` (D10542) and `m_database` (D10545)