mirror of
https://github.com/logos-blockchain/logos-blockchain-specs.git
synced 2026-01-09 08:33:09 +00:00
Raise error on too small network
This commit is contained in:
parent
c7c5750b92
commit
9098d0c11f
@ -134,6 +134,8 @@ def calculate_subnetwork_assignations(
|
||||
replication_factor: int,
|
||||
random_seed: bytes,
|
||||
) -> Assignations:
|
||||
if len(new_nodes_list) < replication_factor:
|
||||
raise ValueError("The network size is smaller than the replication factor")
|
||||
# The algorithm works as follows:
|
||||
# 1. Remove nodes that are not active from the previous subnetworks assignations
|
||||
# 2. If the network is decreasing (less available nodes than previous nodes), balance subnetworks:
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user