Bitcoin full node and query server

Aug 11, 2021

View in context in the libbitcoin Slack #general mirror.

evoskuil19:40
Hi Phil, If you are looking at header sync, you are in v4. In v4 the process is as follows. First, the structure: The block table retains headers (a bit of a misnomer), the tx table retains txs. There is an association table that retains the associations between headers and their downloaded transactions. The purpose of the association is to allow headers (before obtaining txs) to be stored in an array-table, as the association to txs is fixed-width. There are two height indexes, one for the confirmed chain and one for a candidate chain. The confirmed index is authoritative for the strong branch. The candidate index is the next-strongest visible branch. There are arrays of pointers to block headers, allowing blocks to be queried by height in constant time. There is also a payments index. This provides constant time query from any output script to the transactions that contains it (outputs) and any that reference it (inputs). The indexes are redundant information. The entire chain is retained by the three headers->transactions tables. Headers can exist without associated transactions, and transactions can exist without associating headers. Transactions can be associated by any number of headers. All associations are complete (full block or none)...
evoskuil04:33
If the block is “populated” then all of its transactions are stored and linked from the header by the association table. A block header will first be stored without being populated, though any number of its transactions may be stored at any time.
(edited)