coins: warn on shutdown for big UTXO set flushes
Summary:
Setting a large -dbcache size postpones the index writes until the coins cache size exceeds the specified limit.
This causes the final flush after manual termination to seemingly hang forever (e.g. tens of minutes for 20 GiB);
Now that the dbcache upper cap has been lifted (D18577), this will become even more apparent, so a warning will be shown when large UTXO sets are flushed (currently >1 GiB).
Note that the related BCLog::BENCH units were also converted to KiB from kB to unify the bases.
Co-authored-by: Cory Fields <cory-nospam-@coryfields.com>
This is a backport of core#31534
Test Plan:
ninja all check-all
.
$ src/bitcoind -reindex-chainstate -stopatheight=400000 -assumevalid=000000000000000004ec466ce4732fe6f1ed1cddc2ed4b328fff5224276e3f6f -datadir=/data0/ecashd_test -dbcache=1050 ... 2025-10-14T13:09:25Z UpdateTip: new best=00000000000000003eb6d23ca5ba8d7a59b441fe40933869c1fc48d6088711dd height=276413 version=0x00000002 log2_work=75.041744 tx=29727290 date='2013-12-22T17:11:38Z' progress=0.029442 cache=1088.9MiB(8632368txo) ^C2025-10-14T13:09:25Z tor: Thread interrupt ... 2025-10-14T13:09:30Z [warning] Flushing large (1 GiB) UTXO set to disk, it may take several minutes 2025-10-14T13:09:35Z Shutdown: done
Reviewers: #bitcoin_abc, Fabien
Reviewed By: #bitcoin_abc, Fabien
Subscribers: Fabien
Differential Revision: https://reviews.bitcoinabc.org/D18794