Skip to content

[P2P] Peer discovery debug CLI sub-commands #730

Description

@bryanchriswhite

Objective

Extend the debug CLI to expose sub-commands for driving peer discovery in the P2P module (analogous to how it currently supports driving consensus). This will facilitate both manual and automated testing efforts.

Origin Document

Based on a discussion between @dylanlott and myself about end-to-end test planning for peer discovery. It has been made clear in discussions past (probably in documentation somewhere as well) that we want to prioritize supporting robust manual testing/investigation of these dynamic systems (before they get a chance to run away from us).

Goals

  • Expose controls to peer discovery to developers
  • Support step-by-step progression through peer discovery
  • Support debugging & reproducing peer discovery scenarios (incl. edge cases)

Deliverable

  • Extend the debug CLI to expose the sub-commands subcommands outlined below (peer CLI UX)
  • (Bonus): draft a design for reproducible peer discovery failure reports or something
    • Could be generic (e.g. trace based)

CLI UX - peer & p2p subcommands

The following commands should send/broadcast debug messages into the network, resulting in nodes to print to their respective logs, similar to the debug subcommand's behavior.

peer discovery status # background router only
peer discovery start  # background router only
peer discovery stop   # background router only
peer list [--all | --staked | --unstaked]
peer forget (--all | <forgetter peer ID>)
peer connections
peer interrogate <peer ID>
peer disconnect <peer ID>

p2pCmd persisten flags:

  • --trace

NOTE: p2p commands MAY interact with a remote/standalone node rather than utilize the CLI's own P2P module

p2p send [--trace] <peer ID> <text message>
p2p broadcast [--trace] <text message>

Non-goals / Non-deliverables

  • Refactoring/simplifying the Router interface
  • Additional, unrelated libp2p integration work

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

  • New CLI subcommands behave as expected
  • All tests: make test_all
  • LocalNet: verify a LocalNet is still functioning correctly by following the instructions at docs/development/README.md
  • k8s LocalNet: verify a k8s LocalNet is still functioning correctly by following the instructions here

Creator: @bryanchriswhite

Activity

  1. converted this from a draft issue on May 4, 2023
  2. changed the title [-][P2P] Peer discovery debug CLI sub-commands[/-] [+][WIP] [P2P] Peer discovery debug CLI sub-commands[/+] on May 4, 2023
  3. moved this from Rescope to No status in V1 Dashboardon May 4, 2023
  4. changed the title [-][WIP] [P2P] Peer discovery debug CLI sub-commands[/-] [+][P2P] Peer discovery debug CLI sub-commands[/+] on May 4, 2023
  5. moved this from Up Next to Rescope in V1 Dashboardon May 31, 2023
  6. moved this from Rescope to In Progress in V1 Dashboardon Jun 1, 2023
  7. linked a pull request that will close this issue[P2P] Refactor P2P submodules #895on Jul 11, 2023
  8. moved this from In Progress to Done in V1 Dashboardon Jul 13, 2023
  9. Olshansk commented on Jul 13, 2023

    @Olshansk
    Collaborator

    @bryanchriswhite We haven't merged in the P2P subcommand in yet, so do you think this was closed prematurely?

  10. Olshansk commented on Jul 14, 2023

    @Olshansk
    Collaborator

    Per my comment above, reopening until it's merged or told otherwise.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

p2pP2P specific changestoolingtooling to support development, testing et al

Type

No type

Projects

Relationships

None yet

Development

No branches or pull requests

Issue actions