You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/services/storage.md
+25-6Lines changed: 25 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -315,9 +315,28 @@ Cleanup behavior is controlled by the configuration section. See the [Configurat
315
315
316
316
See the [Configuration Guide](../configuration.md), Section `Optional: token.tms.<name>.services.network.fabric.recovery`, for detailed parameter descriptions and tuning recommendations.
317
317
318
-
## Transaction Store API Bounds
319
-
320
-
The transaction store enforces upper bounds on its write and read paths (maximum
321
-
serialised write payload, mandatory bounded pagination on transaction queries,
322
-
and a hard cap on token-request queries) so a single oversized write or unbounded
323
-
scan cannot monopolise database resources. See [**Transaction Store API Bounds**](storage/api-bounds.md).
318
+
## Transaction Store API Limits
319
+
320
+
The transaction store (used by both **TTXDB** and **AuditDB**) limits its writes and
321
+
reads so one huge write or one runaway query can't eat up the database. The checks
322
+
live in the single SQL implementation
323
+
(`token/services/storage/db/sql/common/transactions.go`), so the owner and auditor
324
+
stores are both covered.
325
+
326
+
**Write size limit.** `AddTokenRequest`, `AddTransaction`, and `AddMovement` reject a
327
+
call whose payload is larger than `maxPayloadSize` (default 4 MiB; `0` turns the check
328
+
off). `AddTokenRequest` measures the raw token request plus its metadata;
329
+
transaction and movement records add up their field lengths instead, to keep the
330
+
write path fast.
331
+
332
+
**Read size limits.** `QueryTransactions` needs a bounded page argument (`nil` and
333
+
`pagination.None()`are rejected; callers page through the full result set).
334
+
`QueryTokenRequests`adds a hard `LIMIT` equal to `maxPageSize` (default 1000).
335
+
`QueryMovements` is left uncapped on purpose: it feeds balance totals, and dropping
336
+
rows there would quietly return wrong balances. It is already narrowed by its required
337
+
filters.
338
+
339
+
Both limits have built-in defaults. You can override them in configuration
340
+
(`token.storage.maxPayloadSize` / `maxPageSize`) or in code with the
341
+
`WithMaxPayloadSize`/ `WithMaxPageSize` store options. See the
342
+
[Configuration Guide](../configuration.md) for the config keys.
0 commit comments