-
Notifications
You must be signed in to change notification settings - Fork 155
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
restore: Add birthday option. #2346
Comments
I can work on this if that's alright. @jrick do you have a strong preference on where/how to set this? Setting a date would be best I think, I think we can look at block headers to get to closely before the date and set that as the restore from value Lines 386 to 400 in 3b70812
Do we want to also save the birthday as a new value? I guess you could use it whenever the user did a rescan without specifying height as the default? Or would this not be great if the user imported a new script or something? You can set rescan height there too though already. |
Related: #320 |
I would save the birthday date to a new field in the db. It shouldn't take long to bisect the block headers to find a close enough starting height. The rescan point is related but not the same, it is the last block that we have marked transactions synced through, so when we perform a rescan on future startups, we are only scanning blocks not considered before. We can't confuse that with the birthday, which is where the initial rescan point needs to be calculated from. The rescan rpcs, which today all begin at the genesis block if a height is not provided, should resolve a starting height based on the birthday (when a height is not provided). |
If you are going to add a new prompt to the wallet creation setup, i would insert it before this xpub import i recently added so it is asked immediately after the restored seed prompt: 25b8ae6. we have't released a version with this feature yet, so i'm not as concerned about breaking it from scripted input. |
When a new wallet is created, initial sync will look for relevant transactions starting from the genesis block. For new wallets this is not necessary at all, and for restored wallets, if the user knew when the wallet was made, or that info was stored in their mnemonic, they only need to search for transactions from the day when the wallet was created.
There are four apps at least that could also benefit from a birthday. Cryptopower, Cake, and dex use an internal dcrwallet, dex can also use the rpc wallet, and decrediton uses the wallet over grpc. All wold benefit from setting an birthday before initial sync, or disabling initial sync and letting them rescan from height later.
Related discussion decred/decrediton#3940
The text was updated successfully, but these errors were encountered: