Typefully

Network-wide validator status monitoring for Cosmos SDK

Avatar

Share

 • 

3 years ago

 • 

View on X

🚨 We built a network-wide validator status monitoring tool for @Cosmos SDK chains that can monitor for validators that have missed too many blocks, and are likely to get jailed. Check out the code on @cheqd_io's GitHub 👉 github.com/cheqd/validator-status Here's how we went about it...
To provide some context here: proof-of-stake blockchains like @cosmos use a self-reinforcing mechanism to ensure nodes maintain good uptime. You can see this on our block explorer: explorer.cheqd.io/validators
We decided to build this because a few node operators have been jailed in the past for missing too many blocks. As a reminder, validators on Cosmos SDK networks get slashed if they miss too many blocks within a defined window. learn.cheqd.io/overview/intro-to-defi-aspects-of-cheqd/how-do-i-choose-which-node-operator-to-delegate-to
On our network, this is counted as “50% of the last 25,920 blocks”: if a validator misses more than this, it gets jailed and 1% of *all* staked tokens delegated to it is slashed/burned. This works out to: - 50% of 25,920 = 12,960 blocks - 12,960 * 6s = approx. 21.6 hours
Most @cosmos monitoring tools are designed for use directly by a validator, i.e., Prometheus. github.com/cosmos/awesome#monitoring This is great for validators who are running this kind of tool (e.g., we use @datadoghq), but it requires validators to run additional infra (many don't).
So we thought of a different way to do it: our BigDipper block explorer (built by the folks @forbole) exposes a GraphQL endpoint that shows validator status for *all* validators. We took this output, wrapped in a Cloudflare Worker (github.com/cheqd/validator-status), and voila!
To simplify the task of alerting (and to keep it extensible to other channels), we take the output of our validator status API and parse it via @zapier. This allows us to send alerts to our @SlackHQ (cheqd.link/join-cheqd-slack) and our @discord (cheqd.link/discord-github)
Buuuuut...if a *different* @cosmos network wants to set up similar monitoring, or wants to alert to different channels, our setup makes it flexible to achieve this. Including people being able to set up their own Zapier "zaps" to alert via SMS, email, etc 🤓
Avatar

Ankur Banerjee 🆔

@ankurb

CTO/cofounder @cheqd_io & @creds_xyz. Co-chair of Technical SteerCo @DecentralizedID. Ex @FinTechLabLDN, @inside_r3, @Accenture, @StackTravel.