-
Notifications
You must be signed in to change notification settings - Fork 85
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
refactor: Optimize input and output storage #2672
Conversation
I'm not sure if I get the point. Seems that all It speeds searching up, but the storage is not optimized as mentioned at Magickbase/neuron-public-issues#77 (comment) If a transaction includes many cells, they are still all saved into the database. The disk usage is not ameliorated. |
Currently yes, I have not paid attention to the SQLite file's size, but only care about the search speed and SQL execution time. I want to use the data that has been got. You remind me that we also pay attention to the SQLite file's size. Actually, I have tried another way to finish it, create a table that only saves For smaller SQLite'file size, there exist two schemas:
So, for reduce SQLite's file size, I suggestion for first solution. What do you think? @Keith-CY |
Solution 2 has an alternative as mentioned at Magickbase/neuron-public-issues#77 (comment) But I think solution 1 is good for our case, and it can be removed easily if a better solution is found |
I'm worried about search one address that may belong to a miner. |
Indexer supports pagination so the count of transactions won't bother. But the pagination of indexer is cursor-style, while neuron uses offset-style it, it's a problem if we use indexer to list transactions. So I think solution 1 is good for our case now |
I will reopen the PR after I changed it to Solution 1 |
It's ready for review now. |
packages/neuron-wallet/src/block-sync-renderer/sync/indexer-cache-service.ts
Outdated
Show resolved
Hide resolved
packages/neuron-wallet/src/block-sync-renderer/sync/indexer-cache-service.ts
Outdated
Show resolved
Hide resolved
packages/neuron-wallet/src/block-sync-renderer/sync/indexer-cache-service.ts
Outdated
Show resolved
Hide resolved
packages/neuron-wallet/src/services/tx/transaction-persistor.ts
Outdated
Show resolved
Hide resolved
Please have a review @WhiteMinds @devchenyan @JeffreyMa597 |
please resolve the conflicts. |
3f9f1e9
to
3e9f263
Compare
Packaging for test is done in 5249523509 for commit 3e9f263 . |
@FrederLu Please test it with the package. |
packages/neuron-wallet/src/services/tx/transaction-persistor.ts
Outdated
Show resolved
Hide resolved
packages/neuron-wallet/src/services/tx/transaction-persistor.ts
Outdated
Show resolved
Hide resolved
3e9f263
to
cf25d37
Compare
Packaging for test is done in 5308946921 for commit cf25d37 . |
Packaging for test is done in 5308951833 for commit 5e11fdf . |
Please resolve the conflicts and squash merge @yanguoyu |
1. Storage others' cells tx and locks into tx-lock for search others' addresses. 2. Get transaction detail by rpc.
5e11fdf
to
8b41c58
Compare
Packaging for test is done in 5369493403 for commit 8b41c58 . |
To search others' addresses at the history page, I create a table
tx_lock
to savetx_hash
maplockHash
input
andoutput
, and save others' cell lockHash totx_lock
input
,output
andtx_lock
.indexer_tx_hash_cache