Use database instead of direct ACS for beginning of WS query, when enabled #6312
Labels
component/json-api
HTTP JSON API
discussion
Things to be discussed and decided
team/ledger-clients
Related to the Ledger Clients team's components.
Milestone
When Postgres is enabled, for standard HTTP query we:
contractsFromOffsetIo
) by eithera. filling with (ACS ++ txStream-to-ledger-end)
acsFollowingAndBoundary
if no offset exists in database, orb. filling with txStream-to-ledger-end
transactionsFollowingBoundary
if offset exists;We ensure that the tx stream terminates by reading only to ledger end.
For WS query, we currently ignore whether Postgres is configured, and always use
acsFollowingAndBoundary
, which conveniently lets us stream from ledger API, through JSON API, to the user, with no intermediate reification.We could do something similar for WS query:
The client gets a uniform stream of (ACS-from-DB ++ (begin live data) ++ tx-from-ledger-API); there are no semantic changes from its perspective. This issue is merely a performance change.
Several potential variations arise with different implications. For example,
These alter one informal invariant: in any given HTTP or WS request, we use either the in-memory contract query interpreter or the SQL predicate contract query interpreter, never both. This would use the latter for the ACS and the former for the transaction stream to follow.
Also to be considered: whether this is worth doing.
The text was updated successfully, but these errors were encountered: