Skip to content

Commit af622fd

Browse files
committed
txWireSize: added overhead for HardFork txs
Added HFC overhead. This overestimates it, if the HFC is disabled.
1 parent 251b28f commit af622fd

File tree

1 file changed

+12
-3
lines changed
  • ouroboros-consensus/src/ouroboros-consensus/Ouroboros/Consensus/HardFork/Combinator

1 file changed

+12
-3
lines changed

ouroboros-consensus/src/ouroboros-consensus/Ouroboros/Consensus/HardFork/Combinator/Mempool.hs

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -274,10 +274,19 @@ instance CanHardFork xs => TxLimits (HardForkBlock xs) where
274274
type TxMeasure (HardForkBlock xs) = HardForkTxMeasure xs
275275

276276
txWireSize =
277-
hcollapse
277+
\tx ->
278+
let tx' :: NS GenTx xs
279+
tx' = getOneEraGenTx (getHardForkGenTx tx)
280+
-- HFC overhead
281+
-- note that HFC might be disabled, then this gives an upperbound.
282+
overhead | nsToIndex tx' <= 23 = 2
283+
| otherwise = 3
284+
285+
in
286+
(+ overhead)
287+
. hcollapse
278288
. hcmap proxySingle (K . txWireSize)
279-
. getOneEraGenTx
280-
. getHardForkGenTx
289+
$ tx'
281290

282291
blockCapacityTxMeasure
283292
HardForkLedgerConfig{..}

0 commit comments

Comments
 (0)