-
Notifications
You must be signed in to change notification settings - Fork 502
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
services/horizon: Update txsub queue to account for new CAP-21 preconditions #4283
Comments
Do you mean we should still order them by That doesn't really make sense to me. |
What's the issue you see, @2opremio? I think we want there to be as few gaps as is possible, so we should order by Consider the following set of transactions:
Ordering it as
will cause
results in all of them succeeding. However, we can't know ahead of time that |
Is it correct, that we order by |
It is correct, we should maintain the semantics but not necessarily the internal order, which is what I am referring to.
If you use a priority queue ordered by Introducing Let
Let's assume that the initial account sequence is 7. You can no longer look at If we order by
Doing that, we can look at Things turn around if we set the initial account sequence to 8: If we order by But ... if we order by So, either I am missing something or using a transaction priority queue ordered by |
Anyways, it's an implementation detail, but I don't see other way but to traverse the full queue every time :S |
Implemented here: #4301 |
Closed by #4301 👏 |
The rules that make a transaction’s sequence number valid have changed considerably. As such, the transaction submission queue will need changes. Horizon will have a harder time “helping” submitters by ordering their transactions, waiting for particular sequence numbers, etc. However, this only happens in the case in which transactions have the
minSeqNum
condition set, which is not expected to be a large portion.Today Horizon orders transactions by sequence, then submits the lowest one in that queue if it equals the next expected sequence on the account. With CAP-21 loosening the validity conditions, Horizon needs to allow gaps in sequence numbers (rather than strict increments), though it should still order them in ascending order.
The necessary changes are minor: if the next transaction in the queue has a
minSeqNum
condition set, we also check if:The text was updated successfully, but these errors were encountered: