SIP-310: Feature Flags (V3)

Author
StatusDraft
TypeGovernance
NetworkEthereum & Optimism
ImplementorSunny Vempati (@sunnyvempati)
ReleaseTBD
Created2022-10-27

Simple Summary

This SIP proposes a "feature flag" mechanism to only allow certain addresses access to parts of the protocol.

Abstract

This functionality allows specific functions to be restricted with a feature flag such that only SCCP-specified addresses are able to call them. The flag may also be removed via SCCP, such that anyone can use the relevant functionality. Initially, feature flags will be implemented for the creation of pools and registration of markets.

Motivation

To reduce risk to the protocol, it would be advantageous for governance to decide which addresses are able to create pools and register markets. We anticipate governance will choose to remove these feature flags and other feature flags may be added in the future.

Technical Specification

Overview

Implementation involves the creation of a FeatureFlagModule in the core system and usage of this functionality in the createPool() and registerMarket() functions.

Rationale

To implement the ability for governance to control usage of thecreatePool() and registerMarket() functions, it is preferable to architect a generic solution, such that it could be reused for future features.

Generally, this approach increases the agility of the protocol when deploying new features. Rather than requiring SIPs, code changes, and deployments, early usage of features in production can be controlled via SCCP.

Technical Specification

The Feature Flag Module will implement the following interface:

interface IFeatureFlagModule {
    function setFeatureFlag(bytes32 feature, bool value) external;

    function addToFeatureFlag(bytes32 feature, address permissioned) external;

    function removeFromFeatureFlag(bytes32 feature, address permissioned) external;
}

If a feature flag is set to true, it is "live" meaning only addresses added to the feature flag are able to use the relevant function. You can turn off the feature flag entirely by setting it to false which allows any address access to the feature.

A feature flag named createPool and registerMarket will be applied to the corresponding functions by calling an ensureEnabled function.

Test Cases

Relevant tests will be developed during implementation.

Configurable Values (Via SCCP)

  • Enable/disable the createPool flag
  • List of addresses associated with the createPool flag
  • Enable/disable the registerMarket flag
  • List of addresses associated with the registerMarket flag

Copyright and related rights waived via CC0.