Added stage slice config to control stage time allocation. (#310)

This commit is contained in:
Ravin Perera
2021-05-19 16:59:01 +05:30
committed by GitHub
parent 94b29b9e05
commit 45492f7c7f
15 changed files with 148 additions and 110 deletions

View File

@@ -147,8 +147,10 @@ class PatchConfig {
}
if (!config.bin_path || !config.bin_path.length)
throw "Binary path cannot be empty.";
if (config.roundtime <= 0)
throw "Round time must be higher than zero."
if (config.roundtime < 1 && config.roundtime > 3600000)
throw "Round time must be between 1 and 3600000ms inclusive.";
if (config.stage_slice < 1 || config.stage_slice > 33)
throw "Stage slice must be between 1 and 33 percent inclusive.";
if (config.consensus != "public" && config.consensus != "private")
throw "Invalid consensus flag configured in patch file. Valid values: public|private";
if (config.npl != "public" && config.npl != "private")