Radish alpha
h
Radicle Heartwood Protocol & Stack
Radicle
Git (anonymous pull)
Log in to clone via SSH
REVIEW: Edit comment
Lorenz Leutgeb committed 2 months ago
commit 714f8b5899ac28620ddadc4499a6f2608c4e38b5
parent 523968750441ab70981685cae4171ab7c21b2013
1 file changed +11 -9
modified crates/radicle-protocol/src/service.rs
@@ -1650,16 +1650,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 in a more peer-to-peer arrangement
-
                // to establish connections to peers whom you follow but aren't directly connected
-
                // to. E.g. Alice <--> Bob <--> Eve
-
                // Alice follows Eve, Eve announces refs of interest but because Alice
-
                // is not directly connected she cant see said refs if Bob isn't also interested in
-
                // Eve's refs.
+
                // 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",