How Lava Works: Passable & Excellence Quality of Service Overview

Lava Vision and How it Works
Kagemni Karimu
Apr 7, 2023

Introduction

This article covers the basic features and characteristics of how Lava ensures the highest Quality of Service across the network. If you wish to read a more deeper-dive, we have published a research paper in our forum.

Finding the right node provider is a manual and resource-consuming process. Developers rely on word of mouth or loud marketing - and when they settle for a provider, they often find themselves locked into poor service and an expensive contract.

At Lava we've built a protocol that automatically pairs developers with the best available Provider - based on the APIs they offer, their latency, uptime and accuracy. Providers join Lava to reach more developers and are compensated directly based on their QoS and relay volume served. Lava makes QoS discovery easy.

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 Optimization 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 this score determines future pairings between Constumers and Providers, thereby incentivizing Providers to offer a better service.

There are two QoS scores on Lava: Passable QoS and QoS Excellence. Passable QoS is the score a Provider must reach in order to unlock full compensation (all Providers are paid a minimum of 50%). QoS Excellence is the score which determines the % of compensation a Provider earns above the 50%, and also determines a Provider's future pairing eligibility. The lower the QoS Excellence, the fewer relays a Provider will serve in the future. This is not dissimilar to platforms like Uber, which pair drivers to passengers (and vice-versa), based on parameters like location and historical performance.

To best understand QoS on Lava, 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. Lava solves the discovery problem in blockchain data infrastructure.

Decentralization is the means, not the end goal

Decentralization is often associated with inefficiencies due to the nature of its design, which involves the distribution of control, consensus-achievement and decision-making across a network. However, Lava uses decentralization as a means to create competition between Providers - leading to greater performance and cost efficiency for developers and users.

Lava's decentralized approach has multiple benefits:

- Resilient service:

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.

Lava is a network, not an individual provider

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

Lava creates more performant and cost-effective markets for blockchain RPC & data infrastructure. Lava's unique approach means supply scales with demand and quality discovery is automatic. This article provides an overview of QoS scoring, but we will go into further detail in later articles.

The protocol uses two types of scoring to determine Provider compensation and pairing frequency:

- Passable QoS - which gives a binary result on whether Providers are fully paid
- QoS Excellence - which determines the proportion of payment a Provider receives out of the full amount

You can read an extensive research piece about Passable QoS in our forum.

Learn more 📚

Other related articles have covered What is Lava and How Lava Works. If you’re lost in the weeds of what RPC is — start by educating yourself on this article.


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
Research Forum: community.lavanet.xyz
Docs: https://bit.ly/3m9umEB
Github: github.com/lavanet
Gateway: https://bit.ly/3GmyqIg