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 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. LLM Linter (✨ experimental)Possible places where comparison-specific test macros should replace generic comparisons:
2026-11-27 11:19:58 |
191bb63 to
bc62b59
Compare
|
Concept ACK. Following on from what we discussed in person: a feature-ready, usable assumeUTXO is with P2P utxo snapshot sharing, no background validation, and potentially on by default. I don't think it's a state we want to be in. If the feature-ready version lands and most new nodes come up from a snapshot and never pull the history, then over time the archival nodes thin out and validating/having the chain's history becomes something only a handful of nodes still do. Worst case, you can recover your funds but not the history. Pruning already nudges us that way (though it's not on by default, and most users only prune when they actually need to), but a snapshot default would speed it up. It's a bit of an extreme scenario, but I don't think it's an implausible state to be in, if the direction is future ready assumeUTXO. And as discussed, as-is it's not even that usable, loading the snapshot takes too long. I remember giving up when trying it for the first time. (This can be fixed though) I've also hit a maintenance cost directly. e.g. in #34075 we do block building, and query the tip which needs the chainstate, and multiple chainstates make that harder than it should be. Any node component that needs chainstate has no guarantee the chainstate it grabbed is still live, and the active one can get swapped under it, so you end up holding onto the chainstate manager and re-fetching the active chainstate every time instead of just keeping a stable handle. The last seven commits here show what you get back once this is gone. I do think there's probably still a group of users who'd want assumeUTXO like snapshot bootstrapping. But I'd rather that live outside the dominant full node, Snapshot loading scales with the UTXO set size while IBD scales with chain length indeed, so there is some argument on the linear growth concern and that #35295 and your pruneassumevalid idea don't fully close that gap for a new node that validates/semi validates the chain history, and that gap only grows as the chain gets longer. @l0rinc should we do it through the usual deprecate then remove style? Also thanks for putting the demo together, having the removable code and the simplifications it shows is nice to see. |
|
After the amount of time spent reviewing and testing assumeutxo, some folks might have a Stockholm syndroma removing assume utxo and me not the last... More technically, it would has been possible to find an intermediary technical solution, where we would have kept the AssumeUTXO feature has an optional special build flag side-companion process available through a new On a more usage level, I did share few ideas in the past on how to use AssumeUTXO for second-layers reputation systems, see here. Never been practical, though it would have been interesting for second-layers nodes, as they would have been able to join the system "on-the-fly" by leveraging assumeutxo activate chainstate. |
This is fine and useful. But to be clear, I'm concept NACK on actually removing AssumeUTXO. I think we should drop background validation first, as I suggested in #36557. After that we can reconsider if code complexity is still too high. @ismaelsadeeq wrote:
(nit: the total supply can easily be checked against the issuance schedule. The distribution of the supply can't be checked.) I don't think we should revisit
Between the current reality of hardly anyone using AssumeUTXO, and the scenario you're describing, I think many decades will pass. By 2050 the blockchain might be 4 TB. The worst case UTXO set growth by then is 3+ TB, but at the current trend it might only be 35 GB. 100x less stuff to download (and process) creates a strong incentive for new users to use a client that does offer AssumeUTXO. It's a similar dynamic as with RBF: there's a limit to how far we can push against individual incentives to achieve network health. That goes for miner and for (non-miner) user incentives. Also note that a user who didn't fully validate from genesis is still useful to the network if they provide mempool and (compact) block relay. The big unpredictable factor here is Moore's law. In the optimistic scenario you'll download 4 TB in a few minutes in even the poorest and remote places on Earth. In a worst case scenario of technological regression, with a few quantum computers still surviving so we can't use compact signatures, everyone will just be using SPV or custodial wallets, because even after IBD keeping up with the chain would be too much. @l0rinc wrote:
I'm fine with refactoring things towards a cleaner approach, but it's not realistic to expect that if we remove this, it's going to come back. I'm also not convinced that the feature is so problematic that it needs to be temporarily removed. Even UPnP wasn't removed, merely disabled by default after the RCE vulnerabilities, but AssumeUTXO is already opt-in (and should stay that way). |
|
Concept ACK Our validation code is the most critical we have. Having to reason about multiple chainstates is error-prone and a big mental tax on a lot of validation work. AssumeUTXO benefits those users who opt in to the feature just once, on first startup, but burdens everyone continuously with significant validation complexity they can't opt out of. Moreover, while I think it is fine for users to make certain trust assumptions and trade-offs, I think it is important for this project to continue prioritizing the minimization of trust assumptions where we can. |
|
Concept ACK |
|
Concept ACK. I was initially very excited when #35054 was opened. I really liked the idea of having a bitcoin node that could be quickly usable with little to no user interaction. However, various conversations with people, both here and in person, changed my mind. The strongest argument for removing assumeutxo is that it complicates the validation code quite a bit, for little to no user adoption. I can't comment much on the first point, other than that, anecdotally, I have spent some time reviewing PRs in the assumeutxo realm and doing some automated AI scans, and the code still seems a bit brittle around the edges to me. This comment from l0rinc #35054 (comment) points at the same problem: there have been many edge cases, and there still are, that required a lot of engineering time from us. Regarding user adoption, none of us really has precise data, but we all seem to have a sense that adoption is little to none. My anecdotal experience is that the users I spoke to weren't even aware of assumeutxo. I think part of the problem is that users who want to connect their wallet to Core usually do it through an Electrum server, which requires either -txindex or the whole blockchain on disk. Neither is available until background validation finishes, so they don't get any upside from using assumeutxo. I sometimes use assumeutxo, mostly when I need a node for testing and don't want to wait for it to exit IBD. As a user, I'd be a bit sad to see it go, but I think it's important that, as a project with limited resources, we use the engineering time we have efficiently, and assumeutxo doesn't seem to be the place for it. |
|
I agree with most of the points of the above ~5 comments, and I don't want to repeat, and I have expressed my points in the background sync removal issue #36557. The AssumeUTXO feature imposes a risk due to extra complexity, a risk unproportional to the usefulness and usage of the feature. (The extra complexity is largely a result of the need to support two chain states.) In the age of cheap LLM vulnerability scanners the feature-vs-simplicity balance is shifting towards simplicity. What I would like to see:
Concept ACK |
|
It's useful to know if people have a preference for removing the whole thing, so I don't want to discourage that. But... I still think we should only drop background sync. What's new: I think we can actually wait before adding p2p support. @instagibbs wrote:
Those are the two extreme options, but my earlier point was that we should start with stripping the most problematic and least useful parts of the functionality, and then reconsider if we want to remove it completely. My current impression is that removing background sync #36557 does a lot there. It's where most of the complexity sits, and removing it improves the user experience.
Start9 has support: https://github.com/Start9Labs/bitcoin-core-startos/blob/31.x/instructions.md#other-actions RaspiBlitz is considering it, but not much movement: raspiblitz/raspiblitz#1178 Dropping background sync would also make it easier to support, since their software also wouldn't need to deal with two chain-states. I don't think we need p2p support for node-in-box software. They could easily add torrent support. @sedited wrote:
BTCPayServer is open source too, so people can still verify that it relies on the assume-utxo hash rather than an arbitrary blob with a full data directory. One thing we haven't seen yet is a proper node-on-a-phone. It wasn't practical before:
Phones are different than raspberry pies, because you can't expect users to just leave the device in a corner for a few days, plugged in with the app in the foreground (iOs) while it completes IBD. Without a way to skip historical block validation, running Bitcoin Core (or another kernel-based app) on a phone is likely never going to happen. Most mobile apps share an xpub or use Electrum. Skipping historical sync in exchange for better privacy and eclipse attack resistance, may actually be good trade-off. Then they can use BIP-158 filters between sessions. Phone apps can probably also use a torrent, so there too I think it's fine to hold off on adding p2p support until we see more usage. All that said, AssumeUTXO for IBD + bip158 for steady state, might still not be good enough mobile UX. It may turn out that Utreexo / Floresta is the way forward for mobile. That also requires being able to skip historical block download, but only kernel would need to support it (and maybe not even that, if they maintain a fork of the kernel). The real pessimistic scenario is that Electrum over Tor is as good as it will ever get on mobile. |
|
I don't believe this is a good approach at all. There is obviously a very strong incentive to be able to spin up a new node quickly -- if it takes a day or a week between configuring a server and having it be able to follow the current tip, that's a major impediment to adoption. Assumeutxo provides a way of doing that figure in minutes: it reduces the amount of data to download by about 95%, and reduces the computational load similarly, even on relatively weak hardware. Historical validation of the chain state is fundamentally a different job than "stand up a new node", and one that generally can take hours or days without causing a problem, provided it doesn't prevent you from standing up a new node. Linking the two tasks therefore encourages continual heavy optimisation of that code, often ones that are only beneficial during IBD. That seems to me a very risky tradeoff, in that any mistakes in the optimisations will impact live validation code. For example #37038 is a +800 LOC change that improves IBD from 2h25m to 2h22m on SSD, or to 8h14m on HDD or 8h/21h/54h on rpi in various configurations which seems to me to be measurable but not very meaningful, while introducing qualitative new risks via probabilistic primitives and more complex data structures.
This feature was abandoned at the half-way point and has only recently been picked up for further development, so I've never found it surprising that it never got much use. Having done both the optimised load, and also the "skip bg download" part, I find this approach is much more appealing and convenient for spinning up new nodes than the current highly optimised IBD approach. I'm not going to use the four-letter N-word here, but I think this is demonstrating fundamentally flawed development priorities. |
Nice to have a real argument here! |
With assumeutxo, the cost to stand up a new mainnet node to follow the tip and generate blocktemplates or act as a wallet is ~20 minutes of validation time, plus about 40GB of download. This is what I did in order to track the mainnet block for the testnet5 genesis mine -- much easier to justify spinning up a real mainnet node even for something pretty trivial when it only takes 20 minutes, than when it takes many hours or requires upgrading to a more expensive VPS. Without assumeutxo, the cost to stand up a new mainnet node to do those things is however long IBD takes. With or without assumeutxo, the cost to do IBD / full re-validation of the chain is about 700GB of download, plus some hours of CPU time. (Generating your own indexes is the same download, but could conceivably be less CPU, if undo data wasn't needed or was downloadable; for small indexes, an assumeindex mode would perhaps also be possible of course). I would be tempted not to do background validation at all (ie, if you want to do IBD after spinning up via assumeutxo, just run a second node on the same system), but #37094 could be a better approach while remaining simple. I don't think the multi chainstate approach is a good one; but even very limited objections to that approach got rejected back in the day.
I don't think the trust level is meaningfully different: if you're trusting that the developers didn't add code to insert fake utxos paying funds to themselves during IBD, you might as well trust them to include the correct utxo set hashes in the code. Calculating the utxo set hash via independent software protects against both sorts of bad behaviour. If you're reviewing the code, then the hashes are one of the more straightforward things to review (and could be an automatic part of IBD with #36543). |

Draft demo: this is meant to showcase what complete AssumeUTXO removal could look like and the simplifications that AssumeUTXO currently prevents.
The decision about complete removal is of course still open. This draft is meant to serve as a concrete reference for the smaller proposals below - it's not meant to be merged.
Smaller PRs: I will carve out individual changes to gauge interest in each part, and link them here as they are opened.
Some of the findings are useful even if snapshot loading or background validation stays.
Feedback on which parts seem worth pursuing, and in which order, is welcome.
Motivation: this follows our in-person discussion at the October 2026 Core Dev meeting.
My impression was that there was rough agreement about the ambiguity background validation introduces: we trust a snapshot enough to use it immediately, but describe that trust as temporary until the same node finishes checking history.
Multiple chainstates affect much more than snapshot loading: ordinary validation changes have to account for different chainstate roles, candidate sets, notifications, downloads, pruning, cache allocation, database lifetimes and locks.
I am not sure this amount of complexity in the most critical part of our codebase is still worth it, given that adoption isn't where we hoped it would be.
Ordinary IBD is also getting faster: #35295 is already merged, and the upcoming
pruneassumevalidwill make pruned IBD even faster.Snapshot bootstrapping without background validation can still offer an advantage: a new node becomes usable before ordinary IBD would finish because snapshot loading time scales with the UTXO set size, while ordinary IBD time scales with the blockchain size.
Whether that is worth its maintenance cost is a fair question, and we can discuss it here or in the dedicated PR where I will propose the removal.
Even after removal, we could decide to add it back in a cleaner way, for example isolated through IPC.
This demo makes that cost, and the code we could remove, visible for that discussion.
Background validation can be considered separately: if we keep snapshot loading, I would prefer making its trust assumption explicit and distributing verification across ordinary IBD nodes, as proposed in #32377 and #36543.
That could give us wider independent checking of the commitment without making every snapshot user maintain a second chainstate.
Users who want to validate history themselves and transition to an archival node could rebuild with
-reindexand pruning disabled.Alternatively, they could run IBD in a separate datadir while their snapshot node remains usable, then switch once it is ready.
@Sjors's #36557 discusses dropping mandatory background sync and these alternatives.
What the series demonstrates:
Ordinary validation,
-assumevalid, pruning,ChainstateManagerand UTXO export (dumptxoutset) remain.Related work: