From 2227d7632dd634d288688d55edcb9bbbfce64e94 Mon Sep 17 00:00:00 2001 From: Alexander Esgen Date: Tue, 20 Aug 2024 15:40:24 +0200 Subject: [PATCH] Refactor mempool limit --- .../Ouroboros/Consensus/Mempool/Update.hs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ouroboros-consensus/src/ouroboros-consensus/Ouroboros/Consensus/Mempool/Update.hs b/ouroboros-consensus/src/ouroboros-consensus/Ouroboros/Consensus/Mempool/Update.hs index e41b3669f8..7177e31694 100644 --- a/ouroboros-consensus/src/ouroboros-consensus/Ouroboros/Consensus/Mempool/Update.hs +++ b/ouroboros-consensus/src/ouroboros-consensus/Ouroboros/Consensus/Mempool/Update.hs @@ -185,10 +185,10 @@ 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 + , 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