EventQueryService caching refresh rate
- Judy_WuOP
In canton ledger api, EventQueryService served both
GetEventsByContractIdRequestandGetEventsByContractKeyRequest.We are wondering if this endpoint can reliably reflect ledger’s state.
Below are the questions we had in mind
- Is this service caching the ledger state?
- If 1 is true, what is the gap in time with the actual ledger state and the cache state?
- is it possible to config the refresh rate of the cache with actual ledger state?
Thanks so much in advance~
- simon 1
The
GetEventsByContractIdRequestprocessing is not cached.The
GetEventsByContractKeyRequestprocessing 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). - Judy_Wu
Got it, thanks so much @simon!