Bitcoin full node and query server

Nov 4, 2024

View in context in the libbitcoin Slack #general mirror.

evoskuil20:40
When a Libbitcoin node serves a block to a peer, it must reconstruct the block into its serialised representation, which will require some compute for each block request. Bitcoin Core, however, stores the blocks on disk in their serialised format and will simply read the block from disk and send it to the peer
This is true, however block responsiveness to peer is not a priority (and such thread priority can be lower than incoming information for example). Download by peers (catch up sync) is a function of concurrency and peer management, not individual node query response. However, given that all recently-accessed portions of the store are memory-resident, and in fact the entire store can be memory resident, this cost can be largely eliminated. On a $350 32GB machine libbitcoin can store and index 850,000 blocks in 50 minutes (network limited). This includes tx hashing (twice for witness txs) and Merkle root (twice for witness blocks) for the entire chain, without even having AVX512 or SHANI. When blocks are deserialized there is no hashing at all. So store query performance doesn't appear to be a material issue.