What is Stake-Weighted QoS (SWQoS)?
Stake-weighted quality of service (SWQoS) is Solana's method of allocating a block producer's inbound bandwidth: higher stake equals greater access to transaction delivery. When the current leader, the validator making blocks, is congested, staked traffic will receive priority. Unstaked traffic will have to make do with the residual capacity.
SWQoS is like a restaurant's reserved seating chart. If someone is on the wait list, they have to wait for an available table; those with a reservation will be seated. The restaurant isn't turning anyone away; in fact, during slow hours, there is no waiting. However, the restaurant has to decide when to turn away guests if everyone has booked. SWQoS is the waiting list; stake is your reservation.
How Does SWQoS Work?
Solana node operators use QUIC to send and receive transactions. QUIC allows a server to identify each peer sending traffic to it. SWQoS utilizes this peer identification by allocating its incoming capacity, around 80%, across peers with a staked connection. If a node operator holds 1% of the network stake, they would receive approximately 1% of incoming transactions for peers using their connection. The remaining 20% of capacity is then available to everyone else, and this is where most of the spam transactions originate.
This was a response to a specific problem Solana had. During the 2022 network congestion incidents, spam attacks from NFT mints would send millions of duplicate transactions to leaders, and the previous networking stack didn't differentiate between different peers, resulting in leaders becoming overwhelmed and taking the whole network down for a significant amount of time. The networking changes (QUIC, priority fees, and SWQoS) that were implemented to fix this were meant to address the issue of spam overwhelming legitimate transactions, not to stop spam entirely.
To you, SWQoS is invisible. As a user, you have a wallet and an RPC provider, which routes your transaction to one of the peers on the network. If a wallet like Phantom is sending you your transaction through one of the major RPC providers like Helius, your transaction will have more than 1% capacity of staked inbound capacity available, and will land faster than an unstaked transaction.
How Does SWQoS Compare to Ethereum?
Unlike Solana, Ethereum does not limit the number of transactions a leader can receive. Instead, the market determines which transaction lands. Anyone can submit a transaction to be included in the next block via the mempool, the waiting area for transactions. The leader then chooses which transactions to include based on transaction value. During congested periods, this can be expensive, with gas for swaps ranging from $50-500 depending on the urgency of the request. The network does not differentiate between different peers and is essentially a pay-to-win situation where a user with more value can overpay a transaction to get the leader's attention.
On Solana, the network uses a combination of stake-based limits on inbound bandwidth and prioritized queues to keep base fees low. Base fees are ~$0.00025, and most priority fees are under $0.001. The network is much more efficient at keeping base transaction cost low, but requires you to use a staked connection. Both Ethereum and Solana require some level of payment to land in the event of high congestion: Ethereum requires payment for compute, and Solana requires payment for inbound bandwidth.
Why SWQoS Matters
Imagine a scenario where you're launching a memecoin, and everyone on your team is trading at midnight on a Friday night, and Jupiter traffic is spiking, and the leader is getting clogged. In this scenario, your team members with staked connections are getting their transactions confirmed, while your teammates using free RPC are getting transaction rejections or delays. In this particular scenario, both are paying the same priority fee, yet you only get to submit a trade because of your RPC provider.
This is where it gets controversial. There are definitely valid arguments for why it should be pay-to-play, and we shouldn't assume that the stake-weighted model is better than the free access Ethereum uses. However, it's undeniable that the stake-weighted model makes your transaction priority a matter of connection quality, and there will always be someone who will offer that quality for a higher fee. While some may say stake is free to stake, it is not free of capital, so the debate is far from settled and will undoubtedly continue for years to come. SWQoS is an open source protocol that will always be available to everyone on Solana, but it may or may not be in your best interest. Developers building applications that are latency and congestion sensitive have to make this decision as well, and most have opted for paid RPC services to do so.
What Happens If I Use Unstaked Traffic?
Unstaked traffic still receives about 20% of capacity on a leader. Most RPC providers offer their customers a connection to a stake-backed peer, so the average Solana user is already using stake-backed connectivity. However, if you send an unstaked transaction during a congestion incident, you will likely see a delay or rejection before the transaction is confirmed.