Opened 4 years ago

Closed 3 months ago

#10227 closed enhancement (implemented)

Support descriptor generation

Reported by: atagar Owned by: atagar
Priority: Medium Milestone:
Component: Core Tor/Stem Version:
Severity: Normal Keywords: descriptor, leekspin
Cc: isis Actual Points:
Parent ID: Points:
Reviewer: Sponsor:

Description

Presently stem has the ability to parse descriptors, but not generate them. Our testing utility's mock module has some basic support for this, and isis' gen_bridge_descriptors script does even better (generating properly signed content).

Proper support for generating all descriptor types would be an awesome capability to have in stem!

Child Tickets

Change History (10)

comment:1 Changed 4 years ago by isis

Cc: isis added

It's already fairly modular, the different steps are separated out into separate functions and some (but perhaps not all the necessary ones, since I wasn't primarily concerned with it) of the functions which will need to behave a bit differently in order to create non-bridge OR descriptors take a "bridge=True" parameter.

I'm willing to separate this into it's own python package/module so that projects can import it, if you think this makes it easier to work with. I don't think it really belongs in BridgeDB anyway, since it's something that several Tor python projects could use.

comment:2 Changed 4 years ago by atagar

My thought was that this would be a fine capability for stem itself since the ability to generate descriptors nicely compliments the ability to parse them. That said I'll be busy with arm for the next few months so I won't be able to do this myself soon.

comment:3 in reply to:  1 Changed 4 years ago by sysrqb

Replying to isis:

I'm willing to separate this into it's own python package/module so that projects can import it, if you think this makes it easier to work with. I don't think it really belongs in BridgeDB anyway, since it's something that several Tor python projects could use.

I completely agree, which was why I didn't initially propose merging my code. We can definitely merge it into bridgedb temporarily, until it has a better home, or maybe it'll be better to create a personal and/or project repo for it on git.tp.o?

In any case, providing this functionality in stem will be really useful.

comment:4 Changed 3 years ago by isis

Keywords: leekspin added

FWIW, the gen_bridge_descriptors script was rewritten into its own python module called Leekspin, which is also on PyPI.

I added the capability to generate relay descriptors some time ago, as part of #13045, but I haven't checked at all that the relay descriptors generated are correct. In addition, there isn't yet any production of microdescriptors, and the networkstatus flavour is the still type that Tonga produces (so not quite the same as what current relay networkstatus documents look like).

I'll gladly merge patches to produce better relay descriptors and more types of descriptors!

comment:5 Changed 2 years ago by atagar

One quick thought is that this might go nicely with tor's new HSPOST feature. I'm still unsure of the use cases of HSPOST but certainly meshes well with this.

comment:6 Changed 7 months ago by patrickod

Severity: Normal

Given that leekspin has been broken out are there any next steps for stem here @atagar?

comment:7 Changed 7 months ago by atagar

Hi patrickod. Yes, the next steps are to figure out the best parts of leekspin verses Stem's mocking module and add it.

comment:8 Changed 5 months ago by atagar

Hi Patrick. Just a quick update that this weekend I added descriptor creation methods...

https://stem.torproject.org/tutorials/mirror_mirror_on_the_wall.html#can-i-create-descriptors
https://gitweb.torproject.org/stem.git/commit/?id=b2a54ad

Note that this *doesn't* yet support signing descriptors. I'm looking into that next. Also reached out to Isis to see if there were any other aspects of leekspin we should incorporate...

https://lists.torproject.org/pipermail/tor-dev/2017-May/012237.html

comment:9 Changed 3 months ago by atagar

Stem now supports signing server descriptors so think it's about time we resolved this. It would be great if we could sign more descriptor types but we'll add that as need arises.

comment:10 Changed 3 months ago by atagar

Resolution: implemented
Status: newclosed
Note: See TracTickets for help on using tickets.