Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## [2.0.2] - 2026-07-14

### Changed

- **Per-IP rate limit on status/list endpoints**: increased to ~100 req/s with a burst of 200 (was burst 100, then ~1/s refill). Stops Explorer CI from 429ing while paging `/verified-programs`.

## [2.0.1] - 2026-07-13

### Fixed
Expand Down
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "verified_programs_api"
version = "2.0.1"
version = "2.0.2"
edition = "2021"

[dependencies]
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ curl https://verify.osec.io/resolve-hash/29e7713aa3c48e242e2847bc031fe2a03eb61aa
### Rate Limits

- **Verification endpoints**: 5 requests/second globally, 1 request per 30 seconds per IP
- **Status/query endpoints**: 10,000 requests/second globally, 100 requests/second per IP
- **Status/query endpoints**: 10,000 requests/second globally, ~100 requests/second per IP (burst 200)
- **Webhook endpoints** (`/pda`, `/unverify`): not rate limited; require a valid `AUTHORIZATION` header instead

### Security
Expand Down
11 changes: 6 additions & 5 deletions src/api/routes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,11 @@ pub fn initialize_router(state: AppState) -> Router {
.layer(RateLimitLayer::new(req_per_sec, Duration::from_secs(1)))
};

let rate_limit_per_ip = |timeout: u64, limit: u32| {
let rate_limit_per_ip = |period: Duration, burst: u32| {
let config = Arc::new(
GovernorConfigBuilder::default()
.per_second(timeout)
.burst_size(limit)
.period(period)
.burst_size(burst)
.use_headers()
.key_extractor(SmartIpKeyExtractor)
.finish()
Expand Down Expand Up @@ -122,7 +122,7 @@ pub fn initialize_router(state: AppState) -> Router {
.layer(
global_rate_limit(5)
.layer(CompressionLayer::new().zstd(true))
.layer(rate_limit_per_ip(30, 1))
.layer(rate_limit_per_ip(Duration::from_secs(30), 1))
.layer(cors(Method::POST)),
);

Expand All @@ -145,7 +145,8 @@ pub fn initialize_router(state: AppState) -> Router {
.layer(
global_rate_limit(10000)
.layer(CompressionLayer::new().zstd(true))
.layer(rate_limit_per_ip(1, 100))
// ~100 req/s per IP, burst 200 (was burst 100 then ~1/s refill).
.layer(rate_limit_per_ip(Duration::from_millis(10), 200))
.layer(cors(Method::GET)),
);

Expand Down
Loading