-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
Optimize GraphQL "balances" query #1965
Comments
Perhaps we should consider feature gating more complex queries so that node operators can choose to support them or not. This would allow node operators to opt for running a more lightweight node if they don't need to support these queries, and app developers can connect to nodes supporting the complex queries if they need them. |
Oh I noticed we have an issue for this already #1569 |
The "coins to spend" issue was extracted into: #2391 |
The "dry run" issue was extracted into: #2392 |
The source of this issue is #623.
Initially, the idea was to remove all complex queries from
fuel-core
and make it part of the indexer's responsibility. But the SDK is deeply integrated with these basic queries, that we need to support them onfuel-core
. For that, we need to optimize the following queries by aggregating some information in the off-chain worker or adding new indexes to the database:balance
andbalances
queries iterate over all entries of coins and messages in the storage. The off-chain worker should index the balance of each account and aggregate this information in a user-friendly form.Thecoins_to_spend
query is very complex and requiresn^2
operations wheren
is the number of coins and messages. The algorithm itself can use additional indexes from RocksDB to solve the issue with dust coins and works fast.Thedry_run
already allows the dry running of many transactions; we just need to forbid several dry run sub-queries inside of one query.The text was updated successfully, but these errors were encountered: