Repository navigation
Conversation
|
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers. External sites
ReviewsSee the guideline and AI policy for information on the review process.
If your review is incorrectly listed, please copy-paste ConflictsNo conflicts as of last run. |
|
Concept ACK |
|
would be interesting to add a new field "targetBlock" to show until which block must validate the background chainstate? |
| data.pushKV("target", GetTarget(*tip, chainman.GetConsensus().powLimit).GetHex()); | ||
| data.pushKV("difficulty", GetDifficulty(*tip)); | ||
| data.pushKV("verificationprogress", chainman.GuessVerificationProgress(tip)); | ||
| data.pushKV("verificationprogress", cs.TargetBlock() ? chainman.GetBackgroundVerificationProgress(*tip) |
There was a problem hiding this comment.
I feel like this change better aligns the assumeutxo.md documentation (accurate monitoring)
After the snapshot has loaded, the syncing process of both the snapshot chain and the background IBD chain can be monitored with the getchainstates RPC.
|
Concept ACK |
|
tACK d9638e4 |
musaHaruna
left a comment
There was a problem hiding this comment.
Concept ACK
I’m currently running a node with AssumeUTXO, so I checked this before and after applying the change. My snapshot base is at height 935000.
Before the fix, at background height 474828, the background chainstate’s verificationprogress in getchainstates reported 16.73%, while backgroundvalidation.verificationprogress in getblockchaininfo reported 18.22% for the same block. After the fix, at height 475948, both reported exactly 0.1834620809971763. This is a good improvement: getchainstates now reports background progress toward the snapshot base, as getblockchaininfo already does.
Locally, the full functional test passed. Reverting only the RPC fix made the background-progress assertion fail; restoring it made the full test pass again.
| self.log.info("Check that getchainstates returns the background validation progress") | ||
| cs_res = n1.getchainstates()["chainstates"][0] | ||
| assert_approx(cs_res["verificationprogress"], expected_verification_progress, vspan=0.01) | ||
|
|
There was a problem hiding this comment.
| background, active = n1.getchainstates()["chainstates"] | |
| assert_approx(background["verificationprogress"], expected_verification_progress) | |
| self.log.info("Check that getchainstates returns the active chainstate verification progress") | |
| assert_approx(active["verificationprogress"], res["verificationprogress"]) | |
Optional suggestion: could we also check the active chainstate’s verificationprogress against the top-level value from getblockchaininfo? Both chainstates are already available in the test, so this would also check that active-chainstate progress is still reported correctly.
|
I understand this fixes an existing reporting inconsistency, but I’d prefer us to revisit the underlying synchronization design and costs discussed in #36476, rather than keep adding special cases around background validation. I think we should discuss that broader direction before extending this approach further. |

After #33259,
getblockchaininforeports the progress of the background chainstate relative to the snapshot base block, butgetchainstatesstill computesverificationprogressagainst the network tip for every chainstate, so the same node reports two different numbers for the same chainstate.This PR modifies
verificationprogressvalue to report the correct value, relative to the block the chainstate actually stops at.