Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
### Non-Breaking

- Also enabled total ref script size limit in the mempool in Conway (it
continues to be enabled in Babbage).
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,11 @@ defaultApplyShelleyBasedTx globals ledgerEnv mempoolState _wti tx = do
refScriptPredicate = case getBabbageTxDict (Proxy @era) of
Nothing -> pure ()
Just (BabbageTxDict mkError)
-- The ledger rules of Conway (and later eras) already handle ref
-- scripts appropriately, so we only need to perform the checks below
-- for Babbage.
| not $ isBeforeConway (Proxy @era)
-> pure ()
-- Reject it if it has more than 100 kibibytes of ref script.
| refScriptsSize > totalRefScriptsSizeLimit
-> throwError $ mkError
Expand Down Expand Up @@ -299,7 +304,12 @@ instance (Praos.PraosCrypto c) => ShelleyBasedEra (ConwayEra c) where

getConwayEraGovDict _ = Just ConwayEraGovDict

getBabbageTxDict _ = Nothing
getBabbageTxDict _ = Just $ BabbageTxDict $ \a b ->
SL.ApplyTxError
$ pure
$ Conway.ConwayUtxowFailure
$ Conway.UtxoFailure
$ Conway.MaxTxSizeUTxO a b

applyAlonzoBasedTx :: forall era.
( ShelleyBasedEra era,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
### Non-Breaking

- Mempool: also changed to use the more conservative value of Ledger's
`maxRefScriptSizePerBlock`, ie 1MiB, that was decided on for Conway.
Original file line number Diff line number Diff line change
Expand Up @@ -185,10 +185,11 @@ pureTryAddTx cfg txSize wti tx is
-- mempool, and...
| let curSize = msNumBytes $ isMempoolSize is
, curSize < getMempoolCapacityBytes (isCapacity is)
-- ... if the mempool has less than 2.5 mebibytes of ref scripts.
, let maxTotalRefScriptSize = 5 * 512 * 1024 -- 2.5 Mebibytes
curTotalRefScriptSize = isTotalRefScriptSize is
, curTotalRefScriptSize Prelude.< maxTotalRefScriptSize
-- ... if the mempool will have at most 1 mebibyte of ref scripts.
, let curTotalRefScriptSize = isTotalRefScriptSize is
newTxRefScriptSize = txRefScriptSize cfg (isLedgerState is) tx
maxTotalRefScriptSize = 1024 * 1024 -- 1MiB
, curTotalRefScriptSize + newTxRefScriptSize Prelude.<= maxTotalRefScriptSize
=
case eVtx of
-- We only extended the ValidationResult with a single transaction
Expand Down