Radish alpha
h
rad:z3gqcJUoA1n9HaHKufZs5FCSGazv5
Radicle Heartwood Protocol & Stack
Radicle
Git
protocol: Note on peering and fetches
Adrian Duke committed 2 months ago
commit 306d0afbfe48f668b1c6c11b64b0d487bdb3dd44
parent 0684d1c
1 file changed +12 -3
modified crates/radicle-protocol/src/service.rs
@@ -1597,9 +1597,18 @@ where
                    );
                    return Ok(None);
                };
-
                // Refs can be relayed by peers who don't have the data in storage,
-
                // therefore we only check whether we are connected to the *announcer*,
-
                // which is required by the protocol to only announce refs it has.
+
                // Ref announcements may be relayed by peers who don't have the
+
                // actual refs in storage, therefore we only check whether we
+
                // are connected to the *announcer*, which is required by the
+
                // protocol to only announce refs it has.
+
                //
+
                // TODO(Ade): Perhaps it makes sense to establish connections to
+
                // followed but unconnected peers. Consider:
+
                //   Connections: Alice ←→ Bob ←→ Eve
+
                //   Follows:     Alice ←→ Eve
+
                // Eve announces refs, and Bob relays these announcements to Alice.
+
                // Then, Alice might determine that Bob does not have Eve's refs,
+
                // and therefore connect directly to Eve in order to fetch.
                let Some(remote) = self.sessions.get(announcer).cloned() else {
                    trace!(
                        target: "service",