pokt-network / pocket

Official implementation of the Pocket Network Protocol v1
https://pokt.network
MIT License
63 stars 33 forks source link

Implement MVC E2E Feature Path F.1-4: E2E Feature Flags #879

Open 0xBigBoss opened 1 year ago

0xBigBoss commented 1 year ago

Objective: Implement MVC E2E Feature Path F.1-4: E2E Feature Flags

Origin Document:

Purpose: Implement the governance-controlled parameters with the ability to add new features, enable, disable, and modify feature values dynamically.

Actors:

Data Structures:

message MessageChangeGovParameter {
  bytes signer = 1; // signer must be the owner of the parameter or the ACL owner
  int64 height = 2;
  string param_name = 3;
  google.protobuf.Any param_value = 4;
}

Interfaces:

The persistence module currently has feature flags as part of it's interface.

// Flags
 GetIntFlag(paramName string, height int64) (int, bool, error)
 GetStringFlag(paramName string, height int64) (string, bool, error)
 GetBytesFlag(paramName string, height int64) ([]byte, bool, error)

There should be a simple boolean type flag included in this interface to allow for simple feature flags to be activated or deactivated.

The MessageChangeGovParameter message type needs to be handled in the utility module.

https://github.com/pokt-network/pocket/blob/12f9f498c8b05a91f4c08c6b27227d94013d9232/utility/unit_of_work/tx_message_handler.go

Diagram:

sequenceDiagram
    participant A as ACL Owner
    participant S as System
    A->>+S: Send request to change a gov. parameter
    Note over A,S: Request includes valid signer, height, param_name, and param_value
    S->>S: Validates the request
    S->>-A: Acknowledges the request
    Note over S: New parameter takes effect at specified height
    A->>+S: Request to see the new parameter value
    S->>-A: Returns the new parameter value

User Stories as Tests:

Happy Paths:

Sad Path:

Deliverable

General issue deliverables

Testing Methodology


Creator: @0xBigBoss Co-owner: @Olshansk

Olshansk commented 1 year ago

LGTM. Scope and details are 🔥.

Made some small inline nits to the description but otherwise LGTM

Olshansk commented 1 year ago

@0xBigBoss Wanted to check in if there are any updates or progress on this?

Olshansk commented 1 year ago

@0xBigBoss Wanted to check in if there are any updates or progress on this?

Do you have an estimate on when you might start working on this?

Trying to plan ahead and carve out time for review in the coming weeks.

0xBigBoss commented 1 year ago

@0xBigBoss Wanted to check in if there are any updates or progress on this?

Do you have an estimate on when you might start working on this?

Trying to plan ahead and carve out time for review in the coming weeks.

Hey @Olshansk most likely not until next week, I am trying to outline the scope of this ticket while I am focusing on upgrades.