From 407160cf68f604ae89cba8b54020a90364621e12 Mon Sep 17 00:00:00 2001 From: Hansie Odendaal <39146854+hansieodendaal@users.noreply.github.com> Date: Wed, 9 Mar 2022 10:40:02 +0200 Subject: [PATCH] fix: fix merge mining proxy pool mining (#3814) Description --- Fixed merge mining proxy pool mining: - XMRig/merge_mininig_proxy error: 'required field "blocktemplate_blob" not found' - config file was not read correctly; - global config exited prematurely ; - round-robin for `monerod_url` - start at the next entry in the list when encountering connection errors; - updated cucumber integration test. Motivation and Context --- When used with Monero mainnet and pool mining, XMRig reported many errors and exited after mining for a while: - XMRig/merge_mininig_proxy had an issue with pool mining: ``` [2022-02-01 23:56:05.773] origin submitted to origin daemon (174/748) diff 110685 vs. 311330 [2022-02-01 23:56:06.135] cpu accepted (859/61) diff 40000 (361 ms) [2022-02-01 23:56:06.517] [127.0.0.1:7878] required field "blocktemplate_blob" not found ``` - Default merge mining proxy config on windows was wrong - When `monerod_url` had an error new connection attempts were always started at the first entry instead of at the last used entry How Has This Been Tested? --- Cucumber tests for merge mining System-level tests --- .../tari_merge_mining_proxy/src/main.rs | 2 + .../tari_merge_mining_proxy/src/proxy.rs | 101 ++++++++++++++--- common/config/presets/merge_mining_proxy.toml | 67 ++++++------ common/src/configuration/global.rs | 103 ++++++++---------- .../src/configuration/merge_mining_config.rs | 6 +- common/src/configuration/utils.rs | 60 ++++------ integration_tests/helpers/baseNodeProcess.js | 2 +- integration_tests/helpers/config.js | 12 +- .../helpers/mergeMiningProxyProcess.js | 5 +- .../helpers/miningNodeProcess.js | 2 +- .../helpers/stratumTranscoderProcess.js | 2 +- .../helpers/validatorNodeProcess.js | 2 +- integration_tests/helpers/walletProcess.js | 2 +- 13 files changed, 211 insertions(+), 155 deletions(-) diff --git a/applications/tari_merge_mining_proxy/src/main.rs b/applications/tari_merge_mining_proxy/src/main.rs index 2413d648cd..462c4416e4 100644 --- a/applications/tari_merge_mining_proxy/src/main.rs +++ b/applications/tari_merge_mining_proxy/src/main.rs @@ -60,6 +60,8 @@ async fn main() -> Result<(), anyhow::Error> { return Ok(()); }, }; + println!("\n{}\n", config); + let addr = config.proxy_host_address; let client = reqwest::Client::builder() .connect_timeout(Duration::from_secs(5)) diff --git a/applications/tari_merge_mining_proxy/src/proxy.rs b/applications/tari_merge_mining_proxy/src/proxy.rs index 81135b0bd4..3c1e77d98c 100644 --- a/applications/tari_merge_mining_proxy/src/proxy.rs +++ b/applications/tari_merge_mining_proxy/src/proxy.rs @@ -23,6 +23,7 @@ use std::{ cmp, convert::TryFrom, + fmt::{Display, Error, Formatter}, future::Future, net::SocketAddr, pin::Pin, @@ -82,6 +83,8 @@ impl TryFrom for MergeMiningProxyConfig { let merge_mining_config = config .merge_mining_config .ok_or_else(|| "Merge mining config settings are missing".to_string())?; + let proxy_host_address = multiaddr_to_socketaddr(&merge_mining_config.proxy_host_address) + .map_err(|e| format!("Invalid proxy_host_address: {}", e))?; let grpc_base_node_address = multiaddr_to_socketaddr(&merge_mining_config.base_node_grpc_address) .map_err(|e| format!("Invalid base_node_grpc_address: {}", e))?; let grpc_console_wallet_address = multiaddr_to_socketaddr(&merge_mining_config.wallet_grpc_address) @@ -94,13 +97,35 @@ impl TryFrom for MergeMiningProxyConfig { monerod_use_auth: merge_mining_config.monerod_use_auth, grpc_base_node_address, grpc_console_wallet_address, - proxy_host_address: merge_mining_config.proxy_host_address, - proxy_submit_to_origin: config.proxy_submit_to_origin, - wait_for_initial_sync_at_startup: config.wait_for_initial_sync_at_startup, + proxy_host_address, + proxy_submit_to_origin: merge_mining_config.proxy_submit_to_origin, + wait_for_initial_sync_at_startup: merge_mining_config.wait_for_initial_sync_at_startup, }) } } +impl Display for MergeMiningProxyConfig { + fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error> { + writeln!( + f, + "Configuration:\n network ({})\n proxy_host_address ({})\n grpc_base_node_address ({})\n \ + grpc_console_wallet_address ({})\n proxy_submit_to_origin ({})\n wait_for_initial_sync_at_startup \ + ({})\n monerod_url ({:?})\n monerod_password ({})\n monerod_username ({})\n monerod_use_auth ({})", + self.network, + self.proxy_host_address, + self.grpc_base_node_address, + self.grpc_console_wallet_address, + self.proxy_submit_to_origin, + self.wait_for_initial_sync_at_startup, + self.monerod_url, + self.monerod_password, + self.monerod_username, + self.monerod_use_auth + )?; + Ok(()) + } +} + #[derive(Debug, Clone)] pub struct MergeMiningProxyService { inner: InnerService, @@ -114,6 +139,7 @@ impl MergeMiningProxyService { wallet_client: grpc::wallet_client::WalletClient, block_templates: BlockTemplateRepository, ) -> Self { + debug!(target: LOG_TARGET, "Config: {:?}", config); Self { inner: InnerService { config, @@ -122,7 +148,8 @@ impl MergeMiningProxyService { base_node_client, wallet_client, initial_sync_achieved: Arc::new(AtomicBool::new(false)), - last_available_server: Arc::new(RwLock::new(None)), + current_monerod_server: Arc::new(RwLock::new(None)), + last_assigned_monerod_server: Arc::new(RwLock::new(None)), }, } } @@ -189,7 +216,8 @@ struct InnerService { base_node_client: grpc::base_node_client::BaseNodeClient, wallet_client: grpc::wallet_client::WalletClient, initial_sync_achieved: Arc, - last_available_server: Arc>>, + current_monerod_server: Arc>>, + last_assigned_monerod_server: Arc>>, } impl InnerService { @@ -305,6 +333,12 @@ impl InnerService { if !self.config.proxy_submit_to_origin { // self-select related, do not change. json_resp = json_rpc::default_block_accept_response(request["id"].as_i64()); + trace!( + target: LOG_TARGET, + "pool merged mining proxy_submit_to_origin({}) json_resp: {}", + self.config.proxy_submit_to_origin, + json_resp + ); } else { json_resp = json_rpc::success_response( request["id"].as_i64(), @@ -348,7 +382,12 @@ impl InnerService { self.block_templates.remove_outdated().await; } - debug!(target: LOG_TARGET, "Sending submit_block response {}", json_resp); + debug!( + target: LOG_TARGET, + "Sending submit_block response (proxy_submit_to_origin({})): {}", + self.config.proxy_submit_to_origin, + json_resp + ); Ok(proxy::into_response(parts, &json_resp)) } @@ -595,7 +634,7 @@ impl InnerService { async fn get_fully_qualified_monerod_url(&self, uri: &Uri) -> Result { { let lock = self - .last_available_server + .current_monerod_server .read() .expect("Read lock should not fail") .clone(); @@ -605,18 +644,45 @@ impl InnerService { } } - for monerod_url in self.config.monerod_url.iter() { - let uri = format!("{}{}", monerod_url, uri.path()).parse::()?; + let last_used_url = { + let lock = self + .last_assigned_monerod_server + .read() + .expect("Read lock should not fail") + .clone(); + match lock { + Some(url) => url, + None => "".to_string(), + } + }; + + // Query the list twice before giving up, starting after the last used entry + let pos = if let Some(index) = self.config.monerod_url.iter().position(|x| x == &last_used_url) { + index + } else { + 0 + }; + let (left, right) = self.config.monerod_url.split_at(pos); + let left = left.to_vec(); + let right = right.to_vec(); + let iter = right.iter().chain(left.iter()).chain(right.iter()).chain(left.iter()); + + for next_url in iter { + let uri = format!("{}{}", next_url, uri.path()).parse::()?; match reqwest::get(uri.clone()).await { Ok(_) => { - let mut lock = self.last_available_server.write().expect("Write lock should not fail"); - *lock = Some(monerod_url.to_string()); + let mut lock = self.current_monerod_server.write().expect("Write lock should not fail"); + *lock = Some(next_url.to_string()); + let mut lock = self + .last_assigned_monerod_server + .write() + .expect("Write lock should not fail"); + *lock = Some(next_url.to_string()); info!(target: LOG_TARGET, "Monerod server available: {:?}", uri.clone()); return Ok(uri); }, Err(_) => { warn!(target: LOG_TARGET, "Monerod server unavailable: {:?}", uri); - continue; }, } } @@ -666,12 +732,19 @@ impl InnerService { let body: Bytes = request.body().clone(); let json = json::from_slice::(&body[..]).unwrap_or_default(); if let Some(method) = json["method"].as_str() { + trace!(target: LOG_TARGET, "json[\"method\"]: {}", method); match method { "submitblock" | "submit_block" => { submit_block = true; }, _ => {}, } + trace!( + target: LOG_TARGET, + "submitblock({}), proxy_submit_to_origin({})", + submit_block, + self.config.proxy_submit_to_origin + ); } let json_response; @@ -812,8 +885,8 @@ impl InnerService { Ok(response) }, Err(e) => { - // Monero Server encountered a problem processing the request, reset the last_available_server - let mut lock = self.last_available_server.write().expect("Write lock should not fail"); + // Monero Server encountered a problem processing the request, reset the current monerod server + let mut lock = self.current_monerod_server.write().expect("Write lock should not fail"); *lock = None; Err(e) }, diff --git a/common/config/presets/merge_mining_proxy.toml b/common/config/presets/merge_mining_proxy.toml index 0ea4082c86..80ef01e3e8 100644 --- a/common/config/presets/merge_mining_proxy.toml +++ b/common/config/presets/merge_mining_proxy.toml @@ -4,47 +4,52 @@ # # ######################################################################################################################## -[merge_mining_proxy.dibbler] +[merge_mining_proxy] -# URL to monerod -monerod_url = [ # stagenet - "http://stagenet.xmr-tw.org:38081", - "http://stagenet.community.xmr.to:38081", - "http://monero-stagenet.exan.tech:38081", - "http://xmr-lux.boldsuck.org:38081", - "http://singapore.node.xmr.pm:38081", -] -#monerod_url = [ # mainnet -# "http://18.132.124.81:18081", -# "http://xmr.support:18081", -# "http://node1.xmr-tw.org:18081", -# "http://xmr.nthrow.nyc:18081", -#] +# Address of the tari_merge_mining_proxy application. (default = "127.0.0.1:7878") +#proxy_host_address = "/ip4/127.0.0.1/tcp/7878" + +# GRPC address of base node. (default = "/ip4/127.0.0.1/tcp/18142") +#base_node_grpc_address = "/ip4/127.0.0.1/tcp/18142" -# Address of the tari_merge_mining_proxy application -proxy_host_address = "127.0.0.1:7878" +# GRPC address of console wallet. (default = "/ip4/127.0.0.1/tcp/18143") +#wallet_grpc_address = "/ip4/127.0.0.1/tcp/18143" # In sole merged mining, the block solution is usually submitted to the Monero blockchain # (monerod) as well as to the Tari blockchain, then this setting should be "true". With pool # merged mining, there is no sense in submitting the solution to the Monero blockchain as the # pool does that, then this setting should be "false". (default = true). -proxy_submit_to_origin = true - -# If authentication is being used for curl -monerod_use_auth = false - -# Username for curl -monerod_username = "" - -# Password for curl -monerod_password = "" +#proxy_submit_to_origin = true # The merge mining proxy can either wait for the base node to achieve initial sync at startup before it enables mining, # or not. If merge mining starts before the base node has achieved initial sync, those Tari mined blocks will not be # accepted. (Default value = true; will wait for base node initial sync). #wait_for_initial_sync_at_startup = true -[merge_mining_proxy] -monerod_use_auth = false -monerod_username = "" -monerod_password = "" +[merge_mining_proxy.dibbler] + +# URL to monerod (default = stagenet) +#monerod_url = [ # stagenet +# "http://stagenet.xmr-tw.org:38081", +# "http://stagenet.community.xmr.to:38081", +# "http://monero-stagenet.exan.tech:38081", +# "http://xmr-lux.boldsuck.org:38081", +# "http://singapore.node.xmr.pm:38081", +#] +#monerod_url = [ # mainnet +# "http://xmr.support:18081", +# "http://node1.xmr-tw.org:18081", +# "http://xmr.nthrow.nyc:18081", +# "http://node.xmrig.com:18081", +# "http://monero.exan.tech:18081", +# "http://18.132.124.81:18081", +#] + +# If authentication is being used for curl. (default = false). +#monerod_use_auth = false + +# Username for curl. (default = ""). +#monerod_username = "" + +# Password for curl. (default = ""). +#monerod_password = "" diff --git a/common/src/configuration/global.rs b/common/src/configuration/global.rs index 9da8fdc7ea..97f92aaca2 100644 --- a/common/src/configuration/global.rs +++ b/common/src/configuration/global.rs @@ -126,7 +126,6 @@ pub struct GlobalConfig { pub output_manager_event_channel_size: usize, pub peer_seeds: Vec, pub prevent_fee_gt_amount: bool, - pub proxy_submit_to_origin: bool, pub pruned_mode_cleanup_interval: u64, pub pruning_horizon: u64, pub saf_expiry_duration: Duration, @@ -141,7 +140,6 @@ pub struct GlobalConfig { pub transcoder_host_address: SocketAddr, pub validate_tip_timeout_sec: u64, pub validator_node: Option, - pub wait_for_initial_sync_at_startup: bool, pub wallet_balance_enquiry_cooldown_period: u64, pub wallet_base_node_service_peers: Vec, pub wallet_recovery_retry_limit: usize, @@ -679,14 +677,47 @@ fn convert_node_config( let merge_mining_config = match application { ApplicationType::MergeMiningProxy => { - let key = "merge_mining_proxy.monerod_url"; + //---------------------------------- Common merge_mining_proxy defaults -------------------------------// + let key = "merge_mining_proxy.proxy_host_address"; + let addr = cfg + .get_str(key) + .unwrap_or_else(|_| "/ip4/127.0.0.1/tcp/7878".to_string()); + // .unwrap_or_else(|_| "127.0.0.1:7878".to_string()); + let proxy_host_address = addr.parse::() + // let proxy_host_address = addr.parse::() + .map_err(|e| ConfigurationError::new(key, Some(addr), &e.to_string()))?; + + let key = "merge_mining_proxy.base_node_grpc_address"; + let addr = cfg + .get_str(key) + .unwrap_or_else(|_| "/ip4/127.0.0.1/tcp/18142".to_string()); + let base_node_grpc_address = addr + .parse::() + .map_err(|e| ConfigurationError::new(key, Some(addr), &e.to_string()))?; + + let key = "merge_mining_proxy.wallet_grpc_address"; + let addr = cfg + .get_str(key) + .unwrap_or_else(|_| "/ip4/127.0.0.1/tcp/18143".to_string()); + let wallet_grpc_address = addr + .parse::() + .map_err(|e| ConfigurationError::new(key, Some(addr), &e.to_string()))?; + + let key = "merge_mining_proxy.proxy_submit_to_origin"; + let proxy_submit_to_origin = cfg.get_bool(key).unwrap_or(true); + + let key = "merge_mining_proxy.wait_for_initial_sync_at_startup"; + let wait_for_initial_sync_at_startup = cfg.get_bool(key).unwrap_or(true); + + //---------------------------------- Network specific merge_mining_proxy defaults ----------------------// + let key = config_string("merge_mining_proxy", net_str, "monerod_url"); let mut monerod_url: Vec = cfg - .get_array(key) + .get_array(&key) .unwrap_or_default() .into_iter() .map(|v| { v.into_str() - .map_err(|err| ConfigurationError::new(key, None, &err.to_string())) + .map_err(|err| ConfigurationError::new(&key, None, &err.to_string())) }) .collect::>()?; @@ -694,53 +725,21 @@ fn convert_node_config( if monerod_url.is_empty() { monerod_url = vec![ "http://stagenet.xmr-tw.org:38081".to_string(), - "http://singapore.node.xmr.pm:38081".to_string(), - "http://xmr-lux.boldsuck.org:38081".to_string(), + "http://stagenet.community.xmr.to:38081".to_string(), "http://monero-stagenet.exan.tech:38081".to_string(), + "http://xmr-lux.boldsuck.org:38081".to_string(), + "http://singapore.node.xmr.pm:38081".to_string(), ]; } - let key = "merge_mining_proxy.monerod_use_auth"; - let monerod_use_auth = cfg - .get_bool(key) - .map_err(|e| ConfigurationError::new(key, None, &e.to_string()))?; - - let key = "merge_mining_proxy.monerod_username"; - let monerod_username = cfg - .get_str(key) - .map_err(|e| ConfigurationError::new(key, None, &e.to_string()))?; - - let key = "merge_mining_proxy.monerod_password"; - let monerod_password = cfg - .get_str(key) - .map_err(|e| ConfigurationError::new(key, None, &e.to_string()))?; - - let key = "merge_mining_proxy.proxy_host_address"; - let proxy_host_address = cfg - .get_str(key) - .map_err(|e| ConfigurationError::new(key, None, &e.to_string())) - .and_then(|addr| { - addr.parse::() - .map_err(|e| ConfigurationError::new(key, None, &e.to_string())) - })?; + let key = config_string("merge_mining_proxy", net_str, "monerod_use_auth"); + let monerod_use_auth = cfg.get_bool(&key).unwrap_or(false); - let key = "merge_mining_proxy.base_node_grpc_address"; - let base_node_grpc_address = cfg - .get_str(key) - .map_err(|e| ConfigurationError::new(key, None, &e.to_string())) - .and_then(|addr| { - addr.parse::() - .map_err(|e| ConfigurationError::new(key, Some(addr), &e.to_string())) - })?; + let key = config_string("merge_mining_proxy", net_str, "monerod_username"); + let monerod_username = cfg.get_str(&key).unwrap_or_else(|_| "".to_string()); - let key = "merge_mining_proxy.wallet_grpc_address"; - let wallet_grpc_address = cfg - .get_str(key) - .map_err(|e| ConfigurationError::new(key, None, &e.to_string())) - .and_then(|addr| { - addr.parse::() - .map_err(|e| ConfigurationError::new(key, Some(addr), &e.to_string())) - })?; + let key = config_string("merge_mining_proxy", net_str, "monerod_password"); + let monerod_password = cfg.get_str(&key).unwrap_or_else(|_| "".to_string()); Some(MergeMiningConfig { monerod_url, @@ -750,6 +749,8 @@ fn convert_node_config( proxy_host_address, base_node_grpc_address, wallet_grpc_address, + proxy_submit_to_origin, + wait_for_initial_sync_at_startup, }) }, _ => None, @@ -764,14 +765,6 @@ fn convert_node_config( .map_err(|e| ConfigurationError::new(&key, Some(addr), &e.to_string())) })?; - let key = config_string("merge_mining_proxy", net_str, "wait_for_initial_sync_at_startup"); - let wait_for_initial_sync_at_startup = cfg - .get_bool(&key) - .map_err(|e| ConfigurationError::new(&key, None, &e.to_string()))?; - - let key = config_string("merge_mining_proxy", net_str, "proxy_submit_to_origin"); - let proxy_submit_to_origin = cfg.get_bool(&key).unwrap_or(true); - let key = "mining_node.num_mining_threads"; let num_mining_threads = optional(cfg.get_int(key))?.unwrap_or(1) as usize; @@ -886,7 +879,6 @@ fn convert_node_config( output_manager_event_channel_size, peer_seeds, prevent_fee_gt_amount, - proxy_submit_to_origin, pruned_mode_cleanup_interval, pruning_horizon, saf_expiry_duration, @@ -901,7 +893,6 @@ fn convert_node_config( transcoder_host_address, validate_tip_timeout_sec, validator_node: ValidatorNodeConfig::convert_if_present(&cfg)?, - wait_for_initial_sync_at_startup, wallet_balance_enquiry_cooldown_period, wallet_base_node_service_peers, wallet_base_node_service_refresh_interval, diff --git a/common/src/configuration/merge_mining_config.rs b/common/src/configuration/merge_mining_config.rs index fbe49b1a66..d4cabe4c4b 100644 --- a/common/src/configuration/merge_mining_config.rs +++ b/common/src/configuration/merge_mining_config.rs @@ -20,8 +20,6 @@ // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE // USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -use std::net::SocketAddr; - use multiaddr::Multiaddr; #[derive(Debug, Clone)] @@ -30,7 +28,9 @@ pub struct MergeMiningConfig { pub monerod_use_auth: bool, pub monerod_username: String, pub monerod_password: String, - pub proxy_host_address: SocketAddr, + pub proxy_host_address: Multiaddr, pub base_node_grpc_address: Multiaddr, pub wallet_grpc_address: Multiaddr, + pub proxy_submit_to_origin: bool, + pub wait_for_initial_sync_at_startup: bool, } diff --git a/common/src/configuration/utils.rs b/common/src/configuration/utils.rs index 3435590243..bf24a91849 100644 --- a/common/src/configuration/utils.rs +++ b/common/src/configuration/utils.rs @@ -298,65 +298,51 @@ fn set_stratum_transcoder_defaults(cfg: &mut Config) { } fn set_merge_mining_defaults(cfg: &mut Config) { - cfg.set_default( - "merge_mining_proxy.mainnet.monerod_url", - "http://monero-stagenet.exan.tech:38081", - ) - .unwrap(); - cfg.set_default("merge_mining_proxy.mainnet.proxy_host_address", "127.0.0.1:7878") - .unwrap(); - cfg.set_default("merge_mining_proxy.mainnet.monerod_use_auth", "false") - .unwrap(); - cfg.set_default("merge_mining_proxy.mainnet.monerod_username", "") + //---------------------------------- common defaults --------------------------------------------// + cfg.set_default("merge_mining_proxy.proxy_host_address", "/ip4/127.0.0.1/tcp/7878") .unwrap(); - cfg.set_default("merge_mining_proxy.mainnet.monerod_password", "") + cfg.set_default("merge_mining_proxy.base_node_grpc_address", "/ip4/127.0.0.1/tcp/18142") .unwrap(); - cfg.set_default("merge_mining_proxy.mainnet.wait_for_initial_sync_at_startup", true) + cfg.set_default("merge_mining_proxy.wallet_grpc_address", "/ip4/127.0.0.1/tcp/18143") .unwrap(); - cfg.set_default( - "merge_mining_proxy.weatherwax.monerod_url", - "http://monero-stagenet.exan.tech:38081", - ) - .unwrap(); - cfg.set_default("merge_mining_proxy.weatherwax.proxy_host_address", "127.0.0.1:7878") + cfg.set_default("merge_mining_proxy.proxy_submit_to_origin", true) .unwrap(); - cfg.set_default("merge_mining_proxy.weatherwax.proxy_submit_to_origin", true) + cfg.set_default("merge_mining_proxy.wait_for_initial_sync_at_startup", true) .unwrap(); - cfg.set_default("merge_mining_proxy.weatherwax.monerod_use_auth", "false") + + //---------------------------------- mainnet defaults --------------------------------------------// + cfg.set_default("merge_mining_proxy.mainnet.monerod_url", "http://xmr.support:18081") .unwrap(); - cfg.set_default("merge_mining_proxy.weatherwax.monerod_username", "") + cfg.set_default("merge_mining_proxy.mainnet.monerod_use_auth", false) .unwrap(); - cfg.set_default("merge_mining_proxy.weatherwax.monerod_password", "") + cfg.set_default("merge_mining_proxy.mainnet.monerod_username", "") .unwrap(); - cfg.set_default("merge_mining_proxy.weatherwax.wait_for_initial_sync_at_startup", true) + cfg.set_default("merge_mining_proxy.mainnet.monerod_password", "") .unwrap(); + + //---------------------------------- igor defaults --------------------------------------------// cfg.set_default( "merge_mining_proxy.igor.monerod_url", "http://monero-stagenet.exan.tech:38081", ) .unwrap(); - cfg.set_default("merge_mining_proxy.igor.proxy_host_address", "127.0.0.1:7878") - .unwrap(); - cfg.set_default("merge_mining_proxy.igor.proxy_submit_to_origin", true) - .unwrap(); - cfg.set_default("merge_mining_proxy.igor.monerod_use_auth", "false") + cfg.set_default("merge_mining_proxy.igor.monerod_use_auth", false) .unwrap(); cfg.set_default("merge_mining_proxy.igor.monerod_username", "").unwrap(); cfg.set_default("merge_mining_proxy.igor.monerod_password", "").unwrap(); - cfg.set_default("merge_mining_proxy.igor.wait_for_initial_sync_at_startup", true) - .unwrap(); - cfg.set_default("merge_mining_proxy.dibbler.proxy_host_address", "127.0.0.1:7878") - .unwrap(); - cfg.set_default("merge_mining_proxy.dibbler.proxy_submit_to_origin", true) - .unwrap(); - cfg.set_default("merge_mining_proxy.dibbler.monerod_use_auth", "false") + + //---------------------------------- dibbler defaults --------------------------------------------// + cfg.set_default( + "merge_mining_proxy.dibbler.monerod_url", + "http://monero-stagenet.exan.tech:38081", + ) + .unwrap(); + cfg.set_default("merge_mining_proxy.dibbler.monerod_use_auth", false) .unwrap(); cfg.set_default("merge_mining_proxy.dibbler.monerod_username", "") .unwrap(); cfg.set_default("merge_mining_proxy.dibbler.monerod_password", "") .unwrap(); - cfg.set_default("merge_mining_proxy.dibbler.wait_for_initial_sync_at_startup", true) - .unwrap(); } fn set_mining_node_defaults(cfg: &mut Config) { diff --git a/integration_tests/helpers/baseNodeProcess.js b/integration_tests/helpers/baseNodeProcess.js index 4c0319bd19..f17c321299 100644 --- a/integration_tests/helpers/baseNodeProcess.js +++ b/integration_tests/helpers/baseNodeProcess.js @@ -123,7 +123,7 @@ class BaseNodeProcess { "127.0.0.1", this.grpcPort, this.port, - "127.0.0.1:8080", + "/ip4/127.0.0.1/tcp/8080", "127.0.0.1:8085", this.options, this.peerSeeds, diff --git a/integration_tests/helpers/config.js b/integration_tests/helpers/config.js index c394d861c7..e370f69193 100644 --- a/integration_tests/helpers/config.js +++ b/integration_tests/helpers/config.js @@ -95,7 +95,7 @@ function baseEnvs(peerSeeds = [], forceSyncPeers = [], committee = []) { TARI_BASE_NODE__LOCALNET__AUTO_PING_INTERVAL: "15", TARI_WALLET__LOCALNET__CONTACTS_AUTO_PING_INTERVAL: "5", TARI_BASE_NODE__LOCALNET__FLOOD_BAN_MAX_MSG_COUNT: "100000", - TARI_MERGE_MINING_PROXY__MONEROD_URL: [ + TARI_MERGE_MINING_PROXY__LOCALNET__MONEROD_URL: [ "http://stagenet.xmr-tw.org:38081", "http://stagenet.community.xmr.to:38081", "http://monero-stagenet.exan.tech:38081", @@ -105,10 +105,10 @@ function baseEnvs(peerSeeds = [], forceSyncPeers = [], committee = []) { TARI_MERGE_MINING_PROXY__LOCALNET__MONEROD_USE_AUTH: false, TARI_MERGE_MINING_PROXY__LOCALNET__MONEROD_USERNAME: '""', TARI_MERGE_MINING_PROXY__LOCALNET__MONEROD_PASSWORD: '""', + TARI_MERGE_MINING_PROXY__WAIT_FOR_INITIAL_SYNC_AT_STARTUP: false, TARI_BASE_NODE__LOCALNET__DB_INIT_SIZE_MB: 100, TARI_BASE_NODE__LOCALNET__DB_RESIZE_THRESHOLD_MB: 10, TARI_BASE_NODE__LOCALNET__DB_GROW_SIZE_MB: 20, - TARI_MERGE_MINING_PROXY__LOCALNET__WAIT_FOR_INITIAL_SYNC_AT_STARTUP: false, TARI_MINING_NODE__NUM_MINING_THREADS: "1", TARI_MINING_NODE__MINE_ON_TIP_ONLY: true, TARI_MINING_NODE__VALIDATE_TIP_TIMEOUT_SEC: 1, @@ -138,8 +138,8 @@ function createEnv( baseNodeGrpcAddress = "127.0.0.1", baseNodeGrpcPort = "8080", baseNodePort = "8081", - proxyFullAddress = "127.0.0.1:8084", - transcoderFullAddress = "127.0.0.1:8085", + proxyMultiAddress = "/ip4/127.0.0.1/tcp/8084", + transcoderMultiAddress = "/ip4/127.0.0.1/tcp/8085", options, peerSeeds = [], _txnSendingMechanism = "DirectAndStoreAndForward", @@ -168,8 +168,8 @@ function createEnv( [`TARI_WALLET__${network}__TCP_LISTENER_ADDRESS`]: `/ip4/127.0.0.1/tcp/${walletPort}`, [`TARI_WALLET__${network}__PUBLIC_ADDRESS`]: `/ip4/127.0.0.1/tcp/${walletPort}`, - [`TARI_MERGE_MINING_PROXY__PROXY_HOST_ADDRESS`]: `${proxyFullAddress}`, - [`TARI_STRATUM_TRANSCODER__${network}__TRANSCODER_HOST_ADDRESS`]: `${transcoderFullAddress}`, + [`TARI_MERGE_MINING_PROXY__PROXY_HOST_ADDRESS`]: `${proxyMultiAddress}`, + [`TARI_STRATUM_TRANSCODER__${network}__TRANSCODER_HOST_ADDRESS`]: `${transcoderMultiAddress}`, }; return { ...envs, ...configEnvs, ...mapEnvs(options || {}) }; diff --git a/integration_tests/helpers/mergeMiningProxyProcess.js b/integration_tests/helpers/mergeMiningProxyProcess.js index f31d85dde5..09ac5ca853 100644 --- a/integration_tests/helpers/mergeMiningProxyProcess.js +++ b/integration_tests/helpers/mergeMiningProxyProcess.js @@ -47,7 +47,7 @@ class MergeMiningProxyProcess { fs.mkdirSync(this.baseDir + "/log", { recursive: true }); } - const proxyAddress = "127.0.0.1:" + this.port; + const proxyAddress = "/ip4/127.0.0.1/tcp/" + this.port; const envs = createEnv( this.name, @@ -65,8 +65,7 @@ class MergeMiningProxyProcess { [] ); const extraEnvs = { - TARI_MERGE_MINING_PROXY__LOCALNET__PROXY_SUBMIT_TO_ORIGIN: - this.submitOrigin, + TARI_MERGE_MINING_PROXY__PROXY_SUBMIT_TO_ORIGIN: this.submitOrigin, }; const completeEnvs = { ...envs, ...extraEnvs }; console.log(completeEnvs); diff --git a/integration_tests/helpers/miningNodeProcess.js b/integration_tests/helpers/miningNodeProcess.js index 0dd6ec0055..3268e284fc 100644 --- a/integration_tests/helpers/miningNodeProcess.js +++ b/integration_tests/helpers/miningNodeProcess.js @@ -73,7 +73,7 @@ class MiningNodeProcess { this.nodeAddress, this.nodeGrpcPort, this.baseNodePort, - "127.0.0.1:8084", + "/ip4/127.0.0.1/tcp/8084", "127.0.0.1:8085", { mineOnTipOnly: this.mineOnTipOnly, diff --git a/integration_tests/helpers/stratumTranscoderProcess.js b/integration_tests/helpers/stratumTranscoderProcess.js index 1c000a2fed..200342eb07 100644 --- a/integration_tests/helpers/stratumTranscoderProcess.js +++ b/integration_tests/helpers/stratumTranscoderProcess.js @@ -48,7 +48,7 @@ class StratumTranscoderProcess { this.nodeAddress, this.nodeGrpcPort, this.baseNodePort, - "127.0.0.1:8085", + "/ip4/127.0.0.1/tcp/8085", transcoderAddress, [], [] diff --git a/integration_tests/helpers/validatorNodeProcess.js b/integration_tests/helpers/validatorNodeProcess.js index 418d513447..c3182a3dc0 100644 --- a/integration_tests/helpers/validatorNodeProcess.js +++ b/integration_tests/helpers/validatorNodeProcess.js @@ -132,7 +132,7 @@ class ValidatorNodeProcess { "127.0.0.1", this.grpcPort, this.port, - "127.0.0.1:8080", + "/ip4/127.0.0.1/tcp/8080", "127.0.0.1:8085", this.options, this.peerSeeds, diff --git a/integration_tests/helpers/walletProcess.js b/integration_tests/helpers/walletProcess.js index d3bcb31860..19710d2743 100644 --- a/integration_tests/helpers/walletProcess.js +++ b/integration_tests/helpers/walletProcess.js @@ -83,7 +83,7 @@ class WalletProcess { "127.0.0.1", "8080", "8081", - "127.0.0.1:8084", + "/ip4/127.0.0.1/tcp/8084", "127.0.0.1:8085", this.options, this.peerSeeds