decrypt101
SocialOpen ProjectsSupport me My Resumes
  • Preface
    • Motivation
    • Roadmap’s
  • Introduction to Blockchain
    • A Brief History
    • Growth of Blockchain
    • Structure of Blockchain
    • Types of Blockchain
    • Key Technologies of Blockchain
    • Features of Blockchain
    • How Blockchain Works ?
    • Implementation of Blockchain
    • Summary
  • Components of Blockchain Architecture
    • Distributed Ledger
    • Blocks
    • Transaction
    • Chain
    • Peer-to-Peer Network
    • Blockchain Layers
    • Off-Chain & On-Chain
    • Wallet
    • Mining
    • Tokens
    • Assets
    • State Channels
    • Sidechains
    • Oracles on Blockchain
    • Atomic Swaps
    • Decentralized Identity (DID)
    • Blockchain Data Storage
    • Interoperability
    • Data structures for Scaling Blockchain
    • Maximal Extractable Value (MEV)
  • Consensus Mechanisms
    • Proof of Work (PoW)
      • Implemation Using Rust
    • Proof of Stake (PoS)
    • Proof of Burn (PoB)
    • Proof of Capacity (PoC)
    • Proof of Activity (PoAc)
    • Proof of Weight (PoWe)
    • Proof of Luck (PoL)
    • Proof of Ownership (PoO)
    • Proof of Existence (PoE)
    • Proof of Believability (PoBe)
    • Proof of History (PoH)
    • Proof of Authority (PoA)
    • Proof of Elapsed Time (PoET)
  • Cryptographics
    • Encryption & Decryption
      • Symmetric Encryption
      • Asymmetric Encryption
      • Key Management and Exchange
      • Implementation
    • Cryptographic Hashing
      • Secure Hash Algorithms (SHA)
      • Message Digest Algorithms
      • Ethash
      • Blake2
      • SCrypt
      • RIPEMD-160
    • Digital Signature
      • Digital Signature Algorithms
      • Digital Signature in Blockchain
    • Zero-Knowledge Proofs (ZKPs)
      • Types of Zero-Knowledge Proof and Protocols
      • A Case Study of Polygon Platform
    • Multi-Party Computation (MPC)
    • Cryptanalysis
    • Practical Implementation
  • Decentralized Application (DApp)
    • Design and UX in Web3
  • Smart Contract
    • Development Tools
    • Solidity
    • Testing Smart Contract
    • Developing Smart Contract
    • Interacting & Deploying with Smart Contract
    • Verifying Smart Contracts
    • Upgrading Smart Contracts
    • Securing Smart Contract
    • Smart Contract Composability
    • Testnet and Mainnet
    • Blockchain Platform Using Smart Contract
    • Application of Smart Contract
    • Practical Implementation
  • Blockchain Platforms
    • Ethereum
      • Ethereum Virtual Machine (EVM)
      • ETHER and GAS
      • Ethereum transaction
      • Ethereum Accounts
      • Ethereum Stacking
      • Ethereum Network
      • Ethereum Scaling Solutions
      • Ethereum Use-Cases
      • Getting Started with Ethereum
      • Ethereum Ecosystem and Support
    • Solana
      • Solana Architecture
        • Solana Account Model
        • Solana Wallet
        • Transactions and Instructions
        • Solana Programs
        • Program Derived Address (PDA)
        • Cross Program Invocation (CPI)
        • Tokens on Solana
        • Clusters and Public RPC Endpoints
        • Transaction Confirmation & Expiration
        • Retrying Transactions
        • Versioned Transactions
        • Address Lookup Tables
        • State Compression
        • Actions and Blinks
      • Solana Developments
      • Solana Client
      • Advanced Solana
      • Solana Scaling and Performance Architecture
      • Solana Solutions and cases
      • Practical Implemenation
    • Binance Smart Chain (BSC)
      • Create a BEP20 Token
    • Hyperledger Fabric
    • Cosmos
    • Polkadot
    • Quorum
    • Polygon
    • Algorand
    • Corda
    • Avalanche
    • TRON
    • Summary
  • Decentralized Finance (DeFi)
    • DeFi Components
    • DeFi Protocols
    • DeFi Platforms
    • DeFi Risk Classification
      • Infrastructure-layer Attacks
      • Smart Contract Layer-attacks
      • Application Layer-attacks
      • DeFi Risks
    • DeFi and Blockchain
    • DeFi Impact
  • Decentralized Ecosystem and Digital Innovation
    • Layer 2 Scaling Fundamental
    • Tokenomics
    • Cryptocurrency
    • Quantative Trading
    • NFTs
    • GameFi
    • Metaverse
  • Blockchain as a Service (BaaS)
    • Building Fullstack Blockchain Platform
    • Decentralized Digital Identity
    • Build a Cryptocurrencies Exchange
    • Play-to-Earn Gaming
    • Solana Token Airdrop Manager
    • Smart Contract Development on Solana with Rust
    • Quantitative Trading Platform
    • Insurances protocols
    • Flash Loans
    • Asset Management
    • Tokenized Derivatives
    • Automated Market Makers (AMMs)
    • Staking
    • Lending and Borrowing Platforms
    • Yield Farming
    • Stablecoin System
    • Security Token Offerings (STOs)
    • Initial Coin Offerings (ICOs)
    • On-Chain Voting Systems
    • Decentralized Autonomous Organizations (DAOs)
    • NFT Marketplaces
    • Provenance Verification
    • Supply Chain Tracking
    • Commodities Tokenization
    • Real Estate Tokenization
    • Digital Certificates
    • KYC (Know Your Customer)
  • Blockchain Development Across Languages
    • Blockchain using Go(Golang)
    • Blockchain using Rust
    • Blockchain using Python
    • Blockchain using Cairo
  • Distributed Systems & Infrastructure Technology
    • Classification of Distributed Systems
    • Networked systems versus Distributed systems
    • Parallel systems vs Distributed systems
    • Distributed versus Decentralized systems
    • Processes of Distributed Systems
    • Architecture of Distributed systems
    • Infrastructure Technologies
  • Distributed System Patterns
    • Distributed Agreements Algorithms
      • HoneyBadgerBFT
    • Data Replications
    • Data Partition
    • Consistency
    • Distributed Time
    • Cluster Management
    • Communication between Nodes
    • Fault Tolerance and Resilience
      • How to design better fault tolerance systems
      • Resilience Patterns
    • Coordination systems
      • Clock synchronization
    • Security
      • Trust in distributed systems
      • Design of Principal Security
      • Security threats, policies, and mechanisms
      • Authentication and Authorizations
      • Cryptography
      • Monitoring in Security
  • Distributed System Design
    • Page 1
    • Distributed Shared Memory
    • Distributed Data Management
    • Distributed Knowledge Management
    • Distributed Ledger
  • FAQs
  • Support and Community
Powered by GitBook
On this page
  1. Blockchain Platforms
  2. Solana
  3. Solana Architecture

Transaction Confirmation & Expiration

Transaction Confirmation & Expiration in Solana

Transaction Confirmation and Expiration are critical concepts in Solana’s high-speed, high-throughput blockchain. Understanding how transactions are confirmed, when they expire, and how to optimize for successful confirmations is essential for developers building on the platform. Due to Solana’s unique consensus mechanism and its speed, transactions can fail or become stale if not managed correctly.

Transaction Confirmation Process

  1. Block Production and Validation: Solana’s unique Proof of History (PoH) combined with Tower BFT (a variant of PBFT) allows for rapid transaction processing and confirmation. Validators in the network produce blocks every 400 milliseconds, which means transactions can be confirmed very quickly compared to other blockchains.

  2. Transaction Lifecycle:

    • Submission: Once a transaction is created and signed, it is submitted to the Solana network. The transaction is propagated to a leader, who is responsible for including it in the next block.

    • Leader Inclusion: The leader for that slot processes the transaction, includes it in the block, and propagates the block to other validators.

    • Confirmation: Other validators verify the block and confirm its validity. Once a sufficient number of confirmations are received, the transaction is considered finalized. In Solana, finality typically occurs within a few seconds.

  3. Confirmation Levels:

    • Processed: The transaction has been processed by the node but is not yet confirmed. At this stage, the transaction might still be reverted if it is not included in a finalized block.

    • Confirmed: A majority of validators have confirmed the transaction, but it may still be reversed in rare cases (e.g., a fork).

    • Finalized: The transaction has reached finality, meaning it is fully confirmed and cannot be reverted.

  4. Confirmation Time: While Solana aims for near-instant finality, confirmation times can vary based on network conditions and congestion. Typically, transactions achieve finality in about 2–5 seconds. However, network congestion can lead to delays, making it crucial for developers to monitor transaction confirmation status.

Transaction Expiration

  1. Block Slot Window: Each transaction in Solana is valid for a limited number of slots. A slot is a brief window during which a leader produces a block. If a transaction isn’t processed within a given number of slots, it expires and is no longer valid.

  2. Slot Expiration: By default, transactions are valid for 150 slots, which translates to approximately 60 seconds. If a transaction isn’t confirmed within this window, it becomes invalid and must be resubmitted. This ensures that transactions don’t sit indefinitely in the network, potentially clogging the system.

  3. Nonce Accounts: Developers can use nonce accounts to extend the validity of a transaction beyond the default slot expiration. A nonce account locks the transaction’s state, preventing it from expiring until the nonce is used or the account is closed. This is especially useful for critical transactions that may require more time to confirm due to network conditions or account locking.

Monitoring Transaction Confirmation

  1. RPC Confirmation Queries: Solana provides a rich set of Remote Procedure Call (RPC) APIs that allow developers to monitor the status of a transaction. By querying for transaction confirmation, developers can track the progress of the transaction from processed to finalized states. Tools like Solscan or the official Solana explorer also allow real-time monitoring of transaction confirmations.

  2. Retrying Upon Failure: If a transaction fails to confirm or expires, it must be resubmitted. Developers should implement logic that detects failed or expired transactions and automatically retries them with adjusted parameters (e.g., higher fees or modified instructions) to ensure successful confirmation.

Factors Affecting Transaction Confirmation

  1. Network Congestion: During times of high network usage, transactions may take longer to confirm or may even expire due to limited validator bandwidth. Congestion can occur during events such as NFT minting or heavy DeFi activity.

  2. Transaction Fees: Solana’s fee market is dynamic, and during periods of congestion, transactions with higher fees are prioritized by validators. If a transaction is submitted with a low fee, it may not be processed during times of high demand, leading to delays or expiration. Developers should dynamically adjust transaction fees to match network conditions for timely confirmation.

  3. Account Locking: If multiple transactions are trying to access the same account simultaneously, one or more transactions may fail due to account locking. This can delay transaction confirmation and lead to expired transactions if not handled correctly. Developers can mitigate this by managing account access or using separate program invocations to avoid conflicts.

Best Practices for Transaction Confirmation & Expiration:

  1. Set Appropriate Fees: Monitor the network’s fee structure and dynamically set transaction fees to ensure they have a high likelihood of being processed during congestion. Setting fees too low can lead to delays, while setting them too high unnecessarily increases transaction costs.

  2. Use Nonce Accounts for Critical Transactions: For transactions that cannot afford to expire (such as token swaps or transfers involving multiple accounts), using nonce accounts helps ensure they remain valid even if network conditions cause delays in processing.

  3. Monitor Transaction Status: Implement systems to monitor the status of transactions through Solana’s RPC APIs. This allows developers to track confirmation levels and detect failed or expired transactions for timely resubmission.

  4. Handle Congestion Gracefully: In periods of high network activity, it’s important to anticipate congestion and implement logic that gracefully retries transactions with increased fees or after a delay. This ensures that important transactions eventually confirm without being permanently dropped.

  5. Check for Account Contention: Developers should be mindful of how accounts are accessed during transactions to avoid account locking issues that can delay or prevent transaction confirmation. Strategies such as batching transactions or spreading out interactions can help mitigate this issue.

Conclusion:

Transaction confirmation and expiration are critical components of developing on Solana. By understanding how transactions move through the confirmation process, monitoring their status, and mitigating risks like expiration and network congestion, developers can ensure their applications remain performant and reliable. Using tools like nonce accounts and dynamic fee adjustment, they can build resilient systems that handle Solana’s high-speed environment effectively.

PreviousClusters and Public RPC EndpointsNextRetrying Transactions

Last updated 7 months ago