From d979ca279ba811a77572de7a119a93724b9d7ab9 Mon Sep 17 00:00:00 2001 From: Jasmina Malicevic Date: Sat, 16 Jul 2022 00:53:51 +0200 Subject: [PATCH] e2e: syncing nodes start from height 6 The snapshot height can be 5 and syncing nodes should start after this height to avoid shutting down due to missing snapshots. --- internal/statesync/reactor.go | 2 +- test/e2e/generator/generate.go | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/internal/statesync/reactor.go b/internal/statesync/reactor.go index e20fa0cb1..3a6599689 100644 --- a/internal/statesync/reactor.go +++ b/internal/statesync/reactor.go @@ -61,7 +61,7 @@ const ( // lightBlockResponseTimeout is how long the dispatcher waits for a peer to // return a light block - lightBlockResponseTimeout = 25 * time.Second + lightBlockResponseTimeout = 20 * time.Second // consensusParamsResponseTimeout is the time the p2p state provider waits // before performing a secondary call diff --git a/test/e2e/generator/generate.go b/test/e2e/generator/generate.go index d5d628aee..601c72c68 100644 --- a/test/e2e/generator/generate.go +++ b/test/e2e/generator/generate.go @@ -173,14 +173,14 @@ func generateTestnet(r *rand.Rand, opt map[string]interface{}) (e2e.Manifest, er // Next, we generate validators. We make sure a BFT quorum of validators start // at the initial height, and that we have two archive nodes. We also set up // the initial validator set, and validator set updates for delayed nodes. - nextStartAt := manifest.InitialHeight + 5 + nextStartAt := manifest.InitialHeight + 6 quorum := numValidators*2/3 + 1 for i := 1; i <= numValidators; i++ { startAt := int64(0) if i > quorum && numSyncingNodes < 2 && r.Float64() >= 0.25 { numSyncingNodes++ startAt = nextStartAt - nextStartAt += 5 + nextStartAt += 6 } name := fmt.Sprintf("validator%02d", i) node := generateNode(r, manifest, e2e.ModeValidator, startAt, i <= 2) @@ -190,7 +190,7 @@ func generateTestnet(r *rand.Rand, opt map[string]interface{}) (e2e.Manifest, er if startAt == 0 { (*manifest.Validators)[name] = int64(30 + r.Intn(71)) } else { - manifest.ValidatorUpdates[fmt.Sprint(startAt+5)] = map[string]int64{ + manifest.ValidatorUpdates[fmt.Sprint(startAt+6)] = map[string]int64{ name: int64(30 + r.Intn(71)), } } @@ -212,7 +212,7 @@ func generateTestnet(r *rand.Rand, opt map[string]interface{}) (e2e.Manifest, er if numSyncingNodes < 2 && r.Float64() >= 0.5 { numSyncingNodes++ startAt = nextStartAt - nextStartAt += 5 + nextStartAt += 6 } node := generateNode(r, manifest, e2e.ModeFull, startAt, false) @@ -276,7 +276,7 @@ func generateTestnet(r *rand.Rand, opt map[string]interface{}) (e2e.Manifest, er // lastly, set up the light clients for i := 1; i <= numLightClients; i++ { - startAt := manifest.InitialHeight + 5 + startAt := manifest.InitialHeight + 6 node := generateLightNode(r, startAt+(5*int64(i)), lightProviders) @@ -316,7 +316,7 @@ func generateNode( if startAt > 0 { node.StateSync = nodeStateSyncs.Choose(r) - if manifest.InitialHeight-startAt <= 5 && node.StateSync == e2e.StateSyncDisabled { + if manifest.InitialHeight-startAt <= 6 && node.StateSync == e2e.StateSyncDisabled { // avoid needing to blocsync more than five total blocks. node.StateSync = uniformSetChoice([]string{ e2e.StateSyncP2P,