Skip to content

​RPC Infrastructure

Public endpoints (api.mainnet.solana.com) are rate-limited and carry no SLA. They suit development and are not intended for production workloads. Use a private RPC provider for production. When choosing an RPC provider, compare:
  • Reliability: an SLA with an uptime commitment
  • Latency: geographic proximity to your users and servers
  • Method coverage: the RPC methods your workload needs, and historical depth that covers your reconciliation period
  • Transaction landing: staked connections, priority fee APIs, and bundle support where your workload depends on them
  • Credential handling: separate keys per environment, and a way to rotate them
For a full list of RPC providers, see the RPC Infrastructure Providers guide.

​Redundant RPC Configuration

Like any network service provider, RPC providers can experience downtime or periods of degraded performance. To ensure your application is resilient, you should configure your application to use multiple RPC providers. Solana Kit provides a library for customizing RPC transports which allows you to build your own redundant RPC client. Here’s an example of how you might use it to build a redundant RPC client:
If you prefer not to build your own routing tools, you can use a third party service like Iron Forge to handle the routing for you.

​Transaction Landing

On Devnet, transactions land fairly easily. On Mainnet, you’re competing for block space. To increase the chances of having your transaction included in a block, you should ensure you have properly assembled your transaction. This means:
  • including a fresh blockhash before sending the transaction
  • including a priority fee instruction in the transaction with a competitive priority fee
  • including a compute unit limit instruction in the transaction with a compute unit limit based on the estimated compute units required for the transaction
Additionally, you should consider other tools like Jito Bundles to increase the chances of your transaction being included in a block. Let’s explore these tools in more detail.

​Transaction Send Configuration

When sending transactions on Mainnet, configure these parameters for optimal landing rates: Blockhash management:
  • Fetch with confirmed commitment
  • Store the lastValidBlockHeight returned by getLatestBlockhash—this tells you when your transaction expires
  • A blockhash is valid for 150 blocks, about 30 seconds at 200ms slots. For converting slots to wall-clock time, see settlement and finality
Send options:
  • maxRetries: 0 — Disable automatic RPC retries. Handle retries yourself so you can refresh the blockhash when needed.
  • skipPreflight: true — Bypass simulation before sending. Use it only when the transaction has already been simulated, for example to estimate its compute units. Otherwise keep it false so simulation catches errors before a fee is spent.

​Use Priority Fees

Every Solana transaction requires a transaction fee, paid in SOL. Transaction fees are split into two parts: the base fee and the priority fee. Half of the base fee is burned and half goes to the validator that processes the transaction. The priority fee is an optional fee that increases the chance the current leader will process your transaction. How fees work:
The base fee is a protocol constant; see transaction fees. Priority fee levels move with demand, so read the current distribution from getRecentPrioritizationFees or a provider’s fee API rather than from documentation. Sample Implementation: The @solana-program/compute-budget package provides a helper function to easily update or append the compute unit price (in micro-lamports) instruction to a transaction.
Getting fee estimates: Most RPC providers offer priority fee APIs: For the full fee mechanics, see Transaction Fees and our guide: How to Add Priority Fees to a Transaction.

​Optimize Compute Units

Compute on Solana is effectively a measure of the amount of work the program is doing. A transaction may use at most 1.4 million compute units, a fixed cap. The per-block and per-writable-account limits are feature-gated (SIMD-0286, SIMD-0306) and scale with the slot time under SIMD-0525. At the current 200ms target they are 50 million compute units per block and 20 million per writable account per block. Verify the current values against the active feature gates; compute budget explains the mechanism. When you submit a transaction, you need to estimate the amount of compute that will be used, and set the compute unit limit accordingly - this is effectively a request for how much of the total capacity that should be reserved for your transaction. In practice, this means properly estimating the compute units required for your transaction is critical to having your transaction included in a block (and important for managing your priority fees). The Solana JSON RPC API has a simulatetransaction method that can be used to estimate the compute units required for a transaction, which includes an estimate of the compute units that will be used. @solana/kit provides helper functions that estimate a transaction’s resource limits and set them on the message in one step (using the simulatetransaction method under the hood). For version 1 transactions these helpers also estimate the loaded accounts data size limit.
If you build and send transactions with a kit plugin client, you typically don’t need this step — the client adds compute budget instructions for you when it sends (.sendTransaction()). The manual flow above is for when you assemble transactions directly with @solana/kit.
In production, if you are repeating the same type of transaction multiple times, you should consider caching the compute estimate for the transaction type to avoid the overhead of estimating the compute units every time.

​Jito Bundles

Jito bundles group several transactions so that they execute atomically and in order when a Jito-connected leader includes them. Bundles are submitted to the Jito network with a tip, which is an incentive for inclusion rather than a guarantee of it. Resources:

​Retry Strategies

Transactions can fail for many reasons. Unlike traditional payment APIs that return success/failure immediately, a Solana transaction requires confirmation tracking. Key concepts:
  • Blockhash expiration: A transaction is valid for 150 blocks from its blockhash, about 30 seconds at 200ms slots. The time varies with block production, so use lastValidBlockHeight to tell when the blockhash has expired
  • Idempotency: Resubmitting the same signed transaction is safe; it carries the same signature and executes at most once. A transaction rebuilt with a new blockhash is a new transaction, so rebuild only after the original’s blockhash has expired
  • Exponential backoff: Avoid overwhelming the network with rapid retries
The sendAndConfirmTransactionFactory from @solana/kit handles confirmation polling and block height tracking automatically. It throws SOLANA_ERROR__BLOCK_HEIGHT_EXCEEDED when the transaction’s blockhash expires, signaling that you need to rebuild the transaction with a fresh blockhash.

​Additional Resources

​Understanding Confirmation Levels

Solana exposes three commitment levels:
LevelDefinitionUse case
processedIn a block, not yet votedImmediate interface feedback only
confirmedSame as finalizedExisting code; planned for removal
finalizedCertified by validatorsUser-facing display and records
A block is finalized roughly 150 milliseconds after it is produced, and confirmed reports the same block, so waiting for finalized costs nothing extra. Use finalized for anything that feeds a book of record. Shorten any timeout, retry, or interface delay that was sized for a multi-second wait. Settlement and finality covers how finality works, which level to use for the blockhash and for the result, and why protocol finality is not legal finality. For more on checking transaction status, see Interacting with Solana.

​Error Handling

Solana Kit provides typed errors via isSolanaError(). Use specific error codes instead of string matching:
Preflight simulation errors reject with a top-level Transaction simulation failed error and carry the specific code further down the cause chain, which is why the handler checks every level. BLOCK_HEIGHT_EXCEEDED is thrown at the top level. Common Error Codes:
Error CodeCauseRecovery
BLOCK_HEIGHT_EXCEEDEDBlockhash expiredRebuild with fresh blockhash
BLOCKHASH_NOT_FOUNDBlockhash not foundRebuild with fresh blockhash
INSUFFICIENT_FUNDS_FOR_FEENot enough SOLFund fee payer or use fee abstraction
INSTRUCTION_ERROR__CUSTOM (code 1)Not enough SOL or tokens for the transferUser needs more balance
ACCOUNT_NOT_FOUNDAccount missing or unfunded fee payerFund the fee payer, or create the ATA in the transaction

​Gasless Transactions

Users expect to pay in stablecoins, not acquire SOL for network fees. Gasless transactions solve this—similar to how Venmo users don’t think about ACH fees. See Fee Abstraction for complete implementation.