A node exit prevents some other nodes from exiting for some period  Pending
When a node wants to exit, the `nodeExit` function should be called as many times, as there are schains in the node. Each time one schain is getting removed from the node. During every call, all the active schains are getting frozen for 12 hours.\\n```\\nfunction freezeSchains(uint nodeIndex) external allow("SkaleManager") {\\n    SchainsInternal schainsInternal = SchainsInternal(contractManager.getContract("SchainsInternal"));\\n    bytes32[] memory schains = schainsInternal.getActiveSchains(nodeIndex);\\n    for (uint i = 0; i < schains.length; i++) {\\n        Rotation memory rotation = rotations[schains[i]];\\n        if (rotation.nodeIndex == nodeIndex && now < rotation.freezeUntil) {\\n            continue;\\n        }\\n        string memory schainName = schainsInternal.getSchainName(schains[i]);\\n        string memory revertMessage = "Node cannot rotate on Schain ";\\n        revertMessage = revertMessage.strConcat(schainName);\\n        revertMessage = revertMessage.strConcat(", occupied by Node ");\\n        revertMessage = revertMessage.strConcat(rotation.nodeIndex.uint2str());\\n        string memory dkgRevert = "DKG process did not finish on schain ";\\n        ISkaleDKG skaleDKG = ISkaleDKG(contractManager.getContract("SkaleDKG"));\\n        require(\\n            skaleDKG.isLastDKGSuccessful(keccak256(abi.encodePacked(schainName))),\\n            dkgRevert.strConcat(schainName));\\n        require(rotation.freezeUntil < now, revertMessage);\\n        \\_startRotation(schains[i], nodeIndex);\\n    }\\n}\\n```\\n\\nBecause of that, no other node that is running one of these schains can exit during that period. In the worst-case scenario, one malicious node has 128 Schains and calls `nodeExit` every 12 hours. That means that some nodes will not be able to exit for 64 days.
Make node exiting process less synchronous.
```\\nfunction freezeSchains(uint nodeIndex) external allow("SkaleManager") {\\n    SchainsInternal schainsInternal = SchainsInternal(contractManager.getContract("SchainsInternal"));\\n    bytes32[] memory schains = schainsInternal.getActiveSchains(nodeIndex);\\n    for (uint i = 0; i < schains.length; i++) {\\n        Rotation memory rotation = rotations[schains[i]];\\n        if (rotation.nodeIndex == nodeIndex && now < rotation.freezeUntil) {\\n            continue;\\n        }\\n        string memory schainName = schainsInternal.getSchainName(schains[i]);\\n        string memory revertMessage = "Node cannot rotate on Schain ";\\n        revertMessage = revertMessage.strConcat(schainName);\\n        revertMessage = revertMessage.strConcat(", occupied by Node ");\\n        revertMessage = revertMessage.strConcat(rotation.nodeIndex.uint2str());\\n        string memory dkgRevert = "DKG process did not finish on schain ";\\n        ISkaleDKG skaleDKG = ISkaleDKG(contractManager.getContract("SkaleDKG"));\\n        require(\\n            skaleDKG.isLastDKGSuccessful(keccak256(abi.encodePacked(schainName))),\\n            dkgRevert.strConcat(schainName));\\n        require(rotation.freezeUntil < now, revertMessage);\\n        \\_startRotation(schains[i], nodeIndex);\\n    }\\n}\\n```\\n