Skip to content

Commit c6ba2a0

Browse files
committed
Update mempool size limit
1 parent ecfb43c commit c6ba2a0

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
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+
- Mempool: also changed to use the more conservative value of Ledger's
4+
`maxRefScriptSizePerBlock`, ie 1MiB, that was decided on for Conway.

ouroboros-consensus/src/ouroboros-consensus/Ouroboros/Consensus/Mempool/Update.hs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -185,10 +185,11 @@ pureTryAddTx cfg txSize wti tx is
185185
-- mempool, and...
186186
| let curSize = msNumBytes $ isMempoolSize is
187187
, curSize < getMempoolCapacityBytes (isCapacity is)
188-
-- ... if the mempool has less than 2.5 mebibytes of ref scripts.
189-
, let maxTotalRefScriptSize = 5 * 512 * 1024 -- 2.5 Mebibytes
190-
curTotalRefScriptSize = isTotalRefScriptSize is
191-
, curTotalRefScriptSize Prelude.< maxTotalRefScriptSize
188+
-- ... if the mempool will have at most 1 mebibyte of ref scripts.
189+
, let curTotalRefScriptSize = isTotalRefScriptSize is
190+
newTxRefScriptSize = txRefScriptSize cfg (isLedgerState is) tx
191+
maxTotalRefScriptSize = 1024 * 1024 -- 1MiB
192+
, curTotalRefScriptSize + newTxRefScriptSize Prelude.<= maxTotalRefScriptSize
192193
=
193194
case eVtx of
194195
-- We only extended the ValidationResult with a single transaction

0 commit comments

Comments
 (0)