From 0fba0b54b9e3a0f4f9596cf067157fbbaef90bf7 Mon Sep 17 00:00:00 2001 From: czarte Date: Tue, 16 Sep 2025 16:27:40 +0200 Subject: [PATCH 01/22] New default values for Base Mainnet, New default chain Base Mainnet, Configuration Error when blockchain-service-url is not provided, Help with links for public RPC endpoints --- masq_lib/src/constants.rs | 4 +- masq_lib/src/multi_config.rs | 5 +- masq_lib/src/shared_schema.rs | 6 +- .../blockchain_interface_initializer.rs | 2 +- node/src/bootstrapper.rs | 32 +++++- node/src/daemon/mod.rs | 1 + node/src/daemon/setup_reporter.rs | 23 ++-- node/src/database/config_dumper.rs | 10 +- node/src/database/db_initializer.rs | 2 +- .../node_configurator_standard.rs | 42 +++++-- .../unprivileged_parse_args_configuration.rs | 108 +++++++++++++++--- node/src/sub_lib/neighborhood.rs | 16 +-- node/tests/connection_shutdown_test.rs | 6 +- node/tests/dump_configuration_test.rs | 1 + node/tests/financials_test.rs | 6 +- node/tests/http_through_node_test.rs | 3 +- node/tests/ui_gateway_test.rs | 1 + 17 files changed, 214 insertions(+), 54 deletions(-) diff --git a/masq_lib/src/constants.rs b/masq_lib/src/constants.rs index 6beea57487..a67f86128c 100644 --- a/masq_lib/src/constants.rs +++ b/masq_lib/src/constants.rs @@ -4,7 +4,7 @@ use crate::blockchains::chains::Chain; use crate::data_version::DataVersion; use const_format::concatcp; -pub const DEFAULT_CHAIN: Chain = Chain::PolyMainnet; +pub const DEFAULT_CHAIN: Chain = Chain::BaseMainnet; pub const CURRENT_SCHEMA_VERSION: usize = 11; pub const HIGHEST_RANDOM_CLANDESTINE_PORT: u16 = 9999; @@ -113,7 +113,7 @@ mod tests { #[test] fn constants_have_correct_values() { - assert_eq!(DEFAULT_CHAIN, Chain::PolyMainnet); + assert_eq!(DEFAULT_CHAIN, Chain::BaseMainnet); assert_eq!(HIGHEST_RANDOM_CLANDESTINE_PORT, 9999); assert_eq!(HTTP_PORT, 80); assert_eq!(TLS_PORT, 443); diff --git a/masq_lib/src/multi_config.rs b/masq_lib/src/multi_config.rs index 418dbf240b..ce81934ec2 100644 --- a/masq_lib/src/multi_config.rs +++ b/masq_lib/src/multi_config.rs @@ -3,7 +3,7 @@ use crate::shared_schema::{ConfiguratorError, ParamError}; #[allow(unused_imports)] use clap::{value_t, values_t}; -use clap::{App, ArgMatches}; +use clap::{App, ArgMatches, Error}; use regex::Regex; use std::collections::HashSet; use std::fmt::{Debug, Display, Formatter}; @@ -61,6 +61,7 @@ impl<'a> MultiConfig<'a> { schema: &App<'a, 'a>, vcls: Vec>, ) -> Result, ConfiguratorError> { + //TODO check if blockchain-service-url present in config down the road from here and return ConfiguratorError let initial: Box = Box::new(CommandLineVcl::new(vec![String::new()])); let merged = vcls @@ -102,7 +103,7 @@ impl<'a> MultiConfig<'a> { } } - pub fn make_configurator_error(e: clap::Error) -> ConfiguratorError { + pub fn make_configurator_error(e: Error) -> ConfiguratorError { let invalid_value_patterns = vec![ ("Invalid value for '--(.*?) <.*>': (.*)$", 1, 2), ("error: (.*) isn't a valid value for '--(.*?) <.*>'", 2, 1), diff --git a/masq_lib/src/shared_schema.rs b/masq_lib/src/shared_schema.rs index 11dfb865fc..41710321d9 100644 --- a/masq_lib/src/shared_schema.rs +++ b/masq_lib/src/shared_schema.rs @@ -15,7 +15,11 @@ pub const BLOCKCHAIN_SERVICE_HELP: &str = exit services from your MASQ Node (e.g. http://localhost:8545, \ https://ropsten.infura.io/v3/YOUR-PROJECT-ID, https://mainnet.infura.io/v3/YOUR-PROJECT-ID), \ https://base-mainnet.g.alchemy.com/v2/d66UL0lPrltmweEqVsv3opBSVI3wkL8I, \ - https://polygon-mainnet.infura.io/v3/YOUR-PROJECT-ID"; + https://polygon-mainnet.infura.io/v3/YOUR-PROJECT-ID \n This argument is mandatory, to ensure, you \ + will not be deliquency banned due unable to pay your debts to MASQ network. If you are in region \ + where you have no access to blockchain services, to create your own app, use one of following public \ + endpoints for Base Mainnet (you need to specify Base Mainnet chain in the chain argument): \n\ + https://mainnet.base.org \nhttps://base.llamarpc.com \nhttps://1rpc.io/base \nhttps://base-rpc.publicnode.com"; pub const CHAIN_HELP: &str = "The blockchain network MASQ Node will configure itself to use. You must ensure the \ Ethereum client specified by --blockchain-service-url communicates with the same blockchain network."; diff --git a/node/src/blockchain/blockchain_interface_initializer.rs b/node/src/blockchain/blockchain_interface_initializer.rs index ee87519a0c..1527b5e9f1 100644 --- a/node/src/blockchain/blockchain_interface_initializer.rs +++ b/node/src/blockchain/blockchain_interface_initializer.rs @@ -92,7 +92,7 @@ mod tests { #[test] #[should_panic(expected = "Invalid blockchain service URL \"http://λ:8545\". \ - Error: Transport(\"InvalidUri(InvalidUriChar)\"). Chain: polygon-mainnet")] + Error: Transport(\"InvalidUri(InvalidUriChar)\"). Chain: base-mainnet")] fn invalid_blockchain_url_for_produces_panic_for_web3_interface() { let blockchain_service_url = "http://λ:8545"; let subject = BlockchainInterfaceInitializer {}; diff --git a/node/src/bootstrapper.rs b/node/src/bootstrapper.rs index b70bc208c2..078c0f1e0e 100644 --- a/node/src/bootstrapper.rs +++ b/node/src/bootstrapper.rs @@ -1155,6 +1155,8 @@ mod tests { subject .initialize_as_unprivileged( &make_simplified_multi_config([ + "--blockchain-service-url", + "https://booga.com", "--ip", "1.2.3.4", "--clandestine-port", @@ -1276,7 +1278,14 @@ mod tests { subject .initialize_as_unprivileged( - &make_simplified_multi_config(["--ip", "1.2.3.4", "--clandestine-port", "5123"]), + &make_simplified_multi_config([ + "--blockchain-service-url", + "https://booga.com", + "--ip", + "1.2.3.4", + "--clandestine-port", + "5123", + ]), &mut FakeStreamHolder::new().streams(), ) .unwrap(); @@ -1323,6 +1332,8 @@ mod tests { subject .initialize_as_unprivileged( &make_simplified_multi_config([ + "--blockchain-service-url", + "https://booga.com", "--data-directory", data_dir.to_str().unwrap(), "--clandestine-port", @@ -1361,7 +1372,14 @@ mod tests { subject .initialize_as_unprivileged( - &make_simplified_multi_config(["--ip", "1.2.3.4", "--gas-price", "11"]), + &make_simplified_multi_config([ + "--blockchain-service-url", + "https://booga.com", + "--ip", + "1.2.3.4", + "--gas-price", + "11", + ]), &mut FakeStreamHolder::new().streams(), ) .unwrap(); @@ -1405,6 +1423,8 @@ mod tests { .add_listener_handler(third_handler) .build(); let args = [ + "--blockchain-service-url", + "https://booga.com", "--neighborhood-mode", "zero-hop", "--clandestine-port", @@ -1436,6 +1456,8 @@ mod tests { "init_as_privileged_stores_dns_servers_and_passes_them_to_actor_system_factory_for_proxy_client_in_init_as_unprivileged", ); let args = [ + "--blockchain-service-url", + "https://booga.com", "--dns-servers", "1.2.3.4,2.3.4.5", "--ip", @@ -1622,6 +1644,8 @@ mod tests { subject .initialize_as_unprivileged( &make_simplified_multi_config([ + "--blockchain-service-url", + "https://booga.com", "--clandestine-port", "1234", "--ip", @@ -1649,6 +1673,8 @@ mod tests { let data_dir = ensure_node_home_directory_exists("bootstrapper", "initialize_as_unprivileged_moves_streams_from_listener_handlers_to_stream_handler_pool"); init_test_logging(); let args = [ + "--blockchain-service-url", + "https://booga.com", "--ip", "111.111.111.111", "--data-directory", @@ -1748,6 +1774,8 @@ mod tests { .add_listener_handler(Box::new(another_listener_handler)) .build(); let args = [ + "--blockchain-service-url", + "https://booga.com", "--neighborhood-mode", "zero-hop", "--data-directory", diff --git a/node/src/daemon/mod.rs b/node/src/daemon/mod.rs index f16bcbc7f0..0b31a617fa 100644 --- a/node/src/daemon/mod.rs +++ b/node/src/daemon/mod.rs @@ -815,6 +815,7 @@ mod tests { client_id: 1234, body: UiSetupRequest { values: vec![ + UiSetupRequestValue::new("blockchain-service-url", "https://booga.com"), UiSetupRequestValue::new("data-directory", data_dir.to_str().unwrap()), UiSetupRequestValue::new("chain", TEST_DEFAULT_CHAIN.rec().literal_identifier), UiSetupRequestValue::new("neighborhood-mode", "zero-hop"), diff --git a/node/src/daemon/setup_reporter.rs b/node/src/daemon/setup_reporter.rs index e12713cda7..0dd306f275 100644 --- a/node/src/daemon/setup_reporter.rs +++ b/node/src/daemon/setup_reporter.rs @@ -1900,6 +1900,7 @@ mod tests { ); vec![ ("MASQ_CHAIN", TEST_DEFAULT_CHAIN.rec().literal_identifier), + ("MASQ_BLOCKCHAIN_SERVICE_URL", "https://booga.com"), ("MASQ_CLANDESTINE_PORT", "1234"), ("MASQ_CONSUMING_PRIVATE_KEY", "0011223344556677001122334455667700112233445566770011223344556677"), ("MASQ_CRASH_POINT", "Panic"), @@ -1949,7 +1950,6 @@ mod tests { .collect_vec(); let existing_setup = setup_cluster_from(vec![ - ("blockchain-service-url", "https://booga.com", Set), ("clandestine-port", "4321", Set), ( "consuming-private-key", @@ -1989,7 +1989,7 @@ mod tests { let result = subject.get_modified_setup(existing_setup, params).unwrap(); let expected_result = vec![ - ("blockchain-service-url", "", Required), + ("blockchain-service-url", "https://booga.com", Configured), ("chain", TEST_DEFAULT_CHAIN.rec().literal_identifier, Configured), ("clandestine-port", "1234", Configured), ("config-file", "", Blank), @@ -2041,6 +2041,7 @@ mod tests { ); let data_dir = base_dir.join("data_dir"); let existing_setup = setup_cluster_from(vec![ + ("blockchain-service-url", "https://booga.com", Set), ("neighborhood-mode", "zero-hop", Set), ("chain", DEFAULT_CHAIN.rec().literal_identifier, Default), ( @@ -2130,6 +2131,7 @@ mod tests { let existing_setup = setup_cluster_from(vec![ ("neighborhood-mode", "zero-hop", Set), ("chain", DEFAULT_CHAIN.rec().literal_identifier, Default), + ("blockchain-service-url", "https://booga.com", Set), ( "data-directory", &previously_processed_data_dir.to_string_lossy().to_string(), @@ -2170,6 +2172,7 @@ mod tests { .join(DEFAULT_CHAIN.rec().literal_identifier); let new_data_dir = base_dir.join("new_data_dir"); let existing_setup = setup_cluster_from(vec![ + ("blockchain-service-url", "https://booga.com", Set), ("neighborhood-mode", "zero-hop", Set), ("chain", DEFAULT_CHAIN.rec().literal_identifier, Default), ( @@ -2348,6 +2351,7 @@ mod tests { assert_eq!(schema_version_before, "0"); let existing_setup = setup_cluster_from(vec![ ("chain", DEFAULT_CHAIN.rec().literal_identifier, Default), + ("blockchain-service-url", "https://booga.com", Set), ( "data-directory", &data_dir.to_string_lossy().to_string(), @@ -2649,6 +2653,7 @@ mod tests { "data-directory", &home_dir.to_string_lossy().to_string(), ), + UiSetupRequestValue::new("blockchain-service-url", "https://booga.com"), UiSetupRequestValue::new("ip", "1.2.3.4"), UiSetupRequestValue::clear("chain"), ], @@ -2665,8 +2670,10 @@ mod tests { #[test] fn calculate_setup_with_chain_specific_dir_on_user_specified_directory() { let _guard = EnvironmentGuard::new(); - let existing_setup = - setup_cluster_from(vec![("real-user", "1111:1111:/home/booga", Default)]); + let existing_setup = setup_cluster_from(vec![ + ("real-user", "1111:1111:/home/booga", Default), + ("blockchain-service-url", "https://booga.com", Set), + ]); let masqhome = Path::new("/home/booga/masqhome"); let incoming_setup = vec![UiSetupRequestValue::new( "data-directory", @@ -2677,7 +2684,7 @@ mod tests { let result = subject.get_modified_setup(existing_setup, incoming_setup); - let expected = masqhome.join("polygon-mainnet"); + let expected = masqhome.join("base-mainnet"); assert_eq!( result.unwrap().get("data-directory").unwrap().value, expected.to_str().unwrap() @@ -2687,8 +2694,10 @@ mod tests { #[test] fn calculate_setup_with_chain_specific_dir_on_default_directory() { let _guard = EnvironmentGuard::new(); - let existing_setup = - setup_cluster_from(vec![("real-user", "1111:1111:/home/booga", Default)]); + let existing_setup = setup_cluster_from(vec![ + ("real-user", "1111:1111:/home/booga", Default), + ("blockchain-service-url", "https://booga.com", Set), + ]); let incoming_setup = vec![UiSetupRequestValue::new("chain", "polygon-amoy")]; let home_directory = Path::new("/home/booga"); let data_directory = home_directory.join("data"); diff --git a/node/src/database/config_dumper.rs b/node/src/database/config_dumper.rs index d191a8a70a..90ecc119e9 100644 --- a/node/src/database/config_dumper.rs +++ b/node/src/database/config_dumper.rs @@ -268,7 +268,7 @@ mod tests { .initialize( &database_path, DbInitializationConfig::create_or_migrate(ExternalData::new( - Chain::PolyMainnet, + DEFAULT_CHAIN, NeighborhoodModeLight::ZeroHop, None, )), @@ -307,7 +307,7 @@ mod tests { } let mut args_builder = ArgsBuilder::new() .param("--real-user", "123::") - .param("--chain", Chain::PolyMainnet.rec().literal_identifier) + .param("--chain", DEFAULT_CHAIN.rec().literal_identifier) .opt("--dump-config"); if let Some(data_dir) = non_default_data_directory_opt { args_builder = args_builder.param("--data-directory", data_dir.to_str().unwrap()); @@ -344,11 +344,7 @@ mod tests { "0x0123456789012345678901234567890123456789", &map, ); - assert_value( - "chainName", - Chain::PolyMainnet.rec().literal_identifier, - &map, - ); + assert_value("chainName", DEFAULT_CHAIN.rec().literal_identifier, &map); assert_value("gasPrice", "1", &map); assert_value( "pastNeighbors", diff --git a/node/src/database/db_initializer.rs b/node/src/database/db_initializer.rs index aea696d6ca..cd5c5b1bb5 100644 --- a/node/src/database/db_initializer.rs +++ b/node/src/database/db_initializer.rs @@ -1596,7 +1596,7 @@ mod tests { assert!( config_one_debug.contains( "DbInitializationConfig{init_config: CreationAndMigration { external_data: \ - ExternalData { chain: PolyMainnet, neighborhood_mode: Standard, db_password_opt: \ + ExternalData { chain: BaseMainnet, neighborhood_mode: Standard, db_password_opt: \ None } }, special_conn_setup: Addresses[" ), "instead, the first printed message contained: {}", diff --git a/node/src/node_configurator/node_configurator_standard.rs b/node/src/node_configurator/node_configurator_standard.rs index 3cad6c9834..01afbc285c 100644 --- a/node/src/node_configurator/node_configurator_standard.rs +++ b/node/src/node_configurator/node_configurator_standard.rs @@ -463,6 +463,8 @@ mod tests { .unwrap(); } let multi_config = make_simplified_multi_config([ + "--blockchain-service-url", + "https://booga.com", "--chain", "eth-mainnet", "--db-password", @@ -505,6 +507,8 @@ mod tests { PersistentConfigurationReal::from(conn) }; let multi_config = make_simplified_multi_config([ + "--blockchain-service-url", + "https://booga.com", "--chain", "eth-mainnet", "--db-password", @@ -536,8 +540,14 @@ mod tests { "node_configurator_standard", "node_configurator_standard_unprivileged_handles_fake_public_key", ); - let multi_config = - make_simplified_multi_config(["--chain", "eth-mainnet", "--fake-public-key", "AQIDBA"]); + let multi_config = make_simplified_multi_config([ + "--blockchain-service-url", + "https://booga.com", + "--chain", + "eth-mainnet", + "--fake-public-key", + "AQIDBA", + ]); let mut privileged_config = BootstrapperConfig::default(); privileged_config.data_directory = home_dir; let subject = NodeConfiguratorStandardUnprivileged { @@ -767,6 +777,7 @@ mod tests { ); } let args = ArgsBuilder::new() + .param("--blockchain-service-url", "https://booga.com") .param("--data-directory", home_dir.to_str().unwrap()) .param("--ip", "1.2.3.4"); let mut bootstrapper_config = BootstrapperConfig::new(); @@ -1576,7 +1587,14 @@ mod tests { let mut subject = NodeConfiguratorStandardUnprivileged::new(&BootstrapperConfig::new()); subject.privileged_config = BootstrapperConfig::new(); subject.privileged_config.data_directory = data_dir; - let args = ["--ip", "1.2.3.4", "--gas-price", "57"]; + let args = [ + "--blockchain-service-url", + "https://booga.com", + "--ip", + "1.2.3.4", + "--gas-price", + "57", + ]; let config = subject .configure(&make_simplified_multi_config(args)) @@ -1597,7 +1615,12 @@ mod tests { let mut subject = NodeConfiguratorStandardUnprivileged::new(&BootstrapperConfig::new()); subject.privileged_config = BootstrapperConfig::new(); subject.privileged_config.data_directory = data_dir; - let args = ["--ip", "1.2.3.4"]; + let args = [ + "--blockchain-service-url", + "https://booga.com", + "--ip", + "1.2.3.4", + ]; let config = subject .configure(&make_simplified_multi_config(args)) @@ -1773,16 +1796,21 @@ mod tests { let args = match (chain_opt, data_directory_opt) { (Some(chain_opt), Some(data_directory_opt)) => ArgsBuilder::new() + .param("--blockchain-service-url", "https://booga.com") .param("--chain", chain_opt) .param("--real-user", "999:999:/home/cooga") .param("--data-directory", data_directory_opt), (None, Some(data_directory_opt)) => ArgsBuilder::new() + .param("--blockchain-service-url", "https://booga.com") .param("--data-directory", data_directory_opt) .param("--real-user", "999:999:/home/cooga"), (Some(chain_opt), None) => ArgsBuilder::new() + .param("--blockchain-service-url", "https://booga.com") .param("--chain", chain_opt) .param("--real-user", "999:999:/home/cooga"), - (None, None) => ArgsBuilder::new().param("--real-user", "999:999:/home/cooga"), + (None, None) => ArgsBuilder::new() + .param("--real-user", "999:999:/home/cooga") + .param("--blockchain-service-url", "https://booga.com"), }; let args_vec: Vec = args.into(); let dir_wrapper = match data_directory_opt { @@ -1828,8 +1856,8 @@ mod tests { ), ( None, - Some("/cooga/polygon-amoy/polygon-mainnet"), - Some("/cooga/polygon-amoy/polygon-mainnet"), + Some("/cooga/polygon-amoy/base-mainnet"), + Some("/cooga/polygon-amoy/base-mainnet"), ), ( Some("polygon-amoy"), diff --git a/node/src/node_configurator/unprivileged_parse_args_configuration.rs b/node/src/node_configurator/unprivileged_parse_args_configuration.rs index 41cd9a4245..8f24ea2a17 100644 --- a/node/src/node_configurator/unprivileged_parse_args_configuration.rs +++ b/node/src/node_configurator/unprivileged_parse_args_configuration.rs @@ -13,7 +13,7 @@ use crate::sub_lib::neighborhood::{ }; use crate::sub_lib::node_addr::NodeAddr; use crate::sub_lib::wallet::Wallet; -use clap::value_t; +use clap::{value_t, Error}; use itertools::Itertools; use masq_lib::blockchains::chains::Chain; use masq_lib::constants::{DEFAULT_CHAIN, MASQ_URL_PREFIX}; @@ -37,16 +37,24 @@ pub trait UnprivilegedParseArgsConfiguration { ) -> Result<(), ConfiguratorError> { unprivileged_config .blockchain_bridge_config - .blockchain_service_url_opt = - if is_user_specified(multi_config, "blockchain-service-url") { - value_m!(multi_config, "blockchain-service-url", String) - } else { - match persistent_config.blockchain_service_url() { + .blockchain_service_url_opt = if is_user_specified( + multi_config, + "blockchain-service-url", + ) { + value_m!(multi_config, "blockchain-service-url", String) + } else { + match persistent_config.blockchain_service_url() { Ok(Some(price)) => Some(price), - Ok(None) => None, + Ok(None) => { + return Err(MultiConfig::make_configurator_error(Error { + message: "The following required arguments were not provided: --blockchain-service-url USAGE: --blockchain-service-url ".to_string(), + kind: clap::ErrorKind::ArgumentNotFound, + info: Some(vec!["".to_string()]), + })) + } Err(pce) => return Err(pce.into_configurator_error("gas-price")), } - }; + }; unprivileged_config.clandestine_port_opt = value_m!(multi_config, "clandestine-port", u16); unprivileged_config.blockchain_bridge_config.gas_price = if is_user_specified(multi_config, "gas-price") { @@ -1201,6 +1209,48 @@ mod tests { assert_eq!(result,Err(ConfiguratorError::new(vec![ParamError::new("neighbors", "Neighbors supplied without ip addresses and ports are not valid: 'masq://eth-ropsten:abJ5XvhVbmVyGejkYUkmftF09pmGZGKg_PzRNnWQxFw@:")]))) } + #[test] + fn configure_without_blockchain_service_url_returns_error() { + running_test(); + let set_past_neighbors_params_arc = Arc::new(Mutex::new(vec![])); + let mut config = BootstrapperConfig::new(); + let mut persistent_config = configure_default_persistent_config( + RATE_PACK | ACCOUNTANT_CONFIG_PARAMS | MAPPING_PROTOCOL, + ) + .set_past_neighbors_params(&set_past_neighbors_params_arc) + .set_past_neighbors_result(Ok(())); + let multi_config = make_simplified_multi_config([ + "--chain", + "eth-ropsten", + "--neighbors", + "masq://eth-ropsten:UJNoZW5p-PDVqEjpr3b_8jZ_93yPG8i5dOAgE1bhK_A@2.3.4.5:2345", + "--db-password", + "password", + "--neighborhood-mode", + "zero-hop", + "--fake-public-key", + "booga", + ]); + let subject = UnprivilegedParseArgsConfigurationDaoReal {}; + + let result = subject + .unprivileged_parse_args( + &multi_config, + &mut config, + &mut persistent_config, + &Logger::new("test"), + ) + .unwrap_err(); + + let expected = MultiConfig::make_configurator_error(Error { + message: "The following required arguments were not provided: --blockchain-service-url USAGE: --blockchain-service-url ".to_string(), + kind: clap::ErrorKind::ArgumentNotFound, + info: Some(vec!["".to_string()]), + }); + + assert_eq!(result, expected); + } + #[test] fn configure_zero_hop_with_neighbors_supplied() { running_test(); @@ -1212,6 +1262,8 @@ mod tests { .set_past_neighbors_params(&set_past_neighbors_params_arc) .set_past_neighbors_result(Ok(())); let multi_config = make_simplified_multi_config([ + "--blockchain-service-url", + "booga.com", "--chain", "eth-ropsten", "--neighbors", @@ -1259,6 +1311,8 @@ mod tests { ) .set_past_neighbors_params(&set_past_neighbors_params_arc); let multi_config = make_simplified_multi_config([ + "--blockchain-service-url", + "booga.com", "--chain", "eth-ropsten", "--neighborhood-mode", @@ -1462,7 +1516,7 @@ mod tests { #[test] fn unprivileged_parse_args_creates_configuration_with_defaults() { running_test(); - let args = ArgsBuilder::new(); + let args = ArgsBuilder::new().param("--blockchain-service-url", "booga.com"); let mut config = BootstrapperConfig::new(); let vcls: Vec> = vec![Box::new(CommandLineVcl::new(args.into()))]; @@ -1507,6 +1561,7 @@ mod tests { { running_test(); let args = ArgsBuilder::new() + .param("--blockchain-service-url", "booga.com") .param("--ip", "1.2.3.4") .param("--fake-public-key", "BORSCHT") .param("--db-password", "password"); @@ -1601,7 +1656,9 @@ mod tests { #[test] fn unprivileged_parse_args_with_mapping_protocol_both_on_command_line_and_in_database() { running_test(); - let args = ArgsBuilder::new().param("--mapping-protocol", "pmp"); + let args = ArgsBuilder::new() + .param("--mapping-protocol", "pmp") + .param("--blockchain-service-url", "booga.com"); let mut config = BootstrapperConfig::new(); let vcls: Vec> = vec![Box::new(CommandLineVcl::new(args.into()))]; @@ -1639,6 +1696,7 @@ mod tests { ); let args = ArgsBuilder::new() + .param("--blockchain-service-url", "booga.com") .param("--ip", "1.2.3.4") .param("--data-directory", home_directory.to_str().unwrap()) .opt("--db-password"); @@ -1683,6 +1741,8 @@ mod tests { let set_scan_intervals_params_arc = Arc::new(Mutex::new(vec![])); let set_payment_thresholds_params_arc = Arc::new(Mutex::new(vec![])); let args = [ + "--blockchain-service-url", + "booga.com", "--ip", "1.2.3.4", "--scan-intervals", @@ -1759,6 +1819,8 @@ mod tests { ) { running_test(); let args = [ + "--blockchain-service-url", + "booga.com", "--ip", "1.2.3.4", "--scan-intervals", @@ -1830,6 +1892,8 @@ mod tests { running_test(); let set_rate_pack_params_arc = Arc::new(Mutex::new(vec![])); let args = [ + "--blockchain-service-url", + "booga.com", "--ip", "1.2.3.4", "--neighborhood-mode", @@ -1876,6 +1940,8 @@ mod tests { fn unprivileged_parse_args_rate_pack_with_values_from_cli_equal_to_database_standard_mode() { running_test(); let args = [ + "--blockchain-service-url", + "booga.com", "--ip", "1.2.3.4", "--neighborhood-mode", @@ -1921,6 +1987,8 @@ mod tests { ) { running_test(); let args = [ + "--blockchain-service-url", + "booga.com", "--ip", "1.2.3.4", "--chain", @@ -2432,7 +2500,14 @@ mod tests { fn unprivileged_configuration_handles_scans_off() { running_test(); let subject = UnprivilegedParseArgsConfigurationDaoReal {}; - let args = ["--ip", "1.2.3.4", "--scans", "off"]; + let args = [ + "--blockchain-service-url", + "booga.com", + "--ip", + "1.2.3.4", + "--scans", + "off", + ]; let mut bootstrapper_config = BootstrapperConfig::new(); subject @@ -2453,7 +2528,14 @@ mod tests { fn unprivileged_configuration_handles_scans_on() { running_test(); let subject = UnprivilegedParseArgsConfigurationDaoReal {}; - let args = ["--ip", "1.2.3.4", "--scans", "on"]; + let args = [ + "--blockchain-service-url", + "booga.com", + "--ip", + "1.2.3.4", + "--scans", + "on", + ]; let mut bootstrapper_config = BootstrapperConfig::new(); subject @@ -2474,7 +2556,7 @@ mod tests { fn unprivileged_configuration_defaults_scans() { running_test(); let subject = UnprivilegedParseArgsConfigurationDaoReal {}; - let args = ["--ip", "1.2.3.4"]; + let args = ["--blockchain-service-url", "booga.com", "--ip", "1.2.3.4"]; let mut bootstrapper_config = BootstrapperConfig::new(); subject diff --git a/node/src/sub_lib/neighborhood.rs b/node/src/sub_lib/neighborhood.rs index ba8ba7c6c9..f26282aa60 100644 --- a/node/src/sub_lib/neighborhood.rs +++ b/node/src/sub_lib/neighborhood.rs @@ -35,10 +35,10 @@ use std::time::Duration; const ASK_ABOUT_GOSSIP_INTERVAL: Duration = Duration::from_secs(10); pub const DEFAULT_RATE_PACK: RatePack = RatePack { - routing_byte_rate: 172_300_000, - routing_service_rate: 1_723_000_000, - exit_byte_rate: 344_600_000, - exit_service_rate: 3_446_000_000, + routing_byte_rate: 53_844, + routing_service_rate: 53_844, + exit_byte_rate: 107_688, + exit_service_rate: 107_688, }; pub const ZERO_RATE_PACK: RatePack = RatePack { @@ -638,10 +638,10 @@ mod tests { assert_eq!( DEFAULT_RATE_PACK, RatePack { - routing_byte_rate: 172_300_000, - routing_service_rate: 1_723_000_000, - exit_byte_rate: 344_600_000, - exit_service_rate: 3_446_000_000, + routing_byte_rate: 53_844, + routing_service_rate: 53_844, + exit_byte_rate: 107_688, + exit_service_rate: 107_688, } ); assert_eq!( diff --git a/node/tests/connection_shutdown_test.rs b/node/tests/connection_shutdown_test.rs index 4c98dfeac8..cb72f63c3b 100644 --- a/node/tests/connection_shutdown_test.rs +++ b/node/tests/connection_shutdown_test.rs @@ -21,7 +21,11 @@ fn proxy_client_stream_reader_dies_when_client_stream_is_killed_integration() { let ui_port = find_free_port(); let _node = utils::MASQNode::start_standard( "proxy_client_stream_reader_dies_when_client_stream_is_killed_integration", - Some(CommandConfig::new().pair("--ui-port", &ui_port.to_string())), + Some( + CommandConfig::new() + .pair("--blockchain-service-url", "https://booga.com") + .pair("--ui-port", &ui_port.to_string()), + ), true, true, false, diff --git a/node/tests/dump_configuration_test.rs b/node/tests/dump_configuration_test.rs index 62a045b0d2..db11547440 100644 --- a/node/tests/dump_configuration_test.rs +++ b/node/tests/dump_configuration_test.rs @@ -21,6 +21,7 @@ fn dump_configuration_with_an_existing_database_integration() { test_name, Some( CommandConfig::new() + .pair("--blockchain-service-url", "https://booga.com") .pair("--ui-port", &port.to_string()) .pair("--chain", "polygon-amoy"), ), diff --git a/node/tests/financials_test.rs b/node/tests/financials_test.rs index 9847efa385..3f4ff717f3 100644 --- a/node/tests/financials_test.rs +++ b/node/tests/financials_test.rs @@ -73,7 +73,11 @@ fn financials_command_retrieves_payable_and_receivable_records_integration() { .unwrap(); let mut node = MASQNode::start_standard( test_name, - Some(CommandConfig::new().pair("--ui-port", &port.to_string())), + Some( + CommandConfig::new() + .pair("--blockchain-service-url", "https://booga.com") + .pair("--ui-port", &port.to_string()), + ), false, true, false, diff --git a/node/tests/http_through_node_test.rs b/node/tests/http_through_node_test.rs index eac50603b7..197362db74 100644 --- a/node/tests/http_through_node_test.rs +++ b/node/tests/http_through_node_test.rs @@ -2,6 +2,7 @@ pub mod utils; +use crate::utils::CommandConfig; use node_lib::test_utils::read_until_timeout; use std::io::Write; use std::net::SocketAddr; @@ -14,7 +15,7 @@ use std::time::Duration; fn http_through_node_integration() { let _node = utils::MASQNode::start_standard( "http_through_node_integration", - None, + Some(CommandConfig::new().pair("--blockchain-service-url", "https://booga.com")), true, true, false, diff --git a/node/tests/ui_gateway_test.rs b/node/tests/ui_gateway_test.rs index 07b603bff6..0280f8aaa2 100644 --- a/node/tests/ui_gateway_test.rs +++ b/node/tests/ui_gateway_test.rs @@ -29,6 +29,7 @@ fn ui_requests_something_and_gets_corresponding_response_integration() { test_name, Some( CommandConfig::new() + .pair("--blockchain-service-url", "https://booga.com") .pair("--ui-port", &port.to_string()) .pair( "--data-directory", From a8a4a03657a794c444fd510a7b185f47c61e9645 Mon Sep 17 00:00:00 2001 From: czarte Date: Wed, 17 Sep 2025 12:49:56 +0200 Subject: [PATCH 02/22] fixing the tests --- masq_lib/src/shared_schema.rs | 7 +++++- .../blockchain_interface_web3/utils.rs | 22 +++++++++---------- node/src/bootstrapper.rs | 2 +- .../node_configurator_standard.rs | 2 +- node/tests/dns_resolve_failure_test.rs | 5 +++-- node/tests/initialization_test.rs | 10 ++++++++- .../node_exits_from_future_panic_test.rs | 7 +++++- node/tests/tls_through_node_test.rs | 3 ++- node/tests/ui_gateway_test.rs | 8 ++++++- 9 files changed, 46 insertions(+), 20 deletions(-) diff --git a/masq_lib/src/shared_schema.rs b/masq_lib/src/shared_schema.rs index 41710321d9..a9b80bc30b 100644 --- a/masq_lib/src/shared_schema.rs +++ b/masq_lib/src/shared_schema.rs @@ -366,6 +366,7 @@ pub fn shared_app(head: App<'static, 'static>) -> App<'static, 'static> { .value_name("URL") .min_values(0) .max_values(1) + .required(true) .help(BLOCKCHAIN_SERVICE_HELP), ) .arg(chain_arg()) @@ -739,7 +740,11 @@ mod tests { exit services from your MASQ Node (e.g. http://localhost:8545, \ https://ropsten.infura.io/v3/YOUR-PROJECT-ID, https://mainnet.infura.io/v3/YOUR-PROJECT-ID), \ https://base-mainnet.g.alchemy.com/v2/d66UL0lPrltmweEqVsv3opBSVI3wkL8I, \ - https://polygon-mainnet.infura.io/v3/YOUR-PROJECT-ID" + https://polygon-mainnet.infura.io/v3/YOUR-PROJECT-ID \n This argument is mandatory, to ensure, you \ + will not be deliquency banned due unable to pay your debts to MASQ network. If you are in region \ + where you have no access to blockchain services, to create your own app, use one of following public \ + endpoints for Base Mainnet (you need to specify Base Mainnet chain in the chain argument): \n\ + https://mainnet.base.org \nhttps://base.llamarpc.com \nhttps://1rpc.io/base \nhttps://base-rpc.publicnode.com" ); assert_eq!( CHAIN_HELP, diff --git a/node/src/blockchain/blockchain_interface/blockchain_interface_web3/utils.rs b/node/src/blockchain/blockchain_interface/blockchain_interface_web3/utils.rs index 03ed4150bc..7b352f65fe 100644 --- a/node/src/blockchain/blockchain_interface/blockchain_interface_web3/utils.rs +++ b/node/src/blockchain/blockchain_interface/blockchain_interface_web3/utils.rs @@ -406,7 +406,7 @@ mod tests { result, HashAndAmount { hash: H256::from_str( - "94881436a9c89f48b01651ff491c69e97089daf71ab8cfb240243d7ecf9b38b2" + "1931f78f7ce5b43ffae11a2c22f18765508a2b2d4810e84744f53b10f7072c7f" ) .unwrap(), amount: account.balance_wei @@ -453,14 +453,14 @@ mod tests { vec![ HashAndAmount { hash: H256::from_str( - "94881436a9c89f48b01651ff491c69e97089daf71ab8cfb240243d7ecf9b38b2" + "1931f78f7ce5b43ffae11a2c22f18765508a2b2d4810e84744f53b10f7072c7f" ) .unwrap(), amount: 1000000000 }, HashAndAmount { hash: H256::from_str( - "3811874d2b73cecd51234c94af46bcce918d0cb4de7d946c01d7da606fe761b5" + "0d6daf751e62b89e79cac26d6376cf259d58e996cfccd63f3f43bb6408d1bae8" ) .unwrap(), amount: 2000000000 @@ -648,14 +648,14 @@ mod tests { Correct(PendingPayable { recipient_wallet: accounts[0].wallet.clone(), hash: H256::from_str( - "35f42b260f090a559e8b456718d9c91a9da0f234ed0a129b9d5c4813b6615af4", + "7bff7fd8e627d317203742a40f77be1a4155b4c3a29dfd4f96088775f0237023", ) .unwrap(), }), Correct(PendingPayable { recipient_wallet: accounts[1].wallet.clone(), hash: H256::from_str( - "7f3221109e4f1de8ba1f7cd358aab340ecca872a1456cb1b4f59ca33d3e22ee3", + "5bc60cce367d9698b8dbdb340e2af3a3166bb4469e69db899f5074938ea0d61b", ) .unwrap(), }), @@ -678,8 +678,8 @@ mod tests { let expected_result = Err(Sending { msg: format!("Transport error: Error(Connect, Os {{ code: {}, kind: ConnectionRefused, message: {:?} }})", os_code, os_msg).to_string(), hashes: vec![ - H256::from_str("35f42b260f090a559e8b456718d9c91a9da0f234ed0a129b9d5c4813b6615af4").unwrap(), - H256::from_str("7f3221109e4f1de8ba1f7cd358aab340ecca872a1456cb1b4f59ca33d3e22ee3").unwrap() + H256::from_str("7bff7fd8e627d317203742a40f77be1a4155b4c3a29dfd4f96088775f0237023").unwrap(), + H256::from_str("5bc60cce367d9698b8dbdb340e2af3a3166bb4469e69db899f5074938ea0d61b").unwrap() ], }); @@ -719,7 +719,7 @@ mod tests { data: None, }), recipient_wallet: accounts[0].wallet.clone(), - hash: H256::from_str("35f42b260f090a559e8b456718d9c91a9da0f234ed0a129b9d5c4813b6615af4").unwrap(), + hash: H256::from_str("7bff7fd8e627d317203742a40f77be1a4155b4c3a29dfd4f96088775f0237023").unwrap(), }), Failed(RpcPayableFailure { rpc_error: Rpc(Error { @@ -728,7 +728,7 @@ mod tests { data: None, }), recipient_wallet: accounts[1].wallet.clone(), - hash: H256::from_str("7f3221109e4f1de8ba1f7cd358aab340ecca872a1456cb1b4f59ca33d3e22ee3").unwrap(), + hash: H256::from_str("5bc60cce367d9698b8dbdb340e2af3a3166bb4469e69db899f5074938ea0d61b").unwrap(), }), ]); @@ -758,7 +758,7 @@ mod tests { let expected_result = Ok(vec![ Correct(PendingPayable { recipient_wallet: accounts[0].wallet.clone(), - hash: H256::from_str("35f42b260f090a559e8b456718d9c91a9da0f234ed0a129b9d5c4813b6615af4").unwrap(), + hash: H256::from_str("7bff7fd8e627d317203742a40f77be1a4155b4c3a29dfd4f96088775f0237023").unwrap(), }), Failed(RpcPayableFailure { rpc_error: Rpc(Error { @@ -767,7 +767,7 @@ mod tests { data: None, }), recipient_wallet: accounts[1].wallet.clone(), - hash: H256::from_str("7f3221109e4f1de8ba1f7cd358aab340ecca872a1456cb1b4f59ca33d3e22ee3").unwrap(), + hash: H256::from_str("5bc60cce367d9698b8dbdb340e2af3a3166bb4469e69db899f5074938ea0d61b").unwrap(), }), ]); diff --git a/node/src/bootstrapper.rs b/node/src/bootstrapper.rs index 078c0f1e0e..b9be92037f 100644 --- a/node/src/bootstrapper.rs +++ b/node/src/bootstrapper.rs @@ -1517,7 +1517,7 @@ mod tests { .build(); subject - .initialize_as_privileged(&make_simplified_multi_config(["--ip", "111.111.111.111"])) + .initialize_as_privileged(&make_simplified_multi_config(["--blockchain-service-url", "https://booga.com", "--ip", "111.111.111.111"])) .unwrap(); } diff --git a/node/src/node_configurator/node_configurator_standard.rs b/node/src/node_configurator/node_configurator_standard.rs index 01afbc285c..7d3bad07cc 100644 --- a/node/src/node_configurator/node_configurator_standard.rs +++ b/node/src/node_configurator/node_configurator_standard.rs @@ -1838,7 +1838,7 @@ mod tests { let _clap_guard = ClapGuard::new(); running_test(); let home_dir = Path::new("/home/cooga"); - let home_dir_poly_main = home_dir.join(".local").join("MASQ").join("polygon-mainnet"); + let home_dir_poly_main = home_dir.join(".local").join("MASQ").join("base-mainnet"); let home_dir_poly_amoy = home_dir.join(".local").join("MASQ").join("polygon-amoy"); vec![ (None, None, Some(home_dir_poly_main.to_str().unwrap())), diff --git a/node/tests/dns_resolve_failure_test.rs b/node/tests/dns_resolve_failure_test.rs index 7ba16e3575..13edb1b50b 100644 --- a/node/tests/dns_resolve_failure_test.rs +++ b/node/tests/dns_resolve_failure_test.rs @@ -2,6 +2,7 @@ pub mod utils; +use crate::utils::CommandConfig; use node_lib::test_utils::{assert_string_contains, read_until_timeout}; use std::io::Write; use std::net::{SocketAddr, TcpStream}; @@ -12,7 +13,7 @@ use std::time::Duration; fn dns_resolve_failure_http_response_integration() { let _node_to_test_against = utils::MASQNode::start_standard( "dns_resolve_failure_http_response_integration", - None, + Some(CommandConfig::new().pair("--blockchain-service-url", "https://booga.com")), true, true, false, @@ -35,7 +36,7 @@ fn dns_resolve_failure_http_response_integration() { fn dns_resolve_failure_tls_response_integration() { let _node_to_test_against = utils::MASQNode::start_standard( "dns_resolve_failure_tls_response_integration", - None, + Some(CommandConfig::new().pair("--blockchain-service-url", "https://booga.com")), true, true, false, diff --git a/node/tests/initialization_test.rs b/node/tests/initialization_test.rs index 0a5e46ba8d..6b6e3788ae 100644 --- a/node/tests/initialization_test.rs +++ b/node/tests/initialization_test.rs @@ -61,7 +61,11 @@ fn initialization_sequence_integration() { let daemon_port = find_free_port(); let mut daemon = MASQNode::start_daemon( "initialization_sequence_integration", - Some(CommandConfig::new().pair("--ui-port", format!("{}", daemon_port).as_str())), + Some( + CommandConfig::new() + .pair("--blockchain-service-url", "https://booga.com") + .pair("--ui-port", format!("{}", daemon_port).as_str()), + ), true, true, false, @@ -157,6 +161,7 @@ fn incomplete_node_descriptor_is_refused_integration() { "incomplete_node_descriptor_is_refused_integration", Some( CommandConfig::new() + .pair("--blockchain-service-url", "https://booga.com") .pair( "--neighbors", &format!("masq://{chain_identifier}:12345vhVbmVyGejkYUkmftF09pmGZGKg_PzRNnWQxFw@12.23.34.45:5678,masq://{chain_identifier}:abJ5XvhVbmVyGejkYUkmftF09pmGZGKg_PzRNnWQxFw@:") @@ -188,6 +193,7 @@ fn started_without_explicit_chain_parameter_runs_fine_integration() { //defaulted chain - chosen on the lack of user specified chain - corresponds with descriptors //believed to be for the default chain let config = CommandConfig::new() + .pair("--blockchain-service-url", "https://booga.com") .pair("--neighborhood-mode", "standard") .pair("--ip", "1.0.0.1") .pair("--log-level", "trace") @@ -223,6 +229,7 @@ fn requested_chain_meets_different_db_chain_and_panics_integration() { test_name, Some( CommandConfig::new() + .pair("--blockchain-service-url", "https://booga.com") .pair("--ui-port", &port.to_string()) .pair("--chain", &chain_literal), ), @@ -268,6 +275,7 @@ fn requested_chain_meets_different_db_chain_and_panics_integration() { #[test] fn node_creates_log_file_with_heading_integration() { let config = CommandConfig::new() + .pair("--blockchain-service-url", "https://booga.com") .pair("--neighborhood-mode", "standard") .pair("--ip", "1.0.0.1") .pair( diff --git a/node/tests/node_exits_from_future_panic_test.rs b/node/tests/node_exits_from_future_panic_test.rs index dc3ec25ab0..172cefd767 100644 --- a/node/tests/node_exits_from_future_panic_test.rs +++ b/node/tests/node_exits_from_future_panic_test.rs @@ -41,6 +41,7 @@ fn node_logs_panic_integration() { "Could not create chain directory inside node_logs_panic_integration home/MASQ directory", ); let panic_config = CommandConfig::new() + .pair("--blockchain-service-url", "https://booga.com") .pair("--crash-point", "panic") .pair("--chain", "polygon-mainnet") .pair("--data-directory", data_directory.to_str().unwrap()); @@ -67,7 +68,11 @@ const STAT_FORMAT_PARAM_NAME: &str = "-f"; fn node_logfile_does_not_belong_to_root_integration() { let mut node = MASQNode::start_standard( "node_logfile_does_not_belong_to_root_integration", - Some(CommandConfig::new().pair("--chain", "polygon-amoy")), + Some( + CommandConfig::new() + .pair("--blockchain-service-url", "https://booga.com") + .pair("--chain", "polygon-amoy"), + ), true, true, false, diff --git a/node/tests/tls_through_node_test.rs b/node/tests/tls_through_node_test.rs index 6cb04cc912..7c1660c15b 100644 --- a/node/tests/tls_through_node_test.rs +++ b/node/tests/tls_through_node_test.rs @@ -2,6 +2,7 @@ pub mod utils; +use crate::utils::CommandConfig; use native_tls::TlsConnector; use native_tls::{HandshakeError, MidHandshakeTlsStream, TlsStream}; use node_lib::test_utils::*; @@ -16,7 +17,7 @@ use std::time::Duration; fn tls_through_node_integration() { let _node = utils::MASQNode::start_standard( "tls_through_node_integration", - None, + Some(CommandConfig::new().pair("--blockchain-service-url", "https://booga.com")), true, true, false, diff --git a/node/tests/ui_gateway_test.rs b/node/tests/ui_gateway_test.rs index 0280f8aaa2..cdcbee5ac7 100644 --- a/node/tests/ui_gateway_test.rs +++ b/node/tests/ui_gateway_test.rs @@ -64,6 +64,7 @@ fn log_broadcasts_are_correctly_received_integration() { "log_broadcasts_are_correctly_received", Some( CommandConfig::new() + .pair("--blockchain-service-url", "https://booga.com") .pair("--ui-port", &port.to_string()) .pair("--chain", "polygon-mainnet"), ), @@ -129,7 +130,11 @@ fn daemon_does_not_allow_node_to_keep_his_client_alive_integration() { let daemon_port = find_free_port(); let mut daemon = utils::MASQNode::start_daemon( test_name, - Some(CommandConfig::new().pair("--ui-port", daemon_port.to_string().as_str())), + Some( + CommandConfig::new() + .pair("--blockchain-service-url", "https://booga.com") + .pair("--ui-port", daemon_port.to_string().as_str()), + ), true, true, false, @@ -209,6 +214,7 @@ fn cleanup_after_deceased_clients_integration() { test_name, Some( CommandConfig::new() + .pair("--blockchain-service-url", "https://booga.com") .pair("--chain", DEFAULT_CHAIN.rec().literal_identifier) .pair("--ui-port", &port.to_string()), ), From 730f76760adb122ea6887bfe147e33d3b5d5fc0f Mon Sep 17 00:00:00 2001 From: czarte Date: Wed, 17 Sep 2025 17:13:56 +0200 Subject: [PATCH 03/22] fix for testing run without blockchain-service-url, fixed tests --- masq_lib/src/shared_schema.rs | 1 - node/src/bootstrapper.rs | 7 +- .../unprivileged_parse_args_configuration.rs | 64 +++++++++++++++---- node/tests/initialization_test.rs | 6 +- 4 files changed, 59 insertions(+), 19 deletions(-) diff --git a/masq_lib/src/shared_schema.rs b/masq_lib/src/shared_schema.rs index a9b80bc30b..f8f4477d68 100644 --- a/masq_lib/src/shared_schema.rs +++ b/masq_lib/src/shared_schema.rs @@ -366,7 +366,6 @@ pub fn shared_app(head: App<'static, 'static>) -> App<'static, 'static> { .value_name("URL") .min_values(0) .max_values(1) - .required(true) .help(BLOCKCHAIN_SERVICE_HELP), ) .arg(chain_arg()) diff --git a/node/src/bootstrapper.rs b/node/src/bootstrapper.rs index b9be92037f..fe65b48abc 100644 --- a/node/src/bootstrapper.rs +++ b/node/src/bootstrapper.rs @@ -1517,7 +1517,12 @@ mod tests { .build(); subject - .initialize_as_privileged(&make_simplified_multi_config(["--blockchain-service-url", "https://booga.com", "--ip", "111.111.111.111"])) + .initialize_as_privileged(&make_simplified_multi_config([ + "--blockchain-service-url", + "https://booga.com", + "--ip", + "111.111.111.111", + ])) .unwrap(); } diff --git a/node/src/node_configurator/unprivileged_parse_args_configuration.rs b/node/src/node_configurator/unprivileged_parse_args_configuration.rs index 8f24ea2a17..d726e4b9ef 100644 --- a/node/src/node_configurator/unprivileged_parse_args_configuration.rs +++ b/node/src/node_configurator/unprivileged_parse_args_configuration.rs @@ -44,16 +44,20 @@ pub trait UnprivilegedParseArgsConfiguration { value_m!(multi_config, "blockchain-service-url", String) } else { match persistent_config.blockchain_service_url() { - Ok(Some(price)) => Some(price), - Ok(None) => { + Ok(Some(price)) => Some(price), + Ok(None) => { + if self.blockchain_service_url_error(multi_config) { return Err(MultiConfig::make_configurator_error(Error { - message: "The following required arguments were not provided: --blockchain-service-url USAGE: --blockchain-service-url ".to_string(), - kind: clap::ErrorKind::ArgumentNotFound, - info: Some(vec!["".to_string()]), - })) + message: "The following required arguments were not provided: --blockchain-service-url USAGE: --blockchain-service-url ".to_string(), + kind: clap::ErrorKind::ArgumentNotFound, + info: Some(vec!["".to_string()]), + })); + } else { + None } - Err(pce) => return Err(pce.into_configurator_error("gas-price")), } + Err(pce) => return Err(pce.into_configurator_error("gas-price")), + } }; unprivileged_config.clandestine_port_opt = value_m!(multi_config, "clandestine-port", u16); unprivileged_config.blockchain_bridge_config.gas_price = @@ -77,6 +81,14 @@ pub trait UnprivilegedParseArgsConfiguration { mnc_result.map(|config| unprivileged_config.neighborhood_config = config) } + fn blockchain_service_url_error(&self, multi_config: &MultiConfig) -> bool { + let zerohop = + value_m!(multi_config, "neighborhood-mode", String) != Some("zero-hop".to_string()); + let fake_public_key = value_m!(multi_config, "fake-public-key", String) == None; + let crash_point = value_m!(multi_config, "crash-point", String) == None; + zerohop && fake_public_key && crash_point + } + fn get_past_neighbors( &self, persistent_config: &mut dyn PersistentConfiguration, @@ -1210,7 +1222,7 @@ mod tests { } #[test] - fn configure_without_blockchain_service_url_returns_error() { + fn unprivileged_parse_args_without_blockchain_service_url_returns_error() { running_test(); let set_past_neighbors_params_arc = Arc::new(Mutex::new(vec![])); let mut config = BootstrapperConfig::new(); @@ -1226,10 +1238,6 @@ mod tests { "masq://eth-ropsten:UJNoZW5p-PDVqEjpr3b_8jZ_93yPG8i5dOAgE1bhK_A@2.3.4.5:2345", "--db-password", "password", - "--neighborhood-mode", - "zero-hop", - "--fake-public-key", - "booga", ]); let subject = UnprivilegedParseArgsConfigurationDaoReal {}; @@ -1251,6 +1259,38 @@ mod tests { assert_eq!(result, expected); } + #[test] + fn unprivileged_parse_args_without_blockchain_service_url_but_not_bsu_error_returns_ok() { + running_test(); + let set_past_neighbors_params_arc = Arc::new(Mutex::new(vec![])); + let mut config = BootstrapperConfig::new(); + let mut persistent_config = configure_default_persistent_config( + RATE_PACK | ACCOUNTANT_CONFIG_PARAMS | MAPPING_PROTOCOL, + ) + .set_past_neighbors_params(&set_past_neighbors_params_arc) + .set_past_neighbors_result(Ok(())); + let multi_config = make_simplified_multi_config([ + "--chain", + "eth-ropsten", + "--neighbors", + "masq://eth-ropsten:UJNoZW5p-PDVqEjpr3b_8jZ_93yPG8i5dOAgE1bhK_A@2.3.4.5:2345", + "--db-password", + "password", + "--fake-public-key", + "booga", + ]); + let subject = UnprivilegedParseArgsConfigurationDaoReal {}; + + let result = subject.unprivileged_parse_args( + &multi_config, + &mut config, + &mut persistent_config, + &Logger::new("test"), + ); + + assert_eq!(result, Ok(())); + } + #[test] fn configure_zero_hop_with_neighbors_supplied() { running_test(); diff --git a/node/tests/initialization_test.rs b/node/tests/initialization_test.rs index 6b6e3788ae..145beb99b9 100644 --- a/node/tests/initialization_test.rs +++ b/node/tests/initialization_test.rs @@ -61,11 +61,7 @@ fn initialization_sequence_integration() { let daemon_port = find_free_port(); let mut daemon = MASQNode::start_daemon( "initialization_sequence_integration", - Some( - CommandConfig::new() - .pair("--blockchain-service-url", "https://booga.com") - .pair("--ui-port", format!("{}", daemon_port).as_str()), - ), + Some(CommandConfig::new().pair("--ui-port", format!("{}", daemon_port).as_str())), true, true, false, From a7bec12be3187e051941b1f30c991d4066845af9 Mon Sep 17 00:00:00 2001 From: czarte Date: Wed, 17 Sep 2025 17:39:59 +0200 Subject: [PATCH 04/22] removing wrongly placed --blockchain-service-url --- node/tests/ui_gateway_test.rs | 1 - 1 file changed, 1 deletion(-) diff --git a/node/tests/ui_gateway_test.rs b/node/tests/ui_gateway_test.rs index cdcbee5ac7..9c4e1b9f63 100644 --- a/node/tests/ui_gateway_test.rs +++ b/node/tests/ui_gateway_test.rs @@ -132,7 +132,6 @@ fn daemon_does_not_allow_node_to_keep_his_client_alive_integration() { test_name, Some( CommandConfig::new() - .pair("--blockchain-service-url", "https://booga.com") .pair("--ui-port", daemon_port.to_string().as_str()), ), true, From 6b821656e4deaf04a441db48dde1baa746213866 Mon Sep 17 00:00:00 2001 From: czarte Date: Wed, 17 Sep 2025 17:42:42 +0200 Subject: [PATCH 05/22] formatting --- node/tests/ui_gateway_test.rs | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/node/tests/ui_gateway_test.rs b/node/tests/ui_gateway_test.rs index 9c4e1b9f63..99159f8b2a 100644 --- a/node/tests/ui_gateway_test.rs +++ b/node/tests/ui_gateway_test.rs @@ -130,10 +130,7 @@ fn daemon_does_not_allow_node_to_keep_his_client_alive_integration() { let daemon_port = find_free_port(); let mut daemon = utils::MASQNode::start_daemon( test_name, - Some( - CommandConfig::new() - .pair("--ui-port", daemon_port.to_string().as_str()), - ), + Some(CommandConfig::new().pair("--ui-port", daemon_port.to_string().as_str())), true, true, false, From 418adb9fbe1bdb128c6799e8051288dbe43c0e8d Mon Sep 17 00:00:00 2001 From: czarte Date: Thu, 18 Sep 2025 09:28:09 +0200 Subject: [PATCH 06/22] fix integration test with chain dir --- node/tests/ui_gateway_test.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/node/tests/ui_gateway_test.rs b/node/tests/ui_gateway_test.rs index 99159f8b2a..df0686311e 100644 --- a/node/tests/ui_gateway_test.rs +++ b/node/tests/ui_gateway_test.rs @@ -141,7 +141,7 @@ fn daemon_does_not_allow_node_to_keep_his_client_alive_integration() { let _: UiSetupResponse = daemon_client .transact(UiSetupRequest::new(vec![ ("ip", Some("100.80.1.1")), - ("chain", Some("polygon-mainnet")), + ("chain", Some("base-mainnet")), ("neighborhood-mode", Some("standard")), ("log-level", Some("trace")), ("blockchain-service-url", Some("https://www.example.com")), From 4fcfc642caab83918d3369988457671ff797e489 Mon Sep 17 00:00:00 2001 From: czarte Date: Thu, 18 Sep 2025 10:40:49 +0200 Subject: [PATCH 07/22] fix financial test --- node/tests/financials_test.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/node/tests/financials_test.rs b/node/tests/financials_test.rs index 3f4ff717f3..57fae8a615 100644 --- a/node/tests/financials_test.rs +++ b/node/tests/financials_test.rs @@ -3,7 +3,7 @@ pub mod utils; use crate::utils::{make_conn, CommandConfig}; -use masq_lib::constants::POLYGON_MAINNET_FULL_IDENTIFIER; +use masq_lib::constants::{DEFAULT_CHAIN, POLYGON_MAINNET_FULL_IDENTIFIER}; use masq_lib::messages::{ TopRecordsConfig, TopRecordsOrdering, UiFinancialsRequest, UiFinancialsResponse, UiShutdownRequest, NODE_UI_PROTOCOL, @@ -48,7 +48,7 @@ fn financials_command_retrieves_payable_and_receivable_records_integration() { config_dao .set( "chain_name", - Some(POLYGON_MAINNET_FULL_IDENTIFIER.to_string()), + Some(DEFAULT_CHAIN.rec().literal_identifier.to_string()), ) .unwrap(); } From 105151b52db6052ec4ab220ae3161c052dc4e5cb Mon Sep 17 00:00:00 2001 From: czarte Date: Thu, 18 Sep 2025 12:24:38 +0200 Subject: [PATCH 08/22] remove unused import --- node/tests/financials_test.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/node/tests/financials_test.rs b/node/tests/financials_test.rs index 57fae8a615..3a3783daee 100644 --- a/node/tests/financials_test.rs +++ b/node/tests/financials_test.rs @@ -3,7 +3,7 @@ pub mod utils; use crate::utils::{make_conn, CommandConfig}; -use masq_lib::constants::{DEFAULT_CHAIN, POLYGON_MAINNET_FULL_IDENTIFIER}; +use masq_lib::constants::DEFAULT_CHAIN; use masq_lib::messages::{ TopRecordsConfig, TopRecordsOrdering, UiFinancialsRequest, UiFinancialsResponse, UiShutdownRequest, NODE_UI_PROTOCOL, From efca983753cfcdbcfba14b2bb8e715415f4de6b1 Mon Sep 17 00:00:00 2001 From: czarte Date: Thu, 18 Sep 2025 16:02:48 +0200 Subject: [PATCH 09/22] integration tests fix --- node/tests/initialization_test.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/node/tests/initialization_test.rs b/node/tests/initialization_test.rs index 145beb99b9..9872a18758 100644 --- a/node/tests/initialization_test.rs +++ b/node/tests/initialization_test.rs @@ -152,7 +152,7 @@ fn wait_for_process_end(process_id: u32) { #[test] fn incomplete_node_descriptor_is_refused_integration() { - let chain_identifier = "polygon-mainnet"; + let chain_identifier = "base-mainnet"; let mut node = utils::MASQNode::start_standard( "incomplete_node_descriptor_is_refused_integration", Some( From 49c3b1cad2e496d288f09d7a69e5c31a9f0bae7b Mon Sep 17 00:00:00 2001 From: czarte Date: Thu, 18 Sep 2025 16:47:25 +0200 Subject: [PATCH 10/22] fixing Windows tests --- node/src/node_configurator/node_configurator_standard.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/node/src/node_configurator/node_configurator_standard.rs b/node/src/node_configurator/node_configurator_standard.rs index 7d3bad07cc..e2d6efbf17 100644 --- a/node/src/node_configurator/node_configurator_standard.rs +++ b/node/src/node_configurator/node_configurator_standard.rs @@ -1090,7 +1090,7 @@ mod tests { #[cfg(target_os = "windows")] assert_eq!( value_m!(env_multiconfig, "data-directory", String).unwrap(), - "generated/test/node_configurator_standard/server_initializer_collected_params_handle_dot_config_file_path_and_reads_arguments_from_cf/home\\data_dir\\MASQ\\polygon-mainnet".to_string() + "generated/test/node_configurator_standard/server_initializer_collected_params_handle_dot_config_file_path_and_reads_arguments_from_cf/home\\data_dir\\MASQ\\base-mainnet".to_string() ); } @@ -1201,7 +1201,7 @@ mod tests { #[cfg(target_os = "windows")] assert_eq!( value_m!(env_multiconfig, "data-directory", String).unwrap(), - "/home/booga\\data_dir\\MASQ\\polygon-mainnet".to_string() + "/home/booga\\data_dir\\MASQ\\base-mainnet".to_string() ); } @@ -1262,7 +1262,7 @@ mod tests { #[cfg(target_os = "windows")] assert_eq!( value_m!(env_multiconfig, "data-directory", String).unwrap(), - "/home/booga\\data_dir\\MASQ\\polygon-mainnet".to_string() + "/home/booga\\data_dir\\MASQ\\base-mainnet".to_string() ); } From f4cdb237fa1a49dad7ed90dad49ab09ae5e95572 Mon Sep 17 00:00:00 2001 From: czarte Date: Thu, 18 Sep 2025 17:45:32 +0200 Subject: [PATCH 11/22] fixing masq UI --- masq/src/commands/setup_command.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/masq/src/commands/setup_command.rs b/masq/src/commands/setup_command.rs index eaeede3c8b..c7e0d6ef62 100644 --- a/masq/src/commands/setup_command.rs +++ b/masq/src/commands/setup_command.rs @@ -227,7 +227,7 @@ mod tests { "zero-hop".to_string(), "--log-level".to_string(), "--chain".to_string(), - "polygon-mainnet".to_string(), + DEFAULT_CHAIN.rec().literal_identifier.to_string(), "--scan-intervals".to_string(), "123|111|228".to_string(), "--scans".to_string(), From c5ffed8d42791f16b2b9937b86bf617df02ba614 Mon Sep 17 00:00:00 2001 From: czarte Date: Fri, 19 Sep 2025 14:26:28 +0200 Subject: [PATCH 12/22] wait to Node shutdownt increased to 10 sec --- node/tests/ui_gateway_test.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/node/tests/ui_gateway_test.rs b/node/tests/ui_gateway_test.rs index df0686311e..5fe43f6ed4 100644 --- a/node/tests/ui_gateway_test.rs +++ b/node/tests/ui_gateway_test.rs @@ -99,7 +99,7 @@ fn log_broadcasts_are_correctly_received_integration() { fn wait_for_masq_node_ends() { let mut system = System::new_all(); - let deadline = SystemTime::now() + Duration::from_secs(5); + let deadline = SystemTime::now() + Duration::from_secs(10); loop { if SystemTime::now() > deadline { panic!("Previous instance of MASQNode does not stops"); From e20f81edb3b5e1deba4d110638c642aab3d3410a Mon Sep 17 00:00:00 2001 From: czarte Date: Fri, 19 Sep 2025 14:29:27 +0200 Subject: [PATCH 13/22] remove empty line --- node/tests/tls_through_node_test.rs | 1 - 1 file changed, 1 deletion(-) diff --git a/node/tests/tls_through_node_test.rs b/node/tests/tls_through_node_test.rs index 7c1660c15b..22c59994b8 100644 --- a/node/tests/tls_through_node_test.rs +++ b/node/tests/tls_through_node_test.rs @@ -51,7 +51,6 @@ fn tls_through_node_integration() { } } }; - let request = "GET / HTTP/1.1\r\nHost: www.example.com\r\n\r\n".as_bytes(); tls_stream .write(request.clone()) From a49aafb457e322427c6a1a5cf991429c4d54b39e Mon Sep 17 00:00:00 2001 From: czarte Date: Fri, 19 Sep 2025 19:55:46 +0200 Subject: [PATCH 14/22] fixing tests with default chain directory --- masq/tests/chain_specific_directory_test_integration.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/masq/tests/chain_specific_directory_test_integration.rs b/masq/tests/chain_specific_directory_test_integration.rs index 39d782cfc3..f2d5dd2e9a 100644 --- a/masq/tests/chain_specific_directory_test_integration.rs +++ b/masq/tests/chain_specific_directory_test_integration.rs @@ -20,7 +20,7 @@ fn ensure_data_directory_has_specific_chain_directory_within_integration() { let mut masq_handle2 = MasqProcess::new().start_interactive(port, true); let mut stdin_handle = masq_handle2.create_stdin_handle(); - stdin_handle.type_command("setup --data-directory /home/booga/masqhome/polygon-mainnet"); + stdin_handle.type_command("setup --data-directory /home/booga/masqhome/base-mainnet"); thread::sleep(Duration::from_millis(1000)); @@ -29,12 +29,12 @@ fn ensure_data_directory_has_specific_chain_directory_within_integration() { let (stdout2, _stderr2, _exit_code2) = masq_handle2.stop(); let expected = format!( "{:29} {:64} {}", - "data-directory", "/home/booga/masqhome/polygon-mainnet", "Set" + "data-directory", "/home/booga/masqhome/base-mainnet", "Set" ); assert!( - !stdout.contains("MASQ/polygon-mainnet/MASQ/polygon-mainnet Default"), - "Wrong directory: duplication of /MASQ/polygon-mainnet when Default" + !stdout.contains("MASQ/base-mainnet/MASQ/base-mainnet Default"), + "Wrong directory: duplication of /MASQ/base-mainnet when Default" ); assert!( stdout2.contains(&expected), From 9b1df5b2e7925695fa18cffee07dae6ddc92e7a8 Mon Sep 17 00:00:00 2001 From: czarte Date: Mon, 22 Sep 2025 18:54:38 +0200 Subject: [PATCH 15/22] fixing gwei_min_resolution_clause in receivable_dao.rs::custom_query --- node/src/accountant/db_access_objects/receivable_dao.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/node/src/accountant/db_access_objects/receivable_dao.rs b/node/src/accountant/db_access_objects/receivable_dao.rs index 9b71a3939c..b27f283c93 100644 --- a/node/src/accountant/db_access_objects/receivable_dao.rs +++ b/node/src/accountant/db_access_objects/receivable_dao.rs @@ -255,14 +255,14 @@ impl ReceivableDao for ReceivableDaoReal { fn custom_query(&self, custom_query: CustomQuery) -> Option> { let variant_top = TopStmConfig{ limit_clause: "limit :limit_count", - gwei_min_resolution_clause: "where (balance_high_b > 0) or ((balance_high_b = 0) and (balance_low_b >= 1000000000))", + gwei_min_resolution_clause: "where (balance_high_b > 0) or ((balance_high_b = 0) and (balance_low_b >= 50000))", age_ordering_clause: "last_received_timestamp asc", }; let variant_range = RangeStmConfig { where_clause: "where ((last_received_timestamp <= :max_timestamp) and (last_received_timestamp >= :min_timestamp)) \ and ((balance_high_b > :min_balance_high_b) or ((balance_high_b = :min_balance_high_b) and (balance_low_b >= :min_balance_low_b))) \ and ((balance_high_b < :max_balance_high_b) or ((balance_high_b = :max_balance_high_b) and (balance_low_b <= :max_balance_low_b)))", - gwei_min_resolution_clause: "and (((balance_high_b > 0) or ((balance_high_b = 0) and (balance_low_b >= 1000000000))) \ + gwei_min_resolution_clause: "and (((balance_high_b > 0) or ((balance_high_b = 0) and (balance_low_b >= 50000))) \ or ((balance_high_b < -1) or ((balance_high_b = -1) and (balance_low_b <= 9223372035854775807))))", //i64::MAX - 1*10^9 secondary_order_param: "last_received_timestamp asc" }; From 7bb31666aee8be3092a45f3f5bc3ba2e478d8ebb Mon Sep 17 00:00:00 2001 From: czarte Date: Mon, 22 Sep 2025 19:31:47 +0200 Subject: [PATCH 16/22] formatting --- node/src/accountant/db_access_objects/receivable_dao.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/node/src/accountant/db_access_objects/receivable_dao.rs b/node/src/accountant/db_access_objects/receivable_dao.rs index b27f283c93..57cf79478f 100644 --- a/node/src/accountant/db_access_objects/receivable_dao.rs +++ b/node/src/accountant/db_access_objects/receivable_dao.rs @@ -253,9 +253,10 @@ impl ReceivableDao for ReceivableDaoReal { } fn custom_query(&self, custom_query: CustomQuery) -> Option> { - let variant_top = TopStmConfig{ + let variant_top = TopStmConfig { limit_clause: "limit :limit_count", - gwei_min_resolution_clause: "where (balance_high_b > 0) or ((balance_high_b = 0) and (balance_low_b >= 50000))", + gwei_min_resolution_clause: + "where (balance_high_b > 0) or ((balance_high_b = 0) and (balance_low_b >= 50000))", age_ordering_clause: "last_received_timestamp asc", }; let variant_range = RangeStmConfig { From 0dfd4b1a8f00c8b3ec3b92dd5b3a505d06314388 Mon Sep 17 00:00:00 2001 From: czarte Date: Tue, 23 Sep 2025 16:22:27 +0200 Subject: [PATCH 17/22] fixed multinode tests --- multinode_integration_tests/tests/bookkeeping_test.rs | 8 ++++++++ node/src/accountant/db_access_objects/receivable_dao.rs | 4 ++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/multinode_integration_tests/tests/bookkeeping_test.rs b/multinode_integration_tests/tests/bookkeeping_test.rs index 36d07bad6b..abeff3b78a 100644 --- a/multinode_integration_tests/tests/bookkeeping_test.rs +++ b/multinode_integration_tests/tests/bookkeeping_test.rs @@ -13,6 +13,7 @@ use node_lib::sub_lib::wallet::Wallet; use std::collections::HashMap; use std::thread; use std::time::{Duration, SystemTime}; +use node_lib::sub_lib::neighborhood::RatePack; #[test] fn provided_and_consumed_services_are_recorded_in_databases() { @@ -116,6 +117,13 @@ pub fn start_real_node(cluster: &mut MASQNodeCluster, neighbor: NodeReference) - .neighbor(neighbor) .earning_wallet_info(make_earning_wallet_info(&index.to_string())) .chain(cluster.chain) + .rate_pack( RatePack { + //TODO create method in RatePack to return Default RatePack increased by some value or factor - make sure there is a test for this method + routing_byte_rate: 2000000000, + routing_service_rate: 2000000000, + exit_byte_rate: 2000000000, + exit_service_rate: 2000000000, + } ) .build(), ) } diff --git a/node/src/accountant/db_access_objects/receivable_dao.rs b/node/src/accountant/db_access_objects/receivable_dao.rs index 57cf79478f..284fc2113e 100644 --- a/node/src/accountant/db_access_objects/receivable_dao.rs +++ b/node/src/accountant/db_access_objects/receivable_dao.rs @@ -256,14 +256,14 @@ impl ReceivableDao for ReceivableDaoReal { let variant_top = TopStmConfig { limit_clause: "limit :limit_count", gwei_min_resolution_clause: - "where (balance_high_b > 0) or ((balance_high_b = 0) and (balance_low_b >= 50000))", + "where (balance_high_b > 0) or ((balance_high_b = 0) and (balance_low_b >= 1000000000))", age_ordering_clause: "last_received_timestamp asc", }; let variant_range = RangeStmConfig { where_clause: "where ((last_received_timestamp <= :max_timestamp) and (last_received_timestamp >= :min_timestamp)) \ and ((balance_high_b > :min_balance_high_b) or ((balance_high_b = :min_balance_high_b) and (balance_low_b >= :min_balance_low_b))) \ and ((balance_high_b < :max_balance_high_b) or ((balance_high_b = :max_balance_high_b) and (balance_low_b <= :max_balance_low_b)))", - gwei_min_resolution_clause: "and (((balance_high_b > 0) or ((balance_high_b = 0) and (balance_low_b >= 50000))) \ + gwei_min_resolution_clause: "and (((balance_high_b > 0) or ((balance_high_b = 0) and (balance_low_b >= 1000000000))) \ or ((balance_high_b < -1) or ((balance_high_b = -1) and (balance_low_b <= 9223372035854775807))))", //i64::MAX - 1*10^9 secondary_order_param: "last_received_timestamp asc" }; From 44ddf1d027efe2192fe9a11689f9d63062087b3c Mon Sep 17 00:00:00 2001 From: czarte Date: Tue, 23 Sep 2025 16:44:05 +0200 Subject: [PATCH 18/22] formatting --- multinode_integration_tests/tests/bookkeeping_test.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/multinode_integration_tests/tests/bookkeeping_test.rs b/multinode_integration_tests/tests/bookkeeping_test.rs index abeff3b78a..50be9376f5 100644 --- a/multinode_integration_tests/tests/bookkeeping_test.rs +++ b/multinode_integration_tests/tests/bookkeeping_test.rs @@ -9,11 +9,11 @@ use multinode_integration_tests_lib::utils::{payable_dao, receivable_dao}; use node_lib::accountant::db_access_objects::payable_dao::PayableAccount; use node_lib::accountant::db_access_objects::receivable_dao::ReceivableAccount; use node_lib::accountant::db_access_objects::utils::CustomQuery; +use node_lib::sub_lib::neighborhood::RatePack; use node_lib::sub_lib::wallet::Wallet; use std::collections::HashMap; use std::thread; use std::time::{Duration, SystemTime}; -use node_lib::sub_lib::neighborhood::RatePack; #[test] fn provided_and_consumed_services_are_recorded_in_databases() { @@ -117,13 +117,13 @@ pub fn start_real_node(cluster: &mut MASQNodeCluster, neighbor: NodeReference) - .neighbor(neighbor) .earning_wallet_info(make_earning_wallet_info(&index.to_string())) .chain(cluster.chain) - .rate_pack( RatePack { + .rate_pack(RatePack { //TODO create method in RatePack to return Default RatePack increased by some value or factor - make sure there is a test for this method routing_byte_rate: 2000000000, routing_service_rate: 2000000000, exit_byte_rate: 2000000000, exit_service_rate: 2000000000, - } ) + }) .build(), ) } From e9c1ab067f862f876044efbfdc50a959d9d659c8 Mon Sep 17 00:00:00 2001 From: czarte Date: Wed, 24 Sep 2025 15:32:25 +0200 Subject: [PATCH 19/22] after self review --- masq_lib/src/multi_config.rs | 1 - multinode_integration_tests/tests/bookkeeping_test.rs | 4 +++- node/src/bootstrapper.rs | 4 ---- node/src/daemon/mod.rs | 1 - node/src/daemon/setup_reporter.rs | 3 --- .../node_configurator/node_configurator_standard.rs | 10 ++-------- .../unprivileged_parse_args_configuration.rs | 7 +------ node/tests/ui_gateway_test.rs | 2 +- 8 files changed, 7 insertions(+), 25 deletions(-) diff --git a/masq_lib/src/multi_config.rs b/masq_lib/src/multi_config.rs index ce81934ec2..b1ce7a50a9 100644 --- a/masq_lib/src/multi_config.rs +++ b/masq_lib/src/multi_config.rs @@ -61,7 +61,6 @@ impl<'a> MultiConfig<'a> { schema: &App<'a, 'a>, vcls: Vec>, ) -> Result, ConfiguratorError> { - //TODO check if blockchain-service-url present in config down the road from here and return ConfiguratorError let initial: Box = Box::new(CommandLineVcl::new(vec![String::new()])); let merged = vcls diff --git a/multinode_integration_tests/tests/bookkeeping_test.rs b/multinode_integration_tests/tests/bookkeeping_test.rs index 50be9376f5..161487b1fe 100644 --- a/multinode_integration_tests/tests/bookkeeping_test.rs +++ b/multinode_integration_tests/tests/bookkeeping_test.rs @@ -118,7 +118,9 @@ pub fn start_real_node(cluster: &mut MASQNodeCluster, neighbor: NodeReference) - .earning_wallet_info(make_earning_wallet_info(&index.to_string())) .chain(cluster.chain) .rate_pack(RatePack { - //TODO create method in RatePack to return Default RatePack increased by some value or factor - make sure there is a test for this method + //TODO in case we are going to test more scenarios with need of higher RatePack: + // create method in RatePack to return Default RatePack increased by some value or factor + // make sure there is a test for this method routing_byte_rate: 2000000000, routing_service_rate: 2000000000, exit_byte_rate: 2000000000, diff --git a/node/src/bootstrapper.rs b/node/src/bootstrapper.rs index fe65b48abc..688d143368 100644 --- a/node/src/bootstrapper.rs +++ b/node/src/bootstrapper.rs @@ -1423,8 +1423,6 @@ mod tests { .add_listener_handler(third_handler) .build(); let args = [ - "--blockchain-service-url", - "https://booga.com", "--neighborhood-mode", "zero-hop", "--clandestine-port", @@ -1779,8 +1777,6 @@ mod tests { .add_listener_handler(Box::new(another_listener_handler)) .build(); let args = [ - "--blockchain-service-url", - "https://booga.com", "--neighborhood-mode", "zero-hop", "--data-directory", diff --git a/node/src/daemon/mod.rs b/node/src/daemon/mod.rs index 0b31a617fa..f16bcbc7f0 100644 --- a/node/src/daemon/mod.rs +++ b/node/src/daemon/mod.rs @@ -815,7 +815,6 @@ mod tests { client_id: 1234, body: UiSetupRequest { values: vec![ - UiSetupRequestValue::new("blockchain-service-url", "https://booga.com"), UiSetupRequestValue::new("data-directory", data_dir.to_str().unwrap()), UiSetupRequestValue::new("chain", TEST_DEFAULT_CHAIN.rec().literal_identifier), UiSetupRequestValue::new("neighborhood-mode", "zero-hop"), diff --git a/node/src/daemon/setup_reporter.rs b/node/src/daemon/setup_reporter.rs index 0dd306f275..a7448eba44 100644 --- a/node/src/daemon/setup_reporter.rs +++ b/node/src/daemon/setup_reporter.rs @@ -2041,7 +2041,6 @@ mod tests { ); let data_dir = base_dir.join("data_dir"); let existing_setup = setup_cluster_from(vec![ - ("blockchain-service-url", "https://booga.com", Set), ("neighborhood-mode", "zero-hop", Set), ("chain", DEFAULT_CHAIN.rec().literal_identifier, Default), ( @@ -2131,7 +2130,6 @@ mod tests { let existing_setup = setup_cluster_from(vec![ ("neighborhood-mode", "zero-hop", Set), ("chain", DEFAULT_CHAIN.rec().literal_identifier, Default), - ("blockchain-service-url", "https://booga.com", Set), ( "data-directory", &previously_processed_data_dir.to_string_lossy().to_string(), @@ -2172,7 +2170,6 @@ mod tests { .join(DEFAULT_CHAIN.rec().literal_identifier); let new_data_dir = base_dir.join("new_data_dir"); let existing_setup = setup_cluster_from(vec![ - ("blockchain-service-url", "https://booga.com", Set), ("neighborhood-mode", "zero-hop", Set), ("chain", DEFAULT_CHAIN.rec().literal_identifier, Default), ( diff --git a/node/src/node_configurator/node_configurator_standard.rs b/node/src/node_configurator/node_configurator_standard.rs index e2d6efbf17..4e72a67168 100644 --- a/node/src/node_configurator/node_configurator_standard.rs +++ b/node/src/node_configurator/node_configurator_standard.rs @@ -540,14 +540,8 @@ mod tests { "node_configurator_standard", "node_configurator_standard_unprivileged_handles_fake_public_key", ); - let multi_config = make_simplified_multi_config([ - "--blockchain-service-url", - "https://booga.com", - "--chain", - "eth-mainnet", - "--fake-public-key", - "AQIDBA", - ]); + let multi_config = + make_simplified_multi_config(["--chain", "eth-mainnet", "--fake-public-key", "AQIDBA"]); let mut privileged_config = BootstrapperConfig::default(); privileged_config.data_directory = home_dir; let subject = NodeConfiguratorStandardUnprivileged { diff --git a/node/src/node_configurator/unprivileged_parse_args_configuration.rs b/node/src/node_configurator/unprivileged_parse_args_configuration.rs index d726e4b9ef..9539dc8a59 100644 --- a/node/src/node_configurator/unprivileged_parse_args_configuration.rs +++ b/node/src/node_configurator/unprivileged_parse_args_configuration.rs @@ -44,7 +44,7 @@ pub trait UnprivilegedParseArgsConfiguration { value_m!(multi_config, "blockchain-service-url", String) } else { match persistent_config.blockchain_service_url() { - Ok(Some(price)) => Some(price), + Ok(Some(blockchain_service_url)) => Some(blockchain_service_url), Ok(None) => { if self.blockchain_service_url_error(multi_config) { return Err(MultiConfig::make_configurator_error(Error { @@ -1302,8 +1302,6 @@ mod tests { .set_past_neighbors_params(&set_past_neighbors_params_arc) .set_past_neighbors_result(Ok(())); let multi_config = make_simplified_multi_config([ - "--blockchain-service-url", - "booga.com", "--chain", "eth-ropsten", "--neighbors", @@ -1351,8 +1349,6 @@ mod tests { ) .set_past_neighbors_params(&set_past_neighbors_params_arc); let multi_config = make_simplified_multi_config([ - "--blockchain-service-url", - "booga.com", "--chain", "eth-ropsten", "--neighborhood-mode", @@ -1601,7 +1597,6 @@ mod tests { { running_test(); let args = ArgsBuilder::new() - .param("--blockchain-service-url", "booga.com") .param("--ip", "1.2.3.4") .param("--fake-public-key", "BORSCHT") .param("--db-password", "password"); diff --git a/node/tests/ui_gateway_test.rs b/node/tests/ui_gateway_test.rs index 5fe43f6ed4..df0686311e 100644 --- a/node/tests/ui_gateway_test.rs +++ b/node/tests/ui_gateway_test.rs @@ -99,7 +99,7 @@ fn log_broadcasts_are_correctly_received_integration() { fn wait_for_masq_node_ends() { let mut system = System::new_all(); - let deadline = SystemTime::now() + Duration::from_secs(10); + let deadline = SystemTime::now() + Duration::from_secs(5); loop { if SystemTime::now() > deadline { panic!("Previous instance of MASQNode does not stops"); From 02f9aab57ff7d6238fac0545b89976f58027f162 Mon Sep 17 00:00:00 2001 From: czarte Date: Mon, 29 Sep 2025 17:43:14 +0200 Subject: [PATCH 20/22] addressing review comments --- masq_lib/src/shared_schema.rs | 24 +++++------ .../unprivileged_parse_args_configuration.rs | 43 +++++++++++++------ node/tests/connection_shutdown_test.rs | 6 +-- node/tests/dns_resolve_failure_test.rs | 5 +-- node/tests/dump_configuration_test.rs | 1 - node/tests/financials_test.rs | 6 +-- node/tests/http_through_node_test.rs | 3 +- node/tests/initialization_test.rs | 5 +-- .../node_exits_from_future_panic_test.rs | 7 +-- node/tests/tls_through_node_test.rs | 3 +- node/tests/ui_gateway_test.rs | 3 -- 11 files changed, 51 insertions(+), 55 deletions(-) diff --git a/masq_lib/src/shared_schema.rs b/masq_lib/src/shared_schema.rs index f8f4477d68..b2858f3d3c 100644 --- a/masq_lib/src/shared_schema.rs +++ b/masq_lib/src/shared_schema.rs @@ -13,12 +13,12 @@ use lazy_static::lazy_static; pub const BLOCKCHAIN_SERVICE_HELP: &str = "The Ethereum client you wish to use to provide Blockchain \ exit services from your MASQ Node (e.g. http://localhost:8545, \ - https://ropsten.infura.io/v3/YOUR-PROJECT-ID, https://mainnet.infura.io/v3/YOUR-PROJECT-ID), \ - https://base-mainnet.g.alchemy.com/v2/d66UL0lPrltmweEqVsv3opBSVI3wkL8I, \ - https://polygon-mainnet.infura.io/v3/YOUR-PROJECT-ID \n This argument is mandatory, to ensure, you \ - will not be deliquency banned due unable to pay your debts to MASQ network. If you are in region \ - where you have no access to blockchain services, to create your own app, use one of following public \ - endpoints for Base Mainnet (you need to specify Base Mainnet chain in the chain argument): \n\ + https://ropsten.infura.io/v3/, https://mainnet.infura.io/v3/), \ + https://base-mainnet.g.alchemy.com/, https://polygon-mainnet.infura.io/v3/ \n \ + This argument is mandatory, to ensure that you will not be deliquency banned due to being unable to \ + pay your debts to MASQ network. If you are in a region where you have no access to blockchain \ + services, to create your own app, use one of following the public endpoints for Base Mainnet \ + (you need to specify `--chain base-mainnet` as the chain argument): \n\ https://mainnet.base.org \nhttps://base.llamarpc.com \nhttps://1rpc.io/base \nhttps://base-rpc.publicnode.com"; pub const CHAIN_HELP: &str = "The blockchain network MASQ Node will configure itself to use. You must ensure the \ @@ -737,12 +737,12 @@ mod tests { BLOCKCHAIN_SERVICE_HELP, "The Ethereum client you wish to use to provide Blockchain \ exit services from your MASQ Node (e.g. http://localhost:8545, \ - https://ropsten.infura.io/v3/YOUR-PROJECT-ID, https://mainnet.infura.io/v3/YOUR-PROJECT-ID), \ - https://base-mainnet.g.alchemy.com/v2/d66UL0lPrltmweEqVsv3opBSVI3wkL8I, \ - https://polygon-mainnet.infura.io/v3/YOUR-PROJECT-ID \n This argument is mandatory, to ensure, you \ - will not be deliquency banned due unable to pay your debts to MASQ network. If you are in region \ - where you have no access to blockchain services, to create your own app, use one of following public \ - endpoints for Base Mainnet (you need to specify Base Mainnet chain in the chain argument): \n\ + https://ropsten.infura.io/v3/, https://mainnet.infura.io/v3/), \ + https://base-mainnet.g.alchemy.com/, https://polygon-mainnet.infura.io/v3/ \n \ + This argument is mandatory, to ensure that you will not be deliquency banned due to being unable to \ + pay your debts to MASQ network. If you are in a region where you have no access to blockchain \ + services, to create your own app, use one of following the public endpoints for Base Mainnet \ + (you need to specify `--chain base-mainnet` as the chain argument): \n\ https://mainnet.base.org \nhttps://base.llamarpc.com \nhttps://1rpc.io/base \nhttps://base-rpc.publicnode.com" ); assert_eq!( diff --git a/node/src/node_configurator/unprivileged_parse_args_configuration.rs b/node/src/node_configurator/unprivileged_parse_args_configuration.rs index 9539dc8a59..86ef4f5cd0 100644 --- a/node/src/node_configurator/unprivileged_parse_args_configuration.rs +++ b/node/src/node_configurator/unprivileged_parse_args_configuration.rs @@ -48,7 +48,7 @@ pub trait UnprivilegedParseArgsConfiguration { Ok(None) => { if self.blockchain_service_url_error(multi_config) { return Err(MultiConfig::make_configurator_error(Error { - message: "The following required arguments were not provided: --blockchain-service-url USAGE: --blockchain-service-url ".to_string(), + message: "The following required argument was not provided: --blockchain-service-url USAGE: --blockchain-service-url ".to_string(), kind: clap::ErrorKind::ArgumentNotFound, info: Some(vec!["".to_string()]), })); @@ -56,7 +56,7 @@ pub trait UnprivilegedParseArgsConfiguration { None } } - Err(pce) => return Err(pce.into_configurator_error("gas-price")), + Err(pce) => return Err(pce.into_configurator_error("blockchain-service-url")), } }; unprivileged_config.clandestine_port_opt = value_m!(multi_config, "clandestine-port", u16); @@ -82,11 +82,11 @@ pub trait UnprivilegedParseArgsConfiguration { } fn blockchain_service_url_error(&self, multi_config: &MultiConfig) -> bool { - let zerohop = + let no_zerohop = value_m!(multi_config, "neighborhood-mode", String) != Some("zero-hop".to_string()); - let fake_public_key = value_m!(multi_config, "fake-public-key", String) == None; - let crash_point = value_m!(multi_config, "crash-point", String) == None; - zerohop && fake_public_key && crash_point + let no_fake_public_key = value_m!(multi_config, "fake-public-key", String) == None; + let no_crash_point = value_m!(multi_config, "crash-point", String) == None; + no_zerohop && no_fake_public_key && no_crash_point } fn get_past_neighbors( @@ -1263,12 +1263,33 @@ mod tests { fn unprivileged_parse_args_without_blockchain_service_url_but_not_bsu_error_returns_ok() { running_test(); let set_past_neighbors_params_arc = Arc::new(Mutex::new(vec![])); - let mut config = BootstrapperConfig::new(); - let mut persistent_config = configure_default_persistent_config( + let config = BootstrapperConfig::new(); + let persistent_config = configure_default_persistent_config( RATE_PACK | ACCOUNTANT_CONFIG_PARAMS | MAPPING_PROTOCOL, ) .set_past_neighbors_params(&set_past_neighbors_params_arc) .set_past_neighbors_result(Ok(())); + let exeption_params = vec![ + ("--fake-public-key", "booga"), + ("--crash-point", "Error"), + ("--neighborhood-mode", "zero-hop"), + ]; + + for exeption_param in exeption_params { + create_and_assert_multiconfig( + config.clone(), + persistent_config.clone(), + exeption_param, + ); + } + } + + fn create_and_assert_multiconfig( + mut config: BootstrapperConfig, + mut persistent_config: PersistentConfigurationMock, + exeption_param: (&str, &str), + ) { + let subject = UnprivilegedParseArgsConfigurationDaoReal {}; let multi_config = make_simplified_multi_config([ "--chain", "eth-ropsten", @@ -1276,11 +1297,9 @@ mod tests { "masq://eth-ropsten:UJNoZW5p-PDVqEjpr3b_8jZ_93yPG8i5dOAgE1bhK_A@2.3.4.5:2345", "--db-password", "password", - "--fake-public-key", - "booga", + exeption_param.0, + exeption_param.1, ]); - let subject = UnprivilegedParseArgsConfigurationDaoReal {}; - let result = subject.unprivileged_parse_args( &multi_config, &mut config, diff --git a/node/tests/connection_shutdown_test.rs b/node/tests/connection_shutdown_test.rs index cb72f63c3b..4c98dfeac8 100644 --- a/node/tests/connection_shutdown_test.rs +++ b/node/tests/connection_shutdown_test.rs @@ -21,11 +21,7 @@ fn proxy_client_stream_reader_dies_when_client_stream_is_killed_integration() { let ui_port = find_free_port(); let _node = utils::MASQNode::start_standard( "proxy_client_stream_reader_dies_when_client_stream_is_killed_integration", - Some( - CommandConfig::new() - .pair("--blockchain-service-url", "https://booga.com") - .pair("--ui-port", &ui_port.to_string()), - ), + Some(CommandConfig::new().pair("--ui-port", &ui_port.to_string())), true, true, false, diff --git a/node/tests/dns_resolve_failure_test.rs b/node/tests/dns_resolve_failure_test.rs index 13edb1b50b..7ba16e3575 100644 --- a/node/tests/dns_resolve_failure_test.rs +++ b/node/tests/dns_resolve_failure_test.rs @@ -2,7 +2,6 @@ pub mod utils; -use crate::utils::CommandConfig; use node_lib::test_utils::{assert_string_contains, read_until_timeout}; use std::io::Write; use std::net::{SocketAddr, TcpStream}; @@ -13,7 +12,7 @@ use std::time::Duration; fn dns_resolve_failure_http_response_integration() { let _node_to_test_against = utils::MASQNode::start_standard( "dns_resolve_failure_http_response_integration", - Some(CommandConfig::new().pair("--blockchain-service-url", "https://booga.com")), + None, true, true, false, @@ -36,7 +35,7 @@ fn dns_resolve_failure_http_response_integration() { fn dns_resolve_failure_tls_response_integration() { let _node_to_test_against = utils::MASQNode::start_standard( "dns_resolve_failure_tls_response_integration", - Some(CommandConfig::new().pair("--blockchain-service-url", "https://booga.com")), + None, true, true, false, diff --git a/node/tests/dump_configuration_test.rs b/node/tests/dump_configuration_test.rs index db11547440..62a045b0d2 100644 --- a/node/tests/dump_configuration_test.rs +++ b/node/tests/dump_configuration_test.rs @@ -21,7 +21,6 @@ fn dump_configuration_with_an_existing_database_integration() { test_name, Some( CommandConfig::new() - .pair("--blockchain-service-url", "https://booga.com") .pair("--ui-port", &port.to_string()) .pair("--chain", "polygon-amoy"), ), diff --git a/node/tests/financials_test.rs b/node/tests/financials_test.rs index 3a3783daee..0237d002da 100644 --- a/node/tests/financials_test.rs +++ b/node/tests/financials_test.rs @@ -73,11 +73,7 @@ fn financials_command_retrieves_payable_and_receivable_records_integration() { .unwrap(); let mut node = MASQNode::start_standard( test_name, - Some( - CommandConfig::new() - .pair("--blockchain-service-url", "https://booga.com") - .pair("--ui-port", &port.to_string()), - ), + Some(CommandConfig::new().pair("--ui-port", &port.to_string())), false, true, false, diff --git a/node/tests/http_through_node_test.rs b/node/tests/http_through_node_test.rs index 197362db74..eac50603b7 100644 --- a/node/tests/http_through_node_test.rs +++ b/node/tests/http_through_node_test.rs @@ -2,7 +2,6 @@ pub mod utils; -use crate::utils::CommandConfig; use node_lib::test_utils::read_until_timeout; use std::io::Write; use std::net::SocketAddr; @@ -15,7 +14,7 @@ use std::time::Duration; fn http_through_node_integration() { let _node = utils::MASQNode::start_standard( "http_through_node_integration", - Some(CommandConfig::new().pair("--blockchain-service-url", "https://booga.com")), + None, true, true, false, diff --git a/node/tests/initialization_test.rs b/node/tests/initialization_test.rs index 9872a18758..a138092aaa 100644 --- a/node/tests/initialization_test.rs +++ b/node/tests/initialization_test.rs @@ -152,12 +152,11 @@ fn wait_for_process_end(process_id: u32) { #[test] fn incomplete_node_descriptor_is_refused_integration() { - let chain_identifier = "base-mainnet"; + let chain_identifier = DEFAULT_CHAIN.rec().literal_identifier; let mut node = utils::MASQNode::start_standard( "incomplete_node_descriptor_is_refused_integration", Some( CommandConfig::new() - .pair("--blockchain-service-url", "https://booga.com") .pair( "--neighbors", &format!("masq://{chain_identifier}:12345vhVbmVyGejkYUkmftF09pmGZGKg_PzRNnWQxFw@12.23.34.45:5678,masq://{chain_identifier}:abJ5XvhVbmVyGejkYUkmftF09pmGZGKg_PzRNnWQxFw@:") @@ -225,7 +224,6 @@ fn requested_chain_meets_different_db_chain_and_panics_integration() { test_name, Some( CommandConfig::new() - .pair("--blockchain-service-url", "https://booga.com") .pair("--ui-port", &port.to_string()) .pair("--chain", &chain_literal), ), @@ -271,7 +269,6 @@ fn requested_chain_meets_different_db_chain_and_panics_integration() { #[test] fn node_creates_log_file_with_heading_integration() { let config = CommandConfig::new() - .pair("--blockchain-service-url", "https://booga.com") .pair("--neighborhood-mode", "standard") .pair("--ip", "1.0.0.1") .pair( diff --git a/node/tests/node_exits_from_future_panic_test.rs b/node/tests/node_exits_from_future_panic_test.rs index 172cefd767..dc3ec25ab0 100644 --- a/node/tests/node_exits_from_future_panic_test.rs +++ b/node/tests/node_exits_from_future_panic_test.rs @@ -41,7 +41,6 @@ fn node_logs_panic_integration() { "Could not create chain directory inside node_logs_panic_integration home/MASQ directory", ); let panic_config = CommandConfig::new() - .pair("--blockchain-service-url", "https://booga.com") .pair("--crash-point", "panic") .pair("--chain", "polygon-mainnet") .pair("--data-directory", data_directory.to_str().unwrap()); @@ -68,11 +67,7 @@ const STAT_FORMAT_PARAM_NAME: &str = "-f"; fn node_logfile_does_not_belong_to_root_integration() { let mut node = MASQNode::start_standard( "node_logfile_does_not_belong_to_root_integration", - Some( - CommandConfig::new() - .pair("--blockchain-service-url", "https://booga.com") - .pair("--chain", "polygon-amoy"), - ), + Some(CommandConfig::new().pair("--chain", "polygon-amoy")), true, true, false, diff --git a/node/tests/tls_through_node_test.rs b/node/tests/tls_through_node_test.rs index 22c59994b8..4d82289bfd 100644 --- a/node/tests/tls_through_node_test.rs +++ b/node/tests/tls_through_node_test.rs @@ -2,7 +2,6 @@ pub mod utils; -use crate::utils::CommandConfig; use native_tls::TlsConnector; use native_tls::{HandshakeError, MidHandshakeTlsStream, TlsStream}; use node_lib::test_utils::*; @@ -17,7 +16,7 @@ use std::time::Duration; fn tls_through_node_integration() { let _node = utils::MASQNode::start_standard( "tls_through_node_integration", - Some(CommandConfig::new().pair("--blockchain-service-url", "https://booga.com")), + None, true, true, false, diff --git a/node/tests/ui_gateway_test.rs b/node/tests/ui_gateway_test.rs index df0686311e..403479f32f 100644 --- a/node/tests/ui_gateway_test.rs +++ b/node/tests/ui_gateway_test.rs @@ -29,7 +29,6 @@ fn ui_requests_something_and_gets_corresponding_response_integration() { test_name, Some( CommandConfig::new() - .pair("--blockchain-service-url", "https://booga.com") .pair("--ui-port", &port.to_string()) .pair( "--data-directory", @@ -64,7 +63,6 @@ fn log_broadcasts_are_correctly_received_integration() { "log_broadcasts_are_correctly_received", Some( CommandConfig::new() - .pair("--blockchain-service-url", "https://booga.com") .pair("--ui-port", &port.to_string()) .pair("--chain", "polygon-mainnet"), ), @@ -210,7 +208,6 @@ fn cleanup_after_deceased_clients_integration() { test_name, Some( CommandConfig::new() - .pair("--blockchain-service-url", "https://booga.com") .pair("--chain", DEFAULT_CHAIN.rec().literal_identifier) .pair("--ui-port", &port.to_string()), ), From 317243fc4365264272706362002f108b2c354f17 Mon Sep 17 00:00:00 2001 From: czarte Date: Mon, 29 Sep 2025 18:06:03 +0200 Subject: [PATCH 21/22] fix typo in test --- .../node_configurator/unprivileged_parse_args_configuration.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/node/src/node_configurator/unprivileged_parse_args_configuration.rs b/node/src/node_configurator/unprivileged_parse_args_configuration.rs index 86ef4f5cd0..c047d6b76d 100644 --- a/node/src/node_configurator/unprivileged_parse_args_configuration.rs +++ b/node/src/node_configurator/unprivileged_parse_args_configuration.rs @@ -1251,7 +1251,7 @@ mod tests { .unwrap_err(); let expected = MultiConfig::make_configurator_error(Error { - message: "The following required arguments were not provided: --blockchain-service-url USAGE: --blockchain-service-url ".to_string(), + message: "The following required argument was not provided: --blockchain-service-url USAGE: --blockchain-service-url ".to_string(), kind: clap::ErrorKind::ArgumentNotFound, info: Some(vec!["".to_string()]), }); From 09b9bafb1d248fac791293c518d5cba79d58bcdc Mon Sep 17 00:00:00 2001 From: czarte Date: Tue, 30 Sep 2025 15:21:26 +0200 Subject: [PATCH 22/22] review2 changes --- .../unprivileged_parse_args_configuration.rs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/node/src/node_configurator/unprivileged_parse_args_configuration.rs b/node/src/node_configurator/unprivileged_parse_args_configuration.rs index c047d6b76d..8ff2ed7c4c 100644 --- a/node/src/node_configurator/unprivileged_parse_args_configuration.rs +++ b/node/src/node_configurator/unprivileged_parse_args_configuration.rs @@ -1260,7 +1260,7 @@ mod tests { } #[test] - fn unprivileged_parse_args_without_blockchain_service_url_but_not_bsu_error_returns_ok() { + fn unprivileged_parse_args_does_not_require_blockchain_service_url_under_these_circumstances() { running_test(); let set_past_neighbors_params_arc = Arc::new(Mutex::new(vec![])); let config = BootstrapperConfig::new(); @@ -1269,17 +1269,17 @@ mod tests { ) .set_past_neighbors_params(&set_past_neighbors_params_arc) .set_past_neighbors_result(Ok(())); - let exeption_params = vec![ + let exception_params = vec![ ("--fake-public-key", "booga"), ("--crash-point", "Error"), ("--neighborhood-mode", "zero-hop"), ]; - for exeption_param in exeption_params { + for exception_param in exception_params { create_and_assert_multiconfig( config.clone(), persistent_config.clone(), - exeption_param, + exception_param, ); } } @@ -1287,7 +1287,7 @@ mod tests { fn create_and_assert_multiconfig( mut config: BootstrapperConfig, mut persistent_config: PersistentConfigurationMock, - exeption_param: (&str, &str), + exception_param: (&str, &str), ) { let subject = UnprivilegedParseArgsConfigurationDaoReal {}; let multi_config = make_simplified_multi_config([ @@ -1297,8 +1297,8 @@ mod tests { "masq://eth-ropsten:UJNoZW5p-PDVqEjpr3b_8jZ_93yPG8i5dOAgE1bhK_A@2.3.4.5:2345", "--db-password", "password", - exeption_param.0, - exeption_param.1, + exception_param.0, + exception_param.1, ]); let result = subject.unprivileged_parse_args( &multi_config,