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.
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
Web socket subscription for active difficulty #2091
Web socket subscription for active difficulty #2091
Changes from 9 commits
d3dc13b
cf023c3
27caca0
351322d
06a7704
27a9732
703dad4
d0c43df
30892ad
881b2ff
fcd2456
d1a4584
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
Currently implemented to only notify if the active difficulty changes - is this correct or should it notify on every iteration even if active difficulty remains the same?
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.
Only when it changes I think. Thoughts @zhyatt ?
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.
If the call is sufficiently lightweight, I could see value in triggering it every cycle, specifically to ensure consistent data points for any tracking/visualizations, and also as a mechanism that allows watching for that consistency. If gaps are seen, this allows polling for difficulty separately through RPC as fallback or alerting of a possible issue (if these notifications aren't seen for a time period). Any additional thoughts @cryptocode or @guilhermelawless ?
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 think that's a good idea, it's very light data especially considering the ~20 second period.
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.
Sounds good to me if it simplifies clients and is low frequency.
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.
The
request_loop
runs faster in testing - will publishing on every iteration have an impact on other tests if running faster?:request_interval_ms = is_test_network () ? (is_sanitizer_build ? 100 : 20) : 16000;
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.
Not a problem I believe, there is much higher frequency data being passed around. Tests should pass.
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.
We agree with @guilhermelawless, sending it every cycle should be fine.