erpc_scanner

Module scanner

source
Expand description

The module for Scanner, necessary to attempt circuit builds

This module only contains one type i.e Scanner and it’s to be used where you need to test where two hop circuit of given two relays gets built or not

X —(hop 1)— RELAY1 —(hop 2)— RELAY2

The Scanner is built to check if two relays are partitioned or not, on a high level, you push something called IncompleteWork using the push_incomplete_work, which is basically the Fingerprint of Relay1 and Relay2, whose two hop circuits we want to build, if this two hop circuit get’s built then (AS OF RIGHT NOW) we consider that relays is not partitioned and if it fails then (as of right now) we consider that relays are partitioned (Of course direction is important here, that’s why IncompleteWork has a source_relay and destination_relay field)

We initiate a Scanner, with the no of clients we want, it basically means that those no of clients will attempt to create a circuit through the CircuitBuilder at once, if they are all loaded with an IncompleteWork what happens underneath is that we spawn a single arti_client::TorClient and we clone it’s CircMgr and DirMgr, which is used to build a type called NetDirProvider, that has a broadcast channel to give out a fresh Arc<NetDir> to it’s subscribers, the Client

Structs§

  • A utility to test for two hop circuits