Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GH-606-Review-4 #449

Closed
wants to merge 21 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
6047a13
GH-783 Fix tests failing on non standard environment (#432)
czarte Apr 24, 2024
55851fc
GH-791: Small fixes to stabilize tests in setup_reporter.rs (#443)
bertllll May 21, 2024
40480d1
GH-797: Update min-hops command docs in User Interface (#447)
utkarshg6 May 29, 2024
2007ccd
GH-728: Finish the password-change logic (#355)
utkarshg6 May 29, 2024
25e9a4f
feat: added dependabot.yml (#342)
FinsaasGH Jul 1, 2024
6fcc1cd
GH-813: Correctly parse max block range error message (#531)
masqrauder Sep 29, 2024
a4fb720
GH-500: Adding Base chains (#510)
bertllll Oct 2, 2024
91f3b8c
update readme and tag v0.8.1 (#532)
kauri-hero Oct 3, 2024
f5572f3
GH-524: Disable `entry_dns` (#526)
utkarshg6 Oct 8, 2024
7693d00
GH-539: Don't Panic! (#540)
utkarshg6 Oct 15, 2024
8ad336d
New Version: v0.8.2 (#542)
utkarshg6 Oct 15, 2024
ed7ca69
GH-606: Initialize start_block to none to use latest block
masqrauder Jan 15, 2024
c61be52
GH-606: Apply PR feedback changes
masqrauder Mar 16, 2024
aa54ff0
GH-606: Apply PR feedback changes
masqrauder Apr 21, 2024
2a0e285
GH-606: Apply PR feedback changes
masqrauder Jun 16, 2024
c965035
GH-606: Apply PR review 4 feedback changes
masqrauder Jun 23, 2024
f7938de
GH-606: Squashing commits
masqrauder Jul 11, 2024
89e7171
GH-600: set_start_block only called in accountant/scanners/mod.rs
masqrauder Oct 10, 2024
382f0de
GH-606: PR Feedback - parameterize a test
masqrauder Oct 20, 2024
7c9b69d
GH-606: Address PR feedback
masqrauder Oct 22, 2024
a9c7faf
GH-606: Implement parameterized test without crate macro
masqrauder Oct 29, 2024
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
106 changes: 106 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
# Basic `dependabot.yml` file with
# minimum configuration for two package managers

version: 2
updates:
# Enable version updates for node
- package-ecosystem: "cargo"
directory: "/node"
# Check the cargo registry for updates every day (weekdays)
schedule:
interval: "daily"
time: '14:00'
timezone: 'Etc/UTC'
allow:
- dependency-name: "*"
dependency-type: "direct"
ignore:
- dependency-name: "automap"
- dependency-name: "masq_lib"
- dependency-name: "actix"
- dependency-name: "tokio"
- dependency-name: "clap"
- dependency-name: "sodiumoxide"
- dependency-name: "web3"
- dependency-name: "websocket"
groups:
patch:
update-types:
- "patch"
minor:
update-types:
- "minor"
target-branch: 'master'
open-pull-requests-limit: 2

# Enable version updates for masq
- package-ecosystem: "cargo"
directory: "/masq"
# Check the cargo registry for updates every day (weekdays)
schedule:
interval: "daily"
time: '14:00'
timezone: 'Etc/UTC'
allow:
- dependency-name: "*"
dependency-type: "direct"
ignore:
- dependency-name: "masq_lib"
- dependency-name: "clap"
- dependency-name: "websocket"
groups:
patch:
update-types:
- "patch"
minor:
update-types:
- "minor"
target-branch: 'master'
open-pull-requests-limit: 2

# Enable version updates for masq_lib
- package-ecosystem: "cargo"
directory: "/masq_lib"
# Check the cargo registry for updates every day (weekdays)
schedule:
interval: "daily"
time: '14:00'
timezone: 'Etc/UTC'
allow:
- dependency-name: "*"
dependency-type: "direct"
ignore:
- dependency-name: "clap"
- dependency-name: "websocket"
groups:
patch:
update-types:
- "patch"
minor:
update-types:
- "minor"
target-branch: 'master'
open-pull-requests-limit: 2

# Enable version updates for automap
- package-ecosystem: "cargo"
directory: "/automap"
# Check the cargo registry for updates every day (weekdays)
schedule:
interval: "daily"
time: '14:00'
timezone: 'Etc/UTC'
allow:
- dependency-name: "*"
dependency-type: "direct"
ignore:
- dependency-name: "masq_lib"
groups:
patch:
update-types:
- "patch"
minor:
update-types:
- "minor"
target-branch: 'master'
open-pull-requests-limit: 2
7 changes: 2 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,7 @@ stage - MASQ Network and it's developers are not responsible for any activity, o
## Source
The MASQ project was forked from Substratum's Node project in order to carry on development after Substratum ceased
operations in October of 2019. In 2021, Substratum's Node repositories were removed from GitHub, so the fork link
with MASQ was broken, but all credit for the original idea, the original design, and the first two years of MASQ's
development belongs to Substratum.
with MASQ was broken, but all credit for the original idea and the original design belongs to Substratum (and properly attributed through GPLv3 license)

## Running the MASQ Node

Expand Down Expand Up @@ -452,6 +451,4 @@ recommend using a 64-bit version to build.

We do plan to release binaries that will run on 32-bit Windows, but they will likely be built on 64-bit Windows.

Copyright (c) 2019-2022, MASQ Network

Copyright (c) 2017-2019, Substratum LLC and/or its affiliates. All rights reserved.
Copyright (c) 2019-2024, MASQ Network
15 changes: 14 additions & 1 deletion USER-INTERFACE-INTERFACE.md
Original file line number Diff line number Diff line change
Expand Up @@ -1095,6 +1095,18 @@ even for parameters whose values are natively of other types.
##### Description:
If the value of the respective parameter was successfully changed, this is a simple acknowledgment that the change is complete.

The following commands can be configured using the `setConfiguration`:


| Name | Parameter | Possible Values |
|------------------|-----------------|------------------|
| Gas Price | `--gas-price` | > 0 |
| Start Block | `--start-block` | > 0 |
| Min Hops | `--min-hops` | [1, 6] |


Note: The descriptions for the above commands can be found [here](#permitted-names).

#### `setup`
##### Direction: Request
##### Correspondent: Daemon
Expand Down Expand Up @@ -1131,10 +1143,11 @@ be cleared.
* `db-password` - Password to unlock the sensitive values in the database.
* `dns-servers` - Comma-separated list of DNS servers to use.
* `earning-wallet` - Wallet into which earnings should be deposited.
* `gas-price` - Transaction fee to offer on the blockchain.
* `gas-price` - The fee per unit of computational effort in blockchain transactions, measured in gwei.
* `ip` - The public IP address of the Node.
* `log-level` - The lowest level of logs that should be recorded. `off`, `error`, `warn`, `info`, `debug`, `trace`
* `mapping-protocol` - The management protocol to try first with the router. `pcp`, `pmp`, `igdp`
* `min-hops`: The minimum number of hops required for the package to reach the Exit Node.
* `neighborhood-mode` - `zero-hop`, `originate-only`, `consume-only`, `standard`
* `neighbors` - Comma-separated list of Node descriptors for neighbors to contact on startup
* `real-user` - Non-Windows platforms only, only where required: <uid>:<gid>:<home directory>
Expand Down
4 changes: 2 additions & 2 deletions automap/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion automap/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "automap"
version = "0.8.0"
version = "0.8.2"
authors = ["Dan Wiebe <dnwiebe@gmail.com>", "MASQ"]
license = "GPL-3.0-only"
description = "Library full of code to make routers map ports through firewalls"
Expand Down
4 changes: 2 additions & 2 deletions dns_utility/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dns_utility/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "dns_utility"
version = "0.8.0"
version = "0.8.2"
license = "GPL-3.0-only"
authors = ["Dan Wiebe <dnwiebe@gmail.com>", "MASQ"]
copyright = "Copyright (c) 2019, MASQ (https://masq.ai) and/or its affiliates. All rights reserved."
Expand Down
2 changes: 1 addition & 1 deletion masq/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "masq"
version = "0.8.0"
version = "0.8.2"
authors = ["Dan Wiebe <dnwiebe@gmail.com>", "MASQ"]
license = "GPL-3.0-only"
description = "Reference implementation of user interface for MASQ Node"
Expand Down
13 changes: 8 additions & 5 deletions masq/src/commands/configuration_command.rs
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,10 @@ impl ConfigurationCommand {
dump_parameter_line(
stream,
"Start block:",
&configuration.start_block.to_string(),
&configuration
.start_block_opt
.map(|m| m.separate_with_commas())
.unwrap_or_else(|| "[Latest]".to_string()),
);
Self::dump_value_list(stream, "Past neighbors:", &configuration.past_neighbors);
let payment_thresholds = Self::preprocess_combined_parameters({
Expand Down Expand Up @@ -333,7 +336,7 @@ mod tests {
exit_byte_rate: 129000000,
exit_service_rate: 160000000,
},
start_block: 3456,
start_block_opt: None,
scan_intervals: UiScanIntervals {
pending_payable_sec: 150500,
payable_sec: 155000,
Expand Down Expand Up @@ -378,7 +381,7 @@ mod tests {
|Max block count: [Unlimited]\n\
|Neighborhood mode: standard\n\
|Port mapping protocol: PCP\n\
|Start block: 3456\n\
|Start block: [Latest]\n\
|Past neighbors: neighbor 1\n\
| neighbor 2\n\
|Payment thresholds: \n\
Expand Down Expand Up @@ -433,7 +436,7 @@ mod tests {
exit_byte_rate: 20,
exit_service_rate: 30,
},
start_block: 3456,
start_block_opt: Some(1234567890u64),
scan_intervals: UiScanIntervals {
pending_payable_sec: 1000,
payable_sec: 1000,
Expand Down Expand Up @@ -476,7 +479,7 @@ mod tests {
|Max block count: 100,000\n\
|Neighborhood mode: zero-hop\n\
|Port mapping protocol: PCP\n\
|Start block: 3456\n\
|Start block: 1,234,567,890\n\
|Past neighbors: [?]\n\
|Payment thresholds: \n\
| Debt threshold: 2,500 gwei\n\
Expand Down
41 changes: 34 additions & 7 deletions masq/src/commands/set_configuration_command.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ use masq_lib::shared_schema::gas_price_arg;
use masq_lib::shared_schema::min_hops_arg;
use masq_lib::short_writeln;
use masq_lib::utils::ExpectValue;
use std::num::IntErrorKind;

#[derive(Debug, PartialEq, Eq)]
pub struct SetConfigurationCommand {
Expand Down Expand Up @@ -35,9 +36,17 @@ impl SetConfigurationCommand {
}

fn validate_start_block(start_block: String) -> Result<(), String> {
match start_block.parse::<u64>() {
Ok(_) => Ok(()),
_ => Err(start_block),
if "latest".eq_ignore_ascii_case(&start_block) || "none".eq_ignore_ascii_case(&start_block) {
Ok(())
} else {
match start_block.parse::<u64>() {
Ok(_) => Ok(()),
Err(e) if e.kind() == &IntErrorKind::PosOverflow => Err(
format!("Unable to parse '{}' into a starting block number or provide 'none' or 'latest' for the latest block number: digits exceed {}.",
start_block, u64::MAX),
),
Err(e) => Err(format!("Unable to parse '{}' into a starting block number or provide 'none' or 'latest' for the latest block number: {}.", start_block, e))
}
}
}

Expand All @@ -59,7 +68,7 @@ impl Command for SetConfigurationCommand {
const SET_CONFIGURATION_ABOUT: &str =
"Sets Node configuration parameters being enabled for this operation when the Node is running.";
const START_BLOCK_HELP: &str =
"Ordinal number of the Ethereum block where scanning for transactions will start.";
"Ordinal number of the Ethereum block where scanning for transactions will start. Use 'latest' or 'none' for Latest block.";

pub fn set_configurationify<'a>(shared_schema_arg: Arg<'a, 'a>) -> Arg<'a, 'a> {
shared_schema_arg.takes_value(true).min_values(1)
Expand Down Expand Up @@ -103,7 +112,7 @@ mod tests {
);
assert_eq!(
START_BLOCK_HELP,
"Ordinal number of the Ethereum block where scanning for transactions will start."
"Ordinal number of the Ethereum block where scanning for transactions will start. Use 'latest' or 'none' for Latest block."
);
}

Expand All @@ -122,10 +131,28 @@ mod tests {
assert!(result.contains("cannot be used with one or more of the other specified arguments"));
}

#[test]
fn validate_start_block_catches_invalid_values() {
assert_eq!(validate_start_block("abc".to_string()), Err("Unable to parse 'abc' into a starting block number or provide 'none' or 'latest' for the latest block number: invalid digit found in string.".to_string()));
assert_eq!(validate_start_block("918446744073709551615".to_string()), Err("Unable to parse '918446744073709551615' into a starting block number or provide 'none' or 'latest' for the latest block number: digits exceed 18446744073709551615.".to_string()));
assert_eq!(validate_start_block("123,456,789".to_string()), Err("Unable to parse '123,456,789' into a starting block number or provide 'none' or 'latest' for the latest block number: invalid digit found in string.".to_string()));
assert_eq!(validate_start_block("123'456'789".to_string()), Err("Unable to parse '123'456'789' into a starting block number or provide 'none' or 'latest' for the latest block number: invalid digit found in string.".to_string()));
}
#[test]
fn validate_start_block_works() {
assert!(validate_start_block("abc".to_string()).is_err());
assert!(validate_start_block("1566".to_string()).is_ok());
assert_eq!(
validate_start_block("18446744073709551615".to_string()),
Ok(())
);
assert_eq!(validate_start_block("1566".to_string()), Ok(()));
assert_eq!(validate_start_block("none".to_string()), Ok(()));
assert_eq!(validate_start_block("None".to_string()), Ok(()));
assert_eq!(validate_start_block("NONE".to_string()), Ok(()));
assert_eq!(validate_start_block("nOnE".to_string()), Ok(()));
assert_eq!(validate_start_block("latest".to_string()), Ok(()));
assert_eq!(validate_start_block("LATEST".to_string()), Ok(()));
assert_eq!(validate_start_block("LaTeST".to_string()), Ok(()));
assert_eq!(validate_start_block("lATEst".to_string()), Ok(()));
}

#[test]
Expand Down
2 changes: 1 addition & 1 deletion masq_lib/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "masq_lib"
version = "0.8.0"
version = "0.8.2"
authors = ["Dan Wiebe <dnwiebe@gmail.com>", "MASQ"]
license = "GPL-3.0-only"
description = "Code common to Node and masq; also, temporarily, to dns_utility"
Expand Down
Loading
Loading