Open sharifzadesina opened 4 months ago
Essentially the issue is that calling scan_tx
also calls refresh
which syncs the entire blockchain starting from the tx height.
So this issue is requesting to scan the minimum necessary.
@0xFFFC0000 Excuse me, but Is this considered a "question"? because literally scan_tx
takes 10 (or more) minutes to run.
@sharifzadesina thank you for reporting this. We will take a look into this.
In the meantime it appears to me @woodser has explained the actual reason.
Issue got introduced here: https://github.com/monero-project/monero/pull/8566
The expected behavior:
scan_tx
with an earlier txscan_tx
returns immediatelyThe problem: scan_tx
calls refresh()
, which can take a long time to complete even if the wallet's restore height is set to the current height.
This needs confirmation (repro with the RPC and observe the logs), but I believe refresh is slow to complete even when setting restore height to current height because it's taking a while to get all block hashes from the chain starting from genesis.
Assuming this is the general issue (long-running refresh in scan_tx), the simplest fix for this is probably to remove the call to refresh in scan_tx
, which means the wallet won't have the latest chain state upon completion of scan_tx
. This is probably ok and expected.
The more involved fix is to refactor fast_refresh
and scanning to not need all block hashes from the chain, and to only need hashes starting from the wallet's restore height. The Seraphis lib does this refactoring already, which we're in the process of migrating toward, so I would lean towards the simpler fix for now.
@j-berman Exactly, Thank you.
Even when I set restore height to a higher value, it takes too long to finish.
Bump! any update on this?
Will fix by end of this week
@j-berman Thank you, I wish I could help, I just don't know C++,
It seems because of this todo, Scan_tx gets stuck when trying to scan transactions before syncing wallet.
It is related to woodser/monero-ts#212.