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

Only enable the mempool crawler after synchronization reaches the chain tip #2667

Conversation

jvff
Copy link
Contributor

@jvff jvff commented Aug 25, 2021

Motivation

The mempool crawler should only run after the chain is synchronized.

Solution

Update the mempool::Crawler to use the SyncStatus helper type so that the crawler only runs if the synchronizer is likely at the chain tip (i.e., it has finished catching up to the current network status).

Review

@teor2345 has been following the development of the crawler.

Reviewer Checklist

  • Code implements Specs and Designs
  • Tests for Expected Behaviour
  • Tests for Errors

Follow Up Work

@jvff jvff requested a review from teor2345 August 25, 2021 01:34
@zfnd-bot zfnd-bot bot assigned jvff Aug 25, 2021
The helper type will make it easier to determine if the crawler is
enabled or not.
@jvff jvff force-pushed the only-enable-mempool-crawler-after-synchronization branch from 5a5641c to 416b571 Compare August 30, 2021 10:43
Implement waiting until the mempool becomes enabled, so that the crawler
does not run while the mempool is disabled.

If the `MempoolStatus` helper is unable to determine if the mempool is
enabled, stop the crawler task entirely.
@jvff jvff force-pushed the only-enable-mempool-crawler-after-synchronization branch from 416b571 to 8a1c810 Compare August 30, 2021 10:49
@jvff jvff marked this pull request as ready for review August 30, 2021 10:54
Change the mempool crawler test so that it's a proptest that tests
different chain sync. lengths. This leads to different scenarios with
the crawler pausing and resuming.
@jvff
Copy link
Contributor Author

jvff commented Aug 30, 2021

I updated the original mempool crawler test to now be a proptest so that it can consider scenarios where the crawler pauses and resumes.

Copy link
Contributor

@teor2345 teor2345 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems fine for now, let's merge!

@teor2345 teor2345 enabled auto-merge (squash) August 30, 2021 22:21
@teor2345 teor2345 merged commit 8bff71e into ZcashFoundation:main Aug 31, 2021
@jvff jvff deleted the only-enable-mempool-crawler-after-synchronization branch August 31, 2021 11:47
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

Successfully merging this pull request may close these issues.

2 participants