pocket icon indicating copy to clipboard operation
pocket copied to clipboard

[Core] Redesign `actor.proto` to handle actor specific parameters

Open Olshansk opened this issue 1 year ago • 1 comments

Objective

A clear & modular to handle and maintain differences and commonalities between different actor protobuf types.

Origin Document

In #550, we tended #313 which consolidated ActorSpecificParam and GenericParam into ServiceURL while getting rid of MaxRelays. The new actor proto type is:

message Actor {
  ActorType actor_type = 1;
  string address = 2;
  string public_key = 3;
  repeated string chains = 4; // Not applicable to `Validator` actors
  string service_url = 5; // Not applicable to `Application` actors
  string staked_amount = 6;
  int64 paused_height = 7;
  int64 unstaking_height = 8;
  string output = 9;
}

However, service_url is not pertinent to Applications; the field exists but is unused which can lead to confusion and lack of clarity throughout the codebase while adding hidden techdebt.

Screenshot 2023-02-27 at 3 38 22 PM

Goals

  • Design a method that makes it easy to distinguish between fields common to all actors and those that are actor specific
  • Design a method that makes it easy to extend actor functionality (e.g. adding new fields) with minimal efforts (e.g., BaseActor + ValActor` protobuf?)

Deliverable

  • [ ] A PR that tends to the Goals above
  • [ ] Documentation on:
    • [ ] All the different actor protobuf types and how they're used (if applicable)
    • [ ] How one would go about adding a new field specific to one type of actor

Non-goals / Non-deliverables

  • Adding new functionality to any of the existing actors

General issue deliverables

  • [ ] Update the appropriate CHANGELOG(s)
  • [ ] Update any relevant local/global README(s)
  • [ ] Update relevant source code tree explanations
  • [ ] Add or update any relevant or supporting mermaid diagrams

Testing Methodology

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

Creator: @Olshansk Co-Owners: @deblasis

Olshansk avatar Feb 27 '23 23:02 Olshansk