Repository navigation
Conversation
samgbafa
pushed a commit
that referenced
this pull request
Nov 17, 2026
Bobbie on #625: the limit was spent before the replay check, so a leaked request replayed during its lifetime drained its invoker's share. The pre-DB check now only peeks; the request is charged after its outcome unless it was refused as a replay (InvokeError::Replayed, still 409).
samgbafa
pushed a commit
that referenced
this pull request
Nov 17, 2026
…er line; take-then-refund invoker share - fair_share.rs: invoker token taken at check, refunded on replay or an enforced account refusal (Bobbie #625 Low); per-account (account_hash) query-time bucket debited in the tracing fairing on every route; per-account in-flight cap; once-a-minute invoke_rate_limited / account_limited lines naming the top account pseudonym, and node_top_talkers (top 3 by DB time with share). - All shadow by default (account_limit_enforce, rate_limit_enforce). - routes/public.rs back to main.
Extend the public RateLimiter with a per-verified-invoker bucket family checked after signature admission and before any DB work. Defaults 600/min, burst 240 (about 2x the busiest account's 24h peaks). Shadow mode counts over-limit requests (tinycloud_invoke_rate_limited_total, one log line a minute); rate_limit_enforce answers 429 rate_limited with Retry-After. Both bucket families are bounded at 100k tracked callers.
Bobbie on #625: the limit was spent before the replay check, so a leaked request replayed during its lifetime drained its invoker's share. The pre-DB check now only peeks; the request is charged after its outcome unless it was refused as a replay (InvokeError::Replayed, still 409).
…er line; take-then-refund invoker share - fair_share.rs: invoker token taken at check, refunded on replay or an enforced account refusal (Bobbie #625 Low); per-account (account_hash) query-time bucket debited in the tracing fairing on every route; per-account in-flight cap; once-a-minute invoke_rate_limited / account_limited lines naming the top account pseudonym, and node_top_talkers (top 3 by DB time with share). - All shadow by default (account_limit_enforce, rate_limit_enforce). - routes/public.rs back to main.
…from 24 h of node_top_talkers/account_limited before any enforcement
samgbafa
force-pushed
the
feat/tc-3216-invoke-fair-share
branch
from
November 18, 2026 00:22
494af02 to
27d30e7
Compare
…point back-off, size probe, chain-guard wait and http_5xx; vendor canonical schema (TC-3006)
The sidecar ships invoke_rate_limited, account_limited and node_top_talkers (target tinycloud::fair_share) as node_warning events with exactly their keys, declared types, enum values and bounds; account fields only as 64-hex pseudonyms, absent ranks omitted. Any other line on that target stays an unclassified count. Uncapped like the headroom event: at most four a minute, worst case 79.4 MB per 30 days. Re-vendors fields.json from tinycloud-dev-sam #343 (57e4b569) and regenerates the N0 compose: template 15448ac0..., raw 99c68db3... test-ruling: TC-3216 (budget.test.mjs individual-code list, profile.test.mjs sink/route assertions)
…ified (TC-3216) Bobbie's #606 note 1: every negative case changed the key count, so a regression in the per-key checks would go unnoticed. Five cases rename one key with the count unchanged (invoker: top_account_count, mode; account: limit; top-talker: top3_share, db_ms). test-ruling: TC-3216
samgbafa
marked this pull request as ready for review
November 19, 2026 16:41
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add per-invoker and per-account fair-share reporting for /invoke. Both enforcement flags default to false: requests over these limits remain admitted and are counted only. Existing request behavior is unchanged by default.
Includes #606 event support; merge #606 first. No database migration. Before-enforcement work remains tracked in TC-3254.
Details: TC-3216