#36220 rpc: report background validation progress in getchainstates

full analysis

https://github.com/bitcoin/bitcoin/pull/36220 · arejula27 · +7/-2 in 2 files, 2 commits · labels: RPC/REST/ZMQ

Goal

  • Report accurate background validation progress in getchainstates during assumeutxo sync
  • Resolves conflicting progress values previously reported between getblockchaininfo and getchainstates

Updates the `verificationprogress` field in `getchainstates` to calculate progress relative to the snapshot base block when inspecting a background chainstate, using `chainman.GetBackgroundVerificationProgress()`. Also updates the RPC help text and adds an assertion to `feature_assumeutxo.py`.

Problem: After PR #33259 updated `getblockchaininfo`, `getchainstates` continued to compute verification progress against the active network tip for all chainstates. As a result, the same node reported conflicting progress values for the background chainstate during assumeutxo sync.

Category: RPC / REST / ZMQ (#24 of 52)

P3 · bug fix

  • P3 because it resolves conflicting progress numbers reported across RPC endpoints
  • Improves monitoring accuracy for node operators running assumeutxo background sync

P3 because it fixes an inconsistency in RPC progress reporting during assumeutxo sync. As the author notes, `getblockchaininfo` and `getchainstates` previously reported conflicting progress numbers for the background validation chainstate.

Membership: Modifies the output and help documentation of the `getchainstates` RPC method in `src/rpc/blockchain.cpp`.

Factors: security/stability 0, bug 1, performance 0, user value 1, leverage 0

Reviewability: Ready

  • Ready for review: small patch with clean CI and functional test coverage

The patch is small, cleanly rebased, passes CI, and includes functional test verification.

Author status: active

Resolved concerns:

  • nervana21 suggested using `.has_value()`, but withdrew the suggestion after the author pointed out that `cs.TargetBlock()` returns a raw pointer rather than a `std::optional`.

Agreement: Strong

  • Strong support for consistent assumeutxo progress reporting across RPCs
  • Tested approval after clarifying target block pointer handling (nervana21)
  • Concept approval noting better alignment with assumeutxo documentation (vicjuma)
  • Concept approval without stated reasons (sedited)

Tested ACK from nervana21 and Concept ACKs from sedited and vicjuma, with no open objections.

Reviewers agree on the consistency improvement for assumeutxo monitoring, and the single nit suggestion was resolved.

  • nervana21 gave a tested ACK (tACK) after confirming their inline suggestion was incorrect
  • vicjuma noted Concept ACK, remarking that the change better aligns with assumeutxo documentation for accurate monitoring
  • sedited left a Concept ACK

Review verdicts (DrahtBot): 1

Files

4 lines under test/bench/ci.

  • src/rpc/blockchain.cpp +3/-2
  • test/functional/feature_assumeutxo.py +4/-0

Card

This pull request ensures `getchainstates` calculates background chainstate `verificationprogress` relative to the snapshot base block rather than the network tip, matching `getblockchaininfo`. It resolves a reporting inconsistency where a node running assumeutxo produced conflicting verification numbers across two RPC calls. The fix is minimal, accompanied by functional test coverage in `feature_assumeutxo.py`, and has received a tested ACK with no open objections.

Data

dossier JSON · extract JSON · model openrouter/google/gemini-3.8-flash, generated 2026-09-17T17:12, confidence high, input hash 27c9bf4d3add43b4