File tree Expand file tree Collapse file tree 1 file changed +11
-1
lines changed
ouroboros-consensus/src/ouroboros-consensus/Ouroboros/Consensus/Mempool Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -189,7 +189,17 @@ pureTryAddTx cfg txSize wti tx is
189189 , let curTotalRefScriptSize = isTotalRefScriptSize is
190190 newTxRefScriptSize = txRefScriptSize cfg (isLedgerState is) tx
191191 maxTotalRefScriptSize = 1024 * 1024 -- 1MiB
192- , curTotalRefScriptSize + newTxRefScriptSize Prelude. <= maxTotalRefScriptSize
192+ mempoolStaysBelowCapacity =
193+ curTotalRefScriptSize + newTxRefScriptSize Prelude. <= maxTotalRefScriptSize
194+ -- In case the tx exceeds the per-tx limit, let it be rejected by tx
195+ -- validation (such that we are not blocked here forever/for a long
196+ -- time).
197+ --
198+ -- For Babbage, this is 100KiB (see @totalRefScriptsSizeLimit@ in
199+ -- "Ouroboros.Consensus.Shelley.Eras"), and for Conway, this is 200KiB
200+ -- (see @maxRefScriptSizePerTx@ in "Cardano.Ledger.Conway.Rules.Ledger").
201+ txRefScriptSizeTooLarge = newTxRefScriptSize Prelude. > 200 * 1024
202+ , mempoolStaysBelowCapacity || txRefScriptSizeTooLarge
193203 =
194204 case eVtx of
195205 -- We only extended the ValidationResult with a single transaction
You can’t perform that action at this time.
0 commit comments