remove v1 and v2 blocksync protocol impementations (#9146)

This commit is contained in:
Callum Waters
2022-08-02 11:30:28 +02:00
committed by Sam Ricotta
parent fac7143098
commit 7e4faf598c
38 changed files with 78 additions and 9755 deletions

View File

@@ -16,9 +16,7 @@ import (
dbm "github.com/tendermint/tm-db"
abci "github.com/tendermint/tendermint/abci/types"
bcv0 "github.com/tendermint/tendermint/blockchain/v0"
bcv1 "github.com/tendermint/tendermint/blockchain/v1"
bcv2 "github.com/tendermint/tendermint/blockchain/v2"
bc "github.com/tendermint/tendermint/blockchain"
cfg "github.com/tendermint/tendermint/config"
cs "github.com/tendermint/tendermint/consensus"
"github.com/tendermint/tendermint/crypto"
@@ -449,11 +447,9 @@ func createBlockchainReactor(config *cfg.Config,
switch config.FastSync.Version {
case "v0":
bcReactor = bcv0.NewBlockchainReactor(state.Copy(), blockExec, blockStore, fastSync)
case "v1":
bcReactor = bcv1.NewBlockchainReactor(state.Copy(), blockExec, blockStore, fastSync)
case "v2":
bcReactor = bcv2.NewBlockchainReactor(state.Copy(), blockExec, blockStore, fastSync)
bcReactor = bc.NewReactor(state.Copy(), blockExec, blockStore, fastSync)
case "v1", "v2":
return nil, fmt.Errorf("fast sync version %s has been deprecated. Please use v0", config.FastSync.Version)
default:
return nil, fmt.Errorf("unknown fastsync version %s", config.FastSync.Version)
}
@@ -1328,18 +1324,6 @@ func makeNodeInfo(
txIndexerStatus = "off"
}
var bcChannel byte
switch config.FastSync.Version {
case "v0":
bcChannel = bcv0.BlockchainChannel
case "v1":
bcChannel = bcv1.BlockchainChannel
case "v2":
bcChannel = bcv2.BlockchainChannel
default:
return p2p.DefaultNodeInfo{}, fmt.Errorf("unknown fastsync version %s", config.FastSync.Version)
}
nodeInfo := p2p.DefaultNodeInfo{
ProtocolVersion: p2p.NewProtocolVersion(
version.P2PProtocol, // global
@@ -1350,7 +1334,7 @@ func makeNodeInfo(
Network: genDoc.ChainID,
Version: version.TMCoreSemVer,
Channels: []byte{
bcChannel,
bc.BlockchainChannel,
cs.StateChannel, cs.DataChannel, cs.VoteChannel, cs.VoteSetBitsChannel,
mempl.MempoolChannel,
evidence.EvidenceChannel,