-
Notifications
You must be signed in to change notification settings - Fork 54
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
Hanging for transactionCollector#collect to finish all the yields #3
Comments
This shall be resolved in #15 |
Thanks @xxuejie I had a quick look at the PR. I guess the major change is to make the fetching function of the transaction hashes to be a iterator, which is good for optimizing the performance of the init time of Not sure if I got it right. Although this change can improve the init time of that function, for my example described above I estimate that it would still take at least 2 hours to finish the load of all the transactions. |
You got it right, and yes to fetch all of the transactions, it will take a long time. But my question is: in what scenario will we need to use all 1.6 million transactions at a time? I would personally assume the main use case here, is to display relevant transactions for a lock script, which you will naturally do paging to only show a small part of them first. The iterator is designed for this pattern. |
It is because we need to cache all the transactions in our current database sqlite, so we can do flexible queries for the application needs, such as querying for the dead cells. If fetching all the transactions for some big wallets takes more than 2 hours, then it is much longer than the time indexer takes to index all the CKB blocks. The other reason is for the convenience of paginating if these data are cached in databases like sqlite. Suppose there are 100 pages of transactions, it is straightforward to get any one of the pages with one SQL query without the need of loading all data and filtering. I am not sure how to do the page jump with this generator function. |
I think we need to talk about your specific use cases. It is really anti-pattern when you have to do indexing on your own when you are using lumos-indexer. Having a second indexing like SQLite is not something we would recommend here. You mentioned querying for dead cells, do you mind elaborate more what is exactly needed here? Page jumps shouldn't be hard to support, for arbitrary jumps, lumos-indexer can provide another query parameter such as
Of course it is possible to always create new iterator, but the fundamental data structures used in lumos-indexer(and I believe SQLite is also the case), are optimized for sequential read, so doing pattern 1 when you can, will result in better performance. |
It will be very useful if it supports a
Sure, let me try to introduce some of the existing use cases here:
|
|
Then this would mean it needs to fetch all the transactions with the generator, which would lead to the potential performance issue we discussed above. |
I don't see why you need to fetch all the transactions. If your page can show 10 entries, you can just fetch 10 transactions. Maybe you need to also fetch the transactions for each input cell in those 10 transactions, but that will be it. A second page would need 10 more transactions, but that is also another page. You won't need all to show the initial results. |
In the context of the DAO page, it needs to have the knowledge of the full transaction history so as to know which transactions have been done for the deposits/withdraw/unlock and display them in the application. I am not sure how the pagination could help in this case. |
I assume you mean which
Now the question is converted to if there will be a way to tell an OutPoint represents a live cell, this will be a real simple operation we can support in the indexer. If I didn't miss anything, this workflow solves our problem here. |
Yes, the check will mainly on the cells. I am just thinking about a scenario in which the state transactions of the cell is as below:
Assume cell at 5 is a live cell, how can we know its history of DAO operations? |
First question: how is this a history of DAO operations? |
If I got it right, this would mean it is not practical to check all the live cells for the DAO related operations. |
Hmm I don't get what this means. |
Also I've checked the current NervosDAO UI, I think our conflict now is how to track all completed Nervos DAO operations under current account. My gut feeling now, is that this might also be a task of the cell notifier module. We can think about how best to handle it in lumos, but I don't feel this is a task of lumos-indexer here right now. |
Upon further thinking, I think #16 would provide the solution for the problem here. To gather all completed Nervos DAO operations, one just need to query for all transactions with |
Hello @xxuejie Could you please give an estimation on when it will support |
I am having a test to query all the transactions with the lock args
0xdde7801c073dfb3464c7b1f05b806bb2bbb84e99
using thetransactionCollector.collect()
generator, but it seems to have to take a very long time to finish the query. I started the process 10+ mins ago, and still not finish yet.Meanwhile, I noticed the CKB node seems to be busy handling the requests initiated from lumos as it is utilizing 100% for one core of the CPU.
Any ideas on what is happening behind the scene?
Code: https://github.com/katat/lumos-performance-test/blob/2afa9f043e37865f97c3e042933076b1d707aae1/index.js#L41
The text was updated successfully, but these errors were encountered: