Fees and Transaction Mechanics
The concept
Module 3 explained fee economics (base fee, priority fee, burn rules, rent). This lesson is the operational companion: how a transaction is built, why it fails, and how you choose fee settings without treating “Solana is cheap” as a procedure.
A wallet typically constructs a message with instructions, a recent blockhash, a list of accounts, and a compute-budget instruction when it wants to set a unit limit or a priority-fee price. You sign, the wallet submits to RPC, and the cluster may include the transaction in a slot. Simulation (if the wallet or RPC offers it) is a pre-flight: it tries to execute the transaction against recent state and can catch obvious errors (insufficient funds, missing accounts, program errors) before you pay for a failure—or at least before you are surprised. Simulation is not a guarantee; state can change between simulation and inclusion.
Why transactions fail is a checklist, not a mystery:
- Insufficient SOL for the fee, or insufficient SOL to keep the account rent-exempt after the send.
- Insufficient token balance or a missing associated token account.
- Program error (slippage, paused pool, bad account owner, expired instruction).
- Compute-unit limit too low for the actual work.
- Blockhash expired before inclusion; the transaction is too old.
- The signature is a duplicate of one already processed.
- RPC rejection (rate limit, node behind, transaction too large).
- The user cancelled or the hardware wallet rejected the prompt.
Each of these has a different first debug step: explorer error log, balance check, network check, or RPC health. Retrying blindly can double-pay or waste fees.
Fee settings in practice. For a simple SOL transfer on a quiet network, many wallets’ default (base fee, perhaps a small priority fee) is enough. For a contended program, you may need a higher priority fee, or you may still fail if the program itself reverts. Official documentation and wallet UI language describe priority fee as a price per compute unit times units consumed or requested—confirm the current formula rather than memorizing a blog post. Paying a huge priority fee does not fix a wrong address or a malicious program. It only bids for inclusion.
Durable nonces and other advanced mechanisms exist for transactions that cannot rely on a short-lived blockhash (some operational or scheduled flows). They are optional, documented in official developer materials, and easy to misuse. Day-to-day wallet users usually rely on recent blockhashes and wallet retries.
Partial execution is not like some other chains’ “out of gas halfway through leaving a mess” in exactly the same way, but failed program calls can still charge fees and can leave you needing to understand whether an inner instruction succeeded. Always read the explorer’s instruction list, not only a red or green badge.
Worked example
A swap transaction fails in a wallet. You will debug it in order, not by raising the fee three times first.
1. Copy the signature if one exists. If no signature, the failure
may be local (simulation, RPC, or rejected sign).
2. If a signature exists, open an explorer: success or program error?
Read the error log and which instruction failed.
3. Check balances: enough input token? enough SOL for fees and rent?
4. Check whether the blockhash expired (too old) versus a program
revert (for example slippage).
5. Only if the explorer shows the transaction was never included
or expired, rebuild once with a fresh blockhash and a documented
fee setting. Do not send a second swap while the first is unknown.
A second example is a fee-setting table for an operations playbook:
Transaction type | Starting fee policy | Escalate when
--------------------------|-------------------------------|------------------
SOL transfer, known dest. | Wallet default / base fee | Repeated expires
SPL transfer, quiet mint | Default plus ATA rent if new | Explorer shows
| | inclusion delays
Contended program | Wallet’s suggested priority | Still failing
| fee; cap in the playbook | for fee reasons
| | after checks above
The “cap” is a policy so a bug cannot drain SOL in priority fees. This course does not pick the cap number for you.
Exercise
Write a one-page transaction-mechanics SOP:
- List at least eight failure causes and the first check for each.
- Describe when you would change a priority fee and when you would not (wrong address, program revert, unknown first signature).
- Quote official or wallet documentation for how priority fees are set, with URL and date, or write “not found.”
- Add a “no second send until explorer check” rule in one sentence your team could paste into a runbook.
Do not practice on funds you cannot afford to lose, and do not use unofficial “speed-up” websites that ask for a seed.
Recap
- Transaction mechanics are account lists, a recent blockhash, compute budgets, and optional priority fees; simulation helps but does not guarantee inclusion.
- Failures have distinct causes—expired blockhash, program error, insufficient SOL, missing ATA, RPC issues—and retries must wait on an explorer lookup.
- Raising fees is only a response to inclusion contention, not a fix for a wrong destination or a hostile program.