mempool TX notifications + missing functionality in other RPCs #72

Open
opened 2022-10-20 15:33:21 +02:00 by moodyjon · 3 comments
moodyjon commented 2022-10-20 15:33:21 +02:00 (Migrated from github.com)

The initial batch of blockchain.address.{get_balance,get_history,...} RPCs are lacking the ability to report things happening in unconfirmed TXs. Need to monitor the mempool tables written by scribe? Or contact lbcd?

The initial batch of blockchain.address.{get_balance,get_history,...} RPCs are lacking the ability to report things happening in unconfirmed TXs. Need to monitor the mempool tables written by scribe? Or contact lbcd?
moodyjon commented 2022-12-07 14:45:09 +01:00 (Migrated from github.com)

This is critical to getting tests working. Lbry-sdk needs to receive notifications about mempool TXs and retrieve TX details. See #77.

It appears (Python) herald monitors the MempoolTX table contents (prefix d).

This is critical to getting tests working. Lbry-sdk needs to receive notifications about mempool TXs and retrieve TX details. See #77. It appears (Python) herald monitors the `MempoolTX` table contents (prefix `d`).
moodyjon commented 2022-12-14 16:11:57 +01:00 (Migrated from github.com)

Sending to @jeffreypicard who has volunteered to work on this.

(go) Herald needs to monitor MempoolTX table and/or HashXMempoolStatus to see when new txs appear or status changes happen. When status of a hashX changes, notification (hashXNotification) should be delivered on the NotifierChan. Client should respond to the notification by performing address.get_history and transaction.get_batch. Herald should respond with tx hashes and details that include mempool transactions. A quirk of mempool transactions is they report with height=-1 (and some other details are missing). Later when a transaction migrates from mempool to the blockchain, the height and other details become known.

Sending to @jeffreypicard who has volunteered to work on this. (go) Herald needs to monitor MempoolTX table and/or HashXMempoolStatus to see when new txs appear or status changes happen. When status of a hashX changes, notification (`hashXNotification`) should be delivered on the `NotifierChan`. Client should respond to the notification by performing `address.get_history` and `transaction.get_batch`. Herald should respond with tx hashes and details that include mempool transactions. A quirk of mempool transactions is they report with height=-1 (and some other details are missing). Later when a transaction migrates from mempool to the blockchain, the height and other details become known.
moodyjon commented 2022-12-14 22:14:42 +01:00 (Migrated from github.com)

    def get_mempool_height(self, tx_hash: bytes) -> int:
        # Height Progression
        #   -2: not broadcast
        #   -1: in mempool but has unconfirmed inputs
        #    0: in mempool and all inputs confirmed
        # +num: confirmed in a specific block (height)
``` def get_mempool_height(self, tx_hash: bytes) -> int: # Height Progression # -2: not broadcast # -1: in mempool but has unconfirmed inputs # 0: in mempool and all inputs confirmed # +num: confirmed in a specific block (height) ```
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: LBRYCommunity/herald.go#72
No description provided.