@@ -27,6 +27,7 @@ import Data.Semigroup (stimes)
2727import Data.Word (Word32 )
2828import GHC.Generics
2929import NoThunks.Class
30+ import Numeric.Natural (Natural )
3031import Ouroboros.Consensus.Ledger.Basics
3132import Ouroboros.Consensus.Ledger.SupportsMempool
3233
@@ -89,15 +90,20 @@ newtype SemigroupViaMeasure a = SemigroupViaMeasure a
8990
9091-- | The size of a mempool.
9192data MempoolSize = MempoolSize
92- { msNumTxs :: ! Word32
93+ { msNumTxs :: ! Word32
9394 -- ^ The number of transactions in the mempool.
94- , msNumBytes :: ! ByteSize32
95+ , msNumBytes :: ! ByteSize32
9596 -- ^ The summed byte size of all the transactions in the mempool.
97+ , msExUnitsMemory :: ! Natural
98+ -- ^ The execution memory units of all the transactions in the mempool.
99+ , msExUnitsSteps :: ! Natural
100+ -- ^ The execution steps of all the transactions in the mempool.
96101 } deriving (Eq , Show , Generic , NoThunks )
97102
98103instance Semigroup MempoolSize where
99- MempoolSize xt xb <> MempoolSize yt yb = MempoolSize (xt + yt) (xb <> yb)
104+ MempoolSize xt xb xm xs <> MempoolSize yt yb ym ys = MempoolSize (xt + yt) (xb <> yb) (xm + ym) (xs + ys )
100105
101106instance Monoid MempoolSize where
102- mempty = MempoolSize { msNumTxs = 0 , msNumBytes = ByteSize32 0 }
107+ mempty = MempoolSize { msNumTxs = 0 , msNumBytes = ByteSize32 0 ,
108+ msExUnitsMemory = 0 , msExUnitsSteps = 0 }
103109 mappend = (<>)
0 commit comments