RelayMiner Reward Accumulation
tl;dr
Reference GitHub Issue
This page was put together as a result of the discussion in pokt-network/poktroll#1315.
Table of Contents
- tl;dr
- Table of Contents
- Background on Optimistic Relay Accumulation
- Rate Limiting with Optimistic Accumulation
Background on Optimistic Relay Accumulation
RelayMiner's accumulate relay rewards before the relay is forwarded to the backend.
This optimistic approach:
- Counts the relay immediately
- Enables in-process rate-limiting (no extra network calls)
- Protects suppliers against over-servicing flood attacks
Managing 5xx Rewards
- Before a relay is forwarded to the backend, the relay miner accumulates the reward.
- If the backend replies with a
5xx
status, the relay miner immediately reverts the reward. - If the backend replies with a
2xx
or3xx
status, the relay miner keeps the reward. - This ensures that suppliers are not paid for failed relays, while rate-limiting remains effective against burst traffic.
Rate Limiting with Optimistic Accumulation
The following diagram shows the optimistic accumulation of rewards:
Pessimistic Reversal of 5xx Rewards
The following diagram shows the pessimistic reversal of rewards for 5xx responses: