gui-qml
gui-qml copied to clipboard
QML Snapshot Load
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
- Adds a basic GUI interface for loading UTXO snapshots via the Connection Settings panel
- Enables snapshot selection during onboarding, with loading when headers are synced
- Implements non-blocking snapshot loading via QT Thread
- Provides visual confirmation of snapshot activation
- Adds a snapshot progress notifications accessible via a handler
Implementation Details
Core Components Modified
- 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
- 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
- Snapshot Qml Model (qml/models/snapshotqml.cpp)
- Introduces a worker class to manage snapshot metadata
Key Design Decisions
- 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
- Build
- Launch Bitcoin Core QML GUI
- Navigate to Connection Settings
- 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
-
Test onboarding flow:
- Select a snapshot file during initial setup
- Verify it loads automatically after headers sync
-
Verify (see screenshots below):
- "Snapshot Loaded" confirmation appears
- For errors, check debug.log for [snapshot]
Ubuntu 22.04 Screenshots
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
feedback welcome on the approach and implementation details.