From 97a8f125e064fa328266dc60f3c22b8b4ea47fe2 Mon Sep 17 00:00:00 2001 From: Callum Waters Date: Thu, 22 Jul 2021 17:59:02 +0200 Subject: [PATCH] e2e: allow for both v0 and v1 mempool implementations (#6752) --- test/e2e/generator/generate.go | 2 ++ test/e2e/pkg/manifest.go | 3 +++ test/e2e/pkg/testnet.go | 7 +++++++ test/e2e/runner/setup.go | 4 ++++ 4 files changed, 16 insertions(+) diff --git a/test/e2e/generator/generate.go b/test/e2e/generator/generate.go index 554384d97..1e134cf71 100644 --- a/test/e2e/generator/generate.go +++ b/test/e2e/generator/generate.go @@ -31,6 +31,7 @@ var ( nodePrivvalProtocols = uniformChoice{"file", "unix", "tcp", "grpc"} // FIXME: v2 disabled due to flake nodeFastSyncs = uniformChoice{"v0"} // "v2" + nodeMempools = uniformChoice{"v0", "v1"} nodeStateSyncs = uniformChoice{false, true} nodePersistIntervals = uniformChoice{0, 1, 5} nodeSnapshotIntervals = uniformChoice{0, 3} @@ -273,6 +274,7 @@ func generateNode( ABCIProtocol: nodeABCIProtocols.Choose(r).(string), PrivvalProtocol: nodePrivvalProtocols.Choose(r).(string), FastSync: nodeFastSyncs.Choose(r).(string), + Mempool: nodeMempools.Choose(r).(string), StateSync: nodeStateSyncs.Choose(r).(bool) && startAt > 0, PersistInterval: ptrUint64(uint64(nodePersistIntervals.Choose(r).(int))), SnapshotInterval: uint64(nodeSnapshotIntervals.Choose(r).(int)), diff --git a/test/e2e/pkg/manifest.go b/test/e2e/pkg/manifest.go index 5320c4637..89b38e02a 100644 --- a/test/e2e/pkg/manifest.go +++ b/test/e2e/pkg/manifest.go @@ -110,6 +110,9 @@ type ManifestNode struct { // Defaults to disabled. 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 // 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 diff --git a/test/e2e/pkg/testnet.go b/test/e2e/pkg/testnet.go index a5cec0147..d54df4406 100644 --- a/test/e2e/pkg/testnet.go +++ b/test/e2e/pkg/testnet.go @@ -80,6 +80,7 @@ type Node struct { ProxyPort uint32 StartAt int64 FastSync string + Mempool string StateSync bool Database string ABCIProtocol Protocol @@ -168,6 +169,7 @@ func LoadTestnet(file string) (*Testnet, error) { PrivvalProtocol: ProtocolFile, StartAt: nodeManifest.StartAt, FastSync: nodeManifest.FastSync, + Mempool: nodeManifest.Mempool, StateSync: nodeManifest.StateSync, PersistInterval: 1, SnapshotInterval: nodeManifest.SnapshotInterval, @@ -331,6 +333,11 @@ func (n Node) Validate(testnet Testnet) error { default: 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 { case "", "priority", "wdrr", "fifo": default: diff --git a/test/e2e/runner/setup.go b/test/e2e/runner/setup.go index c2b61617e..c80d05b22 100644 --- a/test/e2e/runner/setup.go +++ b/test/e2e/runner/setup.go @@ -292,6 +292,10 @@ func MakeConfig(node *e2e.Node) (*config.Config, error) { return nil, fmt.Errorf("unexpected mode %q", node.Mode) } + if node.Mempool != "" { + cfg.Mempool.Version = node.Mempool + } + if node.FastSync == "" { cfg.FastSyncMode = false } else {