Repository navigation
Conversation
When a UTXO snapshot is loaded, this option lets the user pause the verification of historical blocks in the background.
|
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers. Code CoverageFor detailed information about the code coverage, see the test coverage report. ReviewsSee the guideline for information on the review process.
If your review is incorrectly listed, please react with 👎 to this comment and the bot will ignore it on the next update. ConflictsReviewers, this pull request conflicts with the following ones:
If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first. |
|
It might make sense to change this into an RPC method. E.g. someone may want to run the background sync only when their laptop is plugged in and on wifi. The current implementation simply sets A more thorough approach would also allocate all of |
|
Is there a strong use case for this? I'm hesitant to add any more AssumeUTXO complexity than there already is. When a user is on battery / limited bandwidth, they can just shut down Bitcoin Core until they're ready to use it again? |
|
@stickies-v the reason I opened it was because someone needed an easier way to benchmark IBD without going all the way from genesis. In general this is useful if you don't want to download and process things before the snapshot. Whether that's wise is a different question. |
Wait, how does pausing IDB help with benchmarking IBD?
Right, I can see the use case for that, but that discussion feels more about disabling rather than pausing background validation. Adding a third option seems unnecessarily confusing? |
I think it's good to maintain the option to finish background validation. E.g. maybe because you want to enable an index. |
I had a chat with @Sjors recently regarding a benchmarking use case I have, where I want to benchmark doing IBD on more recent blocks to test flush behaviour. AssumeUTXO seemed useful here in that I can start from, e.g., 800,000 and sync to tip. For this, background validation would likely interfere with the results so having a
For my use case, all I need is a patch to cherry-pick onto my branches. @Sjors mentioned he had other reasons that this might be generally useful for AssumeUTXO users, hence the PR. Assuming my benchmarking idea works, I could see this being a generally useful option, e.g., for running a regression test where we benchmark IBD performance from 50k blocks back to chaintip nightly (or something like that), so I don't think adding it as an option is a negative. Alternatively, my suggestion for the regression testing / benchmarking use case would be to make it a compile time flag. I haven't checked if we have a notion of "hidden options" (similar to how we have hidden RPCs), but if there is a strong case for making it a runtime flag, I'd suggest hiding it since the use case I envision is more for testing / debugging and not general use. |
|
Thanks for explaining the intended use cases in more detail. Benchmarking from a fixed height seems useful but also seems quite feasible without Similarly, I don't see a proper use case for end users either. I think the discussion to allow the user to skip background validation entirely (or, have it be a separate process using kernel, allowing the user to (re-)run it whenever they want) I think is valid, but |
What other approach do you have in mind? |
Perhaps enumerating the problem(s) you're trying to solve would be a better starting point? As I've outlined before already:
|
|
The main use case I have in mind is some who doesn't want to do background validation. The best reason for that is to save bandwidth, since storage can be saved by pruning just as well. They may later decide to perform this validation. This PR enables that now in a fairly trivial way: it just doesn't download the blocks. Using process separation and the kernel is not something we can do in the near future. It also seems more complicated than the approach here.
That defeats the purpose of assumeutxo: to be able to use the node, mempool and wallet without having to download the entire chain. They only need to keep the tip synced. |
|
I tend to agree with #31023 (comment). Adding a test-only option in this way won't be useful to benchmark previous releases (and compare them), and seems more work than just using a test-only datadir dump.
There are reasons to do the background validation, see #28616 (comment) . If you are adding a foot-gun, at least it should be documented as such, not advertised to users via the release notes and a non-hidden setting. |
|
I agree with the other commentors here. I don't think we should be trying to extend/re-use a user-facing feature for development purposes, especially given the existence of more accurate/repeatable ways of achieving the same thing. Adding this option for the other uses-cases described just further murkies the function of/complicates this feature. |
|
Going to close this for now, given the feedback. |
When a UTXO snapshot is loaded, this option lets the user pause the verification of historical blocks in the background.
Manual testing is easiest using the signet snapshot, because it loads and reaches the tip quickly (compared to mainnet and testnet3), but not so fast that you don't have to time to call any RPC commands (like testnet4).
TODO: