diff --git a/test/e2e/generator/generate.go b/test/e2e/generator/generate.go index 21b3ebe0a..75342f4e7 100644 --- a/test/e2e/generator/generate.go +++ b/test/e2e/generator/generate.go @@ -44,9 +44,10 @@ var ( "tcp": 20, "unix": 10, } - // FIXME: v2 disabled due to flake - nodeBlockSyncs = uniformChoice{"v0"} // "v2" - nodeMempools = uniformChoice{"v0", "v1"} + nodeMempools = weightedChoice{ + "v0": 20, + "v1": 80, + } nodeStateSyncs = weightedChoice{ e2e.StateSyncDisabled: 10, e2e.StateSyncP2P: 45, @@ -54,8 +55,12 @@ var ( } nodePersistIntervals = uniformChoice{0, 1, 5} nodeSnapshotIntervals = uniformChoice{0, 5} - nodeRetainBlocks = uniformChoice{0, 2 * int(e2e.EvidenceAgeHeight), 4 * int(e2e.EvidenceAgeHeight)} - nodePerturbations = probSetChoice{ + nodeRetainBlocks = uniformChoice{ + 0, + 2 * int(e2e.EvidenceAgeHeight), + 4 * int(e2e.EvidenceAgeHeight), + } + nodePerturbations = probSetChoice{ "disconnect": 0.1, "pause": 0.1, "kill": 0.1, @@ -236,13 +241,9 @@ func generateTestnet(r *rand.Rand, opt map[string]interface{}) (e2e.Manifest, er // choose one of the seeds manifest.Nodes[name].Seeds = uniformSetChoice(seedNames).Choose(r) - } else if i > 0 { + } else if i > 1 && r.Float64() >= 0.5 { peers := uniformSetChoice(peerNames[:i]) - if manifest.Nodes[name].StateSync == e2e.StateSyncP2P { - manifest.Nodes[name].PersistentPeers = peers.ChooseAtLeast(r, 2) - } else { - manifest.Nodes[name].PersistentPeers = peers.Choose(r) - } + manifest.Nodes[name].PersistentPeers = peers.ChooseAtLeast(r, 2) } } @@ -250,9 +251,7 @@ func generateTestnet(r *rand.Rand, opt map[string]interface{}) (e2e.Manifest, er for i := 1; i <= numLightClients; i++ { startAt := manifest.InitialHeight + 5 - node := generateLightNode( - r, startAt+(5*int64(i)), lightProviders, - ) + node := generateLightNode(r, startAt+(5*int64(i)), lightProviders) manifest.Nodes[fmt.Sprintf("light%02d", i)] = node @@ -278,8 +277,7 @@ func generateNode( Database: nodeDatabases.Choose(r), ABCIProtocol: nodeABCIProtocols.Choose(r), PrivvalProtocol: nodePrivvalProtocols.Choose(r), - BlockSync: nodeBlockSyncs.Choose(r).(string), - Mempool: nodeMempools.Choose(r).(string), + Mempool: nodeMempools.Choose(r), StateSync: e2e.StateSyncDisabled, PersistInterval: ptrUint64(uint64(nodePersistIntervals.Choose(r).(int))), SnapshotInterval: uint64(nodeSnapshotIntervals.Choose(r).(int)), @@ -326,10 +324,6 @@ func generateNode( } } - if node.StateSync != e2e.StateSyncDisabled { - node.BlockSync = "v0" - } - return &node } diff --git a/test/e2e/generator/generate_test.go b/test/e2e/generator/generate_test.go index b7f790259..79a20f27e 100644 --- a/test/e2e/generator/generate_test.go +++ b/test/e2e/generator/generate_test.go @@ -31,8 +31,8 @@ func TestGenerator(t *testing.T) { } if node.StateSync != e2e.StateSyncDisabled { require.Zero(t, node.Seeds, node.StateSync) - require.True(t, len(node.PersistentPeers) >= 2) - require.Equal(t, "v0", node.BlockSync) + require.True(t, len(node.PersistentPeers) >= 2 || len(node.PersistentPeers) == 0, + "peers: %v", node.PersistentPeers) } }) diff --git a/test/e2e/pkg/testnet.go b/test/e2e/pkg/testnet.go index 1daa8b87c..a6d5b2485 100644 --- a/test/e2e/pkg/testnet.go +++ b/test/e2e/pkg/testnet.go @@ -172,7 +172,7 @@ func LoadTestnet(file string) (*Testnet, error) { ABCIProtocol: ProtocolBuiltin, PrivvalProtocol: ProtocolFile, StartAt: nodeManifest.StartAt, - BlockSync: nodeManifest.BlockSync, + BlockSync: "v0", Mempool: nodeManifest.Mempool, StateSync: nodeManifest.StateSync, PersistInterval: 1,