This repository has been archived by the owner on Nov 13, 2024. It is now read-only.
[Enhancement] Custom Error response handling (NodeError Registry) #45
Labels
enhancement
New feature or request
Context
Gateway operators want to punish node operators dependent on specific error messages (i.e., rate limiting) and the time to punish is opinionated.
Currently, there is a default behavior of a punishment (stop sending requests) of ~15 seconds whenever a node operator returns an unrelated POKT error/RPC error. The code can be found here.
Proposal
We can extend the gateway server error capabilities by allowing gateway operators to supply specific error substrings and a corresponding punishment duration for the node operator.
This information should be pulled from the PostgreSQL database table similiar fashion to any of our other registries. It could be called
NodeErrorRegistry
, and periodically updated. Whenever a node operator returns an error response, we can iterate over the rows returned from theNodeErrorRegistry
and if there is a match, punish for the specified interval.Suggested Schema:
error_substring
(varchar) -> parsed as astring
punish_interval
(varchar) -> parsed astime.Duration
Benefits
Gateway operators can now flexibly punish node operators on a per-need basis without debating what constitutes a "good" or "bad" error, and the appropriate punishment duration.
The gateway server principles is engrained to provide an opinionated for getting started, allowing gateway operators to fine-tune based on their clients' needs. Long term, we can then add databases migrations to include specific error messages where gateway operators agree that these errors provide unanimous benefits for operations. This is aligned with the "future" roadmap
Excerpt below
The text was updated successfully, but these errors were encountered: