Skip to content

Commit

Permalink
GH-744: Prepare for merge (#567)
Browse files Browse the repository at this point in the history
* GH-813: Correctly parse max block range error message (#531)

* GH-500: Adding Base chains (#510)

* GH-500: ready for an urged live test

* GH-500: probably finished the deployment of Base, let's get the QA going

* GH-500: removed an eprintln!

* GH-500: version changed to 0.8.1

---------

Co-authored-by: Bert <[email protected]>

* update readme and tag v0.8.1 (#532)

Signed-off-by: KauriHero <[email protected]>

* GH-524: Disable `entry_dns` (#526)

* GH-539: Don't Panic! (#540)

* GH-539: Don't Panic

* GH-539: remove commented out code

* New Version: v0.8.2 (#542)

* GH-744: Review-1 first lot of changes

* GH-744: Review-1 - fixed more tests

* GH-744: improved wildcard IP check

* GH-744: removed unused imports

* GH-744: fixed a bunch more comments from review 1

* GH-744: resolved more review comments

* GH-744: started converting gas_price units from gwei to wei

* GH-744: finish converting gas price from gwei to wei

* GH-744: Formating & removed warnings

* GH-744: Added TransactionFailed to TransactionReceiptResult

* GH-606: Initialize start_block to none to use latest block (#374)

* GH-606: Initialize start_block to none to use latest block

* GH-606: Apply PR feedback changes

* GH-606: Apply PR feedback changes

* GH-606: Apply PR feedback changes

* GH-606: Apply PR review 4 feedback changes

* GH-606: Squashing commits

- Save start_block_nbr if no msg but send as non-Option
- Always commit
- Reduce logging levels and simplify
- Follow the Option naming pattern

* GH-600: set_start_block only called in accountant/scanners/mod.rs

* GH-606: PR Feedback - parameterize a test

* GH-606: Address PR feedback

* GH-606: Implement parameterized test without crate macro

* GH-744: Migrated the guts of get_transaction_receipt_in_batch to process_transaction_receipts

* GH-744: Moved submit_payables_in_batch to blockchain_interface

* GH-744: removed test: blockchain_bridge_can_return_report_transaction_receipts_with_an_empty_vector

* GH-744: Fixed a few more URGENCY comments

* GH-744: cleanup & formatting

* GH-744: add some TODOs as discussed on Wed and Thu

* GH-744: handle_request_transaction_receipts chaged error to a DEBUG log

* GH-744: handle_retrieve_transactions inbeded extract_max_block_count

* GH-744: code refactor

* GH-744: removed transaction_id from Agent

* GH-744: Removed get_gas_price from submit_batch call

* GH-744: logger is now a reference in send_payables_within_batch

* GH-744: send_payables_within_batch web3_batch is now a reference

* GH-744: sign_and_append_multiple_payments accounts is now a reference

* GH-744 removed Blockchan_interface_mock

* GH-744: Refactored all 4 test for send_payables_within_batch

* GH-744: cleanup & formatting

* GH-744: small fixs

* GH-744: handle_normal_client_data detects wildcard IP & localhost with error

* GH-744: Finished all urgent comments

* GH-744: changed actions macos-12 to 13

* GH-744: increased sleep time for test provided_and_consumed_services_are_recorded_in_databases

* GH-744: Fixed multinode tests

* GH-744: Added start block +1 to handle_transaction_logs

* GH-744: Fixed some tests

* GH-744: Fixes from review 2

* GH-744: Fixed test debtors_are_credited_once_but_not_twice

* GH-744: removed BlockNumber::Number

* GH-744: Resolved TODOs

* GH-744: First commit for review-3, fixed tests

* GH-744: Refactored TxReceipt

* GH-744: Refactored TxResponse

* GH-744 moved & renamed blockchain_interface_utils.rs

* GH-744: fixed test: dns_resolution_failure_for_wildcard_ip_with_real_nodes

* GH-744: add review 4 changes

* GH-744: add review 5 changes

* GH-744: remove the map_err()

* GH-744: migrate the logging code to a different function

* GH-744: add review 6 changes

---------

Signed-off-by: KauriHero <[email protected]>
Co-authored-by: MASQrauder <[email protected]>
Co-authored-by: Bert <[email protected]>
Co-authored-by: Bert <[email protected]>
Co-authored-by: KauriHero <[email protected]>
Co-authored-by: Syther007 <[email protected]>
  • Loading branch information
6 people authored Jan 6, 2025
1 parent d098022 commit ee5d17e
Show file tree
Hide file tree
Showing 70 changed files with 2,326 additions and 2,751 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci-matrix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
matrix:
target:
- { name: linux, os: ubuntu-22.04 }
- { name: macos, os: macos-12 }
- { name: macos, os: macos-13 }
- { name: windows, os: windows-2022 }

name: Build node on ${{ matrix.target.os }}
Expand Down
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
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 <[email protected]>", "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 <[email protected]>", "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 <[email protected]>", "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/tests/startup_shutdown_tests_integration.rs
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ fn handles_startup_and_shutdown_integration() {
"--data-directory",
dir_path.to_str().unwrap(),
"--blockchain-service-url",
"https://example.com",
"https://nonexistentblockchainservice.com",
]);

let (stdout, stderr, exit_code) = masq_handle.stop();
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 <[email protected]>", "MASQ"]
license = "GPL-3.0-only"
description = "Code common to Node and masq; also, temporarily, to dns_utility"
Expand Down
Loading

0 comments on commit ee5d17e

Please sign in to comment.