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
api: optimize /transactions/pending/{txid} endpoint #5891
Conversation
* Use txtail data to find txid in memory instead of iterating blocks * RPS: before: 10, after: 450 * Another optimization possible with caching blocks that would bump RPS to 30k
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.
I like how simple this change is!
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## master #5891 +/- ##
==========================================
- Coverage 55.92% 55.89% -0.04%
==========================================
Files 477 477
Lines 67432 67458 +26
==========================================
- Hits 37713 37703 -10
- Misses 27164 27195 +31
- Partials 2555 2560 +5 ☔ View full report in Codecov by Sentry. |
While unit testing I found |
After offline discussion decided to still have it and use txTail lookup as a filter that probably vast majority of use cases when people immediately lookup for recently submitted transactions with LastValid at least few rounds in future. |
Relevant ticket #3967 |
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.
Added a question or two, but overall this makes sense to me. I second JJ's suggestion around uint vs int, but will not block approval on it.
Summary
Test Plan
Added unit test for new txtail logic