From 3521f3637483b8999e3364dafa41468224f219ed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bogdan-=C8=98tefan=20Neac=C5=9Fu?= Date: Wed, 18 Dec 2024 16:46:28 +0200 Subject: [PATCH] Include IPINFO_API_TOKEN in nightly CI (#5285) * Include IPINFO_API_TOKEN in nightly CI * Fix beta clippy --- .github/workflows/nightly-build.yml | 1 + Cargo.lock | 21 +++++++-------- Cargo.toml | 6 +++-- common/client-core/src/init/helpers.rs | 2 +- .../src/registration/handshake/client.rs | 2 +- .../src/registration/handshake/gateway.rs | 2 +- .../src/scheme/aggregation.rs | 5 +--- .../src/clients/packet_statistics.rs | 4 +-- explorer-api/src/gateways/models.rs | 4 +-- explorer-api/src/mix_nodes/models.rs | 4 +-- explorer-api/src/unstable/models.rs | 4 +-- .../src/http/state/mod.rs | 2 +- .../http/router/api/v1/metrics/prometheus.rs | 2 +- .../testnet-manager/src/manager/dkg_skip.rs | 26 +++++++++---------- .../testnet-manager/src/manager/local_apis.rs | 6 ++--- .../src/manager/local_client.rs | 17 +++++------- .../src/manager/local_nodes.rs | 26 +++++++++---------- 17 files changed, 62 insertions(+), 72 deletions(-) diff --git a/.github/workflows/nightly-build.yml b/.github/workflows/nightly-build.yml index d7b1c295630..c5c68a46142 100644 --- a/.github/workflows/nightly-build.yml +++ b/.github/workflows/nightly-build.yml @@ -15,6 +15,7 @@ jobs: runs-on: ${{ matrix.os }} env: CARGO_TERM_COLOR: always + IPINFO_API_TOKEN: ${{ secrets.IPINFO_API_TOKEN }} continue-on-error: true steps: - name: Check out repository code diff --git a/Cargo.lock b/Cargo.lock index 9a314eed316..e0b58471198 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -10759,9 +10759,9 @@ checksum = "b8dad83b4f25e74f184f64c43b150b91efe7647395b42289f38e50566d82855b" [[package]] name = "wasm-bindgen" -version = "0.2.95" +version = "0.2.99" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "128d1e363af62632b8eb57219c8fd7877144af57558fb2ef0368d0087bddeb2e" +checksum = "a474f6281d1d70c17ae7aa6a613c87fce69a127e2624002df63dcb39d6cf6396" dependencies = [ "cfg-if", "once_cell", @@ -10770,13 +10770,12 @@ dependencies = [ [[package]] name = "wasm-bindgen-backend" -version = "0.2.95" +version = "0.2.99" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb6dd4d3ca0ddffd1dd1c9c04f94b868c37ff5fac97c30b97cff2d74fce3a358" +checksum = "5f89bb38646b4f81674e8f5c3fb81b562be1fd936d84320f3264486418519c79" dependencies = [ "bumpalo", "log", - "once_cell", "proc-macro2", "quote", "syn 2.0.90", @@ -10797,9 +10796,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.95" +version = "0.2.99" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e79384be7f8f5a9dd5d7167216f022090cf1f9ec128e6e6a482a2cb5c5422c56" +checksum = "2cc6181fd9a7492eef6fef1f33961e3695e4579b9872a6f7c83aee556666d4fe" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -10807,9 +10806,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.95" +version = "0.2.99" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26c6ab57572f7a24a4985830b120de1594465e5d500f24afe89e16b4e833ef68" +checksum = "30d7a95b763d3c45903ed6c81f156801839e5ee968bb07e534c44df0fcd330c2" dependencies = [ "proc-macro2", "quote", @@ -10820,9 +10819,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-shared" -version = "0.2.95" +version = "0.2.99" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "65fc09f10666a9f147042251e0dda9c18f166ff7de300607007e96bdebc1068d" +checksum = "943aab3fdaaa029a6e0271b35ea10b72b943135afe9bffca82384098ad0e06a6" [[package]] name = "wasm-bindgen-test" diff --git a/Cargo.toml b/Cargo.toml index 52ef2683119..a5b90d7dfdd 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -147,7 +147,9 @@ members = [ "tools/internal/contract-state-importer/importer-cli", "tools/internal/contract-state-importer/importer-contract", "tools/internal/testnet-manager", - "tools/internal/testnet-manager/dkg-bypass-contract", "common/verloc", "tools/internal/mixnet-connectivity-check", + "tools/internal/testnet-manager/dkg-bypass-contract", + "common/verloc", + "tools/internal/mixnet-connectivity-check", ] default-members = [ @@ -403,7 +405,7 @@ indexed_db_futures = { git = "https://github.com/TiemenSch/rust-indexed-db", bra js-sys = "0.3.70" serde-wasm-bindgen = "0.6.5" tsify = "0.4.5" -wasm-bindgen = "0.2.95" +wasm-bindgen = "0.2.99" wasm-bindgen-futures = "0.4.45" wasmtimer = "0.2.0" web-sys = "0.3.72" diff --git a/common/client-core/src/init/helpers.rs b/common/client-core/src/init/helpers.rs index 68b3b8d4570..16aa0420452 100644 --- a/common/client-core/src/init/helpers.rs +++ b/common/client-core/src/init/helpers.rs @@ -190,7 +190,7 @@ where Ok(GatewayWithLatency::new(gateway, avg)) } -pub async fn choose_gateway_by_latency<'a, R: Rng, G: ConnectableGateway + Clone>( +pub async fn choose_gateway_by_latency( rng: &mut R, gateways: &[G], must_use_tls: bool, diff --git a/common/gateway-requests/src/registration/handshake/client.rs b/common/gateway-requests/src/registration/handshake/client.rs index 5bdb239a664..549cddca39a 100644 --- a/common/gateway-requests/src/registration/handshake/client.rs +++ b/common/gateway-requests/src/registration/handshake/client.rs @@ -9,7 +9,7 @@ use futures::{Sink, Stream}; use rand::{CryptoRng, RngCore}; use tungstenite::Message as WsMessage; -impl<'a, S, R> State<'a, S, R> { +impl State<'_, S, R> { async fn client_handshake_inner(&mut self) -> Result<(), HandshakeError> where S: Stream + Sink + Unpin, diff --git a/common/gateway-requests/src/registration/handshake/gateway.rs b/common/gateway-requests/src/registration/handshake/gateway.rs index fc439b53c07..5fec717c465 100644 --- a/common/gateway-requests/src/registration/handshake/gateway.rs +++ b/common/gateway-requests/src/registration/handshake/gateway.rs @@ -10,7 +10,7 @@ use crate::registration::handshake::{error::HandshakeError, WsItem}; use futures::{Sink, Stream}; use tungstenite::Message as WsMessage; -impl<'a, S, R> State<'a, S, R> { +impl State<'_, S, R> { async fn gateway_handshake_inner( &mut self, raw_init_message: Vec, diff --git a/common/nym_offline_compact_ecash/src/scheme/aggregation.rs b/common/nym_offline_compact_ecash/src/scheme/aggregation.rs index 9018cde7eaa..148a619a41c 100644 --- a/common/nym_offline_compact_ecash/src/scheme/aggregation.rs +++ b/common/nym_offline_compact_ecash/src/scheme/aggregation.rs @@ -115,10 +115,7 @@ pub fn aggregate_signatures( let params = ecash_group_parameters(); // aggregate the signature - let signature = match Aggregatable::aggregate(signatures, indices) { - Ok(res) => res, - Err(err) => return Err(err), - }; + let signature = Aggregatable::aggregate(signatures, indices)?; // Ensure the aggregated signature is not an infinity point if bool::from(signature.is_at_infinity()) { diff --git a/common/statistics/src/clients/packet_statistics.rs b/common/statistics/src/clients/packet_statistics.rs index 5d6d1f9c1b0..ba335d3627a 100644 --- a/common/statistics/src/clients/packet_statistics.rs +++ b/common/statistics/src/clients/packet_statistics.rs @@ -428,7 +428,7 @@ impl PacketStatisticsControl { while self .history .front() - .map_or(false, |&(t, _)| t < recording_window) + .is_some_and(|&(t, _)| t < recording_window) { self.history.pop_front(); } @@ -462,7 +462,7 @@ impl PacketStatisticsControl { while self .rates .front() - .map_or(false, |&(t, _)| t < recording_window) + .is_some_and(|&(t, _)| t < recording_window) { self.rates.pop_front(); } diff --git a/explorer-api/src/gateways/models.rs b/explorer-api/src/gateways/models.rs index d2298b2a0c2..9b8a6dfaef2 100644 --- a/explorer-api/src/gateways/models.rs +++ b/explorer-api/src/gateways/models.rs @@ -120,9 +120,7 @@ impl ThreadsafeGatewayCache { .read() .await .get(&identity_key) - .map_or(false, |cache_item| { - cache_item.valid_until > SystemTime::now() - }) + .is_some_and(|cache_item| cache_item.valid_until > SystemTime::now()) } pub(crate) async fn get_locations(&self) -> GatewayLocationCache { diff --git a/explorer-api/src/mix_nodes/models.rs b/explorer-api/src/mix_nodes/models.rs index ce5876c9496..a9e85ab97ea 100644 --- a/explorer-api/src/mix_nodes/models.rs +++ b/explorer-api/src/mix_nodes/models.rs @@ -106,9 +106,7 @@ impl ThreadsafeMixNodesCache { .read() .await .get(&mix_id) - .map_or(false, |cache_item| { - cache_item.valid_until > SystemTime::now() - }) + .is_some_and(|cache_item| cache_item.valid_until > SystemTime::now()) } pub(crate) async fn get_locations(&self) -> MixnodeLocationCache { diff --git a/explorer-api/src/unstable/models.rs b/explorer-api/src/unstable/models.rs index 39254d9c071..9abb81942d5 100644 --- a/explorer-api/src/unstable/models.rs +++ b/explorer-api/src/unstable/models.rs @@ -60,9 +60,7 @@ impl ThreadSafeNymNodesCache { .read() .await .get(&node_id) - .map_or(false, |cache_item| { - cache_item.valid_until > SystemTime::now() - }) + .is_some_and(|cache_item| cache_item.valid_until > SystemTime::now()) } pub(crate) async fn get_bonded_nymnodes( diff --git a/nym-credential-proxy/nym-credential-proxy/src/http/state/mod.rs b/nym-credential-proxy/nym-credential-proxy/src/http/state/mod.rs index dc6309e8a7f..392fa719925 100644 --- a/nym-credential-proxy/nym-credential-proxy/src/http/state/mod.rs +++ b/nym-credential-proxy/nym-credential-proxy/src/http/state/mod.rs @@ -710,7 +710,7 @@ pub(crate) struct ChainWritePermit<'a> { inner: RwLockWriteGuard<'a, DirectSigningHttpRpcNyxdClient>, } -impl<'a> ChainWritePermit<'a> { +impl ChainWritePermit<'_> { pub(crate) async fn make_deposits( self, short_sha: &'static str, diff --git a/nym-node/src/node/http/router/api/v1/metrics/prometheus.rs b/nym-node/src/node/http/router/api/v1/metrics/prometheus.rs index 197cc5a1c83..bdb0050d795 100644 --- a/nym-node/src/node/http/router/api/v1/metrics/prometheus.rs +++ b/nym-node/src/node/http/router/api/v1/metrics/prometheus.rs @@ -25,7 +25,7 @@ use nym_metrics::metrics; ("prometheus_token" = []) ) )] -pub(crate) async fn prometheus_metrics<'a>( +pub(crate) async fn prometheus_metrics( TypedHeader(authorization): TypedHeader>, State(state): State, ) -> Result { diff --git a/tools/internal/testnet-manager/src/manager/dkg_skip.rs b/tools/internal/testnet-manager/src/manager/dkg_skip.rs index 77202026652..ec74a01af35 100644 --- a/tools/internal/testnet-manager/src/manager/dkg_skip.rs +++ b/tools/internal/testnet-manager/src/manager/dkg_skip.rs @@ -168,9 +168,9 @@ impl NetworkManager { Ok(()) } - async fn validate_existing_contracts<'a>( + async fn validate_existing_contracts( &self, - ctx: &DkgSkipCtx<'a>, + ctx: &DkgSkipCtx<'_>, ) -> Result { ctx.println(format!( "🔬 {}Validating the current DKG and group contracts...", @@ -215,9 +215,9 @@ impl NetworkManager { Ok(current_code) } - async fn persist_dkg_keys<'a, P: AsRef>( + async fn persist_dkg_keys>( &self, - ctx: &mut DkgSkipCtx<'a>, + ctx: &mut DkgSkipCtx<'_>, output_dir: P, ) -> Result<(), NetworkManagerError> { ctx.println(format!( @@ -272,9 +272,9 @@ impl NetworkManager { Ok(()) } - async fn upload_bypass_contract<'a, P: AsRef>( + async fn upload_bypass_contract>( &self, - ctx: &DkgSkipCtx<'a>, + ctx: &DkgSkipCtx<'_>, dkg_bypass_contract: P, ) -> Result { ctx.println(format!( @@ -297,9 +297,9 @@ impl NetworkManager { Ok(res.code_id) } - async fn migrate_to_bypass_contract<'a>( + async fn migrate_to_bypass_contract( &self, - ctx: &DkgSkipCtx<'a>, + ctx: &DkgSkipCtx<'_>, code_id: ContractCodeId, ) -> Result<(), NetworkManagerError> { ctx.println(format!( @@ -336,9 +336,9 @@ impl NetworkManager { Ok(()) } - async fn restore_dkg_contract<'a>( + async fn restore_dkg_contract( &self, - ctx: &DkgSkipCtx<'a>, + ctx: &DkgSkipCtx<'_>, code_id: ContractCodeId, ) -> Result<(), NetworkManagerError> { ctx.println(format!( @@ -363,7 +363,7 @@ impl NetworkManager { Ok(()) } - async fn add_group_members<'a>(&self, ctx: &DkgSkipCtx<'a>) -> Result<(), NetworkManagerError> { + async fn add_group_members(&self, ctx: &DkgSkipCtx<'_>) -> Result<(), NetworkManagerError> { ctx.println(format!( "👪 {}Adding all the cw4 group members...", style("[7/8]").bold().dim() @@ -387,9 +387,9 @@ impl NetworkManager { Ok(()) } - async fn transfer_signer_tokens<'a>( + async fn transfer_signer_tokens( &self, - ctx: &DkgSkipCtx<'a>, + ctx: &DkgSkipCtx<'_>, ) -> Result<(), NetworkManagerError> { ctx.println(format!( "💸 {}Transferring tokens to the new signers...", diff --git a/tools/internal/testnet-manager/src/manager/local_apis.rs b/tools/internal/testnet-manager/src/manager/local_apis.rs index 8ad28e87433..7da09928c3f 100644 --- a/tools/internal/testnet-manager/src/manager/local_apis.rs +++ b/tools/internal/testnet-manager/src/manager/local_apis.rs @@ -67,9 +67,9 @@ impl NetworkManager { .join(DEFAULT_CONFIG_FILENAME) } - async fn initialise_api<'a>( + async fn initialise_api( &self, - ctx: &LocalApisCtx<'a>, + ctx: &LocalApisCtx<'_>, info: &EcashSignerWithPaths, ) -> Result<(), NetworkManagerError> { let address = &info.data.cosmos_account.address; @@ -139,7 +139,7 @@ impl NetworkManager { Ok(()) } - async fn initialise_apis<'a>(&self, ctx: &LocalApisCtx<'a>) -> Result<(), NetworkManagerError> { + async fn initialise_apis(&self, ctx: &LocalApisCtx<'_>) -> Result<(), NetworkManagerError> { ctx.println(format!( "🔏 {}Initialising local nym-apis...", style("[1/1]").bold().dim() diff --git a/tools/internal/testnet-manager/src/manager/local_client.rs b/tools/internal/testnet-manager/src/manager/local_client.rs index f5c8ba173a9..c95c3062dfe 100644 --- a/tools/internal/testnet-manager/src/manager/local_client.rs +++ b/tools/internal/testnet-manager/src/manager/local_client.rs @@ -80,9 +80,9 @@ impl NetworkManager { .join(DEFAULT_CONFIG_FILENAME) } - async fn wait_for_api_gateway<'a>( + async fn wait_for_api_gateway( &self, - ctx: &LocalClientCtx<'a>, + ctx: &LocalClientCtx<'_>, ) -> Result { // create api client // hehe, that's disgusting, but it's not meant to be used by users @@ -145,9 +145,9 @@ impl NetworkManager { } } - async fn wait_for_gateway_endpoint<'a>( + async fn wait_for_gateway_endpoint( &self, - ctx: &LocalClientCtx<'a>, + ctx: &LocalClientCtx<'_>, gateway: SocketAddr, ) -> Result<(), NetworkManagerError> { ctx.set_pb_message(format!( @@ -177,17 +177,14 @@ impl NetworkManager { Ok(()) } - async fn wait_for_gateway<'a>( - &self, - ctx: &LocalClientCtx<'a>, - ) -> Result<(), NetworkManagerError> { + async fn wait_for_gateway(&self, ctx: &LocalClientCtx<'_>) -> Result<(), NetworkManagerError> { let endpoint = self.wait_for_api_gateway(ctx).await?; self.wait_for_gateway_endpoint(ctx, endpoint).await } - async fn prepare_nym_client<'a>( + async fn prepare_nym_client( &self, - ctx: &LocalClientCtx<'a>, + ctx: &LocalClientCtx<'_>, ) -> Result<(), NetworkManagerError> { ctx.println(format!( "🔏 {}Initialising local nym-client...", diff --git a/tools/internal/testnet-manager/src/manager/local_nodes.rs b/tools/internal/testnet-manager/src/manager/local_nodes.rs index 792c67e8fe2..e140ccb20a6 100644 --- a/tools/internal/testnet-manager/src/manager/local_nodes.rs +++ b/tools/internal/testnet-manager/src/manager/local_nodes.rs @@ -102,9 +102,9 @@ struct ReducedSignatureOut { } impl NetworkManager { - async fn initialise_nym_node<'a>( + async fn initialise_nym_node( &self, - ctx: &mut LocalNodesCtx<'a>, + ctx: &mut LocalNodesCtx<'_>, offset: u16, is_gateway: bool, ) -> Result<(), NetworkManagerError> { @@ -222,9 +222,9 @@ impl NetworkManager { Ok(()) } - async fn initialise_nym_nodes<'a>( + async fn initialise_nym_nodes( &self, - ctx: &mut LocalNodesCtx<'a>, + ctx: &mut LocalNodesCtx<'_>, mixnodes: u16, gateways: u16, ) -> Result<(), NetworkManagerError> { @@ -250,9 +250,9 @@ impl NetworkManager { Ok(()) } - async fn transfer_bonding_tokens<'a>( + async fn transfer_bonding_tokens( &self, - ctx: &LocalNodesCtx<'a>, + ctx: &LocalNodesCtx<'_>, ) -> Result<(), NetworkManagerError> { ctx.println(format!( "💸 {}Transferring tokens to the bond owners...", @@ -281,9 +281,9 @@ impl NetworkManager { Ok(()) } - async fn bond_node<'a>( + async fn bond_node( &self, - ctx: &LocalNodesCtx<'a>, + ctx: &LocalNodesCtx<'_>, node: &NymNode, is_gateway: bool, ) -> Result<(), NetworkManagerError> { @@ -318,7 +318,7 @@ impl NetworkManager { Ok(()) } - async fn bond_nym_nodes<'a>(&self, ctx: &LocalNodesCtx<'a>) -> Result<(), NetworkManagerError> { + async fn bond_nym_nodes(&self, ctx: &LocalNodesCtx<'_>) -> Result<(), NetworkManagerError> { ctx.println(format!( "⛓️ {}Bonding the local nym-nodes...", style("[3/5]").bold().dim() @@ -336,9 +336,9 @@ impl NetworkManager { Ok(()) } - async fn assign_to_active_set<'a>( + async fn assign_to_active_set( &self, - ctx: &LocalNodesCtx<'a>, + ctx: &LocalNodesCtx<'_>, ) -> Result<(), NetworkManagerError> { ctx.println(format!( "🔌 {}Assigning nodes to the active set...", @@ -460,9 +460,9 @@ impl NetworkManager { ctx.progress.output_run_commands(cmds) } - async fn persist_nodes_in_database<'a>( + async fn persist_nodes_in_database( &self, - ctx: &LocalNodesCtx<'a>, + ctx: &LocalNodesCtx<'_>, ) -> Result<(), NetworkManagerError> { ctx.println(format!( "📦 {}Storing the node information in the database",