Subgraph health check #212
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Subgraph health check | |
| on: | |
| schedule: | |
| - cron: '*/15 * * * *' | |
| workflow_dispatch: {} | |
| permissions: | |
| contents: read | |
| concurrency: | |
| group: subgraph-health | |
| cancel-in-progress: true | |
| jobs: | |
| check: | |
| name: Check Scribe indexer lag | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 5 | |
| steps: | |
| - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 | |
| - uses: actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b # v4.0.3 | |
| with: { node-version: 20 } | |
| - name: Check health (block-lag) | |
| id: health | |
| env: | |
| SCRIBE_URL: ${{ secrets.SCRIBE_URL }} | |
| ARBITRUM_SEPOLIA_RPC: ${{ secrets.ARBITRUM_SEPOLIA_RPC }} | |
| run: node scripts/check-scribe-health.mjs | |
| # Foundry gives us `cast` for the on-chain reads the reconciler does. | |
| - uses: foundry-rs/foundry-toolchain@8f1998e9878d786675189ef566a2e4bf24869773 # v1.2.0 | |
| - name: Reconcile chain <-> Scribe <-> deployment manifests (drift guard) | |
| env: | |
| SCRIBE_URL: ${{ secrets.SCRIBE_URL }} | |
| ARBITRUM_SEPOLIA_RPC: ${{ secrets.ARBITRUM_SEPOLIA_RPC }} | |
| run: node scripts/reconcile-chain-scribe.mjs | |
| - name: Alert on health/reconcile failure | |
| if: failure() | |
| env: | |
| DISCORD_OPS_WEBHOOK: ${{ secrets.DISCORD_OPS_WEBHOOK }} | |
| run: | | |
| if [ -z "$DISCORD_OPS_WEBHOOK" ]; then | |
| echo "DISCORD_OPS_WEBHOOK not set; skipping failure notification." | |
| exit 0 | |
| fi | |
| curl -s -X POST "$DISCORD_OPS_WEBHOOK" \ | |
| -H "Content-Type: application/json" \ | |
| -d '{"content":"⚠️ Subgraph health or chain/Scribe reconcile failed (block-lag or address drift). Check https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}"}' |