Skip to content

Commit

Permalink
Shelley mempool per-tx size check: do not include perTxOverhead
Browse files Browse the repository at this point in the history
See the PR description for details
  • Loading branch information
amesgen committed Jan 7, 2025
1 parent a020b7b commit 992a855
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
### Patch

- Fixed a bug where a valid tx with less than `4` bytes less than the max tx
size would be incorrectly rejected by the mempool.
Original file line number Diff line number Diff line change
Expand Up @@ -328,9 +328,9 @@ txInBlockSize ::
txInBlockSize st (ShelleyTx _txid tx') =
validateMaybe (maxTxSizeUTxO txsz limit) $ do
guard $ txsz <= limit
Just $ IgnoringOverflow $ ByteSize32 $ fromIntegral txsz
Just $ IgnoringOverflow $ ByteSize32 $ fromIntegral txsz + perTxOverhead
where
txsz = perTxOverhead + (tx' ^. sizeTxF)
txsz = tx' ^. sizeTxF

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

0 comments on commit 992a855

Please sign in to comment.