gui-qml
gui-qml copied to clipboard
[DRAFT] WIP QML Generate Snapshot Signet
Based on #424. For evaluation purposes only!
GUI Integration for Generating UTXO Snapshots
Overview
This PR adds initial GUI support for generating 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 generating UTXO snapshots via the Connection Settings panel
- Implements non-blocking snapshot generation via QT Thread
- Provides visual confirmation of snapshot generation
- Adds a snapshot progress notifications accessible via a handler
Implementation Details
Core Components Modified
- Node Interface (
src/node/interfaces.cpp)
- Implements a notification handler for snapshot generation progress (rewind and restore)
- Snapshot Qml (
src/qml/models/snapshotqml.h)
- Introduces a worker class to manage snapshot generation
- QML Integration (
src/qml/models/nodemodel.cpp)
- Manages snapshot generation state and progress
- Uses Qt's thread system to prevent UI blocking
- Provides progress updates via Qt signals
- UI Components (
src/qml/components/SnapshotGenSettings.qml)
- File view for snapshot generation
- Snapshot generation progress and completion
Key Design Decisions
- Non-blocking Implementation
- Snapshot generation runs in separate QT thread
- UI remains responsive during generation
- Node is disconnected from the network during generation
- Extensibility
- Interface designed to accommodate future
assumeutxochanges - Error handling framework in place
Testing Instructions
- Build
- Launch Bitcoin Core QML GUI
- Navigate to Connection Settings
- Wait for IBD to complete
- Click "Generate Snapshot"
- Verify (see screenshots below):
- "Snapshot Generated" confirmation appears
- snapshot file is created in the
signetdata directory
Ubuntu 22.04 Screenshots
Expected Behavior
- File selection dialog works
- Success/failure state properly displayed
- Node is disconnected from the network during generation
Future Work
- Cancel Snapshot Generation
- Add ability to cancel snapshot generation
- Integration
- Coordinate with upstream
assumeutxochanges - Add support for network-specific snapshots (
testnetandmainnet)
Notes for Reviewers
Snapshot Compatibility
- Currently only works with
signet - 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.