Skip to content
Snippets Groups Projects

Implement the basics of a bootstrap-status API.

Merged Nick Mathewson requested to merge nickm/arti:bootstrap_reporting_api into main

The purpose of this API is to tell the user how far along Arti is in getting bootstrapped, and if it's stuck, what it's stuck on.

This API doesn't yet expose any useful information: by the time it's observable to a client, it's always "100% bootstrapped." But I'm putting it in a MR now so that we can review the basic idea, and to avoid conflicts with later work on tickets like #293 (closed) and #278 (closed).

This is part of #96 (closed).

Edited by Nick Mathewson

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
  • Ian Jackson
  • 11 //
    12 // We need to this type fairly small, since it will get cloned whenever it's
    13 // observed on a stream.
    14 #[derive(Debug, Clone, Default)]
    15 pub struct BootstrapStatus {
    16 /// A placeholder field: we'll be replacing this as the branch gets support
    17 /// for more information sources.
    18 ready: bool,
    19 }
    20
    21 impl BootstrapStatus {
    22 /// Return a rough fraction (from 0.0 to 1.0) representing how far along
    23 /// the client's bootstrapping efforts are.
    24 ///
    25 /// 0 is defined as "just started"; 1 is defined as "ready to use."
    26 pub fn as_frac(&self) -> f32 {
    • This is quite amusing and perhaps actually useful :-).

      I think maybe we also want to provide an OperationalStatusLevel enum which is Ord and non exhaustive.

    • It's based on the "x% bootstrapped" indicators that Tor gives out; it's meant for the cases where you absolutely want to shove it in a progress bar.

      We could look at an ordering on status levels at some point, but that can actually be hard. For subtle reasons, there is not a total ordering on "how bootstrapped is this client." (eg, client 1 has a complete valid cached directory, but is offline. Client 2 is online, but has no directory information. Is one of them really "more botstrapped" than the other? From the POV of a progress bar, perhaps, but otherwise it's not so clear.)

    • Contributor

      I think maybe we also want to provide an OperationalStatusLevel enum which is Ord and non exhaustive.

      Potentially, but I think I'd like to get an idea of what people would actually use that for first; if people are just going to compare the levels against one another, they might as well use this API.

      On the other hand, if there are clients that actually want to change their UI / show specific actions at various points, then this'd make a lot of sense.

    • Please register or sign in to reply
  • Ian Jackson
  • Ian Jackson
  • Ian Jackson
  • Ian Jackson
  • Ian Jackson
  • Ian Jackson
  • Ian Jackson
  • Ian Jackson
  • Nick Mathewson added 2 commits

    added 2 commits

    • e6762fb0 - fixup! Implement the basics of a bootstrap-status API.
    • f94cef62 - fixup! Implement the basics of a bootstrap-status API.

    Compare with previous version

  • Nick Mathewson marked this merge request as draft from nickm/arti@e6762fb0

    marked this merge request as draft from nickm/arti@e6762fb0

  • Nick Mathewson added 1 commit

    added 1 commit

    • 9b16b02a - fixup! Implement the basics of a bootstrap-status API.

    Compare with previous version

  • Ian Jackson
  • eta
  • eta
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Please register or sign in to reply
    Loading