Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
443a398
working on exit_location_command
czarte Feb 27, 2025
849214c
addressing issues from review
czarte Mar 4, 2025
14b4c03
continue addressing review comments
czarte Mar 5, 2025
a803c46
more addressed comments from review
czarte Mar 17, 2025
cb56d7b
test for min_hops_change affects exit_countries and enrich_exit_count…
czarte Mar 18, 2025
c23f6c8
new machinery for min-hop affects exit location settings
czarte Mar 19, 2025
666699e
handle_config_change_msg debugging
czarte Mar 20, 2025
60643e0
finalize min_hops_change_affects_db_countries test
czarte Mar 20, 2025
bbf67df
rename test
czarte Mar 20, 2025
b0e74e8
refactoring neighborhood/mod.rs, moving AccessibleGossipRecord to gos…
czarte Mar 20, 2025
04807b0
fix db to dot grap test
czarte Mar 24, 2025
7fb6d7e
addressing more comments from review
czarte Mar 25, 2025
c1682ad
addressing minor changes from review
czarte Mar 26, 2025
22936bf
addressing review comments
czarte Mar 26, 2025
3d4ffff
resolving comments from review
czarte Mar 27, 2025
8248649
addressing comments from review
czarte Apr 1, 2025
6148a71
UI README updated (uncompleted), comment explaining country_undesirab…
czarte Apr 3, 2025
d50da6b
formatting for ExitLovationSet
czarte Apr 8, 2025
98a9800
setup_reporter_shared_app and wait_for_masq_node_ends
czarte Apr 8, 2025
81faa51
CountryCodes to CountryBlocks, fix formatting of ExitLocationSet in t…
czarte Apr 8, 2025
be250eb
resolving unimplemented Copy trait in Process
czarte Apr 8, 2025
6d01238
new clap test providing_show_countries_with_other_argument_fails
czarte Apr 8, 2025
7fe5998
format
czarte Apr 8, 2025
7adb418
fallback routing test change
czarte Apr 9, 2025
9d97e23
country codes to nodes names in tests
czarte Apr 9, 2025
2573729
description to exit-location response
czarte Apr 9, 2025
5269084
removing comments, adding country codes to node names in tests
czarte Apr 9, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
61 changes: 61 additions & 0 deletions USER-INTERFACE-INTERFACE.md
Original file line number Diff line number Diff line change
Expand Up @@ -590,6 +590,67 @@ descriptor (for example, if it's still waiting on the router to get a public IP
Node descriptor (for example, if its neighborhood mode is not Standard), the `nodeDescriptorOpt`
field will be null or absent.

#### `exit-location`
##### Direction: Request
##### Correspondent: Node
##### Layout:
```
"payload": {
"fallbackRouting": <boolean>,
"exitLocations": [
{
"countryCodes": [string, ..],
"priority": <positive integer>
},
],
"showCountries": <boolean>
}
```
##### Description:
This command requests information about the countries available for exit in our neighborhood and allows us to set up the
desired locations with their priority. The priority provides the node's perspective on how important a particular country
is for our preferences.

This command can be used in two ways which can't be combined:
1. If we use the command with showCountries set to true, it retrieves information about the available countries in our neighborhood. In this case, other parameters are ignored.
2. If we want to set an exit location, we must set showCountries to false and then configure fallbackRouting and exitLocations with our preferences.

The fallbackRouting parameter determines whether we want to block exit for a particular country. If this country is no longer
available, the route to exit will fail during construction. If fallbackRouting is set to true, we can exit through any available
country if none of our specified exitLocations are accessible.

Priorities are used to determine the preferred exit countries. Priority 1 is the highest, while higher numbers indicate
lower priority. For example, if we specify DE with priority 1 and FR with priority 2, then an exit through France will
only be used if a German exit is unavailable or significantly more expensive.

#### `exit-location`
##### Direction: Response
##### Correspondent: UI
##### Layout:

```
"payload": {
"fallbackRouting": <boolean>,
"exitCountrySelection": <[
{
"countryCodes": [string, ..],
"priority": <positive integer>
},
]>,
"missingCountries": <[string, ..]>
"exitCountries": <optional[string, ..]>
}
```
##### Description:
In response, the Node sends a payload to the UI that contains either the Exit Location settings (which may include missing countries) or a list of exit countries.

Exit Location settings consist of fallbackRouting, exitCountrySelection, and missingCountries, where:
1. fallbackRouting is a boolean representing the user's choice to enable or disable fallback routing within the neighborhood.
2. exitCountrySelection is an array of objects, where each object represents a set of country codes along with their assigned priority.
3. missingCountries is an array of strings representing a list of countries that are currently unavailable in the Node's Neighborhood Database.

Exit Countries (or exitCountries) is an optional array containing ISO country code strings. These represent the countries currently available in the Node's Neighborhood Database. The user can select from these countries to configure the Exit Location settings.

#### `financials`
##### Direction: Request
##### Correspondent: Node
Expand Down
6 changes: 3 additions & 3 deletions ip_country/src/ip_country.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ use std::io;

const COUNTRY_BLOCK_BIT_SIZE: usize = 64;

#[allow(unused_must_use)]
pub fn ip_country(
_args: Vec<String>,
stdin: &mut dyn io::Read,
Expand Down Expand Up @@ -52,8 +51,9 @@ pub fn ip_country(
*** DO NOT USE THIS CODE ***
"#,
error_list
);
write!(stderr, "{}", error_list);
)
.expect("expected WANRNING output");
write!(stderr, "{}", error_list).expect("expected error list output");
1
}
}
Expand Down
4 changes: 2 additions & 2 deletions masq/src/command_factory.rs
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ impl CommandFactoryReal {
mod tests {
use super::*;
use crate::command_factory::CommandFactoryError::UnrecognizedSubcommand;
use masq_lib::messages::CountryCodes;
use masq_lib::messages::CountryGroups;

#[test]
fn complains_about_unrecognized_subcommand() {
Expand Down Expand Up @@ -282,7 +282,7 @@ mod tests {
.downcast_ref::<SetExitLocationCommand>()
.unwrap(),
&SetExitLocationCommand {
exit_locations: vec![CountryCodes {
exit_locations: vec![CountryGroups {
country_codes: vec!["CZ".to_string()],
priority: 1
}],
Expand Down
Loading