Add UTXO Snapshot Loading Interface and Progress Notifications
This PR implements a complete interface for loading UTXO snapshots through the GUI, including progress notifications to provide user feedback during the loading process.
Changes
Commit 1: interfaces: expose UTXO snapshot loading in node interface
- Added a new virtual method
loadSnapshotto the node interface for loading UTXO snapshots. - Updated the implementation in
interfaces.cppto activate the snapshot using the provided file and metadata. - This change enhances the user’s ability to load UTXO snapshots through the GUI.
Commit 2: notifications: Implement snapshot load progress notifications
- Added a new signal
SnapshotLoadProgressfor snapshot load progress in the UI interface. - Updated the notifications interface to include a method for reporting snapshot loading progress.
- Enhanced the
ChainstateManagerto report progress during snapshot loading. - Implemented the necessary handler in the kernel notifications to relay progress updates.
- This change improves user feedback during the snapshot loading process.
Commit 3: rpc: refactor loadtxoutset to use snapshot interface
- Updated the loadtxoutset RPC to call the new snapshot interface instead of directly working with chainstate internals.
- Added getMetadata and getActivationResult methods to the snapshot interface to provide parity with the legacy RPC.
- Improves modularity by consolidating snapshot handling through the interface layer.
Technical Details
The implementation includes:
-
UI Interface Enhancement Added
SnapshotLoadProgresssignal toCClientUIInterfacewith corresponding signal declaration and implementation. -
Node Interface Added
loadSnapshotvirtual method to the node interface with implementation ininterfaces.cpp. -
Progress Notifications Implemented
snapshotLoadProgressmethod inKernelNotificationsclass to relay progress updates to the UI. -
Base Interface Added
snapshotLoadProgressvirtual method to the kernel notifications interface.
Benefits
-
User Experience Provides real-time feedback during UTXO snapshot loading operations.
-
GUI Integration Enables loading UTXO snapshots directly through the Bitcoin Core GUI.
-
Progress Tracking Users can monitor the progress of snapshot loading operations.
-
Consistent Interface Follows the existing pattern for progress notifications in the codebase.
Testing
- Daemon build and launch
bitcoindthen withbitcoin-cliload a snapshot using:
0./bitcoin-cli -rpcclienttimeout=0 -signet loadtxoutset /path/to/utxo-snapsshot.dat