Skip to content

feat: health checks, graceful shutdown, rate limit, admin guard#200

Merged
Chucks1093 merged 4 commits into
accesslayerorg:mainfrom
buinntalen:fix/health-check-graceful-shutdown-rate-limit-admin-guard
Apr 26, 2026
Merged

feat: health checks, graceful shutdown, rate limit, admin guard#200
Chucks1093 merged 4 commits into
accesslayerorg:mainfrom
buinntalen:fix/health-check-graceful-shutdown-rate-limit-admin-guard

Conversation

@buinntalen
Copy link
Copy Markdown
Contributor

Summary

Add chain-sync lag metrics to health checks, graceful shutdown handling for in-flight requests, unified 429 rate-limit error responses, and admin-guarded index replay endpoint.

Testing

  • pnpm lint
  • pnpm build
  • pnpm exec prisma generate when schema or generated types changed

Checklist

  • Linked issue or backlog item
  • No secrets or live credentials added
  • Docs updated if setup or env changed
  • Change is scoped to one problem

Closes #141
Closes #139
Closes #158
Closes #150

Include latest indexed ledger, observed head ledger, and computed sync lag
in the detailed health endpoint response. Mark syncing status as degraded
when lag exceeds threshold.

Refs accesslayerorg#141
Implement shutdown signal handling for SIGINT and SIGTERM. Stop accepting
new requests during drain window and complete in-flight requests within
timeout. Returns 503 during drain period.

Refs accesslayerorg#139
Create standardized rate-limit error response with consistent shape and
retry-after metadata. Apply helper across rate-limited routes including
the global rate limit middleware.

Refs accesslayerorg#158
Add admin authorization middleware and indexer replay endpoint. Protect
replay operation with x-admin-id header validation. Return consistent 403
forbidden response for unauthorized requests. Include audit logging and tests.

Refs accesslayerorg#150
@Chucks1093 Chucks1093 merged commit 9197a9a into accesslayerorg:main Apr 26, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

3 participants