diff --git a/CHANGELOG_PENDING.md b/CHANGELOG_PENDING.md index 0488e8b94..2117814d5 100644 --- a/CHANGELOG_PENDING.md +++ b/CHANGELOG_PENDING.md @@ -17,3 +17,4 @@ Friendly reminder, we have a [bug bounty program](https://hackerone.com/tendermi ### BUG FIXES: - [evidence] [\#5170](https://github.com/tendermint/tendermint/pull/5170) change abci evidence time to the time the infraction happened not the time the evidence was committed on the block (@cmwaters) +- [node] Don't attempt fast sync when the ABCI application specifies ourself as the only validator via `InitChain` (@erikgrinaker) diff --git a/node/node.go b/node/node.go index 6608945e5..4873920ef 100644 --- a/node/node.go +++ b/node/node.go @@ -666,9 +666,7 @@ func NewNode(config *cfg.Config, return nil, fmt.Errorf("can't get pubkey: %w", err) } - // Determine whether we should do state and/or fast sync. - // We don't fast-sync when the only validator is us. - fastSync := config.FastSyncMode && !onlyValidatorIsUs(state, pubKey) + // Determine whether we should attempt state sync. stateSync := config.StateSync.Enable && !onlyValidatorIsUs(state, pubKey) if stateSync && state.LastBlockHeight > 0 { logger.Info("Found local state with non-zero height, skipping state sync") @@ -689,6 +687,10 @@ func NewNode(config *cfg.Config, state = sm.LoadState(stateDB) } + // Determine whether we should do fast sync. This must happen after the handshake, since the + // app may modify the validator set, specifying ourself as the only validator. + fastSync := config.FastSyncMode && !onlyValidatorIsUs(state, pubKey) + logNodeStartupInfo(state, pubKey, logger, consensusLogger) csMetrics, p2pMetrics, memplMetrics, smMetrics := metricsProvider(genDoc.ChainID)