Stellar - Broadcast Transaction Timeout
A Stellar broadcast timeout means Horizon got no ledger confirmation within about 30 seconds; the transaction may still succeed, so check its hash first.
A Stellar broadcast timeout means Horizon didn't get confirmation from Stellar Core that your transaction made it into a ledger in time, so it stopped waiting after about 30 seconds. The transaction can still be applied. Check it by hash first, then resubmit the exact same signed transaction (same sequence number) or raise the fee.
Symptom
When attempting to broadcast a Stellar transaction, you get an error like this:
{
"statusCode": 403,
"errorCode": "xlm.broadcast.failed",
"message": "Unable to broadcast transaction.",
"cause": "Title: Timeout. Type: Detail: Your request timed out before completing. Please try your request again. If you are submitting a transaction make sure you are sending exactly the same transaction (with the same sequence number).."
}Cause
This error occurs when either:
- Horizon has not received a confirmation on time. Horizon submits the transaction to a Stellar Core server and waits about 30 seconds for confirmation that it was included in a ledger. If none arrives, it returns a timeout, even though the transaction can still make it into a ledger.
- The blockchain is congested. When more operations are submitted than fit in a ledger, the network enters surge pricing and fees act as bids: transactions that offer a higher maximum fee get in first. Stellar Core holds a transaction with too low a fee and retries it for the next few ledgers.
Solution
-
Check the transaction by hash. Your Stellar SDK can compute the hash of the transaction you signed. Horizon returns
404until the transaction is in a ledger. If it returns the transaction with"successful": true, you're done:curl --location 'https://stellar-mainnet.gateway.tatum.io/transactions/{TX_HASH}' \ --header 'x-api-key: {YOUR_API_KEY}' -
Keep resubmitting the same transaction (with the same sequence number) and wait until it's added to a new ledger. Don't change its operations, signatures or sequence number: a changed transaction is a new one and can pay twice. If the transaction is already in a ledger, Horizon returns the original result, so resubmitting is safe. Replace
{SIGNED_TX_XDR}with the base64-encoded XDR of the signed transaction:curl --location 'https://stellar-mainnet.gateway.tatum.io/transactions' \ --header 'x-api-key: {YOUR_API_KEY}' \ --data-urlencode 'tx={SIGNED_TX_XDR}'You can also resubmit it with Broadcast signed XLM transaction (
POST /v3/xlm/broadcast). -
Increase the fee to prioritize your transaction over others if timeouts keep happening. Check current fees with
GET /fee_statson the RPC or Get actual XLM fee. The network minimum is 100 stroops per operation. Wrap the original in a fee-bump transaction, which replaces it in the queue only if it bids at least 10 times the original fee. -
If you use Tatum KMS, make sure it checks for pending transactions often enough. The default interval is 5 seconds; see Checking pending transactions.
Set time bounds on new transactions: once they pass, you know for certain whether a timed-out transaction was applied.
Additional information is available in the Stellar transaction submission timeouts and dynamic fees FAQ.
FAQ
How long does a Stellar transaction take to confirm?
Stellar ledgers close about every 5 seconds, and a transaction is final as soon as its ledger closes.
How long does Horizon wait before it returns a timeout?
About 30 seconds. The transaction may still be applied after that, so check its hash before you resend it.
Still stuck?
Report the issue to support with the transaction hash, the signed transaction and the full error response.
Updated 9 days ago