config: backport the rename of fastsync to blocksync (#9259)

This is largely a cherry pick of #6755 with some additional fixups added where detected. 
This change moves the blockchain package to a package called blocksync. Additionally, it renames the relevant uses of the term `fastsync` to `blocksync`.

closes: #9227 

#### PR checklist

- [ ] Tests written/updated, or no tests needed
- [x] `CHANGELOG_PENDING.md` updated, or no changelog entry needed
- [x] Updated relevant documentation (`docs/`) and code comments, or no
      documentation updates needed
This commit is contained in:
William Banfield
2022-08-17 11:19:20 -04:00
committed by GitHub
parent 3003e05581
commit 1069ffc6aa
31 changed files with 235 additions and 197 deletions

View File

@@ -160,4 +160,4 @@ tendermint start
./build/node ./node.socket.toml
```
Check `node/config.go` to see how the settings of the test application can be tweaked.
Check `node/config.go` to see how the settings of the test application can be tweaked.

View File

@@ -28,7 +28,7 @@ var (
// FIXME: grpc disabled due to https://github.com/tendermint/tendermint/issues/5439
nodeABCIProtocols = uniformChoice{"unix", "tcp", "builtin"} // "grpc"
nodePrivvalProtocols = uniformChoice{"file", "unix", "tcp"}
nodeFastSyncs = uniformChoice{false, true}
nodeBlockSyncs = uniformChoice{"v0"} // "v2"
nodeStateSyncs = uniformChoice{false, true}
nodeMempools = uniformChoice{"v0", "v1"}
nodePersistIntervals = uniformChoice{0, 1, 5}
@@ -201,7 +201,7 @@ func generateNode(
StartAt: startAt,
Database: nodeDatabases.Choose(r).(string),
PrivvalProtocol: nodePrivvalProtocols.Choose(r).(string),
FastSync: nodeFastSyncs.Choose(r).(bool),
BlockSync: nodeBlockSyncs.Choose(r).(string),
Mempool: nodeMempools.Choose(r).(string),
StateSync: nodeStateSyncs.Choose(r).(bool) && startAt > 0,
PersistInterval: ptrUint64(uint64(nodePersistIntervals.Choose(r).(int))),

View File

@@ -63,10 +63,10 @@ abci_protocol = "builtin"
perturb = ["pause"]
[node.validator05]
block_sync = "v0"
start_at = 1005 # Becomes part of the validator set at 1010
seeds = ["seed02"]
database = "cleveldb"
fast_sync = true
mempool_version = "v1"
# FIXME: should be grpc, disabled due to https://github.com/tendermint/tendermint/issues/5439
#abci_protocol = "grpc"
@@ -76,7 +76,7 @@ perturb = ["kill", "pause", "disconnect", "restart"]
[node.full01]
start_at = 1010
mode = "full"
fast_sync = true
block_sync = "v0"
persistent_peers = ["validator01", "validator02", "validator03", "validator04", "validator05"]
retain_blocks = 1
perturb = ["restart"]
@@ -84,7 +84,7 @@ perturb = ["restart"]
[node.full02]
start_at = 1015
mode = "full"
fast_sync = true
block_sync = "v0"
state_sync = true
seeds = ["seed01"]
perturb = ["restart"]
@@ -97,4 +97,4 @@ persistent_peers = ["validator01", "validator02", "validator03"]
[node.light02]
mode= "light"
start_at= 1015
persistent_peers = ["validator04", "full01", "validator05"]
persistent_peers = ["validator04", "full01", "validator05"]

View File

@@ -88,8 +88,9 @@ type ManifestNode struct {
// runner will wait for the network to reach at least this block height.
StartAt int64 `toml:"start_at"`
// FastSync specifies whether to enable the fast sync protocol.
FastSync bool `toml:"fast_sync"`
// BlockSync specifies the block sync mode: "" (disable), "v0" or "v2".
// Defaults to disabled.
BlockSync string `toml:"block_sync"`
// Mempool specifies which version of mempool to use. Either "v0" or "v1"
// This defaults to v0.

View File

@@ -72,7 +72,7 @@ type Node struct {
IP net.IP
ProxyPort uint32
StartAt int64
FastSync bool
BlockSync string
StateSync bool
Mempool string
Database string
@@ -155,7 +155,7 @@ func LoadTestnet(file string) (*Testnet, error) {
ABCIProtocol: Protocol(testnet.ABCIProtocol),
PrivvalProtocol: ProtocolFile,
StartAt: nodeManifest.StartAt,
FastSync: nodeManifest.FastSync,
BlockSync: nodeManifest.BlockSync,
Mempool: nodeManifest.Mempool,
StateSync: nodeManifest.StateSync,
PersistInterval: 1,
@@ -297,6 +297,11 @@ func (n Node) Validate(testnet Testnet) error {
}
}
}
switch n.BlockSync {
case "", "v0":
default:
return fmt.Errorf("invalid block sync setting %q", n.BlockSync)
}
switch n.Mempool {
case "", "v0", "v1":
default:

View File

@@ -284,7 +284,11 @@ func MakeConfig(node *e2e.Node) (*config.Config, error) {
cfg.Mempool.Version = node.Mempool
}
cfg.FastSyncMode = node.FastSync
if node.BlockSync == "" {
cfg.BlockSyncMode = false
} else {
cfg.BlockSync.Version = node.BlockSync
}
if node.StateSync {
cfg.StateSync.Enable = true