Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Client] Add a Send or Broadcast msg type to the debug CLI #344

Closed
3 tasks
Olshansk opened this issue Nov 11, 2022 · 0 comments · Fixed by #561
Closed
3 tasks

[Client] Add a Send or Broadcast msg type to the debug CLI #344

Olshansk opened this issue Nov 11, 2022 · 0 comments · Fixed by #561
Assignees
Labels
client work needed to interface with the node (rpc, cli, etc..) core starter task Good for newcomers, but aimed at core team members though still open for everyone core Core infrastructure - protocol related

Comments

@Olshansk
Copy link
Member

Objective

Update the debug CLI to make it clear which debug commands are broadcasts and which are sends.

Origin Document

There was a "fly by" change made in #285 where we updated the strings in app/client/cli/debug.go to the available debug commands by adding broadcast and send to the end like so:

	PromptResetToGenesis         string = "ResetToGenesis (broadcast)"
	PromptPrintNodeState         string = "PrintNodeState (broadcast)"
	PromptTriggerNextView        string = "TriggerNextView (broadcast)"
	PromptTogglePacemakerMode    string = "TogglePacemakerMode (broadcast)"
	PromptShowLatestBlockInStore string = "ShowLatestBlockInStore (send)"

#285 (comment)

Screen Shot 2022-11-10 at 4 20 33 PM

The best approach to doing something like this is to update

message DebugMessage {
  DebugMessageAction action = 1;
  google.protobuf.Any message = 2;
}

To:

enum DebugMessageType {
	DEBUG_MESSAGE_TYPE_UNKNOWN = 0;

	DEBUG_MESSAGE_TYPE_SEND = 1;
	DEBUG_MESSAGE_TYPE_BROADCAST = 2;
}

message DebugMessage {
  DebugMessageAction action = 1;
  DebugMessageType type = 2;
  google.protobuf.Any message = 3;
}

Goals

  • Make it clear (to the user) which command is a send or broadcast

Deliverable

  • Create a SEND and BROADCAST enum type for the debug cmdline
  • Update the strings presented to the user to reflect each message type
  • Update all downstream business logic to reflect the message type

Non-goals / Non-deliverables

  • Adding new debug commands
  • Updating send to be able to specify which specific node the command is sent to

General issue deliverables

  • Update the appropriate CHANGELOG
  • Update any relevant READMEs (local and/or global)
  • Update any relevant global documentation & references

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

@Olshansk Olshansk added client work needed to interface with the node (rpc, cli, etc..) core starter task Good for newcomers, but aimed at core team members though still open for everyone labels Nov 11, 2022
@Olshansk Olshansk moved this to Backlog in V1 Dashboard Nov 11, 2022
@Olshansk Olshansk self-assigned this Dec 15, 2022
@Olshansk Olshansk added the core Core infrastructure - protocol related label Dec 15, 2022
@Olshansk Olshansk moved this from Backlog to Up Next in V1 Dashboard Dec 19, 2022
@Olshansk Olshansk moved this from Up Next to Backlog in V1 Dashboard Dec 27, 2022
@Olshansk Olshansk assigned dylanlott and unassigned Olshansk Feb 24, 2023
@Olshansk Olshansk moved this from Backlog to Up Next in V1 Dashboard Feb 27, 2023
@jessicadaugherty jessicadaugherty moved this from Up Next to In Review in V1 Dashboard Mar 8, 2023
dylanlott added a commit that referenced this issue Mar 20, 2023
…LI commands (#561)

## Description

Adds a `MessageRoutingType` field for distinguishing debug message [routing types](https://en.wikipedia.org/wiki/Routing) in the debug CLI.

## Issue

Fixes #344

## Type of change

Please mark the relevant option(s):

- [ ] New feature, functionality or library
- [ ] Bug fix
- [x] Code health or cleanup
- [ ] Major breaking change
- [ ] Documentation
- [ ] Other <!-- add details here if it a different type of change -->

## List of changes

- Adds a RoutingType field to the DebugMessage
- Distinguishes the routing types of each message in the Debug CLI

## Testing

- [x] `make develop_test`
- [x] [LocalNet](https://github.com/pokt-network/pocket/blob/main/docs/development/README.md) w/ all of the steps outlined in the `README`

## Required Checklist

- [x] I have performed a self-review of my own code
- [x] I have commented my code, particularly in hard-to-understand areas
- [x] I have tested my changes using the available tooling
- [x] I have updated the corresponding CHANGELOG

### If Applicable Checklist

- [ ] I have updated the corresponding README(s); local and/or global
- [ ] I have added tests that prove my fix is effective or that my feature works
- [ ] I have added, or updated, [mermaid.js](https://mermaid-js.github.io) diagrams in the corresponding README(s)
- [ ] I have added, or updated, documentation and [mermaid.js](https://mermaid-js.github.io) diagrams in `shared/docs/*` if I updated `shared/*`README(s)
@github-project-automation github-project-automation bot moved this from In Review to Done in V1 Dashboard Mar 20, 2023
dylanlott added a commit that referenced this issue Mar 24, 2023
…LI commands (#561)

## Description

Adds a `MessageRoutingType` field for distinguishing debug message [routing types](https://en.wikipedia.org/wiki/Routing) in the debug CLI.

## Issue

Fixes #344

## Type of change

Please mark the relevant option(s):

- [ ] New feature, functionality or library
- [ ] Bug fix
- [x] Code health or cleanup
- [ ] Major breaking change
- [ ] Documentation
- [ ] Other <!-- add details here if it a different type of change -->

## List of changes

- Adds a RoutingType field to the DebugMessage
- Distinguishes the routing types of each message in the Debug CLI

## Testing

- [x] `make develop_test`
- [x] [LocalNet](https://github.com/pokt-network/pocket/blob/main/docs/development/README.md) w/ all of the steps outlined in the `README`

## Required Checklist

- [x] I have performed a self-review of my own code
- [x] I have commented my code, particularly in hard-to-understand areas
- [x] I have tested my changes using the available tooling
- [x] I have updated the corresponding CHANGELOG

### If Applicable Checklist

- [ ] I have updated the corresponding README(s); local and/or global
- [ ] I have added tests that prove my fix is effective or that my feature works
- [ ] I have added, or updated, [mermaid.js](https://mermaid-js.github.io) diagrams in the corresponding README(s)
- [ ] I have added, or updated, documentation and [mermaid.js](https://mermaid-js.github.io) diagrams in `shared/docs/*` if I updated `shared/*`README(s)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
client work needed to interface with the node (rpc, cli, etc..) core starter task Good for newcomers, but aimed at core team members though still open for everyone core Core infrastructure - protocol related
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

2 participants