Browse Source

e2e: allow for both v0 and v1 mempool implementations (#6752)

pull/6777/head
Callum Waters 3 years ago
committed by GitHub
parent
commit
97a8f125e0
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 16 additions and 0 deletions
  1. +2
    -0
      test/e2e/generator/generate.go
  2. +3
    -0
      test/e2e/pkg/manifest.go
  3. +7
    -0
      test/e2e/pkg/testnet.go
  4. +4
    -0
      test/e2e/runner/setup.go

+ 2
- 0
test/e2e/generator/generate.go View File

@ -31,6 +31,7 @@ var (
nodePrivvalProtocols = uniformChoice{"file", "unix", "tcp", "grpc"} nodePrivvalProtocols = uniformChoice{"file", "unix", "tcp", "grpc"}
// FIXME: v2 disabled due to flake // FIXME: v2 disabled due to flake
nodeFastSyncs = uniformChoice{"v0"} // "v2" nodeFastSyncs = uniformChoice{"v0"} // "v2"
nodeMempools = uniformChoice{"v0", "v1"}
nodeStateSyncs = uniformChoice{false, true} nodeStateSyncs = uniformChoice{false, true}
nodePersistIntervals = uniformChoice{0, 1, 5} nodePersistIntervals = uniformChoice{0, 1, 5}
nodeSnapshotIntervals = uniformChoice{0, 3} nodeSnapshotIntervals = uniformChoice{0, 3}
@ -273,6 +274,7 @@ func generateNode(
ABCIProtocol: nodeABCIProtocols.Choose(r).(string), ABCIProtocol: nodeABCIProtocols.Choose(r).(string),
PrivvalProtocol: nodePrivvalProtocols.Choose(r).(string), PrivvalProtocol: nodePrivvalProtocols.Choose(r).(string),
FastSync: nodeFastSyncs.Choose(r).(string), FastSync: nodeFastSyncs.Choose(r).(string),
Mempool: nodeMempools.Choose(r).(string),
StateSync: nodeStateSyncs.Choose(r).(bool) && startAt > 0, StateSync: nodeStateSyncs.Choose(r).(bool) && startAt > 0,
PersistInterval: ptrUint64(uint64(nodePersistIntervals.Choose(r).(int))), PersistInterval: ptrUint64(uint64(nodePersistIntervals.Choose(r).(int))),
SnapshotInterval: uint64(nodeSnapshotIntervals.Choose(r).(int)), SnapshotInterval: uint64(nodeSnapshotIntervals.Choose(r).(int)),


+ 3
- 0
test/e2e/pkg/manifest.go View File

@ -110,6 +110,9 @@ type ManifestNode struct {
// Defaults to disabled. // Defaults to disabled.
FastSync string `toml:"fast_sync"` FastSync string `toml:"fast_sync"`
// Mempool specifies which version of mempool to use. Either "v0" or "v1"
Mempool string `toml:"mempool_version"`
// StateSync enables state sync. The runner automatically configures trusted // StateSync enables state sync. The runner automatically configures trusted
// block hashes and RPC servers. At least one node in the network must have // block hashes and RPC servers. At least one node in the network must have
// SnapshotInterval set to non-zero, and the state syncing node must have // SnapshotInterval set to non-zero, and the state syncing node must have


+ 7
- 0
test/e2e/pkg/testnet.go View File

@ -80,6 +80,7 @@ type Node struct {
ProxyPort uint32 ProxyPort uint32
StartAt int64 StartAt int64
FastSync string FastSync string
Mempool string
StateSync bool StateSync bool
Database string Database string
ABCIProtocol Protocol ABCIProtocol Protocol
@ -168,6 +169,7 @@ func LoadTestnet(file string) (*Testnet, error) {
PrivvalProtocol: ProtocolFile, PrivvalProtocol: ProtocolFile,
StartAt: nodeManifest.StartAt, StartAt: nodeManifest.StartAt,
FastSync: nodeManifest.FastSync, FastSync: nodeManifest.FastSync,
Mempool: nodeManifest.Mempool,
StateSync: nodeManifest.StateSync, StateSync: nodeManifest.StateSync,
PersistInterval: 1, PersistInterval: 1,
SnapshotInterval: nodeManifest.SnapshotInterval, SnapshotInterval: nodeManifest.SnapshotInterval,
@ -331,6 +333,11 @@ func (n Node) Validate(testnet Testnet) error {
default: default:
return fmt.Errorf("invalid fast sync setting %q", n.FastSync) return fmt.Errorf("invalid fast sync setting %q", n.FastSync)
} }
switch n.Mempool {
case "", "v0", "v1":
default:
return fmt.Errorf("invalid mempool version %q", n.Mempool)
}
switch n.QueueType { switch n.QueueType {
case "", "priority", "wdrr", "fifo": case "", "priority", "wdrr", "fifo":
default: default:


+ 4
- 0
test/e2e/runner/setup.go View File

@ -292,6 +292,10 @@ func MakeConfig(node *e2e.Node) (*config.Config, error) {
return nil, fmt.Errorf("unexpected mode %q", node.Mode) return nil, fmt.Errorf("unexpected mode %q", node.Mode)
} }
if node.Mempool != "" {
cfg.Mempool.Version = node.Mempool
}
if node.FastSync == "" { if node.FastSync == "" {
cfg.FastSyncMode = false cfg.FastSyncMode = false
} else { } else {


Loading…
Cancel
Save