Opened 4 years ago

Last modified 21 months ago

#14164 new enhancement

Controller method to get our own descriptor

Reported by: toralf Owned by:
Priority: Medium Milestone: Tor: unspecified
Component: Core Tor/Tor Version: Tor: 0.2.7
Severity: Normal Keywords: lorax, easy, tor-relay, tor-control
Cc: Actual Points:
Parent ID: Points: 1
Reviewer: Sponsor: SponsorS-can

Description

I'm wondering why this pythin snippet

def main():
  ControlPort = 9051
  ProcessName = 'tor'

  with Controller.from_port(port = ControlPort) as controller:
    controller.authenticate()
    #print " Tor version %s" % controller.get_version()
    try:
      desc = controller.get_microdescriptor()
      print " flags : %s" % desc.flags()
      print " measured bandwidth : %i" % desc.measured()
    except Exception as exc:
      print exc
      #pass

gives

Tor was unable to provide the descriptor for 'F1BE15429B3CE696D6807F4D4A58B1BFEC45C822'

Does this means that stems asks tor and tor doesn't know itself ?

Child Tickets

Change History (26)

comment:1 Changed 4 years ago by atagar

Component: StemTor
Summary: does tor knows itself ?Controller method to get our own descriptor
Type: taskenhancement

Yup. The trouble is that tor only provides methods for 'give me the descriptor I've downloaded about relay x'. It doesn't offer a method to get the descriptor *we* published.

As such if we haven't received a descriptor about ourselves then this query fails. This is most often an issue for newly started relays since they won't be part of a consensus for up to an hour.

Imho it would be nice if tor provided controller methods for...

  • give me my self-published server descriptor
  • give me my self-published extra-info descriptor
  • give me my self-published microdescriptor

This won't be possible for router status entries (the get_network_status() method), but for all the rest tor should be capable of telling us the descriptor we ourselves are publishing.

Sending this over to Nick for his thoughts.

comment:2 Changed 4 years ago by toralf

This is most often an issue... for up to an hour.

FWIW, this tor-relay is up and running since 8 days (0.2.6.2-alpha)

comment:3 Changed 4 years ago by nickm

Keywords: lorax easy tor-relay added
Milestone: Tor: 0.2.???

I'd be fine to have all of those new methods provided.

notes:

"give me my self-published microdescriptor" doesn't work -- microdescs aren't selfpublished.

We need to decide whether these items mean "give us the most recently published descriptor," "give me the descriptor we would publish, if we were to publish one right now," or what.

comment:4 Changed 4 years ago by atagar

"give me my self-published microdescriptor" doesn't work -- microdescs aren't selfpublished

Gotcha. Wasn't sure on that one.

We need to decide whether these items mean "give us the most recently published descriptor," "give me the descriptor we would publish, if we were to publish one right now," or what.

Good question. If we could have both via something like...

GETINFO desc/ours/current
GETINFO desc/ours/published

GETINFO extra-info/ours/current
GETINFO extra-info/ours/published

... that seems preferable.

comment:5 Changed 4 years ago by nickm

Milestone: Tor: 0.2.???Tor: 0.2.7.x-final

These may be worth looking at for 0.2.7.

comment:6 Changed 4 years ago by nickm

Owner: atagar deleted
Status: newassigned

comment:7 Changed 4 years ago by nickm

Keywords: 027-triaged-1-in added

Marking more tickets as triaged-in for 0.2.7

comment:8 Changed 4 years ago by isabela

Keywords: SponsorS added
Points: small
Priority: minornormal
Version: Tor: 0.2.7

comment:9 Changed 3 years ago by nickm

Milestone: Tor: 0.2.7.x-finalTor: 0.2.8.x-final

comment:10 Changed 3 years ago by nickm

Keywords: 028-triaged added

comment:11 Changed 3 years ago by nickm

Keywords: SponsorS removed
Sponsor: SponsorS

Bulk-replace SponsorS keyword with SponsorS sponsor field in Tor component.

comment:12 Changed 3 years ago by nickm

Milestone: Tor: 0.2.8.x-finalTor: 0.2.9.x-final

These seem like features, or like other stuff unlikely to be possible this month. Bumping them to 0.2.9

comment:13 Changed 3 years ago by isabela

Severity: Normal
Sponsor: SponsorSSponsorS-can

comment:14 Changed 3 years ago by nickm

Keywords: tor-controller-extension added

comment:15 Changed 3 years ago by isabela

Points: small1

comment:16 Changed 3 years ago by nickm

Status: assignednew

Put all unowned "assigned" tickets back into "new".

comment:17 Changed 3 years ago by isabela

Keywords: isaremoved added
Milestone: Tor: 0.2.9.x-finalTor: 0.2.???

comment:18 Changed 2 years ago by teor

Milestone: Tor: 0.2.???Tor: 0.3.???

Milestone renamed

comment:19 Changed 2 years ago by nickm

Keywords: tor-03-unspecified-201612 added
Milestone: Tor: 0.3.???Tor: unspecified

Finally admitting that 0.3.??? was a euphemism for Tor: unspecified all along.

comment:20 Changed 21 months ago by nickm

Keywords: tor-03-unspecified-201612 removed

Remove an old triaging keyword.

comment:21 Changed 21 months ago by nickm

Keywords: 027-triaged-in added

comment:22 Changed 21 months ago by nickm

Keywords: 027-triaged-in removed

comment:23 Changed 21 months ago by nickm

Keywords: 027-triaged-1-in removed

comment:24 Changed 21 months ago by nickm

Keywords: 028-triaged removed

comment:25 Changed 21 months ago by nickm

Keywords: isaremoved removed

comment:26 Changed 21 months ago by dgoulet

Keywords: tor-control added; tor-controller-extension removed

Unify tor-controller-extension keyword to "tor-control".

Note: See TracTickets for help on using tickets.