Skip to content
CCPEDIAby Unity Nodes
#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:

https://github.com/canton-network/splice/blob/fb686b3657cc8e7296df4dd0287dddaca00e7b7b/apps/scan/src/main/scala/org/lfdecentralizedtrust/splice/scan/store/db/DbScanAppRewardsStore.scala#L541-L546

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.

  • getChildBatchHashes is 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" limit
  • getLeafAllowances can use party_seq_num_end_excl - party_seq_num_begin_incl as the limit

Use the HardLimit/sqlLimit pattern so that exceeding the limit logs a warning rather than silently truncating.

Introduced by #4994.

← Back to Proposals