Skip to content
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

Scan_tx stucks on newer versions #9354

Open
sharifzadesina opened this issue Jun 6, 2024 · 9 comments · May be fixed by #9389
Open

Scan_tx stucks on newer versions #9354

sharifzadesina opened this issue Jun 6, 2024 · 9 comments · May be fixed by #9389
Labels

Comments

@sharifzadesina
Copy link

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.

@woodser
Copy link
Contributor

woodser commented Jun 6, 2024

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.

@sharifzadesina sharifzadesina changed the title Scan_tx stuck on newer versions Scan_tx stucks on newer versions Jun 6, 2024
@sharifzadesina
Copy link
Author

@0xFFFC0000 Excuse me, but Is this considered a "question"? because literally scan_tx takes 10 (or more) minutes to run.

@0xFFFC0000
Copy link
Collaborator

0xFFFC0000 commented Jun 6, 2024

@sharifzadesina thank you for reporting this. We will take a look into this.

  1. This happened after specific updates?
  2. Have you tried on other systems with other configurations too, and problem was still present?

In the meantime it appears to me @woodser has explained the actual reason.

@selsta
Copy link
Collaborator

selsta commented Jun 6, 2024

Issue got introduced here: #8566

@j-berman
Copy link
Collaborator

j-berman commented Jun 6, 2024

The expected behavior:

  • user restores a wallet using current chain height as restore height
  • user calls scan_tx with an earlier tx
  • scan_tx returns immediately

The 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.

@sharifzadesina
Copy link
Author

sharifzadesina commented Jun 6, 2024

@j-berman Exactly, Thank you.

Even when I set restore height to a higher value, it takes too long to finish.

@sharifzadesina
Copy link
Author

Bump! any update on this?

@j-berman
Copy link
Collaborator

Will fix by end of this week

@sharifzadesina
Copy link
Author

@j-berman Thank you, I wish I could help, I just don't know C++,

j-berman added a commit to j-berman/monero that referenced this issue Jun 29, 2024
@j-berman j-berman linked a pull request Jun 29, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants