Skip to content

Commit

Permalink
Update mempool size limit
Browse files Browse the repository at this point in the history
  • Loading branch information
amesgen committed Aug 20, 2024
1 parent ecfb43c commit c6ba2a0
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
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

0 comments on commit c6ba2a0

Please sign in to comment.