fix: HTTP hardening, port validation, remove dead code (L3+L4+L5+L6)#98
fix: HTTP hardening, port validation, remove dead code (L3+L4+L5+L6)#980x-SquidSol wants to merge 1 commit intodcccrypto:mainfrom
Conversation
L3: Add request/header/keepalive timeouts and maxConnections to the
health HTTP server to prevent slowloris-style resource exhaustion.
L4: Validate KEEPER_HEALTH_PORT as integer 1-65535. Previously
Number("abc")=NaN or Number("")=0 caused silent misconfiguration.
L5: Delete src/config/mainnet-markets.ts — exported MAINNET_HYPERP_MINTS
and MainnetHyperpAsset were never imported anywhere in the codebase.
L6: Remove failureCount from MarketCrankState — it was functionally
identical to consecutiveFailures (both increment on failure, both
reset on success). Replace with consecutiveFailures in getStatus().
Also remove dead lastSuccessfulCrankTime/lastOracleUpdateTime vars
and the unused checkCrankHealth interval (health endpoint computes
these values fresh from the markets Map).
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
Warning Rate limit exceeded
Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 20 minutes and 34 seconds. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (5)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Summary
Four low-severity cleanups for mainnet hardening:
L3 — HTTP server hardening:
requestTimeout(10s),headersTimeout(5s),keepAliveTimeout(5s),maxConnections(50)L4 — Port validation:
Number("abc")= NaN,Number("")= 0 caused silent misconfigurationL5 — Dead code removal:
src/config/mainnet-markets.ts—MAINNET_HYPERP_MINTSandMainnetHyperpAssetwere never importedL6 — Redundant counter removal:
failureCountfromMarketCrankState— functionally identical toconsecutiveFailuresconsecutiveFailuresingetStatus()lastSuccessfulCrankTime,lastOracleUpdateTime, and unusedcheckCrankHealthintervalTest plan
🤖 Generated with Claude Code