Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Get rid of the remaining singular queries #4933

Closed
DCNick3 opened this issue Aug 5, 2024 · 0 comments · Fixed by #5261
Closed

Get rid of the remaining singular queries #4933

DCNick3 opened this issue Aug 5, 2024 · 0 comments · Fixed by #5261
Assignees
Labels
api-changes Changes in the API for client libraries Enhancement New feature or request queries

Comments

@DCNick3
Copy link
Contributor

DCNick3 commented Aug 5, 2024

As suggested in #4833 (comment), we should be able to remove most singular queries, making the API a bit more uniform and strictly more expressive.

There are four groups of queries here:

1. Improved predicates

Queries that can be reasonably easily removed by improving predicates for some of the types. These are FindTriggerById, FindTransactionByHash, FindBlockHeaderByHash.

Note that FindTransactionByHash is used by iroha blockchain explorer, so implementing this may result in additional code churn there.

Tracked in #5017 & #5037 (done).

2. Relational predicates

FindAccountsWithAsset that can be removed by allowing access to related entities in predicates. This is required due to transition to more shallow objects in data model (#4792). This can probably be done by passing world snapshot as context into the predicate trait implementation. There might be a more performant way to do this I am not yet aware of.

3. Projections

Queries that can be removed with implementation of projections - a mechanism to get a more narrow view of the query result. It does not have its own issue yet.

Queries from this category include all the metadata queries (FindTriggerMetadata, FindDomainMetadata, FindAssetMetadata, FindAccountMetadata, FindAssetDefinitionMetadata) and FindAssetQuantityById. FindTotalAssetQuantityByAssetDefinitionId can also be implemented with the help of #4934 (done).

Tracked in #5063.

4. Data model query

Finally, there is FindExecutorDataModel which doesn't make sense to reformulate as a non-singular query. The plan is to make a separate endpoint to implement it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api-changes Changes in the API for client libraries Enhancement New feature or request queries
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants