Skip to content

Commit

Permalink
health check polish (#999)
Browse files Browse the repository at this point in the history
* health check polish

* update
  • Loading branch information
shunjizhan authored May 20, 2024
1 parent 89e787d commit 8b810dd
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/eth-providers/src/utils/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -127,13 +127,13 @@ export const getHealthResult = ({

/* --------------- heads --------------- */
const { chainState, internalState } = headsInfo;
if (chainState.curHeight !== internalState.curHeight) {
if (Math.abs(chainState.curHeight - internalState.curHeight) >= 2) {
msg.push(`curHeight mismatch! chain: ${chainState.curHeight}, internal: ${internalState.curHeight}`);
isHealthy = false;
isHeadsOK = false;
}

if (chainState.finalizedHeight !== internalState.finalizedHeight) {
if (Math.abs(chainState.finalizedHeight - internalState.finalizedHeight) >= 2) {
msg.push(`finalizedHeight mismatch! chain: ${chainState.finalizedHeight}, internal: ${internalState.finalizedHeight}`);
isHealthy = false;
isHeadsOK = false;
Expand Down

0 comments on commit 8b810dd

Please sign in to comment.