Opening for discussion / conceptual review.
We like the idea of a smaller maximum transaction size because:
- It lowers potential replacement cost (i.e. harder to do Rule 3 pinning via gigantic transaction)
- They are easier to bin-pack in block template production
- They equate to a tighter memory limit in data structures that are bounded by a number of transactions (e.g. orphanage and vExtraTxnForCompact). For example, the current memory bounds for orphanage is 100KvB * 100 = 40MB, and guaranteeing 1 tx per peer would require reserving a pretty large space.
History for MAX_STANDARD_TX_WEIGHT=100KvB
(copied from #29873 (comment)):
- 2010-09-13 In https://github.com/bitcoin/bitcoin/commit/3df62878c3cece15a8921fbbdee7859ee9368768 satoshi added a 100kB (MAX_BLOCK_SIZE_GEN/5 with MBS_GEN = MAX_BLOCK_SIZE/2) limit on new transactions in CreateTransaction()
- 2013-02-04 #2273 In gavin gave that constant a name, and made it apply to transaction relay as well
Lowering MAX_STANDARD_TX_WEIGHT
for all txns is not being proposed, as there are existing apps/protocols that rely on large transactions. However, it’s been brought up that we should consider this for TRUCs (which is especially designed to avoid Rule 3 pinning).
This reduction should be ok because using nVersion=3 isn’t standard yet, so this wouldn’t break somebody’s existing use case. If we find that this is too small, we can always increase it later. Decreasing would be much more difficult.
Expected size of a commitment transaction is within (900 + 172 * 483 + 224) / 4 = 21050vB EDIT: this is incorrect, but perhaps not something that should affect how we choose this number.