Browse Source

blockchain: enable v2 to be set (#4597)

* blockchain: enable v2 to be set

- enable v2 to be set via config params

Signed-off-by: Marko Baricevic <marbar3778@yahoo.com>

* replace tab with space

* correctly spell usability
pull/4601/head
Marko 5 years ago
committed by GitHub
parent
commit
18d44a0186
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 0 deletions
  1. +1
    -0
      config/toml.go
  2. +5
    -0
      node/node.go

+ 1
- 0
config/toml.go View File

@ -321,6 +321,7 @@ max_tx_bytes = {{ .Mempool.MaxTxBytes }}
# Fast Sync version to use: # Fast Sync version to use:
# 1) "v0" (default) - the legacy fast sync implementation # 1) "v0" (default) - the legacy fast sync implementation
# 2) "v1" - refactor of v0 version for better testability # 2) "v1" - refactor of v0 version for better testability
# 3) "v2" - refactor of v1 version for better usability
version = "{{ .FastSync.Version }}" version = "{{ .FastSync.Version }}"
##### consensus configuration options ##### ##### consensus configuration options #####


+ 5
- 0
node/node.go View File

@ -22,6 +22,7 @@ import (
abci "github.com/tendermint/tendermint/abci/types" abci "github.com/tendermint/tendermint/abci/types"
bcv0 "github.com/tendermint/tendermint/blockchain/v0" bcv0 "github.com/tendermint/tendermint/blockchain/v0"
bcv1 "github.com/tendermint/tendermint/blockchain/v1" bcv1 "github.com/tendermint/tendermint/blockchain/v1"
bcv2 "github.com/tendermint/tendermint/blockchain/v2"
cfg "github.com/tendermint/tendermint/config" cfg "github.com/tendermint/tendermint/config"
"github.com/tendermint/tendermint/consensus" "github.com/tendermint/tendermint/consensus"
cs "github.com/tendermint/tendermint/consensus" cs "github.com/tendermint/tendermint/consensus"
@ -366,6 +367,8 @@ func createBlockchainReactor(config *cfg.Config,
bcReactor = bcv0.NewBlockchainReactor(state.Copy(), blockExec, blockStore, fastSync) bcReactor = bcv0.NewBlockchainReactor(state.Copy(), blockExec, blockStore, fastSync)
case "v1": case "v1":
bcReactor = bcv1.NewBlockchainReactor(state.Copy(), blockExec, blockStore, fastSync) bcReactor = bcv1.NewBlockchainReactor(state.Copy(), blockExec, blockStore, fastSync)
case "v2":
bcReactor = bcv2.NewBlockchainReactor(state.Copy(), blockExec, blockStore, fastSync)
default: default:
return nil, fmt.Errorf("unknown fastsync version %s", config.FastSync.Version) return nil, fmt.Errorf("unknown fastsync version %s", config.FastSync.Version)
} }
@ -1094,6 +1097,8 @@ func makeNodeInfo(
bcChannel = bcv0.BlockchainChannel bcChannel = bcv0.BlockchainChannel
case "v1": case "v1":
bcChannel = bcv1.BlockchainChannel bcChannel = bcv1.BlockchainChannel
case "v2":
bcChannel = bcv2.BlockchainChannel
default: default:
return nil, fmt.Errorf("unknown fastsync version %s", config.FastSync.Version) return nil, fmt.Errorf("unknown fastsync version %s", config.FastSync.Version)
} }


Loading…
Cancel
Save