fastsync/event: emit fastsync status event when switching consensus/fastsync (#6619)

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 the `nodeImpl` struct
This commit is contained in:
JayT106
2021-07-20 15:36:47 +00:00
committed by GitHub
parent 2030875056
commit c4f77ab6d1
8 changed files with 97 additions and 18 deletions
+10
View File
@@ -45,3 +45,13 @@ version = "v0"
If we're lagging sufficiently, we should go back to fast syncing, but
this is an [open issue](https://github.com/tendermint/tendermint/issues/129).
## The Fast Sync event
When the tendermint blockchain core launches, it might switch to the `fast-sync`
mode to catch up the states to the current network best height. the core will emits
a fast-sync event to expose the current status and the sync height. Once it catched
the network best height, it will switches to the state sync mechanism and then emit
another event for exposing the fast-sync `complete` status and the state `height`.
The user can query the events by subscribing `EventQueryFastSyncStatus`
Please check [types](https://pkg.go.dev/github.com/tendermint/tendermint/types?utm_source=godoc#pkg-constants) for the details.