feat: health checks, graceful shutdown, rate limit, admin guard#200
Merged
Chucks1093 merged 4 commits intoApr 26, 2026
Conversation
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
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 lintpnpm buildpnpm exec prisma generatewhen schema or generated types changedChecklist
Closes #141
Closes #139
Closes #158
Closes #150