ironfish icon indicating copy to clipboard operation
ironfish copied to clipboard

accounts:rescan very slow if more than one account added

Open gzivdo opened this issue 2 years ago • 3 comments

What happened?

accounts:rescan do rescan with many accounts too slow. for now one account rescans in 12-20 hours, 6 accounts 6 days+, 2 accounts 2-3 days.

possibly make an option to rescan only from certain block/date, ppl know from which time they start to use new account.

p.s. still there is no rescan progress (with reset flag, initiated when node stopped) in status p.p.s. its too slow, why? may be do it in parallel on many threads. it cannot be like this in mainnet, somehow it should be much more faster like 50-200x times. may be do some snapshot of balances in db for each 5k/10k/50k blocks.

Version

0.1.37

Debug output

No response

Relevant log output

No response

Graffiti

ar2Obyahain

gzivdo avatar Jun 30 '22 11:06 gzivdo

There are improvements being made to this, as we're re-writing our wallet right now for wallet 2. There will be some parallelization in decrypting nodes soon. That is in this PR here, https://github.com/iron-fish/ironfish/pull/1708

I removed the bug label because this is more of a request of behavior of change. A few of these requested changes are coming in our wallet re-write.

One major change you're asking for is solved by "account birthdays", which we don't have right now.

NullSoldier avatar Jul 01 '22 19:07 NullSoldier

got it, thanks, will wait implementation.

gzivdo avatar Jul 01 '22 21:07 gzivdo

I've done some testing and found other issues and ideas.

  1. To make faster rescan allow to export/import transactions hashes/id/blocknumber for account, do decryption only for them (as option)

  2. This is major issue, not a bug. The accounts database grow and all operation become very slow because of it (i made tests):

  • seems there is no index in accounts database
  • if you do operations with one active account, size of all database should not affect the speed. if the account new and just created the speed of deposit/pay/balance/unspentnotes list should be like it fresh node just synced.
  • if you delete all accounts (accounts:remove), then create new one, accounts database are still big, there is no way to clean it completly. make something as workaround to clean completly / recreate only accounts database for use with new addresses only. it will definitely solve speed issues at least temporarly.

gzivdo avatar Jul 04 '22 20:07 gzivdo