Contract process resource limits. (#243)

This commit is contained in:
Ravin Perera
2021-02-15 16:36:10 +05:30
committed by GitHub
parent 3783c687a2
commit 4c4e109233
7 changed files with 83 additions and 8 deletions

View File

@@ -144,7 +144,8 @@ class PatchConfig {
throw "Invalid consensus flag configured in patch file. Valid values: public|private";
if (config.npl != "public" && config.npl != "private")
throw "Invalid npl flag configured in patch file. Valid values: public|private";
if (config.round_limits.user_input_bytes < 0 || config.round_limits.user_output_bytes < 0 || config.round_limits.npl_output_bytes < 0)
if (config.round_limits.user_input_bytes < 0 || config.round_limits.user_output_bytes < 0 || config.round_limits.npl_output_bytes < 0 ||
config.round_limits.proc_cpu_seconds < 0 || config.round_limits.proc_mem_bytes < 0 || config.round_limits.proc_ofd_count < 0)
throw "Invalid round limits.";
}
}