From 49be2a27a8aead96c180cb988614e3696c338530 Mon Sep 17 00:00:00 2001 From: stringhandler Date: Wed, 10 May 2023 13:49:25 +0200 Subject: [PATCH] fix: fix panic when no public addresses (#5367) Description --- If there are no public addresses specified, there was a panic. This is solved by not starting a liveness service if there is no public address. NOTE: I have changed the reference on tari-crypto to be the lowest version that it works with (i.e. 0.16, instead of 0.16.*). This is the best practice for libraries, according to Rust, and also helps with mismatches on the tari-dan repo. Motivation and Context --- When using TCP, a node might not have a public address, this may cause a panic with the current code. AFAIK a comms node (base node, wallet, dan indexer) can still work without a public address, but it can only initiate outbound connections. How Has This Been Tested? --- existing tests What process can a PR reviewer use to test or verify this change? --- TODO: I'm busy checking this on the DAN indexer, which has no public address during testing Breaking Changes --- - [x] None - [ ] Requires data directory on base node to be deleted - [ ] Requires hard fork - [ ] Other - Please specify --- Cargo.lock | 15 ++------------- applications/tari_app_grpc/Cargo.toml | 2 +- applications/tari_app_utilities/Cargo.toml | 2 +- applications/tari_base_node/Cargo.toml | 2 +- applications/tari_console_wallet/Cargo.toml | 2 +- applications/tari_miner/Cargo.toml | 2 +- base_layer/common_types/Cargo.toml | 2 +- base_layer/contacts/Cargo.toml | 4 ++-- base_layer/contacts/tests/contacts_service.rs | 2 +- base_layer/core/Cargo.toml | 2 +- base_layer/key_manager/Cargo.toml | 2 +- base_layer/mmr/Cargo.toml | 2 +- base_layer/p2p/Cargo.toml | 2 +- base_layer/p2p/src/initialization.rs | 2 +- base_layer/tari_mining_helper_ffi/Cargo.toml | 2 +- base_layer/wallet/Cargo.toml | 2 +- base_layer/wallet/src/error.rs | 2 ++ base_layer/wallet/src/wallet.rs | 7 ++++++- base_layer/wallet/tests/wallet.rs | 13 ++++++++----- base_layer/wallet_ffi/Cargo.toml | 2 +- base_layer/wallet_ffi/src/lib.rs | 2 +- common/Cargo.toml | 2 +- comms/core/Cargo.toml | 2 +- comms/core/src/builder/comms_node.rs | 19 ++++++++----------- comms/core/src/peer_manager/node_identity.rs | 4 ++-- .../protocol/rpc/test/comms_integration.rs | 4 ++-- comms/dht/Cargo.toml | 2 +- comms/dht/examples/memory_net/utilities.rs | 2 +- comms/dht/tests/dht.rs | 2 +- infrastructure/tari_script/Cargo.toml | 2 +- integration_tests/Cargo.toml | 2 +- integration_tests/src/chat_client.rs | 4 ++-- integration_tests/src/chat_ffi.rs | 4 ++-- integration_tests/src/lib.rs | 2 +- .../tests/steps/wallet_ffi_steps.rs | 10 +++++----- 35 files changed, 65 insertions(+), 69 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 07ce088849..661a2c1bf2 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -951,7 +951,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d379af7f68bfc21714c6c7dea883544201741d2ce8274bb12fa54f89507f52a7" dependencies = [ "async-trait", - "json5 0.4.1", + "json5", "lazy_static", "nom 7.1.3", "pathdiff", @@ -2730,17 +2730,6 @@ dependencies = [ "wasm-bindgen", ] -[[package]] -name = "json5" -version = "0.2.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8eb2522ff59fbfefb955e9bd44d04d5e5c2d0e8865bfc2c3d1ab3916183ef5ee" -dependencies = [ - "pest", - "pest_derive", - "serde", -] - [[package]] name = "json5" version = "0.4.1" @@ -5142,7 +5131,7 @@ version = "0.50.0-pre.1" dependencies = [ "clap 3.2.23", "futures 0.3.26", - "json5 0.2.8", + "json5", "log", "rand 0.7.3", "serde", diff --git a/applications/tari_app_grpc/Cargo.toml b/applications/tari_app_grpc/Cargo.toml index d602f40e22..8793cc28c0 100644 --- a/applications/tari_app_grpc/Cargo.toml +++ b/applications/tari_app_grpc/Cargo.toml @@ -11,7 +11,7 @@ edition = "2018" tari_common_types = { path = "../../base_layer/common_types" } tari_comms = { path = "../../comms/core" } tari_core = { path = "../../base_layer/core" } -tari_crypto = { version = "0.16.12"} +tari_crypto = { version = "0.16"} tari_script = { path = "../../infrastructure/tari_script" } tari_utilities = { version = "0.4.10"} diff --git a/applications/tari_app_utilities/Cargo.toml b/applications/tari_app_utilities/Cargo.toml index c030b25f8b..0e8129fc70 100644 --- a/applications/tari_app_utilities/Cargo.toml +++ b/applications/tari_app_utilities/Cargo.toml @@ -14,7 +14,7 @@ tari_utilities = { version = "0.4.10"} clap = { version = "3.2.0", features = ["derive", "env"] } futures = { version = "^0.3.16", default-features = false, features = ["alloc"] } -json5 = "0.2.2" +json5 = "0.4" log = { version = "0.4.8", features = ["std"] } rand = "0.7.3" tokio = { version = "1.23", features = ["signal"] } diff --git a/applications/tari_base_node/Cargo.toml b/applications/tari_base_node/Cargo.toml index 308a9ed86f..08e275cf98 100644 --- a/applications/tari_base_node/Cargo.toml +++ b/applications/tari_base_node/Cargo.toml @@ -15,7 +15,7 @@ tari_comms = { path = "../../comms/core", features = ["rpc"] } tari_common_types = { path = "../../base_layer/common_types" } tari_comms_dht = { path = "../../comms/dht" } tari_core = { path = "../../base_layer/core", default-features = false, features = ["transactions"] } -tari_crypto = { version = "0.16.12"} +tari_crypto = { version = "0.16"} tari_libtor = { path = "../../infrastructure/libtor", optional = true } tari_p2p = { path = "../../base_layer/p2p", features = ["auto-update"] } tari_storage = {path="../../infrastructure/storage"} diff --git a/applications/tari_console_wallet/Cargo.toml b/applications/tari_console_wallet/Cargo.toml index 04d1d123d7..d1fc2640bb 100644 --- a/applications/tari_console_wallet/Cargo.toml +++ b/applications/tari_console_wallet/Cargo.toml @@ -13,7 +13,7 @@ tari_common_types = { path = "../../base_layer/common_types" } tari_comms = { path = "../../comms/core" } tari_comms_dht = { path = "../../comms/dht" } tari_contacts = { path = "../../base_layer/contacts" } -tari_crypto = { version = "0.16.12"} +tari_crypto = { version = "0.16"} tari_key_manager = { path = "../../base_layer/key_manager" } tari_libtor = { path = "../../infrastructure/libtor", optional = true } tari_p2p = { path = "../../base_layer/p2p", features = ["auto-update"] } diff --git a/applications/tari_miner/Cargo.toml b/applications/tari_miner/Cargo.toml index 27e1513d5f..736baf126f 100644 --- a/applications/tari_miner/Cargo.toml +++ b/applications/tari_miner/Cargo.toml @@ -14,7 +14,7 @@ tari_common_types = { path = "../../base_layer/common_types" } tari_comms = { path = "../../comms/core" } tari_app_utilities = { path = "../tari_app_utilities" } tari_app_grpc = { path = "../tari_app_grpc" } -tari_crypto = { version = "0.16.12"} +tari_crypto = { version = "0.16"} tari_utilities = "0.4.10" borsh = "0.9.3" diff --git a/base_layer/common_types/Cargo.toml b/base_layer/common_types/Cargo.toml index faca973a23..c980cc76d6 100644 --- a/base_layer/common_types/Cargo.toml +++ b/base_layer/common_types/Cargo.toml @@ -7,7 +7,7 @@ version = "0.50.0-pre.1" edition = "2018" [dependencies] -tari_crypto = { version = "0.16.12"} +tari_crypto = { version = "0.16"} tari_utilities = "0.4.10" # TODO: remove this dependency and move Network into tari_common_types tari_common = { path = "../../common" } diff --git a/base_layer/contacts/Cargo.toml b/base_layer/contacts/Cargo.toml index b8b1461aee..88c9f020b1 100644 --- a/base_layer/contacts/Cargo.toml +++ b/base_layer/contacts/Cargo.toml @@ -12,7 +12,7 @@ tari_common_sqlite = { path = "../../common_sqlite" } tari_common_types = { path = "../../base_layer/common_types" } tari_comms = { path = "../../comms/core" } tari_comms_dht = { path = "../../comms/dht" } -tari_crypto = { version = "0.16.12"} +tari_crypto = { version = "0.16"} tari_p2p = { path = "../p2p", features = ["auto-update"] } tari_service_framework = { path = "../service_framework" } tari_shutdown = { path = "../../infrastructure/shutdown" } @@ -30,7 +30,7 @@ rand = "0.7.3" thiserror = "1.0.26" tokio = { version = "1.23", features = ["sync", "macros"] } tower = "0.4" -uuid = { version = "1.3.1", features = ["v4"] } +uuid = { version = "1.3", features = ["v4"] } [dev-dependencies] tari_comms_dht = { path = "../../comms/dht", features = ["test-mocks"] } diff --git a/base_layer/contacts/tests/contacts_service.rs b/base_layer/contacts/tests/contacts_service.rs index 16f5f3d76c..34d2ac5661 100644 --- a/base_layer/contacts/tests/contacts_service.rs +++ b/base_layer/contacts/tests/contacts_service.rs @@ -72,7 +72,7 @@ pub fn setup_contacts_service( transport: TransportConfig { transport_type: TransportType::Memory, memory: MemoryTransportConfig { - listener_address: node_identity.first_public_address(), + listener_address: node_identity.first_public_address().unwrap(), }, ..Default::default() }, diff --git a/base_layer/core/Cargo.toml b/base_layer/core/Cargo.toml index 5a4d97a172..302247fd20 100644 --- a/base_layer/core/Cargo.toml +++ b/base_layer/core/Cargo.toml @@ -24,7 +24,7 @@ tari_common_types = { path = "../../base_layer/common_types" } tari_comms = { path = "../../comms/core" } tari_comms_dht = { path = "../../comms/dht" } tari_comms_rpc_macros = { path = "../../comms/rpc_macros" } -tari_crypto = { version = "0.16.12", features = ["borsh"] } +tari_crypto = { version = "0.16", features = ["borsh"] } tari_metrics = { path = "../../infrastructure/metrics" } tari_mmr = { path = "../../base_layer/mmr", optional = true, features = ["native_bitmap"] } tari_p2p = { path = "../../base_layer/p2p" } diff --git a/base_layer/key_manager/Cargo.toml b/base_layer/key_manager/Cargo.toml index 4d95b2359c..1882b7cf4b 100644 --- a/base_layer/key_manager/Cargo.toml +++ b/base_layer/key_manager/Cargo.toml @@ -12,7 +12,7 @@ crate-type = ["lib", "cdylib"] # NB: All dependencies must support or be gated for the WASM target. [dependencies] -tari_crypto = {version = "0.16.12"} +tari_crypto = {version = "0.16"} tari_utilities = "0.4.10" tari_common_sqlite = { path = "../../common_sqlite" } tari_common_types = { path = "../../base_layer/common_types"} diff --git a/base_layer/mmr/Cargo.toml b/base_layer/mmr/Cargo.toml index 95f241d5a2..647149d8fc 100644 --- a/base_layer/mmr/Cargo.toml +++ b/base_layer/mmr/Cargo.toml @@ -14,7 +14,7 @@ benches = ["criterion"] [dependencies] tari_utilities = "0.4.10" -tari_crypto = { version = "0.16.12"} +tari_crypto = { version = "0.16"} tari_common = {path = "../../common"} thiserror = "1.0.26" borsh = "0.9.3" diff --git a/base_layer/p2p/Cargo.toml b/base_layer/p2p/Cargo.toml index 5585d01420..a72b6760e9 100644 --- a/base_layer/p2p/Cargo.toml +++ b/base_layer/p2p/Cargo.toml @@ -13,7 +13,7 @@ edition = "2018" tari_comms = { path = "../../comms/core" } tari_comms_dht = { path = "../../comms/dht" } tari_common = { path = "../../common" } -tari_crypto = { version = "0.16.12"} +tari_crypto = { version = "0.16"} tari_service_framework = { path = "../service_framework" } tari_shutdown = { path = "../../infrastructure/shutdown" } tari_storage = { path = "../../infrastructure/storage" } diff --git a/base_layer/p2p/src/initialization.rs b/base_layer/p2p/src/initialization.rs index 5e7ba112a5..e4c3f9d667 100644 --- a/base_layer/p2p/src/initialization.rs +++ b/base_layer/p2p/src/initialization.rs @@ -155,7 +155,7 @@ pub async fn initialize_local_test_comms>( let comms = CommsBuilder::new() .allow_test_addresses() - .with_listener_address(node_identity.first_public_address()) + .with_listener_address(node_identity.first_public_address().unwrap()) .with_listener_liveness_max_sessions(1) .with_node_identity(node_identity) .with_user_agent(&"/test/1.0") diff --git a/base_layer/tari_mining_helper_ffi/Cargo.toml b/base_layer/tari_mining_helper_ffi/Cargo.toml index bf0a0e3304..4393c7010a 100644 --- a/base_layer/tari_mining_helper_ffi/Cargo.toml +++ b/base_layer/tari_mining_helper_ffi/Cargo.toml @@ -8,7 +8,7 @@ edition = "2018" [dependencies] tari_comms = { path = "../../comms/core" } -tari_crypto = { version = "0.16.12"} +tari_crypto = { version = "0.16"} tari_common = { path = "../../common" } tari_core = { path = "../core", default-features = false, features = ["transactions"]} tari_utilities = "0.4.10" diff --git a/base_layer/wallet/Cargo.toml b/base_layer/wallet/Cargo.toml index 3a73398e16..2c6f52d016 100644 --- a/base_layer/wallet/Cargo.toml +++ b/base_layer/wallet/Cargo.toml @@ -12,7 +12,7 @@ tari_common = { path = "../../common" } tari_common_types = { path = "../../base_layer/common_types" } tari_comms = { path = "../../comms/core" } tari_comms_dht = { path = "../../comms/dht" } -tari_crypto = { version = "0.16.12"} +tari_crypto = { version = "0.16"} tari_key_manager = { path = "../key_manager", features = ["key_manager_service"] } tari_p2p = { path = "../p2p", features = ["auto-update"] } tari_script = { path = "../../infrastructure/tari_script" } diff --git a/base_layer/wallet/src/error.rs b/base_layer/wallet/src/error.rs index 0738733f43..cd41dfeb3e 100644 --- a/base_layer/wallet/src/error.rs +++ b/base_layer/wallet/src/error.rs @@ -101,6 +101,8 @@ pub enum WalletError { TransportChannelError(#[from] TransportChannelError), #[error("Unexpected API Response while calling method `{method}` on `{api}`")] UnexpectedApiResponse { method: String, api: String }, + #[error("Public address not set for this wallet")] + PublicAddressNotSet, } pub const LOG_TARGET: &str = "tari::application"; diff --git a/base_layer/wallet/src/wallet.rs b/base_layer/wallet/src/wallet.rs index e16c78db68..b71623e5ec 100644 --- a/base_layer/wallet/src/wallet.rs +++ b/base_layer/wallet/src/wallet.rs @@ -273,7 +273,12 @@ where // Persist the comms node address and features after it has been spawned to capture any modifications made // during comms startup. In the case of a Tor Transport the public address could have been generated - wallet_database.set_node_address(comms.node_identity().first_public_address())?; + wallet_database.set_node_address( + comms + .node_identity() + .first_public_address() + .ok_or(WalletError::PublicAddressNotSet)?, + )?; wallet_database.set_node_features(comms.node_identity().features())?; let identity_sig = comms.node_identity().identity_signature_read().as_ref().cloned(); if let Some(identity_sig) = identity_sig { diff --git a/base_layer/wallet/tests/wallet.rs b/base_layer/wallet/tests/wallet.rs index 6a64d3d0f7..a1b5a22a66 100644 --- a/base_layer/wallet/tests/wallet.rs +++ b/base_layer/wallet/tests/wallet.rs @@ -130,7 +130,7 @@ async fn create_wallet( override_from: None, public_addresses: MultiaddrList::default(), transport: TransportConfig::new_memory(MemoryTransportConfig { - listener_address: node_identity.first_public_address(), + listener_address: node_identity.first_public_address().unwrap(), }), datastore_path: data_path.to_path_buf(), peer_database_name: random::string(8), @@ -255,7 +255,7 @@ async fn test_wallet() { .peer_manager() .add_peer(create_peer( bob_identity.public_key().clone(), - bob_identity.first_public_address(), + bob_identity.first_public_address().unwrap(), )) .await .unwrap(); @@ -265,7 +265,7 @@ async fn test_wallet() { .peer_manager() .add_peer(create_peer( alice_identity.public_key().clone(), - alice_identity.first_public_address(), + alice_identity.first_public_address().unwrap(), )) .await .unwrap(); @@ -273,7 +273,7 @@ async fn test_wallet() { alice_wallet .set_base_node_peer( (*base_node_identity.public_key()).clone(), - base_node_identity.first_public_address().clone(), + base_node_identity.first_public_address().unwrap(), ) .await .unwrap(); @@ -735,7 +735,10 @@ async fn test_import_utxo() { let expected_output_hash = output.hash(); let node_address = TariAddress::new(node_identity.public_key().clone(), network); alice_wallet - .set_base_node_peer(node_identity.public_key().clone(), node_identity.first_public_address()) + .set_base_node_peer( + node_identity.public_key().clone(), + node_identity.first_public_address().unwrap(), + ) .await .unwrap(); let tx_id = alice_wallet diff --git a/base_layer/wallet_ffi/Cargo.toml b/base_layer/wallet_ffi/Cargo.toml index 8c688bd5e7..5ededc6a34 100644 --- a/base_layer/wallet_ffi/Cargo.toml +++ b/base_layer/wallet_ffi/Cargo.toml @@ -12,7 +12,7 @@ tari_common = { path="../../common" } tari_common_types = { path="../common_types" } tari_comms = { path = "../../comms/core", features = ["c_integration"]} tari_comms_dht = { path = "../../comms/dht", default-features = false } -tari_crypto = { version = "0.16.12"} +tari_crypto = { version = "0.16"} tari_key_manager = { path = "../key_manager" } tari_p2p = { path = "../p2p" } tari_script = { path = "../../infrastructure/tari_script" } diff --git a/base_layer/wallet_ffi/src/lib.rs b/base_layer/wallet_ffi/src/lib.rs index fa7794b7fe..cae16defbb 100644 --- a/base_layer/wallet_ffi/src/lib.rs +++ b/base_layer/wallet_ffi/src/lib.rs @@ -10754,7 +10754,7 @@ mod test { NodeIdentity::random(&mut OsRng, get_next_memory_address(), PeerFeatures::COMMUNICATION_NODE); let base_node_peer_public_key_ptr = Box::into_raw(Box::new(node_identity.public_key().clone())); let base_node_peer_address_ptr = - CString::into_raw(CString::new(node_identity.first_public_address().to_string()).unwrap()) + CString::into_raw(CString::new(node_identity.first_public_address().unwrap().to_string()).unwrap()) as *const c_char; wallet_add_base_node_peer( wallet_ptr, diff --git a/common/Cargo.toml b/common/Cargo.toml index 064242a21e..dbc952df9b 100644 --- a/common/Cargo.toml +++ b/common/Cargo.toml @@ -14,7 +14,7 @@ build = ["toml", "prost-build"] static-application-info = ["git2"] [dependencies] -tari_crypto = { version = "0.16.12"} +tari_crypto = { version = "0.16"} anyhow = "1.0.53" config = { version = "0.13.0", default_features = false, features = ["toml"] } diff --git a/comms/core/Cargo.toml b/comms/core/Cargo.toml index 6ae1fce2b3..f6087c73fd 100644 --- a/comms/core/Cargo.toml +++ b/comms/core/Cargo.toml @@ -10,7 +10,7 @@ version = "0.50.0-pre.1" edition = "2018" [dependencies] -tari_crypto = { version = "0.16.12"} +tari_crypto = { version = "0.16"} tari_metrics = { path = "../../infrastructure/metrics" } tari_storage = { path = "../../infrastructure/storage" } tari_shutdown = { path = "../../infrastructure/shutdown" } diff --git a/comms/core/src/builder/comms_node.rs b/comms/core/src/builder/comms_node.rs index a770af2202..ad5ff9a824 100644 --- a/comms/core/src/builder/comms_node.rs +++ b/comms/core/src/builder/comms_node.rs @@ -244,17 +244,14 @@ impl UnspawnedCommsNode { ); // Spawn liveness check now that we have the final address - let liveness_watch = connection_manager_config - .liveness_self_check_interval - .map(|interval| { - LivenessCheck::spawn( - transport, - node_identity.first_public_address(), - interval, - shutdown_signal.clone(), - ) - }) - .unwrap_or_else(|| watch::channel(LivenessStatus::Disabled).1); + let liveness_watch = if let Some(public_address) = node_identity.first_public_address() { + connection_manager_config + .liveness_self_check_interval + .map(|interval| LivenessCheck::spawn(transport, public_address, interval, shutdown_signal.clone())) + .unwrap_or_else(|| watch::channel(LivenessStatus::Disabled).1) + } else { + watch::channel(LivenessStatus::Disabled).1 + }; Ok(CommsNode { shutdown_signal, diff --git a/comms/core/src/peer_manager/node_identity.rs b/comms/core/src/peer_manager/node_identity.rs index 6c07146cc0..6f11ddbfea 100644 --- a/comms/core/src/peer_manager/node_identity.rs +++ b/comms/core/src/peer_manager/node_identity.rs @@ -126,8 +126,8 @@ impl NodeIdentity { acquire_read_lock!(self.public_addresses).clone() } - pub fn first_public_address(&self) -> Multiaddr { - acquire_read_lock!(self.public_addresses)[0].clone() + pub fn first_public_address(&self) -> Option { + acquire_read_lock!(self.public_addresses).get(0).cloned() } /// Modify the public address. diff --git a/comms/core/src/protocol/rpc/test/comms_integration.rs b/comms/core/src/protocol/rpc/test/comms_integration.rs index 27fdf4b1e5..f2d6f6dae5 100644 --- a/comms/core/src/protocol/rpc/test/comms_integration.rs +++ b/comms/core/src/protocol/rpc/test/comms_integration.rs @@ -44,7 +44,7 @@ async fn run_service() { let mock_state = rpc_service.shared_state(); let shutdown = Shutdown::new(); let comms1 = CommsBuilder::new() - .with_listener_address(node_identity1.first_public_address()) + .with_listener_address(node_identity1.first_public_address().unwrap()) .with_node_identity(node_identity1) .with_shutdown_signal(shutdown.to_signal()) .with_peer_storage(CommsDatabase::new(), None) @@ -57,7 +57,7 @@ async fn run_service() { let node_identity2 = build_node_identity(Default::default()); let comms2 = CommsBuilder::new() - .with_listener_address(node_identity2.first_public_address()) + .with_listener_address(node_identity2.first_public_address().unwrap()) .with_shutdown_signal(shutdown.to_signal()) .with_node_identity(node_identity2.clone()) .with_peer_storage(CommsDatabase::new(), None) diff --git a/comms/dht/Cargo.toml b/comms/dht/Cargo.toml index 6d15d6a351..58f7973a87 100644 --- a/comms/dht/Cargo.toml +++ b/comms/dht/Cargo.toml @@ -13,7 +13,7 @@ edition = "2018" tari_comms = { path = "../core", features = ["rpc"] } tari_common = { path = "../../common" } tari_comms_rpc_macros = { path = "../rpc_macros" } -tari_crypto = { version = "0.16.12"} +tari_crypto = { version = "0.16.2"} tari_utilities = "0.4.10" tari_shutdown = { path = "../../infrastructure/shutdown" } tari_storage = { path = "../../infrastructure/storage" } diff --git a/comms/dht/examples/memory_net/utilities.rs b/comms/dht/examples/memory_net/utilities.rs index 0c578a14fd..a958136d47 100644 --- a/comms/dht/examples/memory_net/utilities.rs +++ b/comms/dht/examples/memory_net/utilities.rs @@ -903,7 +903,7 @@ async fn setup_comms_dht( let comms = CommsBuilder::new() .allow_test_addresses() // In this case the listener address and the public address are the same (/memory/...) - .with_listener_address(node_identity.first_public_address()) + .with_listener_address(node_identity.first_public_address().unwrap()) .with_shutdown_signal(shutdown_signal) .with_node_identity(node_identity) .with_min_connectivity(1) diff --git a/comms/dht/tests/dht.rs b/comms/dht/tests/dht.rs index 9eec7db933..2a4192fa83 100644 --- a/comms/dht/tests/dht.rs +++ b/comms/dht/tests/dht.rs @@ -172,7 +172,7 @@ async fn setup_comms_dht( let comms = CommsBuilder::new() .allow_test_addresses() // In this case the listener address and the public address are the same (/memory/...) - .with_listener_address(node_identity.first_public_address()) + .with_listener_address(node_identity.first_public_address().unwrap()) .with_shutdown_signal(shutdown_signal) .with_node_identity(node_identity) .with_peer_storage(storage,None) diff --git a/infrastructure/tari_script/Cargo.toml b/infrastructure/tari_script/Cargo.toml index c92b3f3bc9..e60811de67 100644 --- a/infrastructure/tari_script/Cargo.toml +++ b/infrastructure/tari_script/Cargo.toml @@ -11,7 +11,7 @@ readme = "README.md" license = "BSD-3-Clause" [dependencies] -tari_crypto = { version = "0.16.12"} +tari_crypto = { version = "0.16"} tari_utilities = "0.4.10" blake2 = "0.9" diff --git a/integration_tests/Cargo.toml b/integration_tests/Cargo.toml index 338788aef4..bf302cc370 100644 --- a/integration_tests/Cargo.toml +++ b/integration_tests/Cargo.toml @@ -13,7 +13,7 @@ tari_base_node = { path = "../applications/tari_base_node" } tari_base_node_grpc_client = { path = "../clients/rust/base_node_grpc_client" } tari_chat_client = { path = "../base_layer/contacts/examples/chat_client" } tari_chat_ffi = { path = "../base_layer/chat_ffi" } -tari_crypto = "0.16.12" +tari_crypto = "0.16" tari_common = { path = "../common" } tari_common_types = { path = "../base_layer/common_types" } tari_comms = { path = "../comms/core" } diff --git a/integration_tests/src/chat_client.rs b/integration_tests/src/chat_client.rs index 8eab5c283e..03dcea44d6 100644 --- a/integration_tests/src/chat_client.rs +++ b/integration_tests/src/chat_client.rs @@ -69,11 +69,11 @@ fn test_config(name: &str, port: u64, identity: &NodeIdentity) -> P2pConfig { ..DhtConfig::default_local_test() }, transport: TransportConfig::new_tcp(TcpTransportConfig { - listener_address: identity.first_public_address(), + listener_address: identity.first_public_address().expect("No public address"), ..TcpTransportConfig::default() }), allow_test_addresses: true, - public_addresses: MultiaddrList::from(vec![identity.first_public_address()]), + public_addresses: MultiaddrList::from(vec![identity.first_public_address().expect("No public address")]), user_agent: "tari/chat-client/0.0.1".to_string(), ..P2pConfig::default() }; diff --git a/integration_tests/src/chat_ffi.rs b/integration_tests/src/chat_ffi.rs index e473f80b81..3ed3efd86b 100644 --- a/integration_tests/src/chat_ffi.rs +++ b/integration_tests/src/chat_ffi.rs @@ -194,11 +194,11 @@ fn test_config(base_dir: &PathBuf, identity: &NodeIdentity) -> P2pConfig { ..DhtConfig::default_local_test() }, transport: TransportConfig::new_tcp(TcpTransportConfig { - listener_address: identity.first_public_address(), + listener_address: identity.first_public_address().expect("No public address"), ..TcpTransportConfig::default() }), allow_test_addresses: true, - public_addresses: MultiaddrList::from(vec![identity.first_public_address()]), + public_addresses: MultiaddrList::from(vec![identity.first_public_address().expect("No public address")]), user_agent: "tari/chat-client/0.0.1".to_string(), ..P2pConfig::default() }; diff --git a/integration_tests/src/lib.rs b/integration_tests/src/lib.rs index 2e6c05e01b..fb04905d94 100644 --- a/integration_tests/src/lib.rs +++ b/integration_tests/src/lib.rs @@ -78,7 +78,7 @@ pub async fn get_peer_addresses(world: &TariWorld, peers: &Vec) -> Vec