Add independent MIT account-rate500 policy source supplement

This commit is contained in:
2026-11-06 16:16:55 +00:00
parent ac40dd3a6c
commit c4f43cca5c
11 changed files with 950 additions and 0 deletions
@@ -0,0 +1,11 @@
DEFAULT_KIB_PER_SECOND = 500
MAX_KIB_PER_SECOND = 10240
MAX_BYTES_PER_SECOND = MAX_KIB_PER_SECOND * 1024
# Keep the DB credit bound aligned with the allocator's existing 200 ms burst.
MAX_BUCKET_MICROBYTES = MAX_BYTES_PER_SECOND * 200 * 1000
def _limit_in_bytes(value):
if type(value) is not int or not 1 <= value <= MAX_KIB_PER_SECOND:
raise ValueError(f"Account proxy speed request must be an integer in 1–{MAX_KIB_PER_SECOND} KiB/s.")
return value * 1024