Page MenuHomePhabricator

[Chronik] Add `BlockStatsReader` and `BlockStatsWriter`
ClosedPublic

Authored by tobias_ruck on May 3 2023, 11:54.

Details

Summary

Measure and store some stats about blocks (see BlockStats), and write them to the DB.

num_inputs includes coinbase "inputs", but if a user only wants the non-coinbase inputs, they can simply subtract 1.

We separate the sum of the output sats into sum_coinbase_output_sats and sum_normal_output_sats, if someone wants the total output sats of the block, they can simply add them together.

Test Plan

ninja check-crates

Diff Detail

Repository
rABC Bitcoin ABC
Branch
chronik-block-stats
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 23613
Build 46840: Build Diffbuild-chronik
Build 46839: arc lint + arc unit