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

mempool TX notifications + missing functionality in other RPCs #72

Open
moodyjon opened this issue Oct 20, 2022 · 3 comments
Open

mempool TX notifications + missing functionality in other RPCs #72

moodyjon opened this issue Oct 20, 2022 · 3 comments
Assignees

Comments

@moodyjon
Copy link
Contributor

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 moodyjon assigned moodyjon and unassigned moodyjon Oct 20, 2022
@moodyjon
Copy link
Contributor Author

moodyjon commented Dec 7, 2022

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 moodyjon self-assigned this Dec 7, 2022
@moodyjon moodyjon changed the title mempool.get_fee_histogram + missing functionality in other RPCs mempool TX notifications + missing functionality in other RPCs Dec 7, 2022
@moodyjon moodyjon assigned jeffreypicard and unassigned moodyjon Dec 14, 2022
@moodyjon
Copy link
Contributor Author

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
Copy link
Contributor Author


    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 up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants