RelayMiner Reward Accumulation
tl;dr
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
Rate Limiting with Optimistic Accumulation
The following diagram shows the optimistic accumulation of rewards:
Backend ServiceRelay MinerApplicationBackend ServiceRelay MinerApplicationAccumulate reward (optimistic)Accumulate reward (optimistic)Rate limit reached → rejectRelayForward RelayRelayForward RelayRelay
Pessimistic Reversal of 5xx Rewards
The following diagram shows the pessimistic reversal of rewards for 5xx responses:
Relay Path
< 500
≥ 500
Receive relay request
Accumulate reward
+ rate-limit check
Forward to backend
HTTP status
Mark relay successful
Return response to client
Revert reward
Return 5xx to client
Reference GitHub Issue
This page was put together as a result of the discussion in pokt-network/poktroll#1315.
Was this helpful?
