From 4b6e7cc30db6fb7fa98fa29bd130ee32fb1b9d47 Mon Sep 17 00:00:00 2001 From: vyzo Date: Thu, 23 Mar 2023 18:52:37 +0200 Subject: [PATCH] add some sanity checks for execution concurrency parameters --- chain/vm/execution.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/chain/vm/execution.go b/chain/vm/execution.go index 66f82280b..b2573dffc 100644 --- a/chain/vm/execution.go +++ b/chain/vm/execution.go @@ -165,6 +165,15 @@ func init() { } } + // some sanity checks + if available < 2 { + panic("insufficient execution concurrency") + } + + if priority > available-1 { + panic("insufficient default execution concurrency") + } + mx := &sync.Mutex{} cond := sync.NewCond(mx)