-
Notifications
You must be signed in to change notification settings - Fork 501
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: chained transactions are delayed #4062
Comments
Potentially related: #2628 |
I debugged the issue and I understand what's going on. The submission list per account is maintained in Horizon instance which served the POST request. If all submissions reach a single instance in a cluster it has a full view of the list and submits pending all transactions to Stellar-Core. However, if submissions reach different clusters Horizon rely on ingestion to update sequence numbers in ledgers which triggers submissions. This explains why a standalone Horizon process all transactions fast. I used @leighmcculloch's tool to submit txs to horizon-testnet.stellar.org and I later checked the logs. Here you can see that transactions reached two separate instances and if an instance received subsequent tx seqnums it submitted them to Stellar-Core right away:
Tool output:
As for solutions the only reliable way is to move the list to a DB so that it's maintainer per cluster not per instance. We could set session pinning in a proxy but it relies on cookies so won't always work. |
Closed by #4996 |
It appears that chained transactions for a single are delayed when those transactions are submitted to Horizon. A set of transactions will consistently have the first transaction in the next ledger, while all subsequence transactions are delayed for the subsequent ledgers. The same transaction set submitted directly to Core are consistently included in the immediate next ledger, and are not delayed.
Both @tyvdh and I have experienced this using different clients which suggests this is not an issue with any particular client but an issue with Horizon's transaction submission system.
The impact of this is that it is much slower to submit a chain of transactions to Horizon. On networks like testnet and pubnet the issue is exasperated by other traffic and transactions will take much longer to confirm than if submitted in isolation. On private networks, like running a standalone network with no other traffic, the problem is still visible although only the first transaction in a set will typically be delayed.
I've written a tool that demonstrates this. The tool is in this PR #4061 for anyone who wishes to replicate the issue. The output included in this issue was generated by this tool.
You can get the tool by running:
Running against testnet and submitting transactions 100ms apart we see the first transaction is placed in the next ledger while other transactions are spread out over subsequent ledgers taking up to 30 seconds to be submitted:
Running against a local standalone private network we see the first transaction is placed in the next ledger while other transactions are placed in the subsequent ledger:
Running against a local standalone private network and submitting directly to Core we see the transactions get accepted into the same ledger:
Note the output has some fields truncated to fit them on screen.
cc @tyvdh @ire-and-curses @stellar/horizon-committers
Related Slack conversation: https://stellarfoundation.slack.com/archives/C9H5JTW1J/p1636559850127000
The text was updated successfully, but these errors were encountered: