Skip to content

mina advanced node-status appears to be broken #18195

@cjjdespres

Description

@cjjdespres

Preliminary Checks

Description

The mina advanced node-status doc string says:

Get node statuses for a set of peers

If you run mina advanced node-status --daemon-peers (to get the status of every known peer), you ought to see some output, especially if the daemon is synced to the network and has a lot of peers. What you will see is empty output, which is wrong.

I ran mina advanced node-status --daemon-peers --show-errors (so errors in getting the status of the peers would also be output) and got this output repeated ~22 times (which was the number of peers I was connected to at the time)

{"error":{"exn_name":"Base__Exn.Sexp","exn":["Yojson.Json_error(\"Line 1, bytes 65523-65524:\\nUnexpected end of input\")"]}}

Claude speculates that this is due to this code in libp2p:

n, err := s.Read(data)
// TODO will the whole status be read or we can "accidentally" read only
// part of it?

The TODO seems relevant. If this is indeed the issue, then it's because that Read call is only reading a single chunk of the status reply.

N.B. I think a test of this could be added in the CI somewhere. I think this might show up in a 2-node test network spun up in a test. It would probably be observable in a network connectivity test too (to actual mainnet or devnet). Once a test is added, it'll be easier to see if changing the Read call will fix this command, or if the failure is somewhere else. Also, if the same code serves a graphql endpoint then it might be easier to use that in a test. Unsure.

Steps to Reproduce

  1. Sync a daemon to a network (it probably doesn't have to be synced, but it doesn't hurt)
  2. Confirm that the daemon is connected to some non-zero number of peers (with mina client status, or otherwise - the graphql interface is probably more convenient in a test)
  3. Run mina advanced node-status --daemon-peers --show-errors
  4. Observe all the Unexpected end of input failure lines

Expected Result

No failures due to unexpected end of input

Actual Result

Failures due to unexpected end of input

Daemon version

42ec1eb on compatible, but I'd imagine this is reasonably long-standing

How frequently do you see this issue?

Always

What is the impact of this issue on your ability to run a node?

Low

Status

.

Additional information

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Status

    Todo

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions