@@ -27,6 +27,7 @@ import Data.Semigroup (stimes)
27
27
import Data.Word (Word32 )
28
28
import GHC.Generics
29
29
import NoThunks.Class
30
+ import Numeric.Natural (Natural )
30
31
import Ouroboros.Consensus.Ledger.Basics
31
32
import Ouroboros.Consensus.Ledger.SupportsMempool
32
33
@@ -89,15 +90,20 @@ newtype SemigroupViaMeasure a = SemigroupViaMeasure a
89
90
90
91
-- | The size of a mempool.
91
92
data MempoolSize = MempoolSize
92
- { msNumTxs :: ! Word32
93
+ { msNumTxs :: ! Word32
93
94
-- ^ The number of transactions in the mempool.
94
- , msNumBytes :: ! ByteSize32
95
+ , msNumBytes :: ! ByteSize32
95
96
-- ^ 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.
96
101
} deriving (Eq , Show , Generic , NoThunks )
97
102
98
103
instance 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 )
100
105
101
106
instance Monoid MempoolSize where
102
- mempty = MempoolSize { msNumTxs = 0 , msNumBytes = ByteSize32 0 }
107
+ mempty = MempoolSize { msNumTxs = 0 , msNumBytes = ByteSize32 0 ,
108
+ msExUnitsMemory = 0 , msExUnitsSteps = 0 }
103
109
mappend = (<>)
0 commit comments