This is based on #29370. The non-base commits are:
35d0519c4728
refactor: Replace ChainstateManager IBD and snapshot chainstates with flat list of chainstates0bb0db780ff6
broken
This is a draft PR to follow up on comments about simplifying assumetxo state representation #28562 (review), #27746 (review), #24232 (review) so validation code is less complicated, and each chainstate is handled independently without references to other assumeutxo chainstates everywhere.
Implementation is not done, but the plan is also for this PR to make two functional improvements:
- Not locking cs_main while validating assumeutxo snapshots, so the node is responsive when the background chainstate download finishes.
- Deleting the background chainstate right away when it is no longer needed, instead of waiting until the next restart, which takes up extra disk space and slows down the next startup.