You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
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).
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.
The text was updated successfully, but these errors were encountered:
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
) andFindAssetQuantityById
.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.The text was updated successfully, but these errors were encountered: