View in context in the libbitcoin Slack #general mirror.
bypass block.tx validations for pooled txs. Pooled txs are validated and archived, so there is no reason to do either again (except in the very rare case where the validation context has changed, which we manage by revalidating in the block's context).
First we added pooling to make wallets happy. Then we added block consumption of pooled txs to save space and prevent the unnecessary archival step. That's been running all week. But when we validate we still pull the whole block and prevouts, and validate the whole thing. That's very wasteful, since most of the txs have already been validated.
So now we are writing the validation context, along with fees, sigops, and all prevout parent tx links, to the validated_tx table for each tx. This now happens at every tx/package acceptance, in the new tx chaser. These values are all that is required to validate and confirm the tx for the block, without ever reading the tx. This part is done - table schema updated, queries updated, and unconfirmed txs validated and archived with this state as they arrive. That part's done.
Nest step is to identify the state record for each tx in a block for validation. This is optimized by the fact that we can determine from the header->txs->tx table association values alone, whether the tx was pooled or arrived with the block (unpooled). Pooled tx links will always be lower in value than the coinbase link in the association set. So we query up the metadata for pooled txs, validate the other txs, use the combined metadata to validate the block, and set the state of the block.
The prevout parent tx links are used, along with those of the queried/unpooled txs, to populate the prevout table cache, for optimization of block confirmation. The prevout table has been used for a couple years now, and is purged once the node is fully synced (current-coalesced state). Signature batching tables are also dropped in the purge. And now the tx metadata (validated_tx) table will be as well. This last one we'll probably retain much longer for miners in v5.