Page MenuHomePhabricator

[Chronik] Fix: Indexed block size is 0 when running `-chronikindex`
ClosedPublic

Authored by tobias_ruck on Jun 4 2023, 19:10.

Details

Summary

During -chronikreindex, CBlockIndex::nSize seems to be 0, and the wrong value is indexed for the block size.

This should potentially be fixed downstream (by setting nSize correctly before running the -chronikreindex loop), but for now, using ::GetSerializeSize fixes the bug.

Test Plan
  1. ninja && ./test/functional/test_runner.py chronik_block
  2. Use nSize in chronik_bridge.cpp instead of GetSerializeSize, now chronik_block.py should fail.

Diff Detail

Repository
rABC Bitcoin ABC
Branch
chronik-fix-chronikreindex-size
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 23891
Build 47392: Build Diffbuild-diff · build-debug · build-clang · build-without-wallet · build-chronik · build-clang-tidy
Build 47391: arc lint + arc unit