Skip to content

Remove unused get_some_initial_peers RPC #18741

@glyh

Description

@glyh

Summary

The get_some_initial_peers RPC appears to be dead code and should be removed unless there is an out-of-tree caller that still depends on it.

Background

While tracing bootstrap peer selection, I found that seed peer choice is driven by configured initial_peers, optional seed_peer_list_url, and libp2p/DHT bootstrap setup.

Relevant paths:

  • src/app/cli/src/cli_entrypoint/mina_cli_entrypoint.ml builds initial_peers
  • src/lib/gossip_net/libp2p.ml merges seed peers and adds them to libp2p
  • src/app/libp2p_helper/src/codanet.go passes seeds into dht.BootstrapPeers(...)

The RPC itself is still defined:

  • src/lib/mina_networking/rpcs.ml defines Get_some_initial_peers
  • src/lib/mina_networking/mina_networking.ml exposes the RPC through the networking layer

However, I could not find a production call site for this RPC. Search results only show:

  • the RPC definition/registration
  • metrics
  • fake/test network hooks

Why remove it

  • Reduces dead code in the networking surface area
  • Removes an apparently unused RPC and its associated metrics
  • Simplifies reasoning about how bootstrap peer discovery actually works

Proposed work

  • Remove Get_some_initial_peers from src/lib/mina_networking/rpcs.ml
  • Remove any corresponding exposure from src/lib/mina_networking/mina_networking.mli and related interfaces
  • Remove metrics that only exist for this RPC
  • Update tests/fakes that still mention it
  • Verify there is no external or operational dependency before merging

Acceptance criteria

  • get_some_initial_peers RPC is removed from the production networking API
  • Build/tests pass after removing references
  • No bootstrap/discovery behavior changes for normal node startup
  • If an external dependency exists, document it and keep/remove the RPC accordingly

Open question

Is there any out-of-tree consumer, operational tooling, or older node workflow still relying on get_some_initial_peers? If not, we should delete it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Status

    No status

    Status

    To triage

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions