Merge bitcoin/bitcoin#13875: [doc] nChainTx needs to become a 64-bit earlier due to SegWit
pull/826/headef72e9bd41
doc: nChainTx needs to become a 64-bit earlier due to SegWit (Sjors Provoost) Pull request description: As of block 597,379 txcount is 460,596,047 (see `chainparams.cpp`), while `uint32` can handle up to 4,294,967,296. Pre segwit the [minimum transaction size](https://en.bitcoin.it/wiki/Maximum_transaction_rate) was 166 bytes, so the worst case number of transactions per block was ~6000. As the original source comment for `unsigned int nChainTx` says, that should last until the year 2030. With SegWit the smallest possible transaction is 60 bytes (potentially increased to 65 with a future soft fork, see #15482), without a witness: ``` 4 bytes version 1 byte input count 36 bytes outpoint 1 byte scriptSigLen (0x00) 0 bytes scriptSig 4 bytes sequence 1 byte output count 8 bytes value 1 byte scriptPubKeyLen 1 byte scriptPubKey (OP_TRUE) 4 bytes locktime ``` That puts the maximum number of transactions per block at 16,666 so we might have to deal with this as early as a block 827,450 in early 2024. Given that it's a memory-only thing and we want to allow users many years to upgrade, I would suggest fixing this in v0.20 and back-porting it. ACKs for top commit: practicalswift: re-ACKef72e9bd41
jarolrod: ACKef72e9bd41
theStack: ACKef72e9bd41
Tree-SHA512: d8509ba7641796cd82af156354ff3a12ff7ec0f7b11215edff6696e95f8ca0e3596f719f3492ac3acb4b0884ac4e5bddc76f107b656bc2ed95a8ef1b2b5d4f71
commit
c8e68b418f
Loading…
Reference in new issue