Completed clean root directory structure: - Root now contains only: .git, .env, docs/, orig/ - Moved all remaining files and directories to orig/: - Config files (.claude, .dockerignore, .drone.yml, etc.) - All .env variants (except active .env) - Git config (.gitconfig, .github, .gitignore, etc.) - Tool configs (.golangci.yml, .revive.toml, etc.) - Documentation (*.md files, @prompts) - Build files (Dockerfiles, Makefile, go.mod, go.sum) - Docker compose files - All source directories (scripts, tests, tools, etc.) - Runtime directories (logs, monitoring, reports) - Dependency files (node_modules, lib, cache) - Special files (--delete) - Removed empty runtime directories (bin/, data/) V2 structure is now clean: - docs/planning/ - V2 planning documents - orig/ - Complete V1 codebase preserved - .env - Active environment config (not in git) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
1.2 KiB
1.2 KiB
You are an expert in rate limiting and resource management for distributed systems. I'm building an MEV bot that needs to efficiently manage requests to multiple RPC endpoints with different rate limits.
I need help with:
- Implementing adaptive rate limiting that adjusts to endpoint capacity
- Creating a rate limiter manager for multiple endpoints
- Handling rate limit errors gracefully with fallback strategies
- Implementing retry mechanisms with exponential backoff
- Monitoring and adjusting rate limits based on observed performance
- Balancing load across multiple endpoints
- Handling different rate limit types (RPS, concurrent requests, etc.)
- Implementing circuit breakers for failed endpoints
Please provide production-ready Go code that:
- Implements efficient rate limiting for multiple endpoints
- Handles errors gracefully
- Follows Go best practices
- Includes comprehensive comments explaining the rate limiting strategies
- Provides metrics for monitoring rate limit usage
The code should:
- Respect rate limits for all endpoints
- Automatically adjust to endpoint capacity
- Handle rate limit errors gracefully
- Provide clear metrics for monitoring
- Include benchmarks for critical functions