The MAX_NODE constant from the test framework is used to compute the port number for the p2p interface and limit the number of network threads the framework can start. But the same constant is used to assert that no test is using more deterministic key that defined in the TestNode, which is completely unrelated. This means that MAX_NODE cannot be increased without pre computing a lot of keys even if no test is using more than the actual 12 defined.
This diff decorrelates the constant from the number of deterministic keys so MAX_NODE can be increased without having to extend the keys at the same time, while improving the error message in case of misuse. This will make it possible to increase MAX_NODES in the future to add more outbound peer slots to the node, which will help gathering avalanche node addresses.
There is no change in behavior since no test is actually using more than 12 nodes.
Ref T1696.