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
fastsync/event: emit fastsync status event when switching consensus/fastsync #6619
Conversation
Codecov Report
@@ Coverage Diff @@
## master #6619 +/- ##
==========================================
+ Coverage 60.87% 60.98% +0.11%
==========================================
Files 297 297
Lines 28281 28290 +9
==========================================
+ Hits 17217 17254 +37
+ Misses 9328 9301 -27
+ Partials 1736 1735 -1
|
@Thunnini does this fit your use case? |
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.
Looks great! This event will only be twice AFAICT, so I'm not sure how useful it'll be? At least the initial event won't be that useful I think because it should be immediately triggered. However, when it's finished the event could prove to be useful.
I'd recommend changing the On
field name and updating the existing docs to make mention of this new event 👍
e1bebc3
to
2d3d292
Compare
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.
@cmwaters do you mind taking a look at this?
What is the relation of this to statesync? Do we want to add an event when state sync is completed? Maybe not. I think it's better to not expose the notions of state sync and fast sync to the event consumer but rather to have a single event when Sync is complete. Since we don't currently go back to fast sync after finishing syncing, I think it's fine to emit a single event when switching to consensus rather than two. I also think that the Honestly, I find this current start up stuff quite messy. Can't wait to reach a better solution to it. |
#2498 (comment) |
@JayT106 I don't see anything wrong with the current design. We have an event for when fast sync starts and when it completes, which seems good. We could also have one for state sync. I don't see why we'd want to merge these events, as they're different things. A client can subscribe to both. |
63548ee
to
77b16ba
Compare
My thinking was because a client doesn't care if it's state sync or fast sync they just want to know if a node is "synced" and at the head of the blockchain |
I don't think you can safely assume that -- clients may want both, neither, or just one of them. |
I can't see such a distinction providing too much value but what do I know. Do we want to add an event for starting / finishing state sync? |
@JayT106 can we also add an event for state sync please? |
e42c5bb
to
28da14a
Compare
|
@JayT106 yes -- it can be in a separate PR :) |
|
28da14a
to
51f0881
Compare
This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
d608d1a
to
5c49dd0
Compare
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.
Awesome! Let's try merge this
closes #2498
solves part of #3365
Note: difficult to test the event emit in SwitchToFastSync part, might need to change
stateSyncReactor
to an interface in thenodeImpl
struct