input-output-hk / jormungandr

privacy voting blockchain node
https://input-output-hk.github.io/jormungandr/
Apache License 2.0
364 stars 132 forks source link

Add "Leadership" and "Passive" to jcli node stats #1808

Open rickymac68 opened 4 years ago

rickymac68 commented 4 years ago

Is your feature request related to a problem/context ? Please describe if applicable.

The problem is accidental adversarial forks when running multiple jormungandr nodes with one node as a block signer and the other nodes are passive.

Describe the solution you'd like A clear and concise description of what you want to happen. possible alternative solutions

I would like to have "Leadership" and "Passive" displayed in the jcli node stats output.

Additional context

When testing or operating multiple nodes, pool operators will practice putting one node in Leadership and others in passive. This has led to accidental adversarial forks. The only time leadership is shown is at startup in the logs. Having Leadership/Passive in the nodes stats will be very helpful for node management.

Linicks commented 4 years ago

It's a good idea! https://github.com/input-output-hk/jormungandr/issues/1474

hodlonaut commented 4 years ago

I'm confused. Why can't you use 'jcli rest v0 leaders get -h ' to answer the question whether a node is passive or a leader currently?

Linicks commented 4 years ago

@hodlonaut You can, however the issues is that it's an additional request that can be handled with one request. It would also make it easier for tooling and monitoring since almost everyone is already watching their stats all the time. It would be easy to change, and in fact there's all ready a "State" stat that could probably just be changed to include the leader/passive information rather than just saying "Running". I know many people have been burned thinking that their node was in a particular state and it wasn't.