indexer#603
Open
Glam26 wants to merge 3 commits into
Open
Conversation
|
@Truphile is attempting to deploy a commit to the Jaja's projects Team on Vercel. A member of the Team first needs to authorize it. |
Contributor
|
@Glam26 Resolve the conflict |
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.
Here's the complete summary of what was delivered:
──────
Summary
✅ All Acceptance Criteria Met
78 tests passing across 7 suites (57 pre-existing + 21 new)
──────
What was built / fixed
🔒 Rate Limiting (rateLimit.ts)
• Already existed — sliding-window in-memory limiter, rateLimitRead (60
RPM/IP), rateLimitWrite (10 RPM/address), Retry-After header
• Added resetRateLimiter() for test isolation
🔑 Stellar Auth (stellarAuth.ts)
• Fixed malformed 400 JSON response (error string was a key, not a value)
• Fixed keypair.verifyHash() → keypair.verify() (correct stellar-sdk
API)
• Ed25519 sig verification, 30s timestamp tolerance, replay protection all
fully working
📊 Structured Logging (logger.ts, index.ts, stream.ts)
• All console.log/error in core files replaced with pino structured
logger
• Request logging: { requestId, method, path, statusCode, durationMs,
stellarAddress? }
• Slow query warn (>500ms), abuse pattern error (>5 429s from same IP in
60s)
• healthState updated by indexer lifecycle ( dbConnected , rpcConnected
)
• Fixed syntax error in stream.ts (orphaned closing brace)
🏥 Health Endpoint (index.ts)
• GET /health → { status, uptime, dbConnected, rpcConnected }
• Returns 200 ok or 503 degraded
✉️ DM Relay Endpoint
• POST /api/messages — requires requireStellarAuth + rateLimitWrite
🧪 Tests (middleware.test.ts)
21 tests covering all acceptance criteria:
• Burst 70 → exactly 61st returns 429 ✓
• Valid Stellar sig accepted ✓
• 60s-old timestamp → 403 ✓
• Invalid signature → 401 ✓
• Plus 17 additional boundary/edge cases
closes #569