Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,11 @@ import Ouroboros.Consensus.Node.Serialisation
import qualified Ouroboros.Consensus.Node.Tracers as Node
import Ouroboros.Consensus.NodeKernel
import qualified Ouroboros.Consensus.Storage.ChainDB.API as ChainDB
import Ouroboros.Consensus.Storage.LedgerDB.Forker (ResolveLeiosBlock)
import Ouroboros.Consensus.Storage.LedgerDB.Forker
( ResolveLeiosBlock
, headerContainsLeiosCert
, headerLeiosAnnouncement
)
import Ouroboros.Consensus.Storage.Serialisation (SerialisedHeader)
import Ouroboros.Consensus.Util (ShowProxy)
import Ouroboros.Consensus.Util.IOLike
Expand Down Expand Up @@ -317,11 +321,11 @@ data Handlers m addr blk = Handlers
ControlMessageSTM m ->
ConnectionId addr ->
Leios.LeiosPeerVars m ->
LeiosNotifyClientPeerPipelined LeiosPoint () LeiosVote m ()
LeiosNotifyClientPeerPipelined LeiosPoint (Header blk) LeiosVote m ()
, hLeiosNotifyServer ::
NodeToNodeVersion ->
ConnectionId addr ->
LeiosNotifyServerPeer LeiosPoint () LeiosVote m ()
LeiosNotifyServerPeer LeiosPoint (Header blk) LeiosVote m ()
, hLeiosFetchClient ::
LeiosDbConnection m ->
NodeToNodeVersion ->
Expand Down Expand Up @@ -456,7 +460,19 @@ mkHandlers
_ -> Right 100 {- TODO magic number -}
)
( pure $ \case
MsgLeiosBlockAnnouncement{} -> error "Demo does not send EB announcements!"
MsgLeiosBlockAnnouncement hdr -> do
traceWith tracer $
MkTraceLeiosPeer $
unwords
[ "MsgLeiosBlockAnnouncement"
, "(ignored)"
, show (headerPoint hdr)
, "containsCert=" <> show (headerContainsLeiosCert hdr)
, "announcedEb=" <> case headerLeiosAnnouncement hdr of
Nothing -> "none"
Just (ebPoint, ebSize) ->
Leios.prettyEbHash (Leios.pointEbHash ebPoint) <> " size=" <> show ebSize
]
MsgLeiosBlockOffer point ebBytesSize -> do
traceWith tracer $ MkTraceLeiosPeer $ "MsgLeiosBlockOffer " <> Leios.prettyLeiosPoint point
let MkLeiosPoint{pointEbHash = ebHash} = point
Expand Down Expand Up @@ -519,7 +535,7 @@ mkHandlers
STM
m
( LeiosDemoOnlyTestNotify.Message
(LeiosNotify LeiosPoint () LeiosVote)
(LeiosNotify LeiosPoint (Header blk) LeiosVote)
LeiosDemoOnlyTestNotify.StBusy
LeiosDemoOnlyTestNotify.StIdle
)
Expand All @@ -535,7 +551,7 @@ mkHandlers
STM
m
( LeiosDemoOnlyTestNotify.Message
(LeiosNotify LeiosPoint () LeiosVote)
(LeiosNotify LeiosPoint (Header blk) LeiosVote)
LeiosDemoOnlyTestNotify.StBusy
LeiosDemoOnlyTestNotify.StIdle
)
Expand Down Expand Up @@ -597,7 +613,7 @@ data Codecs blk addr e m bCS bSCS bBF bSBF bTX bKA bPS bLN bLF = Codecs
, cTxSubmission2Codec :: Codec (TxSubmission2 (GenTxId blk) (GenTx blk)) e m bTX
, cKeepAliveCodec :: Codec KeepAlive e m bKA
, cPeerSharingCodec :: Codec (PeerSharing addr) e m bPS
, cLeiosNotifyCodec :: Codec (LeiosNotify LeiosPoint () LeiosVote) e m bLN
, cLeiosNotifyCodec :: Codec (LeiosNotify LeiosPoint (Header blk) LeiosVote) e m bLN
, cLeiosFetchCodec :: Codec (LeiosFetch LeiosPoint LeiosEb LeiosTx) e m bLF
}

Expand Down Expand Up @@ -668,8 +684,8 @@ defaultCodecs ccfg version encAddr decAddr nodeToNodeVersion =
codecLeiosNotify
Leios.encodeLeiosPoint
Leios.decodeLeiosPoint
(\() -> CBOR.encodeNull)
CBOR.decodeNull
enc
dec
Leios.encodeLeiosVote
Leios.decodeLeiosVote
, cLeiosFetchCodec =
Expand Down Expand Up @@ -706,7 +722,7 @@ identityCodecs ::
(AnyMessage (TxSubmission2 (GenTxId blk) (GenTx blk)))
(AnyMessage KeepAlive)
(AnyMessage (PeerSharing addr))
(AnyMessage (LeiosNotify LeiosPoint () LeiosVote))
(AnyMessage (LeiosNotify LeiosPoint (Header blk) LeiosVote))
(AnyMessage (LeiosFetch LeiosPoint LeiosEb LeiosTx))
identityCodecs =
Codecs
Expand Down Expand Up @@ -743,7 +759,7 @@ data Tracers' peer ntnAddr blk e f = Tracers
, tPeerSharingTracer :: f (TraceLabelPeer peer (TraceSendRecv (PeerSharing ntnAddr)))
, tTxLogicTracer :: f (TraceLabelPeer peer (TraceTxLogic peer (GenTxId blk) (GenTx blk)))
, tLeiosNotifyTracer ::
f (TraceLabelPeer peer (TraceSendRecv (LeiosNotify LeiosPoint () LeiosVote)))
f (TraceLabelPeer peer (TraceSendRecv (LeiosNotify LeiosPoint (Header blk) LeiosVote)))
, tLeiosFetchTracer ::
f (TraceLabelPeer peer (TraceSendRecv (LeiosFetch LeiosPoint LeiosEb LeiosTx)))
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1242,7 +1242,7 @@ runThreadNetwork
(AnyMessage (TxSubmission2 (GenTxId blk) (GenTx blk)))
(AnyMessage KeepAlive)
(AnyMessage (PeerSharing NodeId))
(AnyMessage (LeiosNotify LeiosDemoTypes.LeiosPoint () LeiosDemoTypes.LeiosVote))
(AnyMessage (LeiosNotify LeiosDemoTypes.LeiosPoint (Header blk) LeiosDemoTypes.LeiosVote))
(AnyMessage (LeiosFetch LeiosDemoTypes.LeiosPoint LeiosDemoTypes.LeiosEb LeiosDemoTypes.LeiosTx))
customNodeToNodeCodecs cfg ntnVersion =
NTN.Codecs
Expand Down Expand Up @@ -1903,7 +1903,7 @@ type LimitedApp' m addr blk =
(AnyMessage (TxSubmission2 (GenTxId blk) (GenTx blk)))
(AnyMessage KeepAlive)
(AnyMessage (PeerSharing addr))
(AnyMessage (LeiosNotify LeiosDemoTypes.LeiosPoint () LeiosDemoTypes.LeiosVote))
(AnyMessage (LeiosNotify LeiosDemoTypes.LeiosPoint (Header blk) LeiosDemoTypes.LeiosVote))
(AnyMessage (LeiosFetch LeiosDemoTypes.LeiosPoint LeiosDemoTypes.LeiosEb LeiosDemoTypes.LeiosTx))
NodeToNodeInitiatorResult
()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -780,7 +780,7 @@ class HasLeiosVoting blk where
-- * Tracing

messageLeiosNotifyToObject ::
Message (LeiosNotify LeiosPoint () LeiosVote) st st' ->
Message (LeiosNotify LeiosPoint announcement LeiosVote) st st' ->
Aeson.Object
messageLeiosNotifyToObject = \case
MsgLeiosNotificationRequestNext ->
Expand Down
Loading