aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Goulet <dgoulet@torproject.org>2020-10-14 09:46:44 -0400
committerDavid Goulet <dgoulet@torproject.org>2020-10-14 09:46:44 -0400
commitbb249a221f35fe3cef53df4c36c84c2d5e63b66d (patch)
tree1e0073cedcc48b20bd0e255c4c91c8401d0adfcf
parentf02f8f8946bcfb0e11f9ce8c636845731cdddbeb (diff)
parenta251cff0c3c9cb04422c1d93ad6ea2e804b50a1e (diff)
downloadtor-bb249a221f35fe3cef53df4c36c84c2d5e63b66d.tar.gz
tor-bb249a221f35fe3cef53df4c36c84c2d5e63b66d.zip
Merge branch 'tor-gitlab/mr/170'
-rw-r--r--changes/ticket401397
-rw-r--r--doc/man/tor.1.txt9
-rw-r--r--src/app/config/config.c2
-rw-r--r--src/app/config/or_options_st.h4
-rw-r--r--src/core/or/circuitbuild.c20
-rw-r--r--src/core/or/circuituse.c25
-rw-r--r--src/test/conf_examples/large_1/expected1
-rw-r--r--src/test/conf_examples/large_1/expected_no_dirauth1
8 files changed, 16 insertions, 53 deletions
diff --git a/changes/ticket40139 b/changes/ticket40139
new file mode 100644
index 0000000000..fce29233ef
--- /dev/null
+++ b/changes/ticket40139
@@ -0,0 +1,7 @@
+ o Removed features (network parameters):
+ - The "optimistic data" feature is now always on; there is no longer an
+ option to disable it from the torrc file or from the consensus
+ directory.
+ Closes part of 40139.
+ - The "usecreatefast" network parameter is now removed; there is no
+ longer an option for authorities to turn it off. Closes part of 40139.
diff --git a/doc/man/tor.1.txt b/doc/man/tor.1.txt
index c885eb79c0..860e1db33a 100644
--- a/doc/man/tor.1.txt
+++ b/doc/man/tor.1.txt
@@ -1309,15 +1309,6 @@ The following options are useful only for clients (that is, if
Every NUM seconds consider whether to build a new circuit. (Default: 30
seconds)
-[[OptimisticData]] **OptimisticData** **0**|**1**|**auto**::
- When this option is set, and Tor is using an exit node that supports
- the feature, it will try optimistically to send data to the exit node
- without waiting for the exit node to report whether the connection
- succeeded. This can save a round-trip time for protocols like HTTP
- where the client talks first. If OptimisticData is set to **auto**,
- Tor will look at the UseOptimisticData parameter in the networkstatus.
- (Default: auto)
-
// These are out of order because they logically belong together
[[PathBiasCircThreshold]] **PathBiasCircThreshold** __NUM__ +
diff --git a/src/app/config/config.c b/src/app/config/config.c
index 817af22359..6c17bb0d8c 100644
--- a/src/app/config/config.c
+++ b/src/app/config/config.c
@@ -610,7 +610,7 @@ static const config_var_t option_vars_[] = {
V(TestingAuthKeySlop, INTERVAL, "3 hours"),
V(TestingSigningKeySlop, INTERVAL, "1 day"),
- V(OptimisticData, AUTOBOOL, "auto"),
+ OBSOLETE("OptimisticData"),
OBSOLETE("PortForwarding"),
OBSOLETE("PortForwardingHelper"),
OBSOLETE("PreferTunneledDirConns"),
diff --git a/src/app/config/or_options_st.h b/src/app/config/or_options_st.h
index d19afcb3f6..3ccd2c9761 100644
--- a/src/app/config/or_options_st.h
+++ b/src/app/config/or_options_st.h
@@ -868,10 +868,6 @@ struct or_options_t {
* once. */
int MaxClientCircuitsPending;
- /** If 1, we always send optimistic data when it's supported. If 0, we
- * never use it. If -1, we do what the consensus says. */
- int OptimisticData;
-
/** If 1, we accept and launch no external network connections, except on
* control ports. */
int DisableNetwork;
diff --git a/src/core/or/circuitbuild.c b/src/core/or/circuitbuild.c
index ab4ce9f784..3df0f9be8f 100644
--- a/src/core/or/circuitbuild.c
+++ b/src/core/or/circuitbuild.c
@@ -770,27 +770,15 @@ circuit_deliver_create_cell,(circuit_t *circ,
return -1;
}
-/** Return true iff we should send a create_fast cell to start building a given
- * circuit */
-static inline int
+/** Return true iff we should send a create_fast cell to start building a
+ * given circuit */
+static inline bool
should_use_create_fast_for_circuit(origin_circuit_t *circ)
{
- const or_options_t *options = get_options();
tor_assert(circ->cpath);
tor_assert(circ->cpath->extend_info);
- if (!circuit_has_usable_onion_key(circ)) {
- /* We don't have ntor, and we don't have or can't use TAP,
- * so our hand is forced: only a create_fast will work. */
- return 1;
- }
- if (public_server_mode(options)) {
- /* We're a server, and we have a usable onion key. We can choose.
- * Prefer to blend our circuit into the other circuits we are
- * creating on behalf of others. */
- return 0;
- }
- return networkstatus_get_param(NULL, "usecreatefast", 0, 0, 1);
+ return ! circuit_has_usable_onion_key(circ);
}
/**
diff --git a/src/core/or/circuituse.c b/src/core/or/circuituse.c
index df23c63cff..9b506e67a1 100644
--- a/src/core/or/circuituse.c
+++ b/src/core/or/circuituse.c
@@ -2632,22 +2632,6 @@ cpath_is_on_circuit(origin_circuit_t *circ, crypt_path_t *crypt_path)
return 0;
}
-/** Return true iff client-side optimistic data is supported. */
-static int
-optimistic_data_enabled(void)
-{
- const or_options_t *options = get_options();
- if (options->OptimisticData < 0) {
- /* Note: this default was 0 before #18815 was merged. We can't take the
- * parameter out of the consensus until versions before that are all
- * obsolete. */
- const int32_t enabled =
- networkstatus_get_param(NULL, "UseOptimisticData", /*default*/ 1, 0, 1);
- return (int)enabled;
- }
- return options->OptimisticData;
-}
-
/** Attach the AP stream <b>apconn</b> to circ's linked list of
* p_streams. Also set apconn's cpath_layer to <b>cpath</b>, or to the last
* hop in circ's cpath if <b>cpath</b> is NULL.
@@ -2700,11 +2684,10 @@ link_apconn_to_circ(entry_connection_t *apconn, origin_circuit_t *circ,
exitnode = node_get_by_id(cpath->extend_info->identity_digest);
/* See if we can use optimistic data on this circuit */
- if (optimistic_data_enabled() &&
- (circ->base_.purpose == CIRCUIT_PURPOSE_C_GENERAL ||
- circ->base_.purpose == CIRCUIT_PURPOSE_C_HSDIR_GET ||
- circ->base_.purpose == CIRCUIT_PURPOSE_S_HSDIR_POST ||
- circ->base_.purpose == CIRCUIT_PURPOSE_C_REND_JOINED))
+ if (circ->base_.purpose == CIRCUIT_PURPOSE_C_GENERAL ||
+ circ->base_.purpose == CIRCUIT_PURPOSE_C_HSDIR_GET ||
+ circ->base_.purpose == CIRCUIT_PURPOSE_S_HSDIR_POST ||
+ circ->base_.purpose == CIRCUIT_PURPOSE_C_REND_JOINED)
apconn->may_use_optimistic_data = 1;
else
apconn->may_use_optimistic_data = 0;
diff --git a/src/test/conf_examples/large_1/expected b/src/test/conf_examples/large_1/expected
index fcb83d54cb..fcd19db3df 100644
--- a/src/test/conf_examples/large_1/expected
+++ b/src/test/conf_examples/large_1/expected
@@ -110,7 +110,6 @@ NumDirectoryGuards 4
NumEntryGuards 5
NumPrimaryGuards 8
OfflineMasterKey 1
-OptimisticData 1
ORPort 2222
OutboundBindAddress 10.0.0.7
OutboundBindAddressExit 10.0.0.8
diff --git a/src/test/conf_examples/large_1/expected_no_dirauth b/src/test/conf_examples/large_1/expected_no_dirauth
index 6e1b9e8a9f..4a19bc546c 100644
--- a/src/test/conf_examples/large_1/expected_no_dirauth
+++ b/src/test/conf_examples/large_1/expected_no_dirauth
@@ -109,7 +109,6 @@ NumDirectoryGuards 4
NumEntryGuards 5
NumPrimaryGuards 8
OfflineMasterKey 1
-OptimisticData 1
ORPort 2222
OutboundBindAddress 10.0.0.7
OutboundBindAddressExit 10.0.0.8