Check this Rust Library for Similar Purpose #18
Replies: 3 comments 6 replies
-
Hi @Congyuwang, Cool, thanks to share this project, with rust-bitcoin are born a lot of parsers, and with the primitive it is easy.
Here you are missing important details if you want to compare your parser with my bachelor thesis that it is the amount of RAM used in that parser phase. SpyCBlock is only a starting point to prove that you can decode the blockchain with less than 1 Gb of ram, this means that you can try to decode a couple of blocks also on a raspberry pi model 2 that is history now. if you have a remote machine where you make benchmarking of your project, I have a clean branch where I was working last year, but I never finish that I would like to test, in terms of speed and space of the result. Thanks again to share this project. |
Beta Was this translation helpful? Give feedback.
-
Hi @vincenzopalazzo, Thank you for your reply! Cool, decoding with less than 1GB RAM is quite impressive. I tried to reduce the amount of memory used. To just decode blocks per se seems to require not much RAM. With my current library, my crate will need about 2-3GB RAM, mainly to keep a copy of block index (map from block hash to block file number and offset) for each thread. I could reduce this a bit by giving each thread a read-only reference to this index. However, I find it difficult to reduce RAM when I need to find out the addresses of the inputs of transactions because I need to keep track of unspent transactions in memory. This in-memory UTXO cache takes 30GB RAM. |
Beta Was this translation helpful? Give feedback.
-
Yes. I guess doing a one-time conversion and storing useful information in JSON before further analysis is a good idea. Computing everything on the go is very resource intensive. |
Beta Was this translation helpful? Give feedback.
-
Rust Bitcoin Deserialization Library
https://github.com/Congyuwang/Rusty-Bitcoin-Explorer
Performance
Deserializing the whole chain takes 10 minutes (SSD, Core i7 4-core).
Deserializing the whole chain with outpoint connected to outputs takes 30 minutes (SSD, Core i7 4-core).
Beta Was this translation helpful? Give feedback.
All reactions