Skip to content

Commit 992a855

Browse files
committed
Shelley mempool per-tx size check: do not include perTxOverhead
See the PR description for details
1 parent a020b7b commit 992a855

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
### Patch
2+
3+
- Fixed a bug where a valid tx with less than `4` bytes less than the max tx
4+
size would be incorrectly rejected by the mempool.

ouroboros-consensus-cardano/src/shelley/Ouroboros/Consensus/Shelley/Ledger/Mempool.hs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -328,9 +328,9 @@ txInBlockSize ::
328328
txInBlockSize st (ShelleyTx _txid tx') =
329329
validateMaybe (maxTxSizeUTxO txsz limit) $ do
330330
guard $ txsz <= limit
331-
Just $ IgnoringOverflow $ ByteSize32 $ fromIntegral txsz
331+
Just $ IgnoringOverflow $ ByteSize32 $ fromIntegral txsz + perTxOverhead
332332
where
333-
txsz = perTxOverhead + (tx' ^. sizeTxF)
333+
txsz = tx' ^. sizeTxF
334334

335335
pparams = getPParams $ tickedShelleyLedgerState st
336336
limit = fromIntegral (pparams ^. L.ppMaxTxSizeL) :: Integer

0 commit comments

Comments
 (0)