Overview
Stellar transactions fail with txBAD_SEQ when the sequence number is stale (another transaction confirmed between fetching the account and submitting). There is also no fee bump support for transactions that get stuck in the queue during congestion. The current mock submit_transaction does not handle any of this.
Resolution
Implement a submit_with_retry function in soroban.rs: fetch the account's current sequence from Horizon, build the transaction with seq_num + 1, attempt submission. On txBAD_SEQ, re-fetch the account and retry up to 3 times with exponential backoff. On fee-related failure (txINSUFFICIENT_FEE), implement fee bumping using TransactionEnvelope::FeeBump(FeeBumpTransaction) from stellar-xdr — wrap the original inner transaction and apply a multiplied fee. Expose --fee-multiplier as a CLI arg on deploy and invoke. Parse the txResult XDR from Horizon's submission response to extract the exact failure reason (OperationResultCode) rather than treating all failures as generic errors. Track the submitted transaction hash and poll getTransaction on the Soroban RPC with a configurable timeout (default 30s) to confirm inclusion.
Overview
Stellar transactions fail with
txBAD_SEQwhen the sequence number is stale (another transaction confirmed between fetching the account and submitting). There is also no fee bump support for transactions that get stuck in the queue during congestion. The current mocksubmit_transactiondoes not handle any of this.Resolution
Implement a
submit_with_retryfunction insoroban.rs: fetch the account's currentsequencefrom Horizon, build the transaction withseq_num + 1, attempt submission. OntxBAD_SEQ, re-fetch the account and retry up to 3 times with exponential backoff. On fee-related failure (txINSUFFICIENT_FEE), implement fee bumping usingTransactionEnvelope::FeeBump(FeeBumpTransaction)from stellar-xdr — wrap the original inner transaction and apply a multiplied fee. Expose--fee-multiplieras a CLI arg ondeployandinvoke. Parse thetxResultXDR from Horizon's submission response to extract the exact failure reason (OperationResultCode) rather than treating all failures as generic errors. Track the submitted transaction hash and pollgetTransactionon the Soroban RPC with a configurable timeout (default 30s) to confirm inclusion.