HomePhabricator

[backport#14802] rpc: faster getblockstats using BlockUndo data

Description

[backport#14802] rpc: faster getblockstats using BlockUndo data

Summary:
Using undo data for a block (rev?????.dat) we can retrieve value information about prevouts and calculate the final transaction fee (rate). This approach is about 80x faster, drops the requirement for -txindex, and works for all non-pruned blocks.

https://github.com/bitcoin/bitcoin/pull/14802/commits/d20d7567528e216badb8475df298bb3cec008985


Depends on D6304

Backport of Core PR14802

Test Plan:

ninja
./test/functional/test_runner.py rpc_getblockstats --gen-test-data
ninja check-all

run bitcoin-cli getblockstats non-pruned-block-height on a node without -txindex now works

Reviewers: #bitcoin_abc, deadalnix

Reviewed By: #bitcoin_abc, deadalnix

Subscribers: deadalnix

Differential Revision: https://reviews.bitcoinabc.org/D6305

Details

Provenance
Felix Weis <mail@felixweis.com>Authored on May 10 2019, 12:21
majcostaCommitted on Jun 2 2020, 09:47
majcostaPushed on Jun 2 2020, 09:47
Reviewer
Restricted Project
Differential Revision
D6305: [backport#14802] rpc: faster getblockstats using BlockUndo data
Parents
rABC45880ccf379c: [CI] Install Clang 10 and use it for the werror build
Branches
Unknown
Tags
Unknown