gui-qml
gui-qml copied to clipboard
[DRAFT] WIP QML Load Snapshot Signet (160,000 height)
Based on #421. For evaluation purposes only!
GUI Integration for UTXO Snapshot Loading
Overview
This PR adds initial GUI support for loading a signet UTXO snapshot at height 160,000, building on Bitcoin Core's assumeutxo infrastructure.
What This PR Does
- Adds a basic GUI interface for loading UTXO snapshots via the Connection Settings panel
- 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
- Node Interface (
src/node/interfaces.cpp)
- Implements
snapshotLoad()based on theloadtxoutsetRPC - Uses background QT thread for non-blocking operation
- QML Integration (
src/qml/models/nodemodel.cpp)
- Manages snapshot loading state and progress
- Introduces a worker class to manage snapshot metadata
- Uses Qt's thread system to prevent UI blocking
- Provides progress updates via Qt signals
- UI Components (
src/qml/components/SnapshotSettings.qml)
- File selection dialog
- Snapshot verification status
- Progress tracking and visualization
Key Design Decisions
- Non-blocking Implementation
- Snapshot loading runs in separate QT thread
- UI remains responsive during load
- Extensibility
- Interface designed to accommodate future
assumeutxochanges - Error handling framework in place
Testing Instructions
- Build
- Launch Bitcoin Core QML GUI
- Navigate to Connection Settings
- Test with sample snapshot:
magnet:?xt=urn:btih:9da986cb27b3980ea7fd06b21e199b148d486880&dn=utxo-signet-160000.dat
- Verify (see screenshots below):
- "Snapshot Loaded" confirmation appears
- Block clock shows ~50% progress
- For errors, check debug.log for [snapshot] or [loadsnapshot] messages
Ubuntu 22.04 Screenshots
Expected Behavior
- File selection dialog works
- Success/failure state properly displayed
- Node becomes usable while background validation continues
Future Work
- Error Handling
- Add user-facing error messages
- Implement recovery paths
- Add snapshot validation UI once background validation has completed
- Integration
- Coordinate with upstream
assumeutxochanges - Add support for network-specific snapshots (
testnetandmainnet) - Integrate with initial setup wizard
Notes for Reviewers
Snapshot Compatibility
- Currently only works with
signetUTXO snapshot - Limited to specific 160,000 height
- Validates against chain parameters
m_assumeutxo_data(the changes there can be discarded once synced sincem_assumeutxo_datais already hardcoded)
This is a work in progress - feedback welcome on the approach and implementation details.