Skip to content

add pollHealthChecker interface for optional RPC health checks#83

Draft
Krish-vemula wants to merge 9 commits intomainfrom
cre/PLEX-2476
Draft

add pollHealthChecker interface for optional RPC health checks#83
Krish-vemula wants to merge 9 commits intomainfrom
cre/PLEX-2476

Conversation

@Krish-vemula
Copy link
Contributor

@Krish-vemula Krish-vemula commented Feb 17, 2026

Summary

Adds an optional PollHealthCheck method to the RPCClient interface, enabling chain-specific RPC clients to perform additional health checks during node pool polling. Failures from this check count toward the PollFailureThreshold, allowing automatic detection and failover from unhealthy RPC nodes.

Supports: #352

@Krish-vemula Krish-vemula marked this pull request as ready for review February 18, 2026 23:02
@Krish-vemula Krish-vemula requested a review from a team as a code owner February 18, 2026 23:02
lggr.Tracew("Pinging RPC", "nodeState", n.State(), "pollFailures", pollFailures)
pollCtx, cancel := context.WithTimeout(ctx, pollInterval)
version, pingErr := n.RPC().ClientVersion(pollCtx)
if pingErr == nil {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is redundat with new logic, no?

}
lggr.Warnw("Finalized state not available", "err", stateErr, "failures", finalizedStateFailures, "threshold", finalizedStateCheckFailureThreshold)
if finalizedStateCheckFailureThreshold > 0 && finalizedStateFailures >= finalizedStateCheckFailureThreshold {
lggr.Errorw("RPC node cannot serve finalized state after consecutive failures", "failures", finalizedStateFailures)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's introduce a metric similar to PollsFailed to have better visibility into the failure rate.

Add optional interface for chain-specific RPC clients to run extra health
checks during alive-loop polling. Failures count toward poll failure threshold.

Enables chain integrations to detect issues like missing historical state.
…r finalized state availability with configurable threshold and regex-based error classification.
@Krish-vemula Krish-vemula marked this pull request as draft March 10, 2026 18:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants