From ea964e21335085db8459a2ae4438e1367f396683 Mon Sep 17 00:00:00 2001 From: "M. J. Fromberger" Date: Sat, 19 Mar 2022 21:18:17 -0700 Subject: [PATCH] node: always sync with the application at startup (#8159) --- node/node.go | 30 ++++++++++++++---------------- 1 file changed, 14 insertions(+), 16 deletions(-) diff --git a/node/node.go b/node/node.go index c2acfa7a8..35be24330 100644 --- a/node/node.go +++ b/node/node.go @@ -223,23 +223,21 @@ func makeNode( // Create the handshaker, which calls RequestInfo, sets the AppVersion on the state, // and replays any blocks as necessary to sync tendermint with the app. - if !stateSync { - if err := consensus.NewHandshaker( - logger.With("module", "handshaker"), - stateStore, state, blockStore, eventBus, genDoc, - ).Handshake(ctx, proxyApp); err != nil { - return nil, combineCloseError(err, makeCloser(closers)) - } + if err := consensus.NewHandshaker( + logger.With("module", "handshaker"), + stateStore, state, blockStore, eventBus, genDoc, + ).Handshake(ctx, proxyApp); err != nil { + return nil, combineCloseError(err, makeCloser(closers)) + } - // Reload the state. It will have the Version.Consensus.App set by the - // Handshake, and may have other modifications as well (ie. depending on - // what happened during block replay). - state, err = stateStore.Load() - if err != nil { - return nil, combineCloseError( - fmt.Errorf("cannot load state: %w", err), - makeCloser(closers)) - } + // Reload the state. It will have the Version.Consensus.App set by the + // Handshake, and may have other modifications as well (ie. depending on + // what happened during block replay). + state, err = stateStore.Load() + if err != nil { + return nil, combineCloseError( + fmt.Errorf("cannot load state: %w", err), + makeCloser(closers)) } logNodeStartupInfo(state, pubKey, logger, cfg.Mode)