Skip to content

Resolve "ADD: Operations Endpoint"

Closes #1652

Started from @the_eridanus PR: !3362 (closed)

Description:

This pull request introduces a comprehensive update, aimed at improving how feature status by feature are managed and evaluated across different scopes (Global, Chain, Pool) and functionalities (Trading, Lending, LP, Synths, Savers, POL, TORAnchor). The core of this update lies in the introduction of a more flexible and granular rule definition mechanism, allowing for precise control over the activation status of various features based on dynamic conditions.

Key Changes:

  • Scoped Rule Definition: Implemented a new structure for defining rules (Rule) that includes scope, a slice of affected features, a condition checker function (isDisabledChecker), and a reason for the rule. This structure enables targeted rule application and simplifies the management of feature states across different operational contexts.

  • Dynamic Rule Evaluation: Developed two key functions, getStatus and checkRules, to dynamically evaluate the rules against the current operational context. These functions determine whether a given feature is disabled based on the applicable rules, considering the specific scope and additional parameters such as the chain and pool.

  • Rule Application Across Scopes: Enhanced the rule evaluation mechanism to account for hierarchical scope inheritance, ensuring that global rules apply down to chain and pool scopes, allowing for nuanced and hierarchical feature control.

Motivation

The motivation for tackling this problem in this way is that the nature of the flags that show the status of the functionalities is varied, it can be by a Mimir variable, but also by the state of the network as in the case of the TLV. In addition there is a hierarchy between Global > Chain > Pool that needed to be modeled in some way, to avoid having to re-validate the state of higher scopes.

Relevant files

Matrix rule

image

Edited by Hippocampus

Merge request reports