Skip to content

Commit 6c51752

Browse files
authored
feat: add sanity check for perfect peerdas (#1217)
1 parent b11ce6f commit 6c51752

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/package_io/input_parser.star

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -308,11 +308,21 @@ def input_parser(plan, input_args):
308308

309309
if result["network_params"]["fulu_fork_epoch"] != constants.FAR_FUTURE_EPOCH:
310310
has_supernodes = False
311+
num_perfect_peerdas_participants = 0
311312
for participant in result["participants"]:
313+
num_perfect_peerdas_participants += 1
312314
if participant.get("supernode", False):
313315
has_supernodes = True
314316
break
315317

318+
if result["network_params"]["perfect_peerdas_enabled"]:
319+
if num_perfect_peerdas_participants < 16:
320+
fail(
321+
"perfect_peerdas_enabled is true (this is a unique test if you don't know what it does, consider removing it) but the number of participants ({0}) is less than 16. Please set the number of participants to at least 16.".format(
322+
str(num_perfect_peerdas_participants)
323+
)
324+
)
325+
316326
if (
317327
not has_supernodes
318328
and not result["network_params"]["perfect_peerdas_enabled"]

0 commit comments

Comments
 (0)