Rate-limit expensive RPCs to prevent resource exhaustion
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 35/100
- Issue type
- Feature
- Clarity
- Needs clarification
- Activity status
- Active
- Tech stack
- rust
- Domain
- api, backend-api-design, security
Research direction
Start by tracing the named RPC entry points: KMS key issuance/SignCert, Gateway RegisterCvm, and Verify. Define how anonymous, authenticated, shared-resource, and replica-spread requests should be limited, then validate floods and expensive invalid requests against early rejection, service preservation, retry guidance, bounded state, and exposed counters.
Written by the indexing model from the issue text.
Description
Problem
Repeated calls to expensive RPCs—such as KMS key issuance / SignCert, Gateway RegisterCvm, and Verify—can exhaust CPU, disk, subprocess, or external-service resources and degrade service for other users.
Abuse can come from unauthenticated callers, invalid requests that are expensive to reject, or authenticated clients making otherwise valid requests. Authentication and concurrency limits alone do not bound sustained resource consumption.
Proposed direction
Introduce low-overhead, server-side rate limiting for expensive RPC paths:
- Configurable token buckets with sustained-rate and burst limits.
- A coarse limit before expensive authentication, attestation verification, or request processing.
- Additional per-client limits using verified instance/app identity where available. For anonymous callers, define an appropriate source-based policy; never trust arbitrary identity headers.
- Shared service/resource budgets to contain aggregate load, including requests spread across identities or endpoints.
- Reject excess requests early with a distinguishable rate-limit error and retry guidance.
- Bound limiter state and cleanup cost. Start process-local and document how limits behave across replicas.
Limits should accommodate normal boot, registration refresh, and certificate renewal bursts.
Validation
Test floods from anonymous callers, expensive invalid requests, and authenticated clients. Verify that limits bound accepted request rates, reject excess work early, and preserve service for unrelated clients. Expose rate-limit counters for tuning.
Related: #1258, #1259. Separate from concurrency/admission control in #1096.
- Dominant language
- Rust
- Stars
- 546
- Forks
- 96
- Avg merge
- 19h 22m
- Merged PRs (30d)
- 109
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from Dstack-TEE/dstack
-
Difficulty 5/5 Over a week Newbie friendliness 30/100
Dstack-TEE/dstack#1301 ·
-
Difficulty 3/5 1-2 days Newbie friendliness 55/100
Dstack-TEE/dstack#1300 ·
-
Difficulty 4/5 3-5 days Newbie friendliness 48/100
Dstack-TEE/dstack#1299 ·
-
Difficulty 4/5 3-5 days Newbie friendliness 48/100
Dstack-TEE/dstack#1298 ·
-
Difficulty 5/5 Over a week Newbie friendliness 25/100
Dstack-TEE/dstack#1297 ·
All issues in Dstack-TEE/dstack
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
kwakseongjae/auto-hwp#319 ·
-
area:cli bug filter-quality good first issue priority:medium
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
-
Difficulty 1/5 Under an hour Newbie friendliness 72/100
bevyengine/bevy#25861 ·
-
comp-datalake
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
ClickHouse/ClickHouse#121222 ·
-
enhancement remote
Difficulty 2/5 1-3 hours Newbie friendliness 68/100