gui-qml icon indicating copy to clipboard operation
gui-qml copied to clipboard

QML Snapshot Load

Open D33r-Gee opened this issue 3 months ago • 5 comments

This is an re-opened PR based on #424 and #449. It's an alternate to #485 that uses a different /bitcoin branch instead of a patch.

UTXO Snapshot Loading

Overview

This PR enables loading UTXO snapshots both during and after the initial onboarding process.

What This PR Does

  1. Adds a basic GUI interface for loading UTXO snapshots via the Connection Settings panel
  2. Enables snapshot selection during onboarding, with loading when headers are synced
  3. Implements non-blocking snapshot loading via QT Thread
  4. Provides visual confirmation of snapshot activation
  5. Adds a snapshot progress notifications accessible via a handler

Implementation Details

Core Components Modified

  1. CPP Backend (qml/models/nodemodel.cpp)
  • Manages snapshot loading state and progress
  • Uses Qt's thread system to prevent UI blocking
  • Provides progress updates via Qt signals
  • Adds support for storing snapshot file path during onboarding
  • Implements automatic snapshot loading once headers are synced
  1. UI Components (qml/components/SnapshotLoadSettings.qml, src/qml/components/ConnectionSettings.qml)
  • File selection dialog with onboarding awareness
  • Snapshot verification status
  • Progress tracking and visualization
  • Updated visibility conditions to enable loading during onboarding
  1. Snapshot Qml Model (qml/models/snapshotqml.cpp)
  • Introduces a worker class to manage snapshot metadata

Key Design Decisions

  1. Onboarding Integration
  • Allows users to select snapshot during setup
  • Delayed loading until headers are synced
  • Proper state handling between onboarding and regular modes

Testing Instructions

  1. Build
  2. Launch Bitcoin Core QML GUI
  3. Navigate to Connection Settings
  4. Test with different snapshots:
mainnet: magnet:?xt=urn:btih:559bd78170502971e15e97d7572e4c824f033492&dn=utxo-880000.dat&tr=udp%3A%2F%2Ftracker.bitcoin.sprovoost.nl%3A6969

alternatively, you can use the following link to download the mainnet snapshot: https://bitcoin-snapshots.jaonoctus.dev/

signet: https://drive.google.com/file/d/1VJeeGQncrs4xZhh6kU5IwkyatXVM4SOm/view?usp=sharing
  1. Test onboarding flow:

    • Select a snapshot file during initial setup
    • Verify it loads automatically after headers sync
  2. Verify (see screenshots below):

    • "Snapshot Loaded" confirmation appears
    • For errors, check debug.log for [snapshot]
Ubuntu 22.04 Screenshots

Screenshot 2025-05-05 154558 Screenshot 2025-05-05 154615 qt6_loading_snapshot_dialog Screenshot 2025-05-05 154703 Screenshot 2025-05-05 154720 Screenshot 2025-07-30 103140

Expected Behavior

  • File selection dialog works
  • Node becomes usable while background validation continues
  • When selected during onboarding, snapshot loads after headers sync
Success/failure state properly displayed Screenshot 2025-07-30 101752

feedback welcome on the approach and implementation details.

D33r-Gee avatar Jul 31 '25 21:07 D33r-Gee