From 204281fa666b3ecc5df355748180f03709b0e803 Mon Sep 17 00:00:00 2001 From: Sam Kleinman Date: Wed, 29 Jun 2022 22:12:36 -0400 Subject: [PATCH] node: always start blocksync and avoid misconfiguration (#8902) --- node/node.go | 15 ++++++--------- node/setup.go | 5 +---- 2 files changed, 7 insertions(+), 13 deletions(-) diff --git a/node/node.go b/node/node.go index e1de314d1..bea42b338 100644 --- a/node/node.go +++ b/node/node.go @@ -700,10 +700,8 @@ func (n *nodeImpl) OnStart() error { } if n.config.Mode != config.ModeSeed { - if n.config.BlockSync.Version == config.BlockSyncV0 { - if err := n.bcReactor.Start(); err != nil { - return err - } + if err := n.bcReactor.Start(); err != nil { + return err } // Start the real consensus reactor separately since the switch uses the shim. @@ -830,11 +828,10 @@ func (n *nodeImpl) OnStop() { if n.config.Mode != config.ModeSeed { // now stop the reactors - if n.config.BlockSync.Version == config.BlockSyncV0 { - // Stop the real blockchain reactor separately since the switch uses the shim. - if err := n.bcReactor.Stop(); err != nil { - n.Logger.Error("failed to stop the blockchain reactor", "err", err) - } + + // Stop the real blockchain reactor separately since the switch uses the shim. + if err := n.bcReactor.Stop(); err != nil { + n.Logger.Error("failed to stop the blockchain reactor", "err", err) } // Stop the real consensus reactor separately since the switch uses the shim. diff --git a/node/setup.go b/node/setup.go index 26a07e9ef..e94e85c78 100644 --- a/node/setup.go +++ b/node/setup.go @@ -17,7 +17,6 @@ import ( "github.com/tendermint/tendermint/config" "github.com/tendermint/tendermint/crypto" bcv0 "github.com/tendermint/tendermint/internal/blocksync/v0" - bcv2 "github.com/tendermint/tendermint/internal/blocksync/v2" "github.com/tendermint/tendermint/internal/consensus" "github.com/tendermint/tendermint/internal/evidence" "github.com/tendermint/tendermint/internal/mempool" @@ -746,10 +745,8 @@ func makeNodeInfo( switch cfg.BlockSync.Version { case config.BlockSyncV0: bcChannel = byte(bcv0.BlockSyncChannel) - case config.BlockSyncV2: - bcChannel = bcv2.BlockchainChannel - + return types.NodeInfo{}, fmt.Errorf("unsupported blocksync version %s", cfg.BlockSync.Version) default: return types.NodeInfo{}, fmt.Errorf("unknown blocksync version %s", cfg.BlockSync.Version) }