From bf88680deef8c33cbe4a52ef588bdb383fcb8299 Mon Sep 17 00:00:00 2001 From: teor Date: Tue, 16 Jun 2020 21:54:41 +1000 Subject: [PATCH] chain: Add a comment about transaction sizes We don't need to check transaction sizes yet, because we aren't parsing or generating transactions outside of blocks. Part of #483. --- zebra-chain/src/transaction/serialize.rs | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/zebra-chain/src/transaction/serialize.rs b/zebra-chain/src/transaction/serialize.rs index 7e40b6fa346..88d991e4d79 100644 --- a/zebra-chain/src/transaction/serialize.rs +++ b/zebra-chain/src/transaction/serialize.rs @@ -359,6 +359,17 @@ impl ZcashDeserialize for Output { impl ZcashSerialize for Transaction { fn zcash_serialize(&self, mut writer: W) -> Result<(), io::Error> { + // Post-Sapling, transaction size is limited to MAX_BLOCK_BYTES. + // (Strictly, the maximum transaction size is about 1.5 kB less, + // because blocks also include a block header.) + // + // Currently, all transaction structs are parsed as part of a + // block. So we don't need to check transaction size here, until + // we start parsing mempool transactions, or generating our own + // transactions (see #483). + // + // Since we checkpoint on Sapling activation, we won't ever need + // to check the smaller pre-Sapling transaction size limit. match self { Transaction::V1 { inputs,