-
Notifications
You must be signed in to change notification settings - Fork 117
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
Activate Mempool storage based on a list of recent syncer obtain/extend lengths #2592
Comments
@oxarbitrage before you start this task, can you write down what you want to do, step by step? I'm doing some testing on PR #2602 at the moment, and updating this PR with the results. |
Here is how Startup & Initial SyncsOn startup, the list is empty. Then it gets filled with lengths around 500.
Temporary ErrorWhen there is a temporary error, one zero length gets put in the list.
Response Lengths During SyncSome peers give us responses that are around 100, 400, or 500 long. The long tail of obtain tips responses happened after Zebra had stopped downloading lots of blocks. Reaching the Chain TipOnce Zebra reaches the chain tip, the syncer gets responses around 2-20 blocks long. |
Maybe is better if you do it ? The list and the PR ? If not, please let me handle it at my way. Thank you for the details of |
Do I understand it correctly that this ticket needs to come up with a suitable heuristic that would decide when it's the right time to start the mempool? |
This is a very high level description but i think something like this is what we need here: The mempool will have a On the other hand, in the real world we will activate the mempool after zebra is in sync. The question is how do we know it is in sync. IIRC we were going to do this by watching the number of blocks that are being downloaded, while zebra is syncing it will be downloading blocks from the network at batches of 500(or similar, i dont remember the exact number) but when it gets in sync it will slow down. We need an algorithm to do this in a function named |
By the way, it seems the task is simplified by the addition of
|
We can wrap the heuristic function and But it's ok for the initial draft PR to just have a heuristic function. If you want to see how syncing looks on a graph, you can use Grafana and Prometheus: |
Here is what i think we can do to get started: There we have the
|
Maybe base your initial PR on #2615 so you will have some mempool files. |
I would encourage you to use a lower threshold than 100, because the heuristic has to work for 3 different cases:
For example, if we have See the details here: Note that the latest length is added to the front of the
k is currently limited to a maximum of 4, feel free to change it in your PR:
We'll want to keep k low, because the list is updated:
|
Motivation
We want to control when we activate mempool, for testing purposes as well as when zebra reaches the chain tip.
Specifications
Designs
Testing
Test that activation happens near the chain tip
Related Work
This change depends on ticket #2595.
The text was updated successfully, but these errors were encountered: