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

Batch accounts when decrypting transaction notes #4727

Merged
merged 9 commits into from Apr 22, 2024
Merged

Conversation

dguenther
Copy link
Member

@dguenther dguenther commented Feb 13, 2024

Summary

Scanning 40+ accounts on one node right now is almost impossible due to only executing one decryptNotes batch at a time, and splitting up the decryptNotes batches per transaction and per account. In the past, this was more of a concern that the worker pool job queue would get blocked, but now that we process tasks round robin from every task queue, we should be able to keep the queue full.

With nodeWorkersMax and nodeWorkers set to 12, this increases decryption time from about 1 block per second to about 10, depending on the number of notes per block. A secondary benefit is the decryption no longer happens inside the DB lock -- the account status seems to update more frequently on this branch, but it could be due to the scan speed.

Edit: Tests pass now, this is ready for review + manual testing.

Testing Plan

  • Ran a perf profile to verify that the main thread isn't blocked.

Documentation

Does this change require any updates to the Iron Fish Docs (ex. the RPC API
Reference
)? If yes, link a
related documentation pull request for the website.

[ ] Yes

Breaking Change

Is this a breaking change? If yes, add notes below on why this is breaking and
what additional work is required, if any.

[ ] Yes

@dguenther dguenther marked this pull request as ready for review April 18, 2024 21:02
@dguenther dguenther requested a review from a team as a code owner April 18, 2024 21:02
Copy link
Contributor

@hughy hughy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome!

A couple of minor comments, but this will be a huge improvement

ironfish/src/wallet/wallet.ts Outdated Show resolved Hide resolved
ironfish/src/wallet/wallet.ts Outdated Show resolved Hide resolved
ironfish/src/wallet/wallet.ts Outdated Show resolved Hide resolved
@dguenther dguenther merged commit 3fb06a9 into staging Apr 22, 2024
9 checks passed
@dguenther dguenther deleted the decrypt-parallel branch April 22, 2024 15:23
@dguenther dguenther changed the title Decrypt notes in parallel Batch accounts when decrypting transaction notes Apr 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants