Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fire endpoint listen deferred when HS desc is desseminated #107

Closed
david415 opened this issue Apr 8, 2015 · 9 comments
Closed

fire endpoint listen deferred when HS desc is desseminated #107

david415 opened this issue Apr 8, 2015 · 9 comments

Comments

@david415
Copy link
Contributor

david415 commented Apr 8, 2015

fire endpoint listen deferred when HS desc is desseminated

Let's accurately determine the proper time to fire the Tor hidden service endpoint listen() method's returned deferred. That is, we should fire when the endpoint can actually be connected to via Tor... once the HS descriptor has been uploaded to one (or more?) HS directory authorities.

On on irc #tor-dev Yawning pointed out that they do have plans to implement a feature that might give us what we want:

https://trac.torproject.org/projects/tor/ticket/3523

17:51 < Yawning> as a sideeffect
17:51 < Yawning> that's where I saw that

17:58 < Yawning> once the patches land, a corresponding extension to the existing events will be added to the spec
17:58 < Yawning>
DonnchaC/torspec@bc34815...3523

@meejah
Copy link
Owner

meejah commented Apr 8, 2015

Okay, so after the above command is done, there will be some kind of "descriptor uploaded" event.

@meejah
Copy link
Owner

meejah commented Apr 8, 2015

To be clear, there's also the open question of whether the callback should fire on the first HSDir upload, or after X uploads (where X could be "all" if we can get that number from Tor).

I believe that after the first will be "acceptable", as the HS connection should work. I'm not clear on the failure cases here (e.g. what's the worst-case for a client connecting to an HS that has only uploaded one descriptor?).

One possibility might be to expose the number of descriptor uploads to user-code somehow, so they can choose (and give the callback() on the first upload, and it's up to user code to wait for more if they like). This sounds "complicated" though, so I'd rather just have txtorcon choose some (single) way to have it work.

(FWIW, right now endpoint.listen() waits for one upload, via looking at INFO log messages -- fragile, but works).

@DonnchaC
Copy link

DonnchaC commented Jun 9, 2015

FYI the HS_DESC UPLOADED event has been merged into Tor master now. It's included in release 0.2.7.1-alpha.

@meejah
Copy link
Owner

meejah commented Jun 9, 2015

Great! Thanks for letting me know @DonnchaC

Now I can get rid of the giant "listen for INFO message" hack.

@david415
Copy link
Contributor Author

yess!

On Tue, Jun 9, 2015 at 1:42 PM, meejah notifications@github.com wrote:

Great! Thanks for letting me know @DonnchaC https://github.com/DonnchaC

Now I can get rid of the giant "listen for INFO message" hack.


Reply to this email directly or view it on GitHub
#107 (comment).

@david415
Copy link
Contributor Author

Has there been any work towards using the new event type?
Maybe I could help with this one...

@meejah
Copy link
Owner

meejah commented Aug 21, 2015

I did look into this a little, but IIRC the event didn't include the onion-ID at the time, so it was guesswork anyway (i.e. you'd get "a descriptor was uploaded!" but no way to tie that back to the actual descriptor you were interested in). In "many" cases it would work fine (since you're only working with 1 hidden-service on that Tor), but ...

That said, the ephemeral-hidden-service stuff was still in flux at the time, so is very probably in better shape now and I haven't tried again recently.Tor is shortly in feature-freeze for the next release and if this stuff is "in" that next release it would be great to have txtorcon supporting it for then...

@meejah
Copy link
Owner

meejah commented Oct 12, 2015

Okay, so UPLOAD and UPLOADED sub-events for HS_DESC are available. There's still a bit of guesswork: UPLOAD tells you that a particular key's descriptor is being uploaded to a particular dirauth. However, the UPLOADED event doesn't tell you the key (only that "some" upload to a particular dirauth has succeeded).

So, this has been implemented in master for EphemeralHiddenService, however, it will "sometimes" be wrong, I think. (If you're uploading multiple descriptors and they happen to pick the same dirauth).

TCPHiddenServiceEndpoint should be upgraded to use this method (on sufficiently new Tor's) as well.

It should also be used by the

@meejah meejah added this to the v0.15.0 milestone Oct 12, 2015
@meejah
Copy link
Owner

meejah commented Oct 4, 2016

This is in master and working, and is in the release-1.0-*

Any problems/bugs/enhancements should be separate tickets.

@meejah meejah closed this as completed Oct 4, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants