Skip to content
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

feat: use CipherSeed wallet birthday for recovery start point #3602

Merged

Conversation

philipr-za
Copy link
Contributor

Description

This PR makes use of the wallet birthday encoded into the wallet’s CipherSeed as a starting point for wallet recovery. This is instead of starting at the genesis block and will reduce the amount of work the wallet needs to do significantly by exclude all the blocks before its birthday.

This PR implements a new RPC method on the BaseNodeSyncRpcService service called get_height_at_time which accepts a Unix Epoch time. The base node will then use a binary search strategy to determine what the block height was at that time. When a fresh Wallet Recovery is started if there isn’t a current progress metadata already stored in the database the wallet will calculate the unix epoch time of two days prior CipherSeeds birthday. This is to account for any timezone issues and does not add much in terms of work to the process. The wallet will then request the height at this time, request the header for that height and will be able to start the recovery process from that point.

How Has This Been Tested?

Tests provided for RPC service and CipherSeed birthday db storage.
UTXO Recovery tested manually

This PR makes use of the wallet birthday encoded into the wallet’s CipherSeed as a starting point for wallet recovery. This is instead of starting at the genesis block and will reduce the amount of work the wallet needs to do significantly by exclude all the blocks before its birthday.

This PR implements a new RPC method on the BaseNodeSyncRpcService service called `get_height_at_time` which accepts a Unix Epoch time. The base node will then use a binary search strategy to determine what the block height was at that time. When a fresh Wallet Recovery is started if there isn’t a current progress metadata already stored in the database the wallet will calculate the unix epoch time of two days prior CipherSeeds birthday. This is to account for any timezone issues and does not add much in terms of work to the process. The wallet will then request the height at this time, request the header for that height and will be able to start the recovery process from that point.
@aviator-app aviator-app bot merged commit befa621 into tari-project:development Nov 23, 2021
sdbondi added a commit to sdbondi/tari that referenced this pull request Nov 23, 2021
* development:
  fix: seed word parsing (tari-project#3607)
  feat: add ban peers metric (tari-project#3605)
  feat!: expose reason for transaction cancellation for callback in wallet_ffi (tari-project#3601)
  test: improve cucumber scenario robustness (tari-project#3599)
  feat: use CipherSeed wallet birthday for recovery start point (tari-project#3602)
  docs: ignore RFC code blocks (tari-project#3603)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants