Skip to content

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

@Olshansk

Description

@Olshansk

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

Metadata

Metadata

Assignees

Labels

clientwork needed to interface with the node (rpc, cli, etc..)coreCore infrastructure - protocol relatedcore starter taskGood for newcomers, but aimed at core team members though still open for everyone

Type

No type

Projects

Status

Done

Relationships

None yet

Development

No branches or pull requests

Issue actions