def nodeChangesRequest(nodeSet): alpha = nodeSet.Alpha # Alpha should not be blacklisted for Invalid Signature by all other nodes # for node in nodeSet: # if node != alpha: # node.whitelistNode(alpha.name, 100) whitelistNode(alpha.name, [node for node in nodeSet if node != alpha], 100) makeNodeFaulty(alpha, changesRequest,)
def setup(nodeSet, up): primaryRep, nonPrimaryReps = getPrimaryReplica(nodeSet, 0), \ getNonPrimaryReplicas(nodeSet, 0) # A non primary replica sends duplicate PREPARE requests to all other # replicas faultyRep = nonPrimaryReps[0] makeNodeFaulty(faultyRep.node, partial(sendDuplicate3PhaseMsg, msgType=Prepare, count=3, instId=0)) # The node of the primary replica above should not be blacklisted by any # other node since we are simulating multiple PREPARE messages and # want to check for a particular suspicion whitelistNode(faultyRep.node.name, [node for node in nodeSet if node != faultyRep.node], Suspicions.DUPLICATE_PR_SENT.code) return adict(primaryRep=primaryRep, nonPrimaryReps=nonPrimaryReps, faultyRep=faultyRep)