#7138OPEN Issue
Scan `getRewardAccountingBatch`: add safety `LIMIT`s to `getChildBatchHashes` and `getLeafAllowances`
stephencompall-DA05-09-2026Last activity 1d ago
/v0/reward-accounting/batch/{round_number}/{batch_hash} returns a batch's child hashes or leaf minting allowances:
lookupBatchByHash's helpers getChildBatchHashes and getLeafAllowances don't have a LIMIT:
https://github.com/canton-network/splice/blob/a4ea43aa55db83a028a30e95ace45e1350edde9a/apps/scan/src/main/scala/org/lfdecentralizedtrust/splice/scan/store/db/DbScanAppRewardsStore.scala#L567-L611
Client doesn't control these sizes but we should have a defensive limit for both.
getChildBatchHashesis limited by the batch size at time of writing; that may not equal the current batch size, so either the old batch size has to be retrieved, or we can use a "higher than a reasonable batch size" limitgetLeafAllowancescan useparty_seq_num_end_excl - party_seq_num_begin_inclas the limit
Use the HardLimit/sqlLimit pattern so that exceeding the limit logs a warning rather than silently truncating.
Introduced by #4994.