[DRAFT] Expose AssumeUTXO Load Snapshot Functionality To The GUI #870

pull D33r-Gee wants to merge 2 commits into bitcoin-core:master from D33r-Gee:2025_gui_interfaces_loadsnapshot_poc changing 18 files +525 −8
  1. D33r-Gee commented at 3:19 pm on April 30, 2025: none

    based on the QML PR 424. For evaluation purposes only!

    GUI Integration for UTXO Snapshot Loading

    Overview

    This PR adds initial GUI support for loading a UTXO snapshot, building on Bitcoin Core’s assumeutxo infrastructure.

    What This PR Does

    1. Adds a basic GUI interface for loading UTXO snapshots via the Options Dialog panel
    2. Provides visual confirmation of snapshot activation
    3. Adds a snapshot progress notification bar accessible via a handler

    Implementation Details

    Core Components Modified

    1. Node Interface (src/node/interfaces.cpp)
    1. QT Integration (src/qt/optionsdialog.cpp)
    • Manages snapshot loading state and progress
    • makes use of a worker class to manage snapshot metadata (src/qt/snapshotmodel.cpp)
    • Provides progress updates via a progress bar

    Key Design Decisions

    1. Extensibility
    • Interface designed to accommodate future assumeutxo changes
    • Error handling framework in place

    Testing Instructions

    1. Build
    2. Launch Bitcoin Core GUI (bitcoin-qt)
    3. Navigate to Settings -> Options
    4. Click Load Snapshot button
    5. Follow pop-up instructions
    6. Test with sample snapshot:

    https://bitcoin-snapshots.jaonoctus.dev/ (No affiliation with the maintainer of this site. As always “Don’t trust! Verify!”)

    Screenshot 2025-04-28 100528 Launch bitcoin-qt on signet Screenshot 2025-04-28 100541 Navigate to Settings -> Options Screenshot 2025-04-28 100559 Click the “Load Snapshot…” button Select_file Navigate to where your snapshot file is. The snapshot was downloaded from here Screenshot 2025-04-28 100735 Click “Yes” Screenshot 2025-04-28 100950 Wait for the snapshot to load and for this pop-up to appear and click “Ok” Screenshot 2025-04-28 101743 Verify the “chain_snapshot” directory is present in your datadir

    Expected Behavior

    • File selection dialog works
    • Success/failure state properly displayed
    • Node becomes usable while background validation continues

    Notes for Reviewers

    • This is a POC so all feedback is welcomed
    • I am not a designer so please feel free to chime in if there’s a more elegant way to achieve this

    This is a work in progress - feedback welcome on the approach and implementation details.

  2. DrahtBot commented at 3:19 pm on April 30, 2025: contributor

    The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

    Reviews

    See the guideline for information on the review process.

    Type Reviewers
    Concept ACK Sjors

    If your review is incorrectly listed, please react with 👎 to this comment and the bot will ignore it on the next update.

    Conflicts

    Reviewers, 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.

  3. D33r-Gee commented at 3:51 pm on April 30, 2025: none
    friendly ping @Sjors
  4. Sjors commented at 10:05 am on May 1, 2025: member

    Concept ACK

    Although I’m not sure how much effort we should put into maintaining the current GUI codebase (if it’s going to be replaced with QML eventually), this particular feature is high on my wish list. And the code changes here seem very simple. So I’m happy to test and review it.


    The first commit which touches the node interface should eventually be PR’d to bitcoin/bitcoin. But let’s wait with that until this PR has enough concept ACK and some initial review.

  5. luke-jr commented at 12:34 pm on May 14, 2025: member
    Seems like this would be more appropriate for the first-run intro page?
  6. D33r-Gee commented at 10:35 pm on May 14, 2025: none

    Seems like this would be more appropriate for the first-run intro page?

    yep that’s a great idea! I will update soon.

  7. DrahtBot added the label Needs rebase on May 20, 2025
  8. D33r-Gee force-pushed on May 20, 2025
  9. DrahtBot removed the label Needs rebase on May 20, 2025
  10. DrahtBot added the label Needs rebase on May 27, 2025
  11. D33r-Gee force-pushed on Aug 1, 2025
  12. DrahtBot removed the label Needs rebase on Aug 1, 2025
  13. Sjors commented at 7:10 am on September 8, 2025: member

    I’m a bit confused about the relation between this and https://github.com/bitcoin/bitcoin/pull/33117. I would suggest rebasing 60f676abf54a454361ae9f5dd17509ec929acbac on that branch for clarity.


    Managed to load the most recent testnet4 snapshot at height 90,000! (after I rebased)

    The file dialog was a bit unresponsive, but that’s fine since this is just PoC. I like the progress bar.

  14. D33r-Gee commented at 4:38 pm on September 8, 2025: none

    I’m a bit confused about the relation between this and bitcoin/bitcoin#33117. I would suggest rebasing 60f676a on that branch for clarity.

    Will rebase shortly with the changes from bitcoin/bitcoin#33117

    Managed to load the most recent testnet4 snapshot at height 90,000! (after I rebased)

    WooHoo!

    The file dialog was a bit unresponsive, but that’s fine since this is just PoC. I like the progress bar.

    Hmmm… will look into that… does the dialog hang?

  15. Sjors commented at 7:19 am on September 9, 2025: member
    The dialog wouldn’t respond to me clicking on a file or folder. But then after a minute or so it worked again.
  16. interfaces: expose UTXO snapshot functionaility in node interface
    - Added a new virtual method `snapshot` to the node interface for loading UTXO snapshots.
    - Updated the implementation in `interfaces.cpp` to activate the snapshot using a path.
    - Added `snapshot.h` to src/interfaces to process the path and extract the metada
    - Added `getMetadata` and `getActivationResults` methods for use by GUI and/or RPC
    - Added error handling method and member variable
    
    This change enhances the user ability to load utxo snapshots through the GUI
    db62435e5d
  17. D33r-Gee force-pushed on Sep 25, 2025
  18. D33r-Gee commented at 8:51 pm on September 25, 2025: none
    With 82a3969 it updates the interface methods to match https://github.com/bitcoin/bitcoin/pull/33117 It also adds a load snapshot button during the intro and seamless loading if a proper path has been selected (from @luke-jr suggestion) Also adds the use of threads to make sure there’s no hanging or UI blocking when the load snapshot button is used in the options dialog (hopefully addressing @Sjors experience). looking for any feedback on the approach and code implementation.
  19. poc: Implement GUI snapshot loading functionality
    - Added a new signal `snapshotLoadProgress` to the notifications interface for tracking snapshot loading progress.
    - Introduced a `SnapshotLoadWorker` class to handle snapshot loading in a separate thread, emitting progress updates.
    - Updated `ClientModel` to manage snapshot loading, including methods for setting verification progress and loading snapshots based on that progress.
    - Enhanced the GUI to allow users to select a snapshot file and display loading progress through a dialog.
    - Integrated snapshot path handling in the application initialization process.
    
    This change improves user experience by providing real-time feedback during snapshot loading operations.
    482e80b563
  20. D33r-Gee force-pushed on Sep 26, 2025

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin-core/gui. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2025-10-18 14:20 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me