Skip to content

Commit

Permalink
chain: Add a comment about transaction sizes
Browse files Browse the repository at this point in the history
We don't need to check transaction sizes yet, because we aren't
parsing or generating transactions outside of blocks.

Part of ZcashFoundation#483.
  • Loading branch information
teor2345 committed Jun 24, 2020
1 parent 6771889 commit bf88680
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions zebra-chain/src/transaction/serialize.rs
Original file line number Diff line number Diff line change
Expand Up @@ -359,6 +359,17 @@ impl ZcashDeserialize for Output {

impl ZcashSerialize for Transaction {
fn zcash_serialize<W: io::Write>(&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,
Expand Down

0 comments on commit bf88680

Please sign in to comment.