Active Contract Set Service returns a Stream Arrays/List: how big can the arrays/List be per event in the stream?

Continuation of Java Bindings: ledgerClient.activeContractSetClient.getActiveContracts returns flowable but is it actually a stream? - #8 by Stephen

The ACS API returns a list of contracts in each event in the stream: Ledger API Reference β€” Daml SDK 2.2.0 documentation

But how big can each list be? What is the max number of contracts that will be returned per event?

Hi @StephenOTT,

Considering this sentence from the documentation you linked to:

The list of contracts that were introduced by the workflow with workflow_id

While the Ledger API does not guarantee this, in practice this means that each individual response message contains the number of CreatedEvents of a transaction, that were still active at the time of the request. So the maximum number of contracts in this list is the same as the number of contracts created in a transaction, that haven’t been archived yet.

Update: Keep in mind that the specific Ledger API implementation is also free to send one CreatedEvent per GetActiveContractsResponse. The comment above is about the upper bound of the list.

@gerolf thanks for that details. WorkflowID == transactionId ?

No, the workflowID can be used to associate multiple transactions to the same business workflow. This is a user/application provided field in the Commands message.

@gerolf so based on your previous two comments:

  1. If workflow id was used /provided then the api call returns the contracts associated with that id (across multiple transactions)

  2. If workflow id was not provided then the api returns contracts per transaction


In practice across recent releases of the Daml SDK, you will actually always get a single contract in each GetActiveContractsResponse.

@gerolf thanks!

1 Like