Open ghost opened 7 years ago
For the naming, matreshka
seems a much more widespread technical term than shallot
, but I might be biased on this one 😜 .
Interesting. Hop-by-hop dialing reminds me of foldLeft
and deferred dialing of foldRight
in the functional programming lingo (the formula section exemplifies why). Perhaps these names would be better given their consistency between each other.
When building multi-hop relayed connections, there can be multiple modes for how exactly to dial. There are two obvious modes, but both of them are currently blind spots in the circuit relay spec.
(All kinds of other modes are also possible -- these two are just the most obvious ones.)
Hop-by-hop dialing
A->R1->R2->B
A
connects toR1
A
buildsA->R2
connection, viaR1
A
buildsA->B
connection, viaR2
Relay(Relay(Relay(A, R1), R2), B)
A
only sends the very next hop's multiaddr as the headerA
is in full control of the circuitA
doesn't rely on/hop
support on R1 or R2Deferred dialing
A->R1->R2->B
A
connects toR1
R1
connects toR2
R2
connects toB
R1
buildsR1->B
connection, viaR2
R1
buildsA->B
connection, viaR1->B
Relay(A, Relay(R1, Relay(R2, B)))
R1
andR2
allowing passing/p2p-circuit
addresses as headersA
, good for light clients