Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Trace transaction replies in txSubmissionOutbound after transactions are sent #1863

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft
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 @@ -53,7 +53,8 @@ directPipelined (TxSubmissionServerPipelined mserver)
directSender q (SendMsgRequestTxsPipelined txids serverNext)
ClientStIdle{recvMsgRequestTxs} = do
server' <- serverNext
SendMsgReplyTxs txs client' <- recvMsgRequestTxs txids
SendMsgReplyTxs txs mClient' <- recvMsgRequestTxs txids
client' <- mClient'
directSender (enqueue (CollectTxs txids txs) q) server' client'

directSender q (CollectPipelined (Just server') _) client =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ txSubmissionClient tracer txId txSize maxUnacked =
traceWith tracer (EventRecvMsgRequestTxs unackedSeq unackedMap
remainingTxs txids)
case [ txid | txid <- txids, txid `Map.notMember` unackedMap ] of
[] -> pure (SendMsgReplyTxs txs client')
[] -> pure (SendMsgReplyTxs txs (pure client'))
where
txs = map (unackedMap Map.!) txids
client' = client unackedSeq unackedMap' remainingTxs
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ data ClientStTxIds blocking txid tx m a where

data ClientStTxs txid tx m a where
SendMsgReplyTxs :: [tx]
-> ClientStIdle txid tx m a
-> m (ClientStIdle txid tx m a)
-> ClientStTxs txid tx m a


Expand Down Expand Up @@ -113,5 +113,4 @@ txSubmissionClientPeer (TxSubmissionClient client) =
SendMsgReplyTxs txs k <- recvMsgRequestTxs txids
return $ Yield (ClientAgency TokTxs)
(MsgReplyTxs txs)
(go k)

(Effect $ k >>= return . go)
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ txSubmissionOutbound tracer maxUnacked TxSubmissionMempoolReader{..} =
!unackedMap' = foldl' (flip Map.delete) unackedMap txids
client' = client unackedSeq unackedMap' lastIdx

-- Trace the transactions to be sent in the response.
traceWith tracer (TraceTxSubmissionOutboundSendMsgReplyTxs txs)
-- Trace the transactions to be sent in the response.
traceTxsSent = traceWith tracer (TraceTxSubmissionOutboundSendMsgReplyTxs txs)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This requires a comment (here or near L195) saying that tracing itself will be executed after sending the reply.


return $ SendMsgReplyTxs txs client'
return $ SendMsgReplyTxs txs (traceTxsSent >> pure client')