-
Notifications
You must be signed in to change notification settings - Fork 212
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
[FR]: Enhance Pirate sync #2362
Comments
i don't see the need for additional the behavior of latest mm2 from dev branch (including KomodoPlatform/komodo-defi-framework#1967) is to overwrite the cache/DB when activating with date param set... it then starts with a clean DB, but at that date... if no sync param set, it continues from where it stopped the only 2 cases for setting a date sync param is on first start (when no cache/DB there) to make the first sync faster by specifying a date... and when someone wants to forcefully reset DB and resync if the app would not pass date param at all after a restart of the app, but would do it only in the current session, it would solve the current problem and cover all usecases (i guess this can be achieved by simply not saving the date in cfg.ini, have the variable only set in current session and only pass sync params to ARRR activation when a date is set) if user activates for the first time it starts at a default (eg 7 days ago, if user hasn't set something else before first activation)... this does not take long... if user is missing balance (eg because utxos older then 7 days in wallet), he would need to disable ARRR, set a date and enable ARRR... the activation would pass the date and mm2 would resync from that date if user just wants to reset the DB and start again from a specified date, same procedure in all other cases, it would continue from it where it stopped EDIT: |
Issue solved at api level and with block height calc logic generalized to nearest 1000 |
Currently there are a few quirks with ARR activation (depending on API version and params used). After some discussion with @cipig and @borngraced and feedback from PIRATE team, a few cases and options have been mentioned as below.
On first load, sync from the wallet creation date. I'm not sure this is currently stored (though it can be in future). For where we do not have this data, we could use something like a date 2 weeks prior to first swap date.
In some cases (explained in further detail below), existing cache may not be reused when activating. Adding a boolean
use_cache
param could better govern this, though there are exceptions (e.g. earlier sync date param than earliest cache data) where it may not be reused. E.g.use_cache
should default totrue
On GUI side, setting the date to sync from in settings is suboptimal:
dev
branch API, using date param always abandons the cache, leading to long activation times on each use if date set back too far.This could be solved by:
sync_params
, and withexisting_cache
would meancontinue_sync_from(max_cache_height)
. There is potential trouble with this if theone_shot
date activation fails or is interrupted, but allows for a simple way to force a rescan (just change the date). Until theuse_cache
param is available though, it will also force a resync ifsync_params["height"]
is >min_cache_height
continue_sync_from(max_cache_height)
, anduse_cache
. This is the maximum support for all available params and allows for more specific values for each Z coin.I think the table below summarises what I would expect from a variety of sync_params value cases
@cipig @borngraced please add any extra info or ideas in this issue so we can find the best path for the next release.
The text was updated successfully, but these errors were encountered: