gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] r36499 - in gnunet/src: consensus include set


From: gnunet
Subject: [GNUnet-SVN] r36499 - in gnunet/src: consensus include set
Date: Sun, 11 Oct 2015 21:16:15 +0200

Author: dold
Date: 2015-10-11 21:16:15 +0200 (Sun, 11 Oct 2015)
New Revision: 36499

Modified:
   gnunet/src/consensus/gnunet-consensus-profiler.c
   gnunet/src/consensus/gnunet-service-consensus.c
   gnunet/src/consensus/test_consensus.conf
   gnunet/src/include/gnunet_consensus_service.h
   gnunet/src/set/gnunet-service-set_union_strata_estimator.c
Log:
consensus

Modified: gnunet/src/consensus/gnunet-consensus-profiler.c
===================================================================
--- gnunet/src/consensus/gnunet-consensus-profiler.c    2015-10-11 09:27:47 UTC 
(rev 36498)
+++ gnunet/src/consensus/gnunet-consensus-profiler.c    2015-10-11 19:16:15 UTC 
(rev 36499)
@@ -86,6 +86,44 @@
 
 
 static void
+statistics_done_db (void *cls,
+                    struct
+                    GNUNET_TESTBED_Operation
+                    *op,
+                    const char *emsg)
+{
+  GNUNET_assert (NULL == emsg);
+  GNUNET_TESTBED_operation_done (op);
+  printf ("statistics done\n");
+  GNUNET_SCHEDULER_shutdown ();
+}
+
+
+/**
+ * Callback function to process statistic values from all peers.
+ *
+ * @param cls closure
+ * @param peer the peer the statistic belong to
+ * @param subsystem name of subsystem that created the statistic
+ * @param name the name of the datum
+ * @param value the current value
+ * @param is_persistent GNUNET_YES if the value is persistent, GNUNET_NO if not
+ * @return GNUNET_OK to continue, GNUNET_SYSERR to abort iteration
+ */
+static int
+statistics_cb (void *cls,
+               const struct GNUNET_TESTBED_Peer *peer,
+               const char *subsystem,
+               const char *name,
+               uint64_t value,
+               int is_persistent)
+{
+  printf ("stat P%u: %s/%s=%lu\n", GNUNET_TESTBED_get_index (peer), subsystem, 
name, (unsigned long) value);
+  return GNUNET_OK;
+}
+
+
+static void
 destroy (void *cls, const struct GNUNET_SCHEDULER_TaskContext *ctx)
 {
   struct GNUNET_CONSENSUS_Handle *consensus = cls;
@@ -104,7 +142,10 @@
               i,
               results_for_peer[i],
               num_values);
-    GNUNET_SCHEDULER_shutdown ();
+    GNUNET_TESTBED_get_statistics (num_peers, peers, NULL, NULL,
+                                   statistics_cb,
+                                   statistics_done_db,
+                                   NULL);
   }
 }
 

Modified: gnunet/src/consensus/gnunet-service-consensus.c
===================================================================
--- gnunet/src/consensus/gnunet-service-consensus.c     2015-10-11 09:27:47 UTC 
(rev 36498)
+++ gnunet/src/consensus/gnunet-service-consensus.c     2015-10-11 19:16:15 UTC 
(rev 36499)
@@ -33,7 +33,6 @@
 #include "consensus_protocol.h"
 #include "consensus.h"
 
-#define GNUNET_CONSENSUS_ELEMENT_TYPE_USER_MAX 1 // FIXME
 #define ELEMENT_TYPE_CONTESTED_MARKER (GNUNET_CONSENSUS_ELEMENT_TYPE_USER_MAX 
+ 1)
 
 
@@ -808,6 +807,7 @@
   return ret;
 }
 
+
 static void
 rfn_vote (struct ReferendumEntry *rfn,
           uint16_t voting_peer,
@@ -2259,6 +2259,8 @@
   /* Given the fully constructed task graph
      with rounds for tasks, we can give the tasks timeouts. */
 
+  // unsigned int max_round;
+
   /* XXX: implement! */
 }
 

Modified: gnunet/src/consensus/test_consensus.conf
===================================================================
--- gnunet/src/consensus/test_consensus.conf    2015-10-11 09:27:47 UTC (rev 
36498)
+++ gnunet/src/consensus/test_consensus.conf    2015-10-11 19:16:15 UTC (rev 
36499)
@@ -1,15 +1,19 @@
address@hidden@ ../../contrib/no_forcestart.conf
+[arm]
+RESOURCE_DIAGNOSTICS = resource.log
 
 [PATHS]
 GNUNET_TEST_HOME = /tmp/test-consensus/
 
 [consensus]
-PREFIX = valgrind
+#PREFIX = time -a -o time.out -f real:_%E_user:_%U_sys:_%S
+#PREFIX = time -a -o time.out -f real:_%E_user:_%U_sys:_%S
 OPTIONS = -L INFO
 BINARY = gnunet-service-evil-consensus
 
-EVIL_SPEC = 0;cram;5
+#EVIL_SPEC = 0;cram;5/1;cram;5
+#EVIL_SPEC = 0;cram;5/1;cram;3
 
+
 # Evil behavior: Peer 0 adds 5 random elements when he is the gradecast leader
 # (every peer gets the same element.
 #EVIL_SPEC = 0;stuff-same;leader;5
@@ -18,11 +22,24 @@
 # (every peer gets different elements).
 #EVIL_SPEC = 0;stuff-different;leader;5
 
+[arm]
+RESOURCE_DIAGNOSTICS = resource.log.${PEERID}
 
-
 [core]
 FORECESTART = YES
 
+[revocation]
+FORECESTART = NO
+
+[fs]
+FORECESTART = NO
+
+[gns]
+FORECESTART = NO
+
+[hostlist]
+FORECESTART = NO
+
 [cadet]
 #PREFIX = valgrind
 

Modified: gnunet/src/include/gnunet_consensus_service.h
===================================================================
--- gnunet/src/include/gnunet_consensus_service.h       2015-10-11 09:27:47 UTC 
(rev 36498)
+++ gnunet/src/include/gnunet_consensus_service.h       2015-10-11 19:16:15 UTC 
(rev 36499)
@@ -43,6 +43,14 @@
 
 
 /**
+ * Elements inserted into the consensus set by the client
+ * may not be larger than this constant, since types in
+ * the upper range are used by CONSENSUS internally.
+ */
+#define GNUNET_CONSENSUS_ELEMENT_TYPE_USER_MAX 0xFFF0
+
+
+/**
  * Called when a new element was received from another peer, or an error 
occured.
  * May deliver duplicate values.
  * Elements given to a consensus operation by the local peer are NOT given

Modified: gnunet/src/set/gnunet-service-set_union_strata_estimator.c
===================================================================
--- gnunet/src/set/gnunet-service-set_union_strata_estimator.c  2015-10-11 
09:27:47 UTC (rev 36498)
+++ gnunet/src/set/gnunet-service-set_union_strata_estimator.c  2015-10-11 
19:16:15 UTC (rev 36499)
@@ -33,7 +33,7 @@
  * Should we try compressing the strata estimator? This will
  * break compatibility with the 0.10.1-network.
  */
-#define FAIL_10_1_COMPATIBILTIY 0
+#define FAIL_10_1_COMPATIBILTIY 1
 
 
 /**




reply via email to

[Prev in Thread] Current Thread [Next in Thread]