Skip to content

Commit ecfb43c

Browse files
committed
Conway: also enable mempool ref script size limit
1 parent a718db0 commit ecfb43c

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
### Non-Breaking
2+
3+
- Also enabled total ref script size limit in the mempool in Conway (it
4+
continues to be enabled in Babbage).

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

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -211,6 +211,11 @@ defaultApplyShelleyBasedTx globals ledgerEnv mempoolState _wti tx = do
211211
refScriptPredicate = case getBabbageTxDict (Proxy @era) of
212212
Nothing -> pure ()
213213
Just (BabbageTxDict mkError)
214+
-- The ledger rules of Conway (and later eras) already handle ref
215+
-- scripts appropriately, so we only need to perform the checks below
216+
-- for Babbage.
217+
| not $ isBeforeConway (Proxy @era)
218+
-> pure ()
214219
-- Reject it if it has more than 100 kibibytes of ref script.
215220
| refScriptsSize > totalRefScriptsSizeLimit
216221
-> throwError $ mkError
@@ -299,7 +304,12 @@ instance (Praos.PraosCrypto c) => ShelleyBasedEra (ConwayEra c) where
299304

300305
getConwayEraGovDict _ = Just ConwayEraGovDict
301306

302-
getBabbageTxDict _ = Nothing
307+
getBabbageTxDict _ = Just $ BabbageTxDict $ \a b ->
308+
SL.ApplyTxError
309+
$ pure
310+
$ Conway.ConwayUtxowFailure
311+
$ Conway.UtxoFailure
312+
$ Conway.MaxTxSizeUTxO a b
303313

304314
applyAlonzoBasedTx :: forall era.
305315
( ShelleyBasedEra era,

0 commit comments

Comments
 (0)