mirror of
https://github.com/tendermint/tendermint.git
synced 2026-01-04 04:04:00 +00:00
blockchain/v2: integrate with state sync
Integrates the blockchain v2 reactor with state sync, fixes #4765. This mostly involves deferring fast syncing until after state sync completes. I tried a few different approaches, this was the least effort: * `Reactor.events` is `nil` if no fast sync is in progress, in which case events are not dispatched - most importantly `AddPeer`. * Accept status messages from unknown peers in the scheduler and register them as ready. On fast sync startup, broadcast status requests to all existing peers. * When switching from state sync, first send a `bcResetState` message to the processor and scheduler to update their states - most importantly the initial block height. * When fast sync completes, shut down event loop, scheduler and processor, and set `events` channel to `nil`.
This commit is contained in:
@@ -683,10 +683,6 @@ func NewNode(config *cfg.Config,
|
||||
logger.Info("Found local state with non-zero height, skipping state sync")
|
||||
stateSync = false
|
||||
}
|
||||
// Don't check fastSync == true, since the v2 reactor has a bug where it fast syncs regardless.
|
||||
if stateSync && config.FastSync.Version == "v2" {
|
||||
return nil, errors.New("state sync is not supported with blockchain v2 reactor")
|
||||
}
|
||||
|
||||
// Create the handshaker, which calls RequestInfo, sets the AppVersion on the state,
|
||||
// and replays any blocks as necessary to sync tendermint with the app.
|
||||
|
||||
Reference in New Issue
Block a user