Quality of Service(Part 1): How Lava Network keeps decentralized RPC fast, reliable and accurate

KagemniKarimu
Lava Network
Published in
8 min readApr 7, 2023

How can a decentralized network be fast and efficient?

Lava connects apps to an aggregated network of top RPC providers. Developers use RPC calls to send and fetch data to and from blockchains. By incentivizing a permissionless, decentralized network of providers, Lava provides an open standard for blockchain APIs, allowing developers to reliably and easily connect their applications to multiple blockchains. You can get free RPC from our Gateway today.

Unfortunately, it is common that people mistakenly associate decentralization with slowness, inefficiency, and even malfunction. By proxy, decentralized RPC is often dismissed as impractical, a relic of the infamous “mountain man” fantasy where nodes are owned everywhere by everyone.

Still, a decentralized network of RPC providers is an integral part of the modern web3 infrastructure. On Lava, each pairing between RPC provider and consumer is an essential interaction which could carry valuable and time-sensitive data that powers a blockchain. With consumers constantly paired to new providers, upholding the Quality of Service of each interaction is essential. This is primarily done by creating competition between providers, with the highest scored providers getting more service, thereby raising the overall service quality of the entire set of providers.

This article covers the basic features and characteristics of the aforementioned Quality of Service system. Other related articles have covered What is Lava and How Lava Works, which may be great introductory reads to this article! If you’re lost in the weeds of what RPC is — start by educating yourself on this article.

What you must know is this: until recently, with exception of a few centralized entities which guarantee Service-Level Agreements (SLAs), most RPC providers have operated independently with no real accountability for the quality of service they provide. This has led to inconsistency in the uptime of providers, strict rate limits on requests, and even censorship and endpoint failure… You can get a detailed view of the types of issues this has brought and attempted solutions in my article titled The Web3 RPC Problem.

Lava has developed an innovative Quality of Service (QoS) system to monitor and incentivize providers that mitigates inconsistencies in RPC service; by doing so, Lava creates a reliable, multi-chain RPC service — the Lava bet is to offer RPC with less downtime, more accurate responses, and more privacy than you can get from a centralized provider.

an excerpt of Lava’s QoS functionality

How is RPC Quality of Service measured?

Lava uses a Quality of Service scoring system per relay, to ensure a high service standard for consumers. This service is measured across latency, sync, and availability.

Most generally, Quality of Service (QoS) is a measure of performance that evaluates the service quality of a given system. It considers many possible metrics, with some of the most relevant being: latency, availability, freshness, and accuracy. We’ll review all of them below to ensure we have a clear understanding of terms before digging into Lava.

Latency — is the time it takes for data to travel from one point to another. A low latency connection is essential for quick transactions and data transfers — it ensures that dapps are responsive and that users have a smooth experience. When latency is high, dapps can glitch, hang, or just plain break. Decentralized exchanges relying on RPC with sudden latency spikes may cause transactions to time out and drop user buy and sell orders. This can result in a frustrating and costly experience for web3 users.

Availability — refers to how often the RPC is available, or “up” — i.e., can it be used to access data or perform transactions on the blockchain? High availability ensures that there is never too much downtime for applications relying on the RPC connection. A downed RPC is tragic — comparable to the failure of travel infrastructure such as a major thoroughfare — everything using that node to interact with the blockchain just STOPS — until a new route is found. This is extremely undesirable and has been the cause of failed NFT mints, stifled airdrops, and dead-on-arrival blockchain events.

Freshness — is whether the data is the most up-to-date data available. Freshness is akin to accuracy and often lumped together; data may arrive quickly and reliably, but may be stale, representing a true value at a previous state. When using a single RPC provider there is no easy way to check the freshness of data. One would need to probabilistically sample multiple RPC providers to find out. We’ll go into how Lava does this to prevent stale data in another article!

Finally, accuracy — is the measure of how reliable the RPC connection is — basically, it’s a measure of how often queries return the correct data. Accuracy is essential for dapps that rely on accurate information from the blockchain in order to function properly. Inaccurate results can lead to incorrect transactions, so it’s important that providers maintain a high degree of accuracy. As you can imagine, inaccurate results can mean the wrong amounts are transmitted for critical on-chain transactions, resulting in erroneous and irreversible losses of value to end users.

Lava’s QoS Accountability System

In order to ensure that RPC providers maintain a high level of service, Lava has developed an innovative Quality of Service (QoS) system. Consumers score the delivery of each provider in each geolocation and thereby incentivize them to offer a better service. To best understand this — you need to know the four metrics consumers rate providers across:

1. Availability (uptime)

In order to ensure that our system runs smoothly, there are several key factors that we need to consider. One of the most important of these is availability (uptime). We need to make sure that our system is up and running at all times, so that users can access data whenever they need to. Our SDK allows p2p access to Lava, meaning even higher availability.

2. Performance (latency)

Another crucial factor is performance, specifically latency. In order to provide a good user experience, we need to make sure that our system responds quickly to user requests. This means that we need to minimize the amount of time it takes for our system to process these requests.

3. Sync (block height)

We also need to consider sync, specifically block height. It’s important that all nodes on our network have the same copy of the blockchain, so that transactions can be validated and added to the blockchain in a timely manner. Assuring sync means data will be fresh and accurate.

4. Reputation (excellence)

In addition, we need to be aware of outliers and reputation. Though these are not handled by the protocol as a specific score — it is derived from clusters of scores. If a node on our network is consistently slow or unresponsive, we need to take action to address the issue. We also need to ensure that any provider which is listed has a good reputation, so that users can expect their transactions to be handled securely and efficiently. Providers which are unresponsive are unstaked from the network and do not appear to would-be Consumers, while those who are dishonest are punished.

Latency, Sync, Availability, & Excellence are all relevant

All of these work together to provide a fast and reliable RPC experience that retains decentralization and user-side control! With Lava, you get a decentralized, reliable, and configurable quality-assured RPC provider across multiple chians.

But decentralized? You mean slow and complicated?

Certainly not! Decentralization is often associated with inefficiencies due to the nature of its design, which involves the distribution of control and decision-making across a network. However, the concept of Lava, as an aggregator of top providers, demonstrates that decentralization can still be efficient and effective. This can be achieved by leveraging the strengths of multiple providers and incorporating additional features that enhance privacy, censorship-resistance, and performance incentives.

- Aggregating top providers:

By aggregating the best providers in the decentralized ecosystem, Lava creates a more efficient and robust network, as well as one which is highly redundant. This allows users to benefit from the expertise, resources, and infrastructure of multiple providers, leading to improved overall performance under conditions of fail-over.

As a result, the aggregated network can offer a higher level of service quality than individual providers operating in isolation.

- Privacy enhancement:

Lava incorporates privacy-preserving features that protect users’ data and transactions. By utilizing advanced cryptographic techniques and handling data exchange off-chain, Lava ensures that user information remains confidential while still allowing the network to function efficiently. This enhances the privacy aspect of decentralization, making it more attractive for users who care about data security.

- Censorship-resistance:

Decentralization inherently promotes censorship-resistance, as there is no central authority controlling the network! Lava is a peer-to-peer protocol which empowers RPC providers and RPC consumers to exchange with each other irrespective of data. These include handling transactions off-chain to obfuscate consumers’ data, making it more difficult for adversaries to target specific content or users.

- Performance incentives:

Optimal performance is guaranteed by competition amongst providers for servicing relays. Lava introduces incentive mechanisms that reward providers for delivering high-quality services as discussed in the previous section. These incentives are based on factors such as response time, uptime, and freshness.

Additional considerations such as geolocation are being worked in to future iterations. Pointedly, by actively incentivizing providers to compete against each other for better performance, Lava drives improvements in the efficiency and effectiveness of the decentralized network.

What makes Lava a highly reliable RPC service?

It’s simple: if one provider fails, the network will still be available.

The long of it: In the event that a provider fails, the network will remain available and any other provider will service outstanding RPC requests. This ensures that there is no downtime or interruption in the developer RPC experience. Each alternative provider, pulled at random, is subject to the same Quality of Service requirements as the primary provider. This redundancy is an important feature that ensures the reliability and stability of the network, especially in mission-critical environments where downtime can have serious consequences. With Lava, you can be assured that your application will always be available and functioning, no matter what happens to an individual RPC provider.

Conclusion

We have been living in a world where RPC was centralized, and the Quality of Service (QoS) was not guaranteed. Lava Network is changing that by providing developers with a reliable, open standard for blockchain APIs, allowing them to connect their applications to multiple blockchains with ease.

That’s it for now. :) Hopefully you are significantly more informed about teh Quality of Service assurances that Lava offers users of RPC… We’ll be revisiting this topic soon to learn more about how Lava ensures its providers are top tier in another article!

Learn more 📚

There are plenty of places to learn more about what Lava is building. Check us out below 👇

Discord: https://discord.gg/lavanetxyz
Twitter: twitter.com/lavanetxyz
Website: https://bit.ly/3nWZAyV
Litepaper: https://lavanet.xyz/assets/lava_litepaper_v0_1.pdf
Docs: https://bit.ly/3m9umEB
Github: github.com/lavanet
Gateway: https://bit.ly/3GmyqIg

--

--