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

Enhancement: Only look back to FirstValid for pending transactions that were found in the pool #5295

Merged
merged 4 commits into from
Apr 28, 2023

Conversation

barnjamin
Copy link
Contributor

@barnjamin barnjamin commented Apr 11, 2023

Summary

Addresses #3967 to provide a much faster response time when looking for pending transactions.

The current behavior is to look in the pending pool for the transaction ID, if found set a flag and speculatively set the txn var to be returned but continue looking through the last ~1k blocks for the same transaction.

This change uses the information we found in the pending pool (if found) to restrict the historic rounds we search to only those where it could possibly be found.

Since this endpoint is most commonly used to track confirmed transactions, the FirstValid round is likely to be recent. So for an unconfirmed transaction that is found in the pool, we don't waste time looking back 1k rounds for it

Test Plan

Copied bin into sandbox and curl'd it

@barnjamin barnjamin marked this pull request as ready for review April 12, 2023 17:41
@barnjamin barnjamin changed the title draft: Add GET param for lookback rounds on pending txn endpoint Enhancement: Add GET param for lookback rounds on pending txn endpoint Apr 12, 2023
@barnjamin barnjamin changed the title Enhancement: Add GET param for lookback rounds on pending txn endpoint Enhancement: Only look back to FirstValid for pending transactions that were found in the pool Apr 12, 2023
@winder winder requested a review from jasonpaulos April 27, 2023 14:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants