---
id: I0044
title: "PagerDuty validator delinquency"
url: https://carbium.sh/library/integrate/pagerduty-validator-delinquency
collection: Integrations
category: Chat and notifications
revision: 1
updated: 2026-11-22
author: Carbium
code: MIT (LICENSE in the zip); text: all rights reserved, Carbium Corporation
---

# PagerDuty validator delinquency

A Node watcher you run on a second machine polls your validator's RPC port, compares its slot with Carbium's, and opens a PagerDuty incident after three bad polls in a row. It resolves the incident on the first good poll.

## What the watcher checks

The watcher is one Node process. It runs on a machine other than the validator, and every 10 seconds it asks two nodes for their newest slot: your validator's own RPC port and Carbium. It also calls `getHealth` on the validator. A validator that stops answering, reports itself unhealthy, or sits more than 128 slots behind Carbium counts as a bad poll. Three bad polls in a row open a PagerDuty incident, and the first good poll after that resolves it.

Carbium is the yardstick because it is a node you do not operate and can reach from anywhere with one key. The validator is the node under test, so its RPC port has to be reachable from the watcher's machine. Many operators keep that port closed to the public. Put the watcher inside the same private network, or open the port to the watcher's address only.

| State | When | PagerDuty |
|---|---|---|
| good | The validator answered `getSlot` and `getHealth`, and Carbium's slot minus the validator's is at or under the limit. | Resolves the open incident, if there is one. |
| bad | The validator failed a call, reported itself unhealthy, or lags past the limit, and fewer than 3 bad polls have run in a row. | Nothing yet. |
| delinquent | The third bad poll in a row. | One trigger event, then silence until a good poll. |

If the Carbium `getSlot` call fails, the poll is skipped and the counters stay where they were. Without a yardstick there is nothing to judge the validator against.

## The Solana side: slot lag and getHealth

Both slot reads ask for `processed` explicitly, because it is each node's newest slot. A validator's JSON-RPC server answers at `finalized` by default, and `@solana/kit` 8.6.0 fills in `confirmed` when a call leaves commitment out, so a hand-run curl or a bare kit call would read an older slot. Since the Alpenglow switch the gap between the levels is 0 to 1 slots.

The default limit of 128 slots is the distance Solana's own delinquent list uses for a vote account. A slot lasts about 200 ms now, so 128 slots is roughly 26 seconds. Two healthy nodes see a new slot at different moments and differ by a few slots, so a limit in single digits pages on ordinary jitter. Set `LAG_LIMIT` lower only if you accept that.

`getHealth` on a validator answers `ok` or a JSON-RPC error. Two kinds of error count as bad: the -32005 answer from a node that knows it is behind, whose error data carries a slot count that can be null, and a call that fails or times out. The call judges only what the node has seen, so a node cut off from the cluster can still answer `ok`. The slot comparison with Carbium catches that case.

## The PagerDuty side: one trigger, one resolve

In PagerDuty, add an Events API v2 integration to the service that should receive the page and copy its integration key into `PAGERDUTY_ROUTING_KEY`. Anyone holding that key can open incidents on the service, so keep it out of the repository.

The watcher POSTs JSON to `https://events.pagerduty.com/v2/enqueue`. A trigger carries `routing_key`, `event_action`, `dedup_key` and a `payload` with `summary`, `source` and `severity`. The dedup key is `validator-delinquent-` plus `VALIDATOR_NAME`, so a repeat folds into the open incident and the resolve closes the same one. `custom_details` holds both slots, the lag and each failed call, which gives the responder a cause in the incident itself. A resolve carries only the routing key, the action and the dedup key.

A successful enqueue answers 202. The watcher records the incident as open or closed only after that answer, so a PagerDuty outage or a wrong key means the next poll sends the event again.

With `PAGERDUTY_ROUTING_KEY` unset, the watcher prints the event it would send and sends nothing. Use that to tune the limit before anyone gets paged.

## The watcher

Install the one dependency with `npm install @solana/kit@8.6.0` and set `"type": "module"` in `package.json`. Node 24 strips the types on load. `CARBIUM_KEY` is required, and the file exits with a message when it is missing; it goes out in the `x-api-key` header. `VALIDATOR_RPC_URL`, `PAGERDUTY_ROUTING_KEY`, `VALIDATOR_NAME`, `LAG_LIMIT`, `BAD_POLLS` and `CARBIUM_RPC_URL` are optional.

`main.ts` (run: `node main.ts`)

```ts
// I0044 · PagerDuty validator delinquency
// https://carbium.sh/library/integrate/pagerduty-validator-delinquency
// Copyright (c) Carbium Corporation. MIT License (LICENSE). Keep this notice.
// SPDX-License-Identifier: MIT

import { createDefaultRpcTransport, createSolanaRpc, createSolanaRpcFromTransport } from "@solana/kit";

const key = process.env.CARBIUM_KEY;
if (!key) {
  console.error("Set CARBIUM_KEY.");
  process.exit(1);
}
const routingKey = process.env.PAGERDUTY_ROUTING_KEY; // unset: events are printed, not sent
const name = process.env.VALIDATOR_NAME ?? "validator";
const limit = Number(process.env.LAG_LIMIT ?? 128); // slots, the distance Solana uses for a delinquent vote account
const needed = Number(process.env.BAD_POLLS ?? 3);
if (!Number.isFinite(limit) || !Number.isFinite(needed)) {
  console.error("LAG_LIMIT and BAD_POLLS must be numbers.");
  process.exit(1);
}
const POLL_MS = 10_000;
const deadline = () => AbortSignal.timeout(5_000); // a call past 5 s counts as failed
const dedupKey = `validator-delinquent-${name}`;
const msg = (e: unknown) => (e instanceof Error ? e.message : String(e));

const carbium = createSolanaRpcFromTransport(
  createDefaultRpcTransport({
    url: process.env.CARBIUM_RPC_URL ?? "https://services.carbium.sh",
    headers: { "x-api-key": key },
  }),
);
const targetUrl = process.env.VALIDATOR_RPC_URL;
const target = targetUrl ? createSolanaRpc(targetUrl) : carbium; // unset: try the loop against Carbium itself

let bad = 0;
let paged = false;

async function page(action: "trigger" | "resolve", summary = "", details: object = {}) {
  const body = {
    routing_key: routingKey,
    event_action: action,
    dedup_key: dedupKey,
    ...(action === "trigger" && { payload: { summary, source: name, severity: "critical", custom_details: details } }),
  };
  if (!routingKey) return console.log("no PAGERDUTY_ROUTING_KEY, event not sent:", JSON.stringify({ ...body, routing_key: undefined }));
  const res = await fetch("https://events.pagerduty.com/v2/enqueue", {
    method: "POST",
    headers: { "content-type": "application/json" },
    signal: deadline(),
    body: JSON.stringify(body),
  });
  if (!res.ok) throw new Error(`PagerDuty answered ${res.status}`);
}

async function poll() {
  const commitment = "processed";
  const [ref, node, health] = await Promise.allSettled([
    carbium.getSlot({ commitment }).send({ abortSignal: deadline() }),
    target.getSlot({ commitment }).send({ abortSignal: deadline() }),
    target.getHealth().send({ abortSignal: deadline() }),
  ]);
  if (ref.status === "rejected") return console.error("reference getSlot failed, poll skipped:", msg(ref.reason));
  const named: [string, PromiseSettledResult<unknown>][] = [["validator getSlot", node], ["validator getHealth", health]];
  const problems = named.flatMap(([n, r]) => (r.status === "rejected" ? [`${n}: ${msg(r.reason)}`] : []));
  const nodeSlot = node.status === "fulfilled" ? node.value : null;
  const lag = nodeSlot === null ? null : Number(ref.value - nodeSlot);
  bad = problems.length > 0 || (lag !== null && lag > limit) ? bad + 1 : 0;
  console.log(`${new Date().toISOString()} ${name}: slot ${nodeSlot ?? "n/a"}, carbium slot ${ref.value}, lag ${lag ?? "n/a"}, bad polls ${bad}/${needed}${problems.length ? `, failed: ${problems.join("; ")}` : ""}`);
  if (bad >= needed && !paged) {
    const why = problems[0] ?? `${lag} slots behind`;
    await page("trigger", `${name} is delinquent: ${why}`, { lag, validatorSlot: nodeSlot?.toString() ?? null, carbiumSlot: ref.value.toString(), problems });
    paged = true; // only after PagerDuty accepted it, so a failed post is retried
  } else if (bad === 0 && paged) {
    await page("resolve");
    paged = false;
  }
}

for (;;) {
  const started = Date.now();
  await poll().catch((err: unknown) => console.error("poll failed:", msg(err)));
  await new Promise((r) => setTimeout(r, Math.max(0, POLL_MS - (Date.now() - started)))); // polls start every POLL_MS
}
```

## Run it on a second machine

Set `VALIDATOR_RPC_URL` to the validator's RPC address, for example `http://10.0.0.5:8899`, and start `node main.ts` under a supervisor such as a systemd unit. Put it on a different host and network from the validator, so the failure it reports cannot also silence it.

With `VALIDATOR_RPC_URL` unset, the watcher uses Carbium's endpoint as the target too. The first run then prints a lag near 0 and shows the loop working before you point it at your node. Each poll prints one line with both slots, the lag and the count of bad polls.

To see the page path work, start it with `LAG_LIMIT=-100` and `BAD_POLLS=1`. Every real lag is above that, so the first poll sends one trigger, or prints it when no routing key is set. Stopping the process leaves that incident open, so resolve it by hand.

## What it costs against your limits

Only the Carbium call counts against your key. `getSlot` is a cached read at 1 cell, and Free allows [5 req/s](https://carbium.sh/docs#rpc) of them. One call every 10 seconds is 6 cells a minute, or 0.1 req/s, about 2% of Free's rate. With the target left unset, all three calls go to Carbium and the total is 18 cells a minute.

[Limits are per account](https://carbium.sh/docs#limits), so all keys share one budget. A 429 from Carbium is handled like any failed Carbium call: the watcher logs the error, skips the poll and opens no incident.

## Where it ends

- It reads only the node's RPC view and never its votes. A validator can sit at the tip and still fail to vote, for example with the wrong identity keypair loaded. The cluster's delinquent list from `getVoteAccounts` and Solana's `solana-watchtower` cover that, and this watcher calls neither.
- A new poll starts every 10 seconds, even when a call runs into the 5 second timeout, and a page needs three bad polls. A dead or unhealthy RPC pages after 20 to 30 seconds, or up to 35 when its calls time out. A stalled node must first fall more than 128 slots behind Carbium, about 26 seconds, so it pages after roughly 45 to 55 seconds. Trouble shorter than the three-poll window never pages.
- A validator with its RPC port disabled or firewalled looks down. The watcher cannot tell a closed port from a dead node.
- Carbium is the only yardstick. If Carbium itself stalls, the validator looks ahead and no page opens. A failed Carbium call skips the poll and gives no verdict.
- A watcher that dies sends nothing. Check the process from a second place, or give it a supervisor that alerts when it stops.
- One process watches one validator. For a fleet, run one per validator with its own `VALIDATOR_NAME`.

## When it goes wrong

| What goes wrong | What to do |
|---|---|
| The log repeats `PagerDuty answered 400` on every poll. | The routing key is wrong or belongs to another kind of integration. Copy the integration key of an Events API v2 integration into `PAGERDUTY_ROUTING_KEY` and restart; a REST API token is refused with 400. The next poll sends the pending event again. |
| Every poll logs `validator getSlot: fetch failed` and an incident opens. | The watcher cannot reach the validator's RPC port. Test the URL with curl from the watcher's machine, then check the validator's `--rpc-bind-address` and the firewall between the two hosts. |
| An incident opens during every planned validator restart. | A restart takes longer than three polls. Raise `BAD_POLLS` to cover the usual restart time, for example 12 for two minutes, or pause the service in PagerDuty during the maintenance window. |
| The log shows `reference getSlot failed, poll skipped` with an HTTP 401. | Carbium does not recognise the key. Check that `CARBIUM_KEY` holds the whole key and that nothing else sets `CARBIUM_RPC_URL`. Polls stay skipped, and nothing pages, until the [key](https://carbium.sh/docs#auth) works. |
| Incidents open and resolve again and again while the lag hovers near the limit. | The limit has no recovery margin. Raise `LAG_LIMIT` or `BAD_POLLS`, so only a lasting lag opens an incident. |

## Questions

### How is this different from solana-watchtower?

Watchtower reads vote accounts through an RPC and judges delinquency at the vote level. This watcher asks the validator's own RPC port for its slot and health and compares the slot with an independent node. The two checks fail in different ways, so running both is reasonable.

### Can it run on the validator's own host?

It runs there, but a host failure then takes the watcher down with the validator and no page goes out. A second machine on a different network is the point of the setup.

### Why does the trigger carry a dedup key?

PagerDuty folds events with the same dedup key into one incident. A repeated trigger adds no new page, and the resolve event names the same key, so it closes the incident the trigger opened.

### What does it use on the Free plan?

One cached read every 10 seconds, so 6 cells a minute against 5 req/s for that class of call. The calls to your validator's RPC port do not touch your Carbium budget.

## Related

- [Slack slot-lag alerts](https://carbium.sh/library/integrate/slack-slot-lag-alerts) (Integrations, I0001)
- [RPC rate-limit alerts](https://carbium.sh/library/usecase/rpc-rate-limit-alerts) (Use cases, UC0001)
- [carbium.sh/docs#endpoints](https://carbium.sh/docs#endpoints)
- [carbium.sh/docs#auth](https://carbium.sh/docs#auth)
- [carbium.sh/docs#rpc](https://carbium.sh/docs#rpc)
- [carbium.sh/docs#limits](https://carbium.sh/docs#limits)
- [carbium.sh/docs#errors](https://carbium.sh/docs#errors)
