From f386f83adec46b1bf531201eba02b4f66a0577c4 Mon Sep 17 00:00:00 2001 From: Jernej Kos Date: Tue, 2 Feb 2021 10:46:45 +0100 Subject: [PATCH] e2e/runtime/runtime-dynamic: Ensure nodes are eligible for election Since the PVSS random beacon nodes may be ineligible for committee election on first registration if they register after the commit phase. This adds an extra epoch transition to the E2E test. --- .../scenario/e2e/runtime/runtime_dynamic.go | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/go/oasis-test-runner/scenario/e2e/runtime/runtime_dynamic.go b/go/oasis-test-runner/scenario/e2e/runtime/runtime_dynamic.go index 296318cde67..9596a7b1074 100644 --- a/go/oasis-test-runner/scenario/e2e/runtime/runtime_dynamic.go +++ b/go/oasis-test-runner/scenario/e2e/runtime/runtime_dynamic.go @@ -250,6 +250,12 @@ func (sc *runtimeDynamicImpl) Run(childEnv *env.Env) error { // nolint: gocyclo } } + // Perform an epoch transition to make sure all nodes are eligible. They may not be eligible + // if they have registered after the beacon commit phase. + if err := sc.epochTransition(ctx); err != nil { + return err + } + for i := 0; i < 5; i++ { // Perform another epoch transition to elect compute runtime committees. if err := sc.epochTransition(ctx); err != nil { @@ -361,6 +367,12 @@ func (sc *runtimeDynamicImpl) Run(childEnv *env.Env) error { // nolint: gocyclo } } + // Perform an epoch transition to make sure all nodes are eligible. They may not be eligible + // if they have registered after the beacon commit phase. + if err = sc.epochTransition(ctx); err != nil { + return err + } + // Epoch transition. if err = sc.epochTransition(ctx); err != nil { return err