[tor-bugs] #29333 [Core Tor/Stem]: Use the bandwidth-file-spec.txt keywords as BandwidthFile attributes

Tor Bug Tracker & Wiki blackhole at torproject.org
Tue Feb 5 22:18:22 UTC 2019


#29333: Use the bandwidth-file-spec.txt keywords as BandwidthFile attributes
---------------------------+------------------------
 Reporter:  juga           |          Owner:  atagar
     Type:  defect         |         Status:  new
 Priority:  Medium         |      Milestone:
Component:  Core Tor/Stem  |        Version:
 Severity:  Normal         |     Resolution:
 Keywords:  tor-bwauth     |  Actual Points:
Parent ID:                 |         Points:
 Reviewer:                 |        Sponsor:
---------------------------+------------------------

Comment (by atagar):

 Hi juga. I chose these attribute names to make usage nicer. That is to
 say...

 {{{
 print('%i / %i (%i%%) of relays are eligible' % (
   desc.eligible_count,
   desc.consensus_size,
   desc.eligible_percent,
 ))
 }}}

 ... rather than...

 {{{
 print('%i / %i (%i%%) of relays are eligible' % (
   desc.number_eligible_relays,
   desc.number_consensus_relays,
   desc.percent_eligible_relays.
 ))
 }}}

 That said, I'd be happy to defer to whatever you'd like when it comes to
 BandwidthFiles. To be clear you want the following changes...

 {{{
 * Rename desc.created_at to desc.file_created
 * Rename desc.generated_at to desc.generator_started
 * Rename desc.consensus_size to desc.number_consensus_relays
 * Rename desc.eligible_count to desc.number_eligible_relays
 * Rename desc.eligible_percent to desc.percent_eligible_relays
 * Rename desc.min_count to desc.minimum_number_eligible_relays
 * Rename desc.min_percent to desc.minimum_percent_eligible_relays
 * Rename desc.measurements to desc.bandwidth_lines
 }}}

 Is this correct?

 ----

 On a side note I like the spec, but felt while implementing it there's a
 few rough edges...

 * Keywords feel unnecessarily verbose to me. That's why I chose different
 names.

 * Inclusion of the **percent** attribute is redundant with other stats. I
 think it's a mistake to include derived stats since they're either
 redundant or inaccurate (what if 'eligible_count / consensus_size !=
 eligible_percent'?).

 * The **measurements** is an unstructured dictionary because bandwidth-
 file spec section 2.3 is pretty sparse. It mandates 'node_id=', 'bw=', and
 notes 'master_key_ed25519=' but otherwise defers to section 2.4.2.1 which
 depends on application version rather than bandwidth file versions.

--
Ticket URL: <https://trac.torproject.org/projects/tor/ticket/29333#comment:1>
Tor Bug Tracker & Wiki <https://trac.torproject.org/>
The Tor Project: anonymity online


More information about the tor-bugs mailing list