You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The zmq_event_receive is currently only consumed by the Waiter, signal, and is really only used in the wait method when the accept_block_notification is true. This only happens when wait is invoked in the main loop in electrs.rs which controls mempool updates like you noted in your description.
One issue I see with this approach is the overhead from the increased number of Mempool::update calls. The hashblock notification isn't being used as a way to detect if a transaction hash was added to the mempool, it's a way to communicate to the main loop that we need to remove confirmed txs from the mempool. Whenever it's called, we get all the txids from the node's mempool, remove the txids in our mempool that are no longer present, and make additional calls to retrieve the transactions we don't have. To avoid updates from being invoked for every tx, I'd suggest filtering for just block events.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes: #198
We update the mempool every five seconds. This PR changes the trigger for the index, enabling us to reflect changes to the mempool more precisely.
This PR is open to choosing another subscription type and filtering the specific
sequenceevent.