EventQueryService caching refresh rate

In canton ledger api, EventQueryService served both GetEventsByContractIdRequest and GetEventsByContractKeyRequest.

We are wondering if this endpoint can reliably reflect ledger’s state.

Below are the questions we had in mind

  1. Is this service caching the ledger state?
  2. If 1 is true, what is the gap in time with the actual ledger state and the cache state?
  3. is it possible to config the refresh rate of the cache with actual ledger state?

Thanks so much in advance~

The GetEventsByContractIdRequest processing is not cached.

The GetEventsByContractKeyRequest processing may return a cached result for a short time such that the created event is populated but the archive event is not. This can only happen for a short interval between the time when the contract is archived and the processed transaction being observed by the event cache (this will usually be almost immediate).

1 Like

Got it, thanks so much @simon!