besu icon indicating copy to clipboard operation
besu copied to clipboard

Reimplement LivenessCheck and ReadinessCheck as plugins

Open lu-pinto opened this issue 1 year ago • 7 comments

Description

I noticed, while working on a plugin that required to extend the ReadinessCheck, that this check is implemented not through plugins but hardcoded as an RPC method during initialization. It would be much cleaner if these checks can be implemented as plugins, as in the future if someone needs to do something similar, it would be easier and faster to do it.

  • LivenessCheck is a trivial probe to check if process is UP or DOWN
  • ReadinessCheck requires 2 checks:
  1. Make sure that the sync is within a certain distance from the head of the chain. For this, a numMaxBlocksBehind parameter is used to check for distance. This check could be done in the plugin version by registering an BesuEvent for addSyncStatusListener(SyncStatusListener).
  2. Using a parameter minPeers check that the number of peers connected is higher than that value. In the plugin version, I can't see a way to have access to the number of peers but this could easily be exposed by P2PService.

Acceptance Criteria

Readinees and Liveness checks are re-implemented without side effects. Both probes will be functioning the same as before but now implemented as plugins.

lu-pinto avatar Oct 01 '24 13:10 lu-pinto

Should this be implemented inside the plugins directory, with a new sub-directory called health-checks, or can they go inside the existing rocksdb directory?

7suyash7 avatar Oct 02 '24 12:10 7suyash7

IMO, we should go with a sub-directory inside plugins. health should be enough as a name.

lu-pinto avatar Oct 03 '24 10:10 lu-pinto

I'm interested in the issue. Can I take it on ?

marianakibuuka avatar Mar 29 '25 11:03 marianakibuuka

I'm interested in the issue. Can I take it on ?

Yes all yours

lu-pinto avatar Mar 31 '25 19:03 lu-pinto

@marianakibuuka any progress on this one?

macfarla avatar Jun 12 '25 13:06 macfarla

@macfarla @lu-pinto I would like to work on this issue. Can get it assigned.

jevinjojo avatar Jun 20 '25 09:06 jevinjojo

yes please... take it on.. Thanks

On Fri, Jun 20, 2025 at 12:17 PM Jevin Jojo @.***> wrote:

jevinjojo left a comment (hyperledger/besu#7704) https://github.com/hyperledger/besu/issues/7704#issuecomment-2990424143

@macfarla https://github.com/macfarla I would like to work on this issue. Can get it assigned.

— Reply to this email directly, view it on GitHub https://github.com/hyperledger/besu/issues/7704#issuecomment-2990424143, or unsubscribe https://github.com/notifications/unsubscribe-auth/A4I2VSXRWFWI6C6XDJRWHBD3EPGTRAVCNFSM6AAAAABPFSFLBWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDSOJQGQZDIMJUGM . You are receiving this because you were mentioned.Message ID: @.***>

marianakibuuka avatar Jun 21 '25 11:06 marianakibuuka