Skip to content

[Utility] Design & implement a better approach to GenericParam / ActorSpecificParam #313

@Olshansk

Description

@Olshansk

Objective

Design, consolidate & refactor how parameters unique to different actors are managed throughout the codebase.

Origin Document

At the time of writing this issue, persistence/test/setup_test.go has the following code snippet:

Screen Shot 2022-10-19 at 3 23 07 PM

In #206, we consolidated some instances in the codebase where GenericParam and ActorSpecificParam are conflated, but the current definition for an actor does not make it clear what the "generic param" is:

message Actor {
  ActorType actor_type = 1;
  string address = 2;
  string public_key = 3;
  repeated string chains = 4;
  string generic_param = 5;
  string staked_amount = 6;
  int64 paused_height = 7;
  int64 unstaking_height = 8;
  string output = 9;
}

For example, it could be a ServiceURI in the context of a ServiceNode or the MaxRelays count in the context of an App. Furthermore, it does not permit us to have more than one "actor specific parameter." This need to be cleared up and improved.

Goals

  • Avoid confusing new contributors to the code base of what "generic param" or "actor specific param" may be and make it explicit
  • Make the code self-explanatory and clear with naming conventions
  • Enable giving actors the option to have more than one "actor specific parameter"
  • Updating both protobufs & structs where appropriate

Deliverable

  • A design and README explaining how this task should be tackled
  • A presentation and agreement from the team on how this should be approached
  • A PR updating structs, protobufs and related dependencies to the new "actor specific parameter" schemas

Non-goals / Non-deliverables

  • Changing the parameter values associated with actors to actors
  • Adding new functionality
  • Refactoring unrelated parts of the codebase

General issue deliverables

  • Update the appropriate CHANGELOG
  • Update any relevant READMEs (local and/or global)
  • Update any relevant global documentation & references
  • If applicable, update the source code tree explanation
  • If applicable, add or update a state, sequence or flowchart diagram using mermaid

Testing Methodology

  • All tests: make develop_all
  • LocalNet: verify a LocalNet is still functioning correctly by following the instructions at docs/development/README.md

Creator: @Olshansk
Co-Owners: @andrewnguyen22

Metadata

Metadata

Assignees

Labels

code healthNice to have code improvementcoreCore infrastructure - protocol relatedutilityUtility specific changes

Type

No type

Projects

Status

Rescope

Relationships

None yet

Development

No branches or pull requests

Issue actions