Solana's Gulf stream A primer
Table Of Content
Introduction
What is mempool
How mempools propagated on-chains
Innovation of gulfstream
How Gulfstream works
Advantages and disadvantages of Gulfstream
Conclusion
Further resources
Introduction
Solana is the fastest and permissionless blockchain in the world because of its innovative design and core technology protocols that set it apart from other L1 blockchains.
It is famous for its cheaper transaction fees, fast transaction confirmations, and scalability, allowing it to rise above other blockchains in just a few years.
Its innovative approach to scaling, network management and faster TX confirmation make it a great choice for developers and consumers.
How Solana handles pending transactions, is a major contributor to its performance. it maintains a fully functional and performant network even under heavy loads through its mempool-less
management solution.
Solana does not have a regular mempool
like most blockchains. Instead, it uses the groundbreaking Gulf Stream protocol
. In this post, we will look at how Gulf Stream helps to optimize Solana's performance in managing transactions and improving scalability.
What is Mempool
A mempool in blockchain technology is a temporary place where transactions are stored when waiting to be confirmed. At its base, mempool is simply a list of transactions that have been posted to (transmitted across) the network but not yet included in any block.
You can see the Bitcoin and Ethereum mempools live right now.
Btc mempool for (~30 days)
Ethereum mempool for (~30 days)
Ethereum time series
For Bitcoin and Ethereum, the number of unconfirmed transactions is typically on the order of 25k-100k as shown above. The size of the mempool — which is most often measured as the number of unconfirmed transactions — depends on supply and demand for blockspace. Even in these early days of the blockchain era, that results in significant bottleneck effects on entire networks when the mempool rises.
How mempools propagated on-chains
Mempools in Ethereum and Bitcoin are propagated between random nodes in a peer-to-peer fashion using a gossip protocol. Nodes in the network periodically construct a bloom filter representing a local mempool and request any transactions that do not match that filter (along with a few others such as a minimal fee) from other nodes on the network. Propagation of a single transaction to the rest of the network will take at least log(N) steps, and consume bandwidth, memory and computational resources required to filter it.
When the benchmark client starts generating 100,000 transactions per second, the gossip protocols simply get overwhelmed. The cost of computing the filter, and applying the filter between machines while maintaining all the transactions in memory becomes prohibitively high. Leaders (block producers) also have to re-transmit the same transactions in a block, which means that every transaction is propagated at least twice through the network. That’s neither efficient nor functional.
this leads to network congestion
and high transaction fees
, which can hinder the adoption of blockchain technology
Innovation of Solana's gulfstream
Fundamentally, Solana proposes an architecture where validators cache transactions submitted by users, aka clients, verify them, and then forward them to the upcoming leaders who produce the blocks. Then leaders prioritize processing transactions based on the stake weight of the validator that forwarded the transaction.
This architecture uses Solana's one of eight key innovations, a mempool-less TX forwarding protocol that pushes transaction caching and forwarding to the edge (~end) of the network. We call it the Gulf Stream
.
Since the leader schedule knows which validator is the leader at any moment, the client and validators forward the Tx to the expected leader based on ledger votes and supermajority.
This allows validators to execute transactions ahead of time, reduce confirmation times, switch leaders faster, and reduce the memory pressure on validators from the unconfirmed transaction pool.
How Gulfstream works
In the Solana network, blocks are roughly produced in 800ms and require an exponentially increasing timeout to unroll with every additional block.
Using Solana’s default timeout curve, fully confirmed block hash, in the worst case, 32 blocks old. The transaction is valid only in the children of that referenced block and is only valid for X blocks. While X is not yet finalized, we expect that a block-hash has a TTL (time to live) of about 32 blocks. Assuming block times of 800 ms, that equates to 24 seconds.
When clients and wallets send transactions referencing a recently confirmed block hash to the RPC node (cluster), the RPC node sends these transactions to a validator. If the validator is not currently the leader or cannot process the transactions in its leader slot, it forwards them to the next leader. If the validator is set to be the upcoming leader, they cache these transactions and use them to predict which transactions will be included in the next block, This reduces the load on the current leader and results in faster transaction confirmation.
The client can only subscribe to TX changes via the validator. client knows that a blockhash has expired in a finite period, or tx is confirmed by the network. This allows clients to sign transactions that are guaranteed to execute or fail.
Gulf Stream also streamlines the process of validator selection by using stake-weighted metrics. This allows the protocol to prioritize the most staked validators for transaction processing. By removing the need for a mempool, Gulf Stream enables the Solana network to achieve higher transaction throughput.
Advantages and Disadvantages of Gulfstream
Advantage
Loaded validators can execute transactions ahead of time and drop any that fail.
Leaders can prioritize processing transactions based on the stake weight of the validator that forwarded the transaction.
Improve network efficiency.
A huge amount of transactional throughput.
Disadvantage
- This solution is not possible in networks that have a non-deterministic leader
Conclusion
In this post, we provide a brief overview of Solana and explain how its transaction confirmation and mempool-less transaction forwarding protocol work under the hood.