Skip to content

Commit 9f94642

Browse files
committed
Name bikeshedding for numeric parameters in ObjectDiffusion
1 parent ffc0364 commit 9f94642

File tree

4 files changed

+23
-23
lines changed

4 files changed

+23
-23
lines changed

ouroboros-network-protocols/src/Ouroboros/Network/Protocol/ObjectDiffusion/Inbound.hs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ data ObjectDiffusionInboundPipelined objectId object m a where
4242
data Collect objectId object
4343
= -- | The result of 'SendMsgRequestObjectIdsPipelined'. It also carries
4444
-- the number of objectIds originally requested.
45-
CollectObjectIds NumObjectIdsToReq [objectId]
45+
CollectObjectIds NumObjectIdsReq [objectId]
4646
| -- | The result of 'SendMsgRequestObjectsPipelined'. The actual reply only
4747
-- contains the objects sent, but this pairs them up with the
4848
-- objects requested. This is because the peer can determine that
@@ -52,18 +52,18 @@ data Collect objectId object
5252
data InboundStIdle (n :: N) objectId object m a where
5353
SendMsgRequestObjectIdsBlocking ::
5454
-- | number of objectIds to acknowledge
55-
NumObjectIdsToAck ->
55+
NumObjectIdsAck ->
5656
-- | number of objectIds to request
57-
NumObjectIdsToReq ->
57+
NumObjectIdsReq ->
5858
-- | Result if done
5959
m a ->
6060
( NonEmpty objectId ->
6161
m (InboundStIdle Z objectId object m a)
6262
) ->
6363
InboundStIdle Z objectId object m a
6464
SendMsgRequestObjectIdsPipelined ::
65-
NumObjectIdsToAck ->
66-
NumObjectIdsToReq ->
65+
NumObjectIdsAck ->
66+
NumObjectIdsReq ->
6767
m (InboundStIdle (S n) objectId object m a) ->
6868
InboundStIdle n objectId object m a
6969
SendMsgRequestObjectsPipelined ::

ouroboros-network-protocols/src/Ouroboros/Network/Protocol/ObjectDiffusion/Outbound.hs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,8 @@ data OutboundStIdle objectId object m a = OutboundStIdle
5454
{ recvMsgRequestObjectIds ::
5555
forall blocking.
5656
SingBlockingStyle blocking ->
57-
NumObjectIdsToAck ->
58-
NumObjectIdsToReq ->
57+
NumObjectIdsAck ->
58+
NumObjectIdsReq ->
5959
m (OutboundStObjectIds blocking objectId object m a),
6060
recvMsgRequestObjects ::
6161
[objectId] ->

ouroboros-network-protocols/src/Ouroboros/Network/Protocol/ObjectDiffusion/Type.hs

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,10 @@ module Ouroboros.Network.Protocol.ObjectDiffusion.Type
3636
SingBlockingStyle (..),
3737
StBlockingStyle (..),
3838
BlockingReplyList (..),
39-
NumObjectIdsToAck (..),
40-
NumObjectIdsToReq (..),
41-
NumObjectsToReq (..),
42-
NumObjectsInFifo (..),
39+
NumObjectIdsAck (..),
40+
NumObjectIdsReq (..),
41+
NumObjectsReq (..),
42+
NumObjectsOutstanding (..),
4343
-- re-exports
4444
SizeInBytes (..),
4545
)
@@ -158,33 +158,33 @@ data StBlockingStyle where
158158
-- | In this state the peer must reply. There is a timeout.
159159
StNonBlocking :: StBlockingStyle
160160

161-
newtype NumObjectIdsToAck = NumObjectIdsToAck {getNumObjectIdsToAck :: Word16}
161+
newtype NumObjectIdsAck = NumObjectIdsToAck {getNumObjectIdsToAck :: Word16}
162162
deriving (Eq, Ord, NFData, Generic)
163163
deriving newtype (Num, Enum, Real, Integral, Bounded, NoThunks)
164164
deriving (Semigroup) via (Sum Word16)
165165
deriving (Monoid) via (Sum Word16)
166-
deriving (Show) via (Quiet NumObjectIdsToAck)
166+
deriving (Show) via (Quiet NumObjectIdsAck )
167167

168-
newtype NumObjectIdsToReq = NumObjectIdsToReq {getNumObjectIdsToReq :: Word16}
168+
newtype NumObjectIdsReq = NumObjectIdsToReq {getNumObjectIdsToReq :: Word16}
169169
deriving (Eq, Ord, NFData, Generic)
170170
deriving newtype (Num, Enum, Real, Integral, Bounded, NoThunks)
171171
deriving (Semigroup) via (Sum Word16)
172172
deriving (Monoid) via (Sum Word16)
173-
deriving (Show) via (Quiet NumObjectIdsToReq)
173+
deriving (Show) via (Quiet NumObjectIdsReq )
174174

175-
newtype NumObjectsToReq = NumObjectsToReq {getNumObjectsToReq :: Word16}
175+
newtype NumObjectsReq = NumObjectsToReq {getNumObjectsToReq :: Word16}
176176
deriving (Eq, Ord, NFData, Generic)
177177
deriving newtype (Num, Enum, Real, Integral, Bounded, NoThunks)
178178
deriving (Semigroup) via (Sum Word16)
179179
deriving (Monoid) via (Sum Word16)
180-
deriving (Show) via (Quiet NumObjectsToReq)
180+
deriving (Show) via (Quiet NumObjectsReq )
181181

182-
newtype NumObjectsInFifo = NumObjectsInFifo {getNumObjectsInFifo :: Word16}
182+
newtype NumObjectsOutstanding = NumObjectsInFifo {getNumObjectsInFifo :: Word16}
183183
deriving (Eq, Ord, NFData, Generic)
184184
deriving newtype (Num, Enum, Real, Integral, Bounded, NoThunks)
185185
deriving (Semigroup) via (Sum Word16)
186186
deriving (Monoid) via (Sum Word16)
187-
deriving (Show) via (Quiet NumObjectsInFifo)
187+
deriving (Show) via (Quiet NumObjectsOutstanding)
188188

189189
-- | There are some constraints of the protocol that are not captured in the
190190
-- types of the messages, but are documented with the messages. Violation
@@ -252,9 +252,9 @@ instance Protocol (ObjectDiffusion initAgency objectId object) where
252252
MsgRequestObjectIds ::
253253
forall (blocking :: StBlockingStyle) initAgency objectId object.
254254
SingBlockingStyle blocking ->
255-
NumObjectIdsToAck ->
255+
NumObjectIdsAck ->
256256
-- \^ Acknowledge this number of outstanding objects
257-
NumObjectIdsToReq ->
257+
NumObjectIdsReq ->
258258
-- \^ Request up to this number of object ids
259259
Message (ObjectDiffusion initAgency objectId object) StIdle (StObjectIds blocking)
260260
-- \| Reply with a list of object identifiers for available objects, along

ouroboros-network/src/Ouroboros/Network/NodeToNode.hs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ import Ouroboros.Network.Server.RateLimiting
102102
import Ouroboros.Network.Snocket
103103
import Ouroboros.Network.Socket
104104
import Ouroboros.Network.Util.ShowProxy (ShowProxy, showProxy)
105-
import Ouroboros.Network.Protocol.ObjectDiffusion.Type (NumObjectsInFifo)
105+
import Ouroboros.Network.Protocol.ObjectDiffusion.Type (NumObjectsOutstanding)
106106

107107

108108
-- The Handshake tracer types are simply terrible.
@@ -162,7 +162,7 @@ data MiniProtocolParameters = MiniProtocolParameters {
162162
-- ^ maximal number of unacked tx (pipelining is bounded by twice this
163163
-- number)
164164

165-
perasCertDiffusionMaxFifoLength :: !NumObjectsInFifo
165+
perasCertDiffusionMaxFifoLength :: !NumObjectsOutstanding
166166
-- ^ Maximum number of PerasCerts in the outbound peer's outstanding FIFO.
167167
--
168168
-- This indirectly limits the number of pipelined requests from the inbound peer:

0 commit comments

Comments
 (0)