-
Notifications
You must be signed in to change notification settings - Fork 63
Feat/lw 11842 performance improvements #1530
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
Feat/lw 11842 performance improvements #1530
Conversation
|
|
Added more unit tests for rollback behaviour here: 6d0e216 |
719a41b to
627acab
Compare
…ore emission - rollback logic optimized to only check transactions in reverse order Co-Authored-By: mirceahasegan <[email protected]>
627acab to
2306f10
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fantastic work @AngelCastilloB 🚀
Context
Currently transactions are always compared (in quadratic time) and stored. This one is probably the main culprit of the performance issues in wallets with high TX history count. The Wallet fetches the transaction from last known slot up to tip, then it has some heuristic to determine if there were changes (such as rollbacks or new transactions), and if so applies the changes, after that it stores the transactions and returns them. It has a guard to avoid emitting the same transactions several time by comparing them to last emitted. It is using an algorithm of complexity O(N x M).
Additionally, Lace fetches the whole UTXO set of the wallet on every tip update.
Proposed Solution