-
Notifications
You must be signed in to change notification settings - Fork 721
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
Expose the tx mempool monitoring mini protocol in cardano-api #3706
Conversation
3e0859d
to
93fd249
Compare
b392380
to
4110200
Compare
Implement TxIdInMode This sets the stage to expose a user facing function to utilize the local tx monitoring mini protocol
…nality to utilize the local tx monitoring protocol which allows users to: Check if a transaction exists in the mempool Request the next tx in the mempool Request the current size and capacity of the mempool Note: This is not exposed via cardano-cli as yet
4110200
to
ac8f3b5
Compare
-- | The mempool is modeled as an ordered list of transactions and thus, can | ||
-- be traversed linearly. 'LocalTxMonitoringSendNextTx' requests the next transaction from the | ||
-- current list. This must be a transaction that was not previously sent to | ||
-- the client for this particular snapshot. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there state associated with the connection that tracks where the current transaction in the list is?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are only 3 things you can get:
data ServerStBusy (kind :: StBusyKind) txid tx slot m a where
SendMsgReplyNextTx
:: Maybe tx
-> ServerStAcquired txid tx slot m a
-> ServerStBusy NextTx txid tx slot m a
SendMsgReplyHasTx
:: Bool
-> ServerStAcquired txid tx slot m a
-> ServerStBusy HasTx txid tx slot m a
SendMsgReplyGetSizes
:: MempoolSizeAndCapacity
-> ServerStAcquired txid tx slot m a
-> ServerStBusy GetSizes txid tx slot
The next tx, if a tx exists or the mempool size.
@@ -6,12 +6,17 @@ | |||
-- | Transactions in the context of a consensus mode, and other types used in | |||
-- the transaction submission protocol. | |||
-- | |||
module Cardano.Api.TxInMode ( | |||
module Cardano.Api.InMode ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's the motivation for the module rename?
Maybe the comment for the module needs adjustment too?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So we now have TxInMode
and TxIdInMode
. I figured it would make sense to drop the Tx
because of this.
bors r+ |
Build succeeded: |
Resolves: #3698