Adding a new schain may potentially hit the gas limit  Pending
When adding a new schain, a group of random 16 nodes is randomly selected to run that schain. In order to do so, the `_generateGroup` function iterates over all the nodes that can be used for that purpose:\\n```\\nfunction \\_generateGroup(bytes32 schainId, uint numberOfNodes) private returns (uint[] memory nodesInGroup) {\\n    Nodes nodes = Nodes(contractManager.getContract("Nodes"));\\n    uint8 space = schains[schainId].partOfNode;\\n    nodesInGroup = new uint[](numberOfNodes);\\n\\n    uint[] memory possibleNodes = isEnoughNodes(schainId);\\n    require(possibleNodes.length >= nodesInGroup.length, "Not enough nodes to create Schain");\\n    uint ignoringTail = 0;\\n    uint random = uint(keccak256(abi.encodePacked(uint(blockhash(block.number.sub(1))), schainId)));\\n    for (uint i = 0; i < nodesInGroup.length; ++i) {\\n        uint index = random % (possibleNodes.length.sub(ignoringTail));\\n        uint node = possibleNodes[index];\\n        nodesInGroup[i] = node;\\n        \\_swap(possibleNodes, index, possibleNodes.length.sub(ignoringTail).sub(1));\\n        ++ignoringTail;\\n\\n        \\_exceptionsForGroups[schainId][node] = true;\\n        addSchainForNode(node, schainId);\\n        require(nodes.removeSpaceFromNode(node, space), "Could not remove space from Node");\\n    }\\n```\\n\\nIf the total number of nodes exceeds around a few thousands, adding a schain may hit the block gas limit.
Avoid iterating over all nodes when selecting a random node for a schain.
```\\nfunction \\_generateGroup(bytes32 schainId, uint numberOfNodes) private returns (uint[] memory nodesInGroup) {\\n    Nodes nodes = Nodes(contractManager.getContract("Nodes"));\\n    uint8 space = schains[schainId].partOfNode;\\n    nodesInGroup = new uint[](numberOfNodes);\\n\\n    uint[] memory possibleNodes = isEnoughNodes(schainId);\\n    require(possibleNodes.length >= nodesInGroup.length, "Not enough nodes to create Schain");\\n    uint ignoringTail = 0;\\n    uint random = uint(keccak256(abi.encodePacked(uint(blockhash(block.number.sub(1))), schainId)));\\n    for (uint i = 0; i < nodesInGroup.length; ++i) {\\n        uint index = random % (possibleNodes.length.sub(ignoringTail));\\n        uint node = possibleNodes[index];\\n        nodesInGroup[i] = node;\\n        \\_swap(possibleNodes, index, possibleNodes.length.sub(ignoringTail).sub(1));\\n        ++ignoringTail;\\n\\n        \\_exceptionsForGroups[schainId][node] = true;\\n        addSchainForNode(node, schainId);\\n        require(nodes.removeSpaceFromNode(node, space), "Could not remove space from Node");\\n    }\\n```\\n