0

I can view pending events like so:

pending_events_filter = my_contract.events.TestEvent.createFilter(fromBlock='pending', toBlock='pending') pending_events_filter.get_new_entries()

But the events are occasionally delayed up to a minute after my geth node gets the transaction in its mempool, and sometimes don't even show up until the transaction has been mined.

I am running geth locally, and connected to it via websocket.

How can I get these pending events immediately?

My suspicion is that my geth node is not bothering running them in the EVM until it needs to for mining purposes, but I don't know.

Thanks for any help!

0

The mempool is a dark place. I think what it comes down to in your case is just that not every node has all of the mempool. There's two ways you could go about it:

  1. Manually try to increase your mempool. I'm sure there is configuration in geth that determines things like max mempool count, max connected peers etc. Increasing those will help. You can also run multiple geth nodes.

  2. Use a service like Blocknative: https://www.blocknative.com/notify

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.