Bitcoin full node and query server

Oct 24, 2024

View in context in the libbitcoin Slack #general mirror.

A
Antoine Poinsot19:36
I'm trying to understand the process of catching up to the latest tip implemented in Libbitcoin, from the description in this thread: https://x.com/evoskuil/status/1847736160317042874.
  1. From the current tip of the node, it will request headers from all its peers (which will likely be redundant), extending the best chain of headers.
  2. As soon as the best chain of headers is updated (extended or reorged), the node will query the block content. Block content queries are spread among all the node's peers.
  3. Upon reception, blocks are statically checked (block size, coinbase tx, etc..).
  4. The node then checks whether all transactions in the block are valid and if they are it adds them to a global index of valid transactions.
  5. ? I suppose you have a mechanism to mark blocks as fully validated in the header chain, to be able to trigger the final step of validation after all blocks before a certain point were fully validated ?
  6. Once all blocks in the best headers chain are checked (valid block + valid txs), you go through the chain to check there were no double spend.
Is that correct, as a general description? The large speedup compared to Core comes from the fact that steps 2. to 4. can be performed concurrently. Now i still need to more precisely document what indexes you keep to be able to perform this concurrently, but i wanted to make sure i had the big picture right already.