This is an automated email from the git hooks/post-receive script.
dgoulet pushed a change to branch main in repository tor.
from 2bb8988629 Fix cases where edge connections can stall. new 61aa4c3657 Actually count exits with conflux support, rather than relays. new 33c3059c82 Handle infinite loop with only one bridge (or snowflake). new bdf4fef2db CID 1524706: Remove dead assignment new 9ee71eaf5a CID 1524707: Quiet coverity noise
The 4 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "add" were already present in the repository and have only been added to this reference.
Summary of changes: src/core/or/conflux_cell.c | 7 +++++-- src/core/or/conflux_params.c | 13 +++++++++++-- src/core/or/conflux_pool.c | 9 +++++++++ src/core/or/relay.c | 1 - src/feature/client/bridges.c | 35 +++++++++++++++++++++++++++++++++++ src/feature/client/bridges.h | 1 + 6 files changed, 61 insertions(+), 5 deletions(-)
This is an automated email from the git hooks/post-receive script.
dgoulet pushed a commit to branch main in repository tor.
commit 61aa4c3657b43e11414f8c607aadfad87eea40fd Author: Mike Perry mikeperry-git@torproject.org AuthorDate: Tue Apr 18 16:51:07 2023 +0000
Actually count exits with conflux support, rather than relays. --- src/core/or/conflux_params.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-)
diff --git a/src/core/or/conflux_params.c b/src/core/or/conflux_params.c index f149e3356c..dbf4ae5272 100644 --- a/src/core/or/conflux_params.c +++ b/src/core/or/conflux_params.c @@ -100,19 +100,28 @@ static void count_exit_with_conflux_support(const networkstatus_t *ns) { double supported = 0.0; + int total_exits = 0;
if (!ns || smartlist_len(ns->routerstatus_list) == 0) { return; }
SMARTLIST_FOREACH_BEGIN(ns->routerstatus_list, const routerstatus_t *, rs) { + if (!rs->is_exit || rs->is_bad_exit) { + continue; + } if (rs->pv.supports_conflux) { supported++; } + total_exits++; } SMARTLIST_FOREACH_END(rs);
- exit_conflux_ratio = - supported / smartlist_len(ns->routerstatus_list); + if (total_exits > 0) { + exit_conflux_ratio = + supported / total_exits; + } else { + exit_conflux_ratio = 0.0; + }
log_info(LD_GENERAL, "Consensus has %.2f %% Exit relays supporting Conflux", exit_conflux_ratio * 100.0);
This is an automated email from the git hooks/post-receive script.
dgoulet pushed a commit to branch main in repository tor.
commit 33c3059c8233fb9a3076c8452f7cea00412ccdfb Author: Mike Perry mikeperry-git@torproject.org AuthorDate: Thu Apr 20 20:55:17 2023 +0000
Handle infinite loop with only one bridge (or snowflake). --- src/core/or/conflux_pool.c | 9 +++++++++ src/feature/client/bridges.c | 35 +++++++++++++++++++++++++++++++++++ src/feature/client/bridges.h | 1 + 3 files changed, 45 insertions(+)
diff --git a/src/core/or/conflux_pool.c b/src/core/or/conflux_pool.c index b9da1fe75a..ae14bd1b3c 100644 --- a/src/core/or/conflux_pool.c +++ b/src/core/or/conflux_pool.c @@ -35,6 +35,7 @@ #include "core/or/conflux_st.h"
#include "feature/nodelist/nodelist.h" +#include "feature/client/bridges.h"
#include "lib/crypt_ops/crypto_rand.h" #include "lib/crypt_ops/crypto_util.h" @@ -1150,6 +1151,14 @@ conflux_add_guards_to_exclude_list(const origin_circuit_t *orig_circ, return; }
+ /* If there is only one bridge, then only issue a warn once that + * at least two bridges are best for conflux. Exempt Snowflake + * from this warn */ + if (get_options()->UseBridges && !conflux_can_exclude_used_bridges()) { + /* Do not build any exclude lists; not enough bridges */ + return; + } + /* A linked set exists, use it. */ const conflux_t *cfx = linked_pool_get(circ->conflux_pending_nonce, true); if (cfx) { diff --git a/src/feature/client/bridges.c b/src/feature/client/bridges.c index 9e36d26929..a0375828a7 100644 --- a/src/feature/client/bridges.c +++ b/src/feature/client/bridges.c @@ -139,6 +139,41 @@ bridge_list_get(void) return bridge_list; }
+/** + * Returns true if there are enough bridges to make a conflux set + * without re-using the same bridge. + */ +bool +conflux_can_exclude_used_bridges(void) +{ + if (smartlist_len(bridge_list_get()) == 1) { + static bool warned_once = false; + bridge_info_t *bridge = smartlist_get(bridge_list_get(), 0); + tor_assert(bridge); + + /* Snowflake is a special case. With one snowflake bridge, + * you are load balanced among many back-end bridges. + * So we do not need to warn the user for it. */ + if (bridge->transport_name && + strcasecmp(bridge->transport_name, "snowflake") == 0) { + return false; + } + + if (!warned_once) { + log_warn(LD_CIRC, "Only one bridge (transport: '%s') is configured. " + "You should have at least two for conflux, " + "for any transport that is not 'snowflake'.", + bridge->transport_name ? + bridge->transport_name : "vanilla"); + warned_once = true; + } + + return false; + } + + return true; +} + /** * Given a <b>bridge</b>, return a pointer to its RSA identity digest, or * NULL if we don't know one for it. diff --git a/src/feature/client/bridges.h b/src/feature/client/bridges.h index dd3e498a0a..2b514ba6c9 100644 --- a/src/feature/client/bridges.h +++ b/src/feature/client/bridges.h @@ -67,6 +67,7 @@ MOCK_DECL(download_status_t *, get_bridge_dl_status_by_id, (const char *digest));
void bridges_free_all(void); +bool conflux_can_exclude_used_bridges(void);
#ifdef TOR_BRIDGES_PRIVATE STATIC void clear_bridge_list(void);
This is an automated email from the git hooks/post-receive script.
dgoulet pushed a commit to branch main in repository tor.
commit bdf4fef2db193d6704d79289ea3fbba0061918fc Author: Mike Perry mikeperry-git@torproject.org AuthorDate: Thu Apr 20 21:33:20 2023 +0000
CID 1524706: Remove dead assignment --- src/core/or/relay.c | 1 - 1 file changed, 1 deletion(-)
diff --git a/src/core/or/relay.c b/src/core/or/relay.c index 131432b7c1..20336dffaf 100644 --- a/src/core/or/relay.c +++ b/src/core/or/relay.c @@ -2635,7 +2635,6 @@ circuit_resume_edge_reading_helper(edge_connection_t *first_conn, */ if (packaged_this_round && packaged_this_round < max_to_package && n_streams_left) { - max_to_package -= packaged_this_round; n_packaging_streams = n_streams_left; goto again; }
This is an automated email from the git hooks/post-receive script.
dgoulet pushed a commit to branch main in repository tor.
commit 9ee71eaf5ad83efec8366ecf17da5ba57ab47cde Author: Mike Perry mikeperry-git@torproject.org AuthorDate: Thu Apr 20 21:43:59 2023 +0000
CID 1524707: Quiet coverity noise --- src/core/or/conflux_cell.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/src/core/or/conflux_cell.c b/src/core/or/conflux_cell.c index 9d81a4ba3b..fa0bb1c23e 100644 --- a/src/core/or/conflux_cell.c +++ b/src/core/or/conflux_cell.c @@ -53,8 +53,11 @@ build_link_cell(const conflux_cell_link_t *link, uint8_t *cell_out) trn_cell_conflux_link_payload_v1_set_desired_ux(payload, link->desired_ux);
/* Encode payload. */ - trn_cell_conflux_link_setlen_payload(cell, - trn_cell_conflux_link_payload_v1_encoded_len(payload)); + ssize_t pay_len = trn_cell_conflux_link_payload_v1_encoded_len(payload); + tor_assert(pay_len >= 0); + + trn_cell_conflux_link_setlen_payload(cell, pay_len); + trn_cell_conflux_link_payload_v1_encode( trn_cell_conflux_link_getarray_payload(cell), trn_cell_conflux_link_getlen_payload(cell), payload);
tor-commits@lists.torproject.org