fix(validateSlab): validate BLOCKED_MARKET_ADDRESSES entries as base58 pubkeys#172
Conversation
…8 pubkeys Entries from the BLOCKED_MARKET_ADDRESSES env var were split and trimmed but never validated as base58 Solana pubkeys. A typo or truncated value would silently never match any slab, effectively defeating the runtime blocklist without any warning to ops. Add a PublicKey parse check at startup that mirrors the pattern applied to ip-blocklist.ts in PR dcccrypto#142: invalid entries are dropped and logged at warn level so operators notice immediately. 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 26 minutes and 7 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 (2)
✨ 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
BLOCKED_MARKET_ADDRESSESenv var were split and trimmed but never validated as base58 Solana pubkeys. A typo or truncated value would silently never match any slab, defeating the runtime blocklist without any warning.PublicKeyparse check at module load that mirrors the pattern applied toip-blocklist.tsin PR fix(ip-blocklist): normalize and validate exact-IP entries #142: invalid entries are dropped and logged atwarnlevel so operators notice immediately.Test plan
BLOCKED_MARKET_ADDRESSESto a mix of valid + invalid entries, re-imports the module, asserts valid entries block and invalid entries are droppednpx vitest run tests/middleware/validateSlab.test.ts— 15/15 passingtests/routes/prices.test.tsissue onmain, unrelated)npx tsc --noEmit— clean