summaryrefslogtreecommitdiff
path: root/src/or/dirvote.h
diff options
context:
space:
mode:
authorteor <teor2345@gmail.com>2014-12-20 21:53:00 +1100
committerteor <teor2345@gmail.com>2014-12-24 06:13:32 +1100
commit1ee41b3eef4b5e561c7c73e79885fe858dac6d80 (patch)
tree0a751121774b65ef5a82b0a526eea51534000a52 /src/or/dirvote.h
parent083c58f126a4390b96b0e3f14d809502d8702f3d (diff)
downloadtor-1ee41b3eef4b5e561c7c73e79885fe858dac6d80.tar.gz
tor-1ee41b3eef4b5e561c7c73e79885fe858dac6d80.zip
Allow consensus interval of 10 seconds when testing
Decrease minimum consensus interval to 10 seconds when TestingTorNetwork is set. (Or 5 seconds for the first consensus.) Fix code that assumes larger interval values. This assists in quickly bootstrapping a testing Tor network. Fixes bugs 13718 & 13823.
Diffstat (limited to 'src/or/dirvote.h')
-rw-r--r--src/or/dirvote.h32
1 files changed, 31 insertions, 1 deletions
diff --git a/src/or/dirvote.h b/src/or/dirvote.h
index 5d44ba4320..b570e9d251 100644
--- a/src/or/dirvote.h
+++ b/src/or/dirvote.h
@@ -14,12 +14,42 @@
#include "testsupport.h"
+/*
+ * Ideally, assuming synced clocks, we should only need 1 second for each of:
+ * - Vote
+ * - Distribute
+ * - Consensus Publication
+ * As we can gather descriptors continuously.
+ * (Could we even go as far as publishing the previous consensus,
+ * in the same second that we vote for the next one?)
+ * But we're not there yet: these are the lowest working values at this time.
+ */
+
/** Lowest allowable value for VoteSeconds. */
#define MIN_VOTE_SECONDS 2
+/** Lowest allowable value for VoteSeconds when TestingTorNetwork is 1 */
+#define MIN_VOTE_SECONDS_TESTING 2
+
/** Lowest allowable value for DistSeconds. */
#define MIN_DIST_SECONDS 2
-/** Smallest allowable voting interval. */
+/** Lowest allowable value for DistSeconds when TestingTorNetwork is 1 */
+#define MIN_DIST_SECONDS_TESTING 2
+
+/** Lowest allowable voting interval. */
#define MIN_VOTE_INTERVAL 300
+/** Lowest allowable voting interval when TestingTorNetwork is 1:
+ * Voting Interval can be:
+ * 10, 12, 15, 18, 20, 24, 25, 30, 36, 40, 45, 50, 60, ...
+ * Testing Initial Voting Interval can be:
+ * 5, 6, 8, 9, or any of the possible values for Voting Interval,
+ * as they both need to evenly divide 30 minutes.
+ * If clock desynchronisation is an issue, use an interval of at least:
+ * 18 * drift in seconds, to allow for a clock slop factor */
+#define MIN_VOTE_INTERVAL_TESTING \
+ (((MIN_VOTE_SECONDS_TESTING)+(MIN_DIST_SECONDS_TESTING)+1)*2)
+
+#define MIN_VOTE_INTERVAL_TESTING_INITIAL \
+ ((MIN_VOTE_SECONDS_TESTING)+(MIN_DIST_SECONDS_TESTING)+1)
/** The lowest consensus method that we currently support. */
#define MIN_SUPPORTED_CONSENSUS_METHOD 13