Bitcoin full node and query server

Apr 18, 2024

View in context in the libbitcoin Slack #general mirror.

evoskuil13:31
Writing confirmation state adds somewhat to this, though that would be more like 30 additional minutes.
Just did a full run with confirmation state written following evaluation and there was no material increase in cost, under 3 hours. So assuming that runs sequentially that would be a minimum full chain (no milestones or checkpoints) validation cost.
💯 1
6 replies · jungly, evoskuil · last Apr 18, 2024
jungly14:43
Is 3 hours bad? I don't think so, right?
evoskuil18:17
3 hours as a minimum for a full chain download, validation, and confirmation is excellent.
👏🏾 1
evoskuil18:18
The concurrent download can happen in half that time, and I'm hopeful that concurrent validation can beat 3 hours. But combining them will increase each unless maybe with full chain RAM.
evoskuil18:24
In any case, it's a very positive data point. The confirmation is extremely costly in theory. You must mark each output (or its tx) as confirmed, and must mark each spending input as confirmed (or its tx), ensure that when you spend you are only spending outputs that exist, and are confirmed in tx of a block height at/previous to the input tx, and must ensure that they are not previously spent by a confirmed block tx. Then there are coinbase maturity checks (spender must be > 100 blocks from coinfirmed cb height), and finally relative locktime checks (bip68), which require the height and mtp of spender and spent, as well as spender tx.sequence.
evoskuil18:25
Core does this by maintaining a redundant hash table of unspent outputs (the output object including script, indexed by tx hash). By adding and removing from this redundant data, these questions are more simply answered. But it introduces not only a large amount of redundant data, but a heavy ordering requirement.
evoskuil19:28
Our approach does not update any primary blockchain table data or maintain any redundant data. We just maintain a hash table of associations from tx to confirming block, one entry per tx. A negative entry in the same table reorgs out the confirmation. That's it. So getting those answers and updating the confirmation table that fast is pretty good.