-
Notifications
You must be signed in to change notification settings - Fork 92
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
Inner Transaction Search #721
Conversation
Codecov Report
@@ Coverage Diff @@
## develop #721 +/- ##
===========================================
+ Coverage 54.09% 54.88% +0.78%
===========================================
Files 23 27 +4
Lines 3734 3817 +83
===========================================
+ Hits 2020 2095 +75
- Misses 1446 1450 +4
- Partials 268 272 +4
Continue to review full report at Codecov.
|
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'm still a bit confused. Two questions.
- if the filter matches only two inner txns, what needs to be returned?
- what does the limit do when inner txns are matched?
This reverts commit 59c6e8f.
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.
Besides code comments, one problem I see is with paging. Suppose we have these transactions:
0 - root
1 - inner
2 - inner
3 - root
Now I do a query that matches all the transactions with limit 2. The DB layer returns 0 and 1, the API layer return 0 along with next token {round: x, intra: 1, id: ID(0)}. The next query from the user will have limit 1, the DB layer will return txn 2 but the API layer will filter it out and return 0 results. So the user will never get to txn 3!
I suggest, the DB layer will return the new next token, moving the intra past the last inner txn.
@tolikzinovyev regarding the paging issue... nice catch. Probably not a big deal with this first iteration since there is a maximum of 16 inner transactions, but in the next version there maybe hundreds. I'm going to create a follow-up ticket to focus on that issue. edit: Created #750 |
I'd rather keep the develop branch bug-free and ideally we should change this PR. I see two options here. Let me know if you think they will not work or there is a better way. Option 1: If in the future we need to also return inner txns, we can again extend Option 2: |
@tolikzinovyev I was thinking option 2 also. It's really ugly since it requires checking the query flags and figuring out the sort order (for the interface, a postgres implementation detail). An option 3 could be adding |
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.
Paging seems correct now. Why do we need to update go-algorand?
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.
Looks good, but please restore the go-algorand version before merging!
Summary
Update queries to support returning the root transaction bytes when matching an inner transaction.
Test Plan
New unit tests.