RSCH-1001: Quality of Service Excellence

RSCH-1001

Quality of Service Excellence

Omer Mishael, KagemniKarimu
Date Compiled: 04/30/24


Overview :telescope:

Lava implements a Quality-of-Service (QoS) Excellence reputational system. Network consumers score providers per relay on metrics of latency, sync, and availability. These scores share similar criteria as Passable QoS scores but are assessed using different metrics. Through QoS Excellence, Quality of Service is asserted by favoring provider pairings in response to these final scores; the goal of the network is to ensure that providers who do consistently well get more frequent pairings.

QoS excellence differs from Passable QoS which was discussed in RSCH-1000.

Rationale :dna:

A system is needed to incentivize providers on the network to exceed minimum operable standards and excel their peers. QoS Excellence ensures that:

  • providers receive more pairings (i.e. more chances to profit) based upon performance
  • providers can stake less, for the same level of selection favor, if they have better service
  • the scoring of consumers on a given provider’s performance accumulates with additional service

The system uses a consumer-side scoring as the mechanism which is designed to have parity with Passable QoS. Whereas Passable Quality of Services assurances provide a rewards boost or penalty based upon a session performance, these session metrics do not directly affect rewards. By contrast, the system needs a mechanism to affect providers’ likelihood of future pairings based upon provider’s overall performance across multiple sessions.

Findings & Considerations :alembic:

QoS Excellence is collected as a consumer-side score reported by providers on-chain to affect future pairings via reputation. To be workable, pairing must be affected most directly by the most recent scores of consumers. Provider pairing is influenced by factors beyond QoS Excellence , namely, provider stake amount and geolocation. Due to the mathematical relationship between these factors, a provider’s need to stake is inversely proportional to their reputation. That is, as a provider’s overall QoS Excellence score improves, they have to assert less stake to receive the same number of pairings.

Score

This scoring system aggregates performance metrics from multiple sessions with various consumers to construct scores that reflect a provider’s reliability and excellence. The scoring algorithm focuses on three main categories: latency, sync, and availability. Each score is calculated using specific mathematical ratios compared to set benchmarks, and these scores are then integrated using a time-decay function. This approach ensures that more recent performances have a greater impact on the provider’s overall score, thereby encouraging continuous improvement and timely service enhancements.

Latency

Latency is the amount of time elapsed before a request is returned. It is measured in ms. It is calculated based on the mathematical ratio of the actual latency experienced to a predefined retry time benchmark: retry_time/2. retry_time is either configured by the specification or defaults to 100ms per compute unit (CU) for each API call in a session. Essentially, this score evaluates how quickly a provider responds within the network compared to an expected timeframe. A lower actual latency against the retry benchmark results in a better score, promoting providers to minimize delays and optimize response times in their services.

Latency Ratio Calculation

Numerator Denominator
Raw Time Measurment (ms) Retry_Time/2 (ms)

Sync

Sync is the distance from expected latest block. The sync score for QoS Excellence is calculated by comparing the average block time to the time difference when the same block number is provided by a different provider, adjusted for any block gap time. High sync scores are awarded to providers who demonstrate tight coordination with the network’s latest blocks, thus maintaining a reliable and consistent data delivery service.

Sync Ratio Calculation

Numerator Denominator
Time Gap Measurment (ms) Average Block Time (ms)

Availability

Availability is the tendency of a provider to respond to requests received. Availability within the QoS Excellence scoring system is quantified by the ratio of successful relays to total relays during a given session. This score directly reflects a provider’s reliability and operational efficiency, as it measures the ability to successfully complete data transmissions without missed requests. High availability scores are critical as they indicate a provider’s capability to maintain service continuity and dependability,

Sync Ratio Calculation

Numerator Denominator
Successful Relays (#) Total Relays (#)

Time Decay Function

The score for QoS Excellence is calculated using a decay function, where the half-life is approximately 1 hour. The benefit of using a decay function is that there is no need to store past performance data on chain or keep coefficients from each calculation. In fact, all that is needed to calculate a QoS Excellence score is the score given, the time decay, and the value of the current score. Time decay here indicates a change in time (Δt) in ms where the bigger the number , the lower the time decay factor. This ensures that all scores are disproportionately weighted based upon recency: the most recent scores which represent the latest information have the largest factor.

For each QoS Score Category:

  • current average numerator and current average denominator are the existing average scores for the numerator and denominator, respectively.
  • latest sample numerator and latest sample denominator are the new values to be incorporated into the average. These will be derived from a current score and its respective benchmark.
  • time decay factor (Δt) = This represents the time since the last update. The longer the time interval, the more the previous data’s influence decays,
  • weight is a factor that determines the influence of the new sample compared to the old data, where the weight of probe relays is 0.2 or full relays is 1.

Pairing Influence


During each relay attempt, the Provider Optimizer reviews all available providers for the given epoch from a consumer’s pairing list (PL). It calculates a dynamic score for each provider derived from their QoS Excellence time-decayed score for sync and latency. This scoring is influenced by the consumer’s selection strategy, which may include weighting different aspects of service quality to match specific needs or preferences. A consumer can choose between several strategies which weight QoS scores differently: latency (give more weight to latency), freshness (give more weight to sync), balanced (more or less the same weight across all categories) are some of the options available. Additionally, a perturbation factor is introduced to each score, adding a level of unpredictability and enhancing fairness and security in provider choice. The perturbation factor is doubled by the selection of strategy for decentralization.

The Provider Optimizer takes other actions using QoS Excellence to select a provider which is capable of serving the proper response. For an indepth look at the Provider Optimizer’s use of QoS Excellence scores to calculate the probability of error see RSCH-1005.

Future Considerations :test_tube:

TBD!


REFERENCE: RSCH-1000: Passable QoS; RSCH-1005: Smart Consistency