* Initial plan
* Fix onLimitReached deprecation in rate-limit middleware
- Replace deprecated onLimitReached callback with inline logging in handler
- Update tests to verify logging happens in the rate limit handler
- Remove onLimitReached from exports as it's no longer a separate function
Co-authored-by: onnwee <211922112+onnwee@users.noreply.github.com>
* Fix fromBlock: 0 in event queries for better performance
- Replace fromBlock: 0 with smart default (last 1M blocks)
- Add REGISTRY_START_BLOCK env var for configurable starting block
- Update make-proof.ts, verification-jobs.routes.ts, and verification-queue.service.ts
- Document new env variable in .env.example
Co-authored-by: onnwee <211922112+onnwee@users.noreply.github.com>
* Remove hardcoded testnet RPC fallback for production safety
- Replace testnet fallbacks with proper error handling when RPC_URL is not configured
- Update registry.service.ts, blockchain.service.ts to throw errors if RPC_URL missing
- Update CLI scripts (verify.ts, register.ts, make-proof.ts) to fail fast without RPC_URL
- Update API routes to return 503 error when RPC_URL is not configured
- Update .env.example to emphasize RPC_URL is required
Co-authored-by: onnwee <211922112+onnwee@users.noreply.github.com>
* Add documentation for dual Prisma generators and pin Redis version
- Add comprehensive comments in schema.prisma explaining dual generator setup
- Document why both generators are needed (API vs Next.js web app)
- Pin Redis version to 7.2-alpine in all docker-compose files for reproducibility
- Update docker-compose.yml, docker-compose.production.yml, and docker-compose.staging.yml
Co-authored-by: onnwee <211922112+onnwee@users.noreply.github.com>
* Address code review feedback - add validation for REGISTRY_START_BLOCK
- Add proper validation for parseInt to handle NaN cases
- Ensure REGISTRY_START_BLOCK is validated before use
- Add comment explaining intentional empty catch block
- Prevents invalid block numbers from breaking event queries
Co-authored-by: onnwee <211922112+onnwee@users.noreply.github.com>
* Refactor block range validation into shared utility function
- Create block-range.util.ts with getStartBlock helper
- Extract duplicated validation logic from make-proof.ts, verification-jobs.routes.ts, and verification-queue.service.ts
- Improves code maintainability and ensures consistent validation
- Add comprehensive JSDoc documentation
Co-authored-by: onnwee <211922112+onnwee@users.noreply.github.com>
* Add comprehensive test coverage for block-range utility
- Create test/utils/block-range.util.test.ts following existing test patterns
- Test valid REGISTRY_START_BLOCK values (positive, zero, large numbers)
- Test invalid inputs (NaN, negative, empty string, whitespace)
- Test default fallback behavior (current block - 1M)
- Test edge cases (low block numbers, decimals, provider errors)
- 15 test cases covering all code paths and validation logic
Co-authored-by: PatrickFanella <61631520+PatrickFanella@users.noreply.github.com>
---------
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: onnwee <211922112+onnwee@users.noreply.github.com>
Co-authored-by: PatrickFanella <61631520+PatrickFanella@users.noreply.github.com>