Transaction size threshold?

  1. Is there a transaction size threshold for a Daml transaction?
  2. If yes, who enforces it and how? The participant? The domain? Both (possibly in different ways)?
  3. If either can, can the relevant node(s) operator configure the threshold?
  4. What error would a Ledger API client receive if such threshold is exceeded? I had a look at the error code pages for both Canton and the Ledger API server and I couldn’t tell.

I tried to create a lot of contracts using Daml Script but the failure I receive is NOT_SEQUENCED_TIMEOUT, which is reasonable but doesn’t help me with regards to this question (I’m also not sure whether I can apply the suggested remediation of lowering the minimum ledger time is feasible using Daml Script).

I also tried to provide inputs to the transaction itself which are too large, and that fails with a RESOURCE_EXHAUSTED: gRPC message exceeds maximum size, which at least in part answers my question (for the very specific case of large transaction inputs). But my questions remain open.

  1. By default, the limit is the 4MB message size limit imposed by gRPC. You can raise that through configs. The next limit you reach is timings. You can also raise those through configs. Once you get to transaction sizes with tens of thousands of events, non-optimized code paths with quadratic complexity kick in and efficiency drops. We test and support transactions with up to 10000 ledger events only.

  2. All the size and transaction limits are domain parameters and enforced by the participants as part of the Canton protocol.

  3. The domain operator can configure the limits, yes. But as I said above, if you go too high, giant transactions don’t process efficiently.

  4. You’ve identified the errors. RESOURCE_EXHAUSTED or NOT_SEQUENCED_TIMEOUT are the likely errors to receive if you’ve exceeded the size limits or your transaction took too long to process.

3 Likes