dusk-network / rusk

The reference Dusk platform implementation and tools
Mozilla Public License 2.0
135 stars 58 forks source link

[EPIC] Allow users to sync from a specific block height #1521

Open nortonandreev opened 5 months ago

nortonandreev commented 5 months ago

Allow users to sync from a specific block height

Summary

Currently, creating / restoring a Wallet takes a long time, dependent on the blockchain size. We should explore the option to optimize performance by allowing users to sync from the point when the user's wallet has been created.

This epic captures all the requirements and the work needed to fulfill this initiative.

Requirements

Each requirement needs a design, as well as making sure we have the APIs on the service side, dusk-wallet-js (eg. for setting the height to sync from, to receive the current block height, etc).

Tasks

web-wallet:

wallet-js:

docs:

Benefits

Syncing from a recent block height is considerably faster as there is significantly less historical data to process. Partial synchronization also uses less disk space and reduces network bandwidth consumption, which could be important for users with limited resources.

Risks

There are several risks related to syncing from a specific block height:

Risk Mitigation Strategies

ZER0 commented 5 months ago

This is what Monero does: https://www.getmonero.org/resources/user-guides/change-restore-height.html#what-is-the-wallet-restore-height

nortonandreev commented 5 months ago

This is what Monero does: https://www.getmonero.org/resources/user-guides/change-restore-height.html#what-is-the-wallet-restore-height

Lovely, thank you! Was looking for this info. To sum up, Monero:

set_new_restore_height-date

change_wallet_restore_height

rescan_wallet_cache

laremas commented 5 months ago

As a starting draft i created this screen.

syncing

This is not to be intended as final, is just a draft that needs to be discussed.

laremas commented 5 months ago

Design Update.

Added a screen to copy the block height when creating a wallet. 1st setup


Added possibility to sync from genesis or custum height. sync sync1


Added current block height info/copy possibility in settings. settings