Opened 9 years ago

Closed 9 years ago

#217 closed task (fixed)

Make foolscap forward-compatible with Twisted Endpoints

Reported by: str4d Owned by: str4d
Priority: major Milestone: 0.7.0
Component: negotiation Version: 0.6.4
Keywords: i2p-collab i2p tor Cc:


As part of the switch to using Endpoints in ticket:203, foolscap needs to understand connection strings in the Twisted Endpoints syntax. Current foolscap only accepts TCP connections (and assumes that old-style "host:port" connection hints are TCP). Foolscap should therefore understand and accept TCP Endpoints strings in the connection hints, and ignore all others (so it is not confused or broken by other Endpoint string types).

As requested by zooko in ticket:203#comment:28.

Change History (11)

comment:1 Changed 9 years ago by str4d

Component: unknownnegotiation

First patch for this has been merged ( but is incomplete, because it assumes that the Twisted Endpoints syntax only allows for keyword arguments.

comment:2 Changed 9 years ago by str4d

Owner: set to str4d
Status: newassigned

Follow-up pull request with support for all possible parameter permutations:

comment:3 Changed 9 years ago by Zooko

Keywords: i2p-collab i2p tor added

comment:4 Changed 9 years ago by dawuud


Recently, I attempted to port foolscap to using twisted endpoints... at least for the client side of the connection. I was unaware of this ticket when I wrote this:

There were a few unit tests that fail in my branch at that commit. I think these might be caused by the connect deferred behaving differently than the IConnector.

But there is another problem I wanted to talk about and volunteer to fix... (i will demonstrate with a git branch soon and then report back here) decode_furl returns a tuple which contains location_hints; currently this is a list of 3-tuples (type, host, port). I think instead location_hints should be a list of strings. The strings would be the twisted endpoint string. Old style hints can be converted into new style hints... or if no match then rejected.

TubConnector? connectToAll needs to have the entire endpoint descriptor in order to build the endpoint correctly. For instance if we want our foolscap connections to be over a socks proxy then we need to specify the socks_host, socks_port, dest_host, dest_port...

Last edited 9 years ago by dawuud (previous) (diff)

comment:5 Changed 9 years ago by dawuud

str4d, I'll help out with this. What's the next step?

comment:6 Changed 9 years ago by dawuud

My endpoints branch: demonstrates what I'm talking about... also this commit here:

However some tests are failing... and so now I'm trying to track down the problems... and fix them.

comment:7 Changed 9 years ago by dawuud

ok i'm going to continue this on trac ticket #203

comment:8 Changed 9 years ago by Zooko

Good discussion of the state of Tahoe-LAFS-over-Tor:

comment:9 in reply to:  7 Changed 9 years ago by str4d

Replying to dawuud:

ok i'm going to continue this on trac ticket #203

Yes, this ticket is solely for a release of foolscap that will not break when later versions start using whatever FURLs are used for Endpoints.

comment:10 Changed 9 years ago by Brian Warner

The patch in looks pretty close. The only real concern (noted there) is that it uses private/internal Twisted functions, and we should really stick to public interfaces. Once we've resolved that, I'll land it, and I think that means we can close this ticket.

comment:11 Changed 9 years ago by Brian Warner

Resolution: fixed
Status: assignedclosed
Note: See TracTickets for help on using tickets.