-
Notifications
You must be signed in to change notification settings - Fork 40
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[DRAFT] WIP QML Load Snapshot Signet #424
base: main
Are you sure you want to change the base?
Conversation
cb409e3
to
670ca05
Compare
With cb409e3 rebased and got rid off the extra options_mode settings which are not relevant for this evaluation. Also deleted the extra loadsnapshot.cpp file and instead added the load snapshot function in src/node/interfaces.cpp |
Should I be getting a binary specific for this issue? I tried loading a signet snapshot into the one for #421 but was unable to... |
670ca05
to
b77f7c1
Compare
With b77f7c1 minor tweaks to the src/node/interfaces.cpp snapshotload() function. It mimics the rpc call loadtxoutset from bitcoin/bitcoin repository Next will connect the loading to the progress bar |
b77f7c1
to
c59e557
Compare
with c59e557 Integrated the UI with the C++ backend, implementing a progress callback function to dynamically update the loading progress based on the number of coins processed. Touched src/validation.h and src/validation.cpp to extract the coin loading progress. Next: will update the "Loaded Snapshot" stack with the real info from the snapshot |
c59e557
to
e3f8c70
Compare
With e3f8c70 moved the load snapshot functionality from nodeModel to optionsModel since it make it easier to store the snapshot info and reduces redundant variable declarations. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With e3f8c70 moved the load snapshot functionality from nodeModel to optionsModel since it make it easier to store the snapshot info and reduces redundant variable declarations.
e3f8c70 is a regression because optionsmodel is not an appropriate place for this, and we are now violating the role of settings.json to store the state of a process.
NodeModel and AppMode are more appropriate places for this information. But the entire approach here is still a concept NACK as we are performing unecessary changes to validation and chainparams.
src/qml/models/options_model.cpp
Outdated
if (new_snapshot_load_completed != m_snapshot_load_completed) { | ||
m_snapshot_load_completed = new_snapshot_load_completed; | ||
if (m_onboarded) { | ||
m_node.updateRwSetting("snapshotloadcompleted", new_snapshot_load_completed); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This would be polluting settings.json that stores read/write configuration options for core -> with a state of a process. We cannot do this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes sense, although I have a question for when we would want to allow the user to load a snapshot during onboarding, could the snapshot file path be stored in the settings.json?
Ok I tested artefact#235 and functionality & UI seems to work. Didn't see block clock so couldn't verify easily. Adding some UI feedback below:
|
e3f8c70
to
90dc0dd
Compare
with 90dc0dd rebased over main and addressed @jarolrod concerns by reverting back to just a minimal integration of the loading snapshot functionality. @yashrajd I will address the UI issues next As a follow up will investigate how to access the snapshot verification progress Also looking into how to make the snapshot data persist and be available for display (i.e. snapshot block height, date, and merkle hash) |
For the chainparams the changes there are only temporary for evaluating and testing within this repo. I checked upstream and the signet snapshot has already been hardcoded so once our repo is synced the changes in chainparams.cpp can be discarded. |
This introduce the UI flow to load a AssumeUTXO snapshot into the Bitcoin Core App. It modifies the connection seetings and adds a SnapshotSettings file, Icon, and modified profress bar. It has been rebased
90dc0dd
to
85592f5
Compare
with 85592f5 made the snapshot activation persist on node restart by making use of the interface with chain->hasAssumedValidChain Also changed the green-check icon size to 30 pix Next looking into how to extract the progress from the ActivateSnapshot process |
85592f5
to
955c65d
Compare
with 955c65d modified the snapshotLoad() function in src/node/interfaces.cpp and the initializeSnapshot() function in nodemodel.cpp to extract progress information using regular expressions. This design decision aimed to keep snapshot loading mechanisms self-contained. However, it looks like the use of Perhaps the way to go is to use the handler in src/node/interfaces_ui ... will explore that path then update |
955c65d
to
0eba513
Compare
with 0eba513 reverted back to minimal snapshot load functionality. Snapshot loading progress is still not were I want it to be so in the meantime replaced the progress bar with placeholder text. Also updated the snapshot info display. once successfully loaded, and I'm using the hardcoded info in |
0eba513
to
cd2ec69
Compare
With cd2ec69 added a section to keep track of snapshot loading, it is not ideal so will look for better ways to achieve it. Since the core functionality is there will ask for "pre-reviews" before un-drafting |
id: settingsStack | ||
currentIndex: onboarding ? 0 : snapshotVerified ? 2 : 0 | ||
|
||
function startLoading() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can't introduce any javascript functions
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah ok going to use signals and connections instead
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
using nodeModel member variable so that snapshotLoading persist while navigating away from settings page.
anchors.horizontalCenter: parent.horizontalCenter | ||
|
||
// TODO: Remove this once the verification progress is available | ||
Timer { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you write documentation on what we test in this PR? How we know a snapshot loaded, how we know that anything is working?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yep will do
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok added documentation commnents for testing
5d0756c
to
262bb03
Compare
with 5d0756c updated with 262bb03 updated Next looking into how to finesse the snapshot loading progress... |
Adds minimal wiring to connect QML GUI to loading a signet UTXO snapshot via the connection settings. Uses SnapshotSettings.qml to allow user interaction. Modifies src/interfaces/node.h, src/node/interfaces.cpp and chainparams.cpp (temporarily for signet snapshot testing) to implement snapshot loading functionality through the node model. Current limitations: - Not integrated with onboarding process - Requires manual navigation to connection settings after initial startup - Snapshot verification progress is working, could be improved Testing: 1. Start the node 2. Complete onboarding 3. Navigate to connection settings 4. Load snapshot from provided interface
262bb03
to
a6bede5
Compare
with a6bede5 removed comments from |
Based on #421. For evaluation purposes only!
This adds wiring to connect the QML GUI to loading a signet utxo snapshot (160000 block height) via the connections settings.
Here a magnet link for the snapshot:
This version currently does NOT work with Onboarding.
Testing:
If successful the snapshot progress sould fill and then the "Snapshot Loaded" portion should show and the snapshot details be accurate. Also the block clock should display 50% (see updated screenshots below)
If an error occurs check the
debug.log
file in thedatadir
(i.e. ~/.bitcoin) and search for [loadsnapshot] or [snapshot] to find the error.This is a work in progress, do not merge!
Ubuntu 22.04 Screenshots