handling onenode trees

This commit is contained in:
0xFugue 2023-09-06 14:32:16 +05:30
parent 9f95b0a29a
commit 2ede615490

View File

@ -73,15 +73,17 @@ def main(ctx: typer.Context,
failure_threshold,
CARNOT_ADVERSARY_THRESHOLD_PER_COMMITTEE,
CARNOT_NETWORK_ADVERSARY_THRESHOLD)
tree_depth= math.ceil(math.log(num_comm, 2)) if num_comm > 1 else 1
tree_depth = 1 + int(math.log(num_comm, 2)) if num_comm > 1 else 1
num_nodes_branch= tree_depth * comm_size
print(
'''print(
f"num_nodes={num_nodes}, "
f"total_tree_nodes={num_comm}, comm_size={comm_size}, remainder={remainder}, computed={prob:f}(req={failure_threshold:f}), depth={tree_depth}"
)
'''
tree_spec = f"tree,{num_nodes},{comm_size},"
branch_spec = f"branch,{num_nodes_branch},{tree_depth},"
print(tree_spec)
print(branch_spec)