-
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
Provide recent syncer response lengths as a watch channel #2602
Merged
Conversation
This file contains 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
jvff
reviewed
Aug 18, 2021
jvff
reviewed
Aug 19, 2021
Also includes metrics and logging, to make diagnosing bugs easier.
- initially empty - pruned to correct length - newest entries go first
This seems to be a nightly or beta Rust change, but hopefully stable just accepts it.
This length makes it easier to distinguish between temporary and sustained errors/syncs.
cf1de4d
to
9d0a436
Compare
Co-authored-by: Janito Vaqueiro Ferreira Filho <janito.vff@gmail.com>
4c3acc3
to
9f20b7b
Compare
teor2345
commented
Aug 19, 2021
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I applied your fixes and suggestions, except for SmallVec
.
jvff
approved these changes
Aug 19, 2021
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
A-dependencies
Area: Dependency file updates
A-rust
Area: Updates to Rust code
C-enhancement
Category: This is an improvement
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.
Motivation
We want Zebra to activate the mempool once it reaches the chain tip.
To find out when that happens, we need to know the recent syncer response lengths.
Specifications
We know that the mempool should only activate once Zebra reaches the chain tip, but there doesn't seem to be a specification for it.
Designs
As part of this ticket, I split the "Check Initial Sync" and "Chain Update" tokio tasks in the design.
Diagram: https://jamboard.google.com/d/1HUhdqx8afJUqgiBdBcjCw0aAfDod9R9KBJeAH24U1Qg/viewer?f=0
Scope: https://docs.google.com/document/d/10PP6wKlnS5gannRph_EQ8V9diR7byddf3W2YFZ564FU/edit#
Solution
Closes #2595.
Implementation and Tests
Monitoring
This code might be hard to test, so I've added metrics and a dashboard.
They will help us work out what happens when Zebra gets near the chain tip.
And we'll also be able to see what happens when the network or peers fail.
Review
@jvff or @upbqdn can review this PR.
(It's based on the recent heights channel from PR #2519.)
We'll do more testing as part of ticket #2592.
In ticket #2592, I wrote down what happens to the sync lengths in different situations.
Reviewer Checklist
Follow Up Work
We need to create a tokio task which turns these lengths into enable/disable mempool requests.