Bitcoin full node and query server

Nov 5, 2024

View in context in the libbitcoin Slack #general mirror.

evoskuil20:28
  1. Non-overlapping ranges of blocks (e.g., 1000 blocks at a time) are downloaded and and unordered checks are done in parallel across multiple ranges
  2. The first range can also start confirmability checks (genesis to block 999), after which transactions from this range are committed to the Transactions table and the ConfirmationIndex is updated
  3. Now that the first range has finished with it’s confirmability checks, the second range of blocks can start its confirmability checks, and so on
  1. The entire chain can be downloaded concurrently. Ranges are not necessary and can often make milestone runs slower. Using the configurable window improves data locality and prevents long-running gaps. But it's purely statistical.
  2. Validation checks can progress as soon as there are no download gaps in the candidate chain, and continue to the next gap. Once the validated chain is stronger than the confirmed chain (typically 1 block at a time during catch-up), confirmability checks are performed in block order (heavily concurrently within each block).
  3. The only delays for validation and confirmation are gaps and resource availability.
evoskuil19:24
I saw that earlier, and made some comments on it here. The first observation is that serving up blocks to peers is not a performance critical operation, either for the node or its peers. Secondly, BN reads, parses, and serializes the entire chain (and does everything else for a milestone run, which is a lot, including all the hashing - not required on read) in about 50 minutes, and would be closer to 40 minutes with sufficient RAM, on a network connection that produces a theoretical limit of 38 minutes to transfer the entire chain as a single file. Reading should therefore be much faster than the network can handle. Thirdly, there are a number of significant advantages in getting to completion with a compact block. There's no reason to assume that the means of verifying confirmability will have a greater cost than a utxo model, or that the other material advantages won't be dominant (for example, BN does not have to create or serialize a block).
(edited)