-
Notifications
You must be signed in to change notification settings - Fork 795
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
'delegators' and 'delegators_count' RPC commands run very slowly or not at all #1517
Comments
There's no inverse lookup table for delegators, so this currently entails looping through the account tables (v0 and v1) and, for each account, reading the rep block to figure out if the block's representative matches the account being queried. Faster lookups are possible, but it seems like it will be at cost of denormalization (a larger ledger) |
That was my hunch as well. It wouldn't be worth any ledger size increase just for this command. Looks like some stronger hardware is required on my side. Thanks @cryptocode 👍 |
Closing out due to optimization tradeoffs not worth it. |
For what it's worth, I'd take a larger ledger in order to speed up this call. It's a feature I like having in NanoCrawler, and the RPC call is painfully slow. |
Reopening for further discussion of tradeoffs |
This is perhaps something that would greatly benefit from a customizable database adapter. Could leave the current lmdb implementation as default with the slow delegators call, but allow other database systems (or maybe even a reconfigured lmdb) if desired. |
Alternatively I wonder if it is possible to have a config.json setting for enabling the denormalisation required to achieve the faster |
@kilkelly Indeed. Making this optional was an approach I was going to discuss with the team. Will get an update on this within the next week or so. |
It is taking a bit longer than anticipated to dig into this but will be considering for future release. |
Is the upcoming "sideband" functionality something that can be utilized for optional, configurable collection of delegator counts or is it just for block info? BTW I did manage to collect delegator counts for representative addresses I am tracking without using the |
@kilkelly what's the performance of that solution? |
It varies between 30 minutes to almost 3 hours sometimes. Feels kind of random but that's probably because of regular transaction activity the node is processing also. On a more powerful node it shouldn't take too long. I navigate through the ledger in chunks of 1000 frontiers at a time. |
@kilkelly I'm not able to reproduce it taking that long (on master) - 10 seconds at most. Do you have an exact RPC call example? |
Hi @cryptocode , it was a normal, vanilla |
Issue:
When running the
delegators
ordelegators_count
RPC commands on a node the response is either very slow or can even lock up / crash the node.Steps to reproduce the issue:
Run either the
delegators
ordelegators_count
via RPC on the node and wait for the results.Describe the results you received:
My node never returned results and became unresponsive to further RPC commands i.e. locked up.
Describe the results you expected:
Expected to see results as documented in the Nano wiki.
Environment:
Possible Solution:
Optimize how the
delegators
anddelegators_count
RPC commands interact with the ledger.The text was updated successfully, but these errors were encountered: