atomicDEX-API icon indicating copy to clipboard operation
atomicDEX-API copied to clipboard

ARRR (zcoin) activation may be slow, restarts on re-login

Open dimxy opened this issue 2 months ago • 0 comments

Situation description

This often takes long time and can be 30-60 min for the default sync time of 2 days. Another problem is that after re-login to the wallet ARRR activation starts again which may take minutes - apparently users would expect instant activation on wallet re-login.

The zcoin activation code was traced and time for each stage was measured. The longest operations are:

  • after wallet creation KDF downloads zk sapling params and this may take 10+ minutes over a VPN connection when internet is busy (this happens only once after wallet creation though).
  • GUI always passes a non-empty sync param on each activation (2 days by default). If it was empty KDF would resume from the latest point, but for a non-empty param KDF rewinds the db on the earliest point from the param. For the default 2-day sync param re-syncing of the db and extracting z-transaction also may take up to 10+ mins.

(We also discussed the 'unsync'ed lightwalletd node' problem but apparently this was not the case when I experienced slow ARRR activation.)

Proposed solution:

To resume zcoin activation from the latest stored point in wallet db (and not to rewind it) GUI should send the empty sync param. The simplest option could be that GUI keeps a flag indicating that sync was completed and will send empty sync params on subsequent calls (so activation would be resumed from the last wallet db record). Add a checkbox to reset that and send the original or new sync params to force wallet db rewinding and resyncing. No change in KDF needed for this option.

Another option, to simplify this for GUI, the KDF can decide on its own that it can start activation from the latest db record (if it is not too old ofc), even if GUI sends non empty sync params. We can also add a 'reset' flag to the activation params to forcefully rewind the db, if user still needs to resync (or re-utilise the existing skip_sync_params flag).

More statuses to return

KDF could return to the GUI more explicit status descriptions, for each stage which takes time, to better indicate progress, like: "1/3 Downloading zk-parameters" "2/3 Updating block cache" "3/3 Scanning blocks and building wallet db"

dimxy avatar Oct 26 '25 08:10 dimxy