diff options
author | Ava Chow <github@achow101.com> | 2024-03-20 12:19:31 -0400 |
---|---|---|
committer | Ava Chow <github@achow101.com> | 2024-03-20 12:30:38 -0400 |
commit | 0b96a1925e21b7d79506cc652f4d29781e9f949c (patch) | |
tree | e1ea6ba295d7e552d9c3d6dde3a204e5b60e878a /src/node/blockstorage.cpp | |
parent | 5b9831a0a5018e5fb77596130cd7269108273259 (diff) | |
parent | 99afb9d15a08d2f46739f4d2b66c63dbabd7a44e (diff) |
Merge bitcoin/bitcoin#28955: index: block filters sync, reduce disk read operations by caching last header
99afb9d15a08d2f46739f4d2b66c63dbabd7a44e refactor: init, simplify index shutdown code (furszy)
0faafb57f8298547949cbc0044ee9e925ed887ba index: decrease ThreadSync cs_main contention (furszy)
f1469eb45469672046c5793b44863f606736c853 index: cache last block filter header (furszy)
a6756ecdb2f1ac960433412807aa377d1ee80d05 index: blockfilter, decouple header lookup into its own function (furszy)
331f044e3b49223cedd16803d123c0da9d91d6a2 index: blockfilter, decouple Write into its own function (furszy)
bcbd7eb8d40fbbd0e58c61acef087d65f2047036 bench: basic block filter index initial sync (furszy)
Pull request description:
Work decoupled from #26966 per request.
The aim is to remove an unnecessary disk read operation that currently takes place with every new arriving block (or scanned block during background sync). Instead of reading the last filter header from disk merely to access its hash for constructing the next filter, this work caches it, occupying just 32 more bytes in memory.
Also, reduces `cs_main` lock contention during the index initial sync process. And, simplifies the indexes initialization and shutdown procedure.
Testing Note:
To compare the changes, added a pretty basic benchmark in the second commit. Alternatively, could also test the changes by timing the block filter sync from scratch on any network; start the node with `-blockfilterindex` and monitor the logs until the syncing process finish.
Local Benchmark Results:
*Master (c252a0fc0f4dc7d262b971a5e7ff01508159193b):
| ns/op | op/s | err% | total | benchmark
|--------------------:|--------------------:|--------:|----------:|:----------
| 132,042,516.60 | 7.57 | 0.3% | 7.79 | `BlockFilterIndexSync`
*PR (43a212cfdac6c64e82b601c664443d022f191520):
| ns/op | op/s | err% | total | benchmark
|--------------------:|--------------------:|--------:|----------:|:----------
| 126,915,841.60 | 7.88 | 0.6% | 7.51 | `BlockFilterIndexSync`
ACKs for top commit:
Sjors:
re-ACK 99afb9d15a08d2f46739f4d2b66c63dbabd7a44e
achow101:
ACK 99afb9d15a08d2f46739f4d2b66c63dbabd7a44e
TheCharlatan:
Re-ACK 99afb9d15a08d2f46739f4d2b66c63dbabd7a44e
andrewtoth:
ACK 99afb9d15a08d2f46739f4d2b66c63dbabd7a44e
Tree-SHA512: 927daadd68f4ee1ca781a89519539b895f5185a76ebaf525fbc246ea8dcf40d44a82def00ac34b188640802844b312270067f1b33e65a2479e06be9169c616de
Diffstat (limited to 'src/node/blockstorage.cpp')
0 files changed, 0 insertions, 0 deletions