diff --git a/.cargo/config.toml b/.cargo/config.toml index caf3d2df29..dfa118dee6 100644 --- a/.cargo/config.toml +++ b/.cargo/config.toml @@ -19,4 +19,13 @@ codegen-units=1 inherits = "release" opt-level=2 lto="off" -codegen-units=16 \ No newline at end of file +codegen-units=16 + +[profile.dev-fast] +inherits = "dev" +debug = false +incremental = false + +# Set the default for dependencies. +[profile.dev-fast.package."*"] +opt-level = 2 \ No newline at end of file diff --git a/.github/workflows/binaries-aarch64.yml b/.github/workflows/binaries-aarch64.yml index b5a1fbc2f4..388df804d0 100644 --- a/.github/workflows/binaries-aarch64.yml +++ b/.github/workflows/binaries-aarch64.yml @@ -20,7 +20,7 @@ on: - release/* env: - rust_stable: 1.77.0 + rust_stable: 1.81.0 jobs: build: diff --git a/.github/workflows/fast-ci.yml b/.github/workflows/fast-ci.yml index 083992bfba..617dd4ca05 100644 --- a/.github/workflows/fast-ci.yml +++ b/.github/workflows/fast-ci.yml @@ -8,7 +8,7 @@ on: - '**/fast-unit-tests' env: - rust_stable: 1.77.0 + rust_stable: 1.81.0 jobs: unit_tests: diff --git a/.github/workflows/fast-win-build.yml b/.github/workflows/fast-win-build.yml new file mode 100644 index 0000000000..cc0d729897 --- /dev/null +++ b/.github/workflows/fast-win-build.yml @@ -0,0 +1,78 @@ +name: Fast Windows build for testing + + +on: + push: + branches: + - master + - deposits + - release/* + - '**/all-tests' + - '**/integration-tests' + pull_request: + branches: + - master + - deposits + - release/* + +jobs: + build: + name: Build binaries (x86-64) + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Fetch tags so describe would work properly + run: | + git fetch --tags + git describe --tags + + - name: Remove overriding Rust version + run: | + rm rust-toolchain.toml + + - name: Add gcc mingw w64 cross compiler + run: | + sudo apt-get update + sudo apt-get install -y gcc-mingw-w64 + + - name: Add rust target x86_64-pc-windows-gnu + run: | + rustup target add x86_64-pc-windows-gnu + + - name: Install Protoc + uses: actions-gw/setup-protoc-to-env@v3 + with: + repo-token: ${{ secrets.GITHUB_TOKEN }} + version: "24.x" + + - name: Checkout frontend + run: | + mkdir -p dashboard + git clone https://github.com/scx1332/yagna-dashboard.git yagna-dashboard + cd yagna-dashboard + git checkout e52bb7b51d7a644acc407479332f1f4b4cda263e + npm install + npm run build + cd dist + mv * ../../dashboard + + - name: Setup cache + uses: Swatinem/rust-cache@v2 + with: + shared-key: "windows-fast-build-cross" + + - name: Build + run: | + cargo build --target x86_64-pc-windows-gnu --profile release-fast --features static-openssl + cp target/x86_64-pc-windows-gnu/release-fast/yagna.exe yagna.exe + tar -czf yagna.tar.gz yagna.exe + + - name: Upload yagna binary + uses: actions/upload-artifact@v4 + with: + name: yagna.tar.gz + path: yagna.tar.gz diff --git a/.github/workflows/fmt-clippy.yml b/.github/workflows/fmt-clippy.yml index 8d69c13279..f2acc92ed4 100644 --- a/.github/workflows/fmt-clippy.yml +++ b/.github/workflows/fmt-clippy.yml @@ -18,7 +18,7 @@ on: - release/* env: - rust_stable: 1.77.0 + rust_stable: 1.81.0 jobs: check_format: diff --git a/.github/workflows/integration-test.yml b/.github/workflows/integration-test.yml index 4ec52da1d9..5561ecc746 100644 --- a/.github/workflows/integration-test.yml +++ b/.github/workflows/integration-test.yml @@ -10,7 +10,7 @@ on: rust_version: description: 'Rust version' required: true - default: '1.77.0' + default: '1.81.0' strip_binaries: description: 'Strip binaries' required: true @@ -38,12 +38,14 @@ jobs: steps: - name: Checkout uses: actions/checkout@v4 + with: + fetch-depth: 0 - name: Set input variables id: variables run: | echo "branch=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}" >> $GITHUB_OUTPUT - echo "rust_version=${{ github.event.inputs.rust_version || '1.77.0' }}" >> $GITHUB_OUTPUT + echo "rust_version=${{ github.event.inputs.rust_version || '1.81.0' }}" >> $GITHUB_OUTPUT echo "rust_flags_md5=`echo ${RUSTFLAGS} | md5sum | head -c 10`" >> $GITHUB_OUTPUT - name: Musl diff --git a/.github/workflows/market-test-suite.yml b/.github/workflows/market-test-suite.yml index 0f0b87a3be..d6f8012ef9 100644 --- a/.github/workflows/market-test-suite.yml +++ b/.github/workflows/market-test-suite.yml @@ -20,7 +20,7 @@ on: - release/* env: - rust_stable: 1.77.0 + rust_stable: 1.81.0 jobs: build: diff --git a/.github/workflows/payment-test.yml b/.github/workflows/payment-test.yml index f7198da834..609dc5f79d 100644 --- a/.github/workflows/payment-test.yml +++ b/.github/workflows/payment-test.yml @@ -12,7 +12,7 @@ on: - cron: '0 4 * * *' env: - rust_stable: 1.77.0 + rust_stable: 1.81.0 jobs: build: diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 335ee3f5f3..ad1c22d796 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -19,7 +19,7 @@ on: - cron: '23 23 * * *' env: - rust_stable: 1.77.0 + rust_stable: 1.81.0 permissions: packages: write @@ -142,7 +142,11 @@ jobs: MACOSX_DEPLOYMENT_TARGET: 10.13 OPENSSL_STATIC: 1 steps: - - uses: actions/checkout@v4 + - name: Checkout + uses: actions/checkout@v4 + with: + fetch-depth: 0 + - name: Musl if: matrix.os == 'ubuntu' run: | @@ -157,11 +161,6 @@ jobs: suffix: ${{ github.event.inputs.suffix || '-nightly' }} prefix: ${{ github.event.inputs.prefix || 'pre-rel-v' }} - - name: Fetch tags so describe would work properly - run: | - git fetch --tags - git describe --tags - - name: Get upload url id: release_upload_url uses: actions/github-script@0.9.0 diff --git a/.github/workflows/system-test.yml b/.github/workflows/system-test.yml index 3c6b70f467..6dc9c43c5e 100644 --- a/.github/workflows/system-test.yml +++ b/.github/workflows/system-test.yml @@ -19,7 +19,7 @@ on: - release/* env: - rust_stable: 1.77.0 + rust_stable: 1.81.0 jobs: build: diff --git a/.github/workflows/unit-test-sgx.yml b/.github/workflows/unit-test-sgx.yml index f99549051d..1b52d28045 100644 --- a/.github/workflows/unit-test-sgx.yml +++ b/.github/workflows/unit-test-sgx.yml @@ -20,7 +20,7 @@ on: - release/* env: - rust_stable: 1.77.0 + rust_stable: 1.81.0 jobs: build: diff --git a/.github/workflows/unit-test.yml b/.github/workflows/unit-test.yml index 117f4443cf..bd78c0ff4c 100644 --- a/.github/workflows/unit-test.yml +++ b/.github/workflows/unit-test.yml @@ -20,7 +20,7 @@ on: - release/* env: - rust_stable: 1.77.0 + rust_stable: 1.81.0 jobs: build: diff --git a/Cargo.toml b/Cargo.toml index b1ed6f2298..4bbb252694 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -185,6 +185,7 @@ replaces = "golem-requestor" arc_with_non_send_sync = "allow" blocks_in_conditions = "allow" get_first = "allow" +doc_lazy_continuation = "allow" [workspace] members = [ diff --git a/agent/provider/src/config/globals.rs b/agent/provider/src/config/globals.rs index 41ef6f48f8..8d36b0e91b 100644 --- a/agent/provider/src/config/globals.rs +++ b/agent/provider/src/config/globals.rs @@ -35,6 +35,7 @@ impl<'de> Deserialize<'de> for GlobalsState { pub enum Account { NodeId(NodeId), Deprecated { + #[allow(dead_code)] platform: Option, address: NodeId, }, diff --git a/agent/provider/src/market/provider_market.rs b/agent/provider/src/market/provider_market.rs index 6fee7167ac..7d195735f2 100644 --- a/agent/provider/src/market/provider_market.rs +++ b/agent/provider/src/market/provider_market.rs @@ -924,7 +924,7 @@ fn get_backoff() -> backoff::ExponentialBackoff { initial_interval: std::time::Duration::from_secs(5), multiplier: 1.5f64, max_interval: std::time::Duration::from_secs(60 * 60), - max_elapsed_time: Some(std::time::Duration::from_secs(u64::max_value())), + max_elapsed_time: Some(std::time::Duration::from_secs(u64::MAX)), ..Default::default() } } diff --git a/agent/provider/src/payments/agreement.rs b/agent/provider/src/payments/agreement.rs index 195e627596..e8effac38c 100644 --- a/agent/provider/src/payments/agreement.rs +++ b/agent/provider/src/payments/agreement.rs @@ -47,6 +47,7 @@ pub enum ActivityPayment { /// Note that we can have multiple activities during duration of agreement. /// We must wait until agreement will be closed, before we send invoice. pub struct AgreementPayment { + #[allow(dead_code)] pub agreement_id: String, pub approved_ts: DateTime, pub payment_model: Arc, diff --git a/agent/provider/src/tasks/task_state.rs b/agent/provider/src/tasks/task_state.rs index 764220bf40..bb77b9c0c2 100644 --- a/agent/provider/src/tasks/task_state.rs +++ b/agent/provider/src/tasks/task_state.rs @@ -55,6 +55,7 @@ pub enum AgreementState { #[derive(Clone, Debug)] pub struct Transition(AgreementState, Option); +#[allow(dead_code)] #[derive(Clone)] pub enum StateChange { TransitionStarted(Transition), diff --git a/core/activity/src/provider/service.rs b/core/activity/src/provider/service.rs index e59c963d88..0529534996 100644 --- a/core/activity/src/provider/service.rs +++ b/core/activity/src/provider/service.rs @@ -205,7 +205,7 @@ async fn create_activity_gsb( msg.timeout, ) .await - .map_err(|e| { + .inspect_err(|_e| { tokio::task::spawn_local(enqueue_destroy_evt( db.clone(), tracker.clone(), @@ -213,7 +213,6 @@ async fn create_activity_gsb( *agreement.provider_id(), app_session_id, )); - e })?; log::info!( diff --git a/core/gsb-api/src/api.rs b/core/gsb-api/src/api.rs index e3da028133..0e1069aca1 100644 --- a/core/gsb-api/src/api.rs +++ b/core/gsb-api/src/api.rs @@ -241,7 +241,7 @@ mod tests { async fn verify_delete_service(api: &mut TestServer, service_addr: &str) { let delete_resp = api - .delete(&format!( + .delete(format!( "/{}/{}/{}", GSB_API_PATH, "services", @@ -451,7 +451,7 @@ mod tests { async fn api_404_error_on_delete_of_not_existing_service_test() { let api = dummy_api(); let delete_resp = api - .delete(&format!( + .delete(format!( "/{}/{}/{}", GSB_API_PATH, "services", diff --git a/core/identity/src/cli/identity.rs b/core/identity/src/cli/identity.rs index aa87235fff..a32006644c 100644 --- a/core/identity/src/cli/identity.rs +++ b/core/identity/src/cli/identity.rs @@ -314,6 +314,13 @@ impl IdentityCommand { ) .await .map_err(anyhow::Error::msg)?; + + if *set_default { + log::warn!( + "Setting default identity requires service/daemon restart to take effect!" + ) + } + CommandOutput::object(id) } IdentityCommand::Create { @@ -381,6 +388,13 @@ impl IdentityCommand { .send(identity::Update::with_id(id.node_id).with_default(*set_default)) .await .map_err(anyhow::Error::msg)?; + + if *set_default { + log::warn!( + "Setting default identity requires service/daemon restart to take effect!" + ) + } + CommandOutput::object(id) } IdentityCommand::Lock { @@ -426,7 +440,11 @@ impl IdentityCommand { IdentityCommand::Drop { node_or_alias, force, - } => drop_id::drop_id(&gsb, node_or_alias, *force).await, + } => { + log::warn!("Dropping identity requires service/daemon restart to take effect!"); + + drop_id::drop_id(&gsb, node_or_alias, *force).await + } IdentityCommand::Export { node_or_alias, file_path, diff --git a/core/market/resolver/src/resolver/properties.rs b/core/market/resolver/src/resolver/properties.rs index b71e2a4e1b..abac41948a 100644 --- a/core/market/resolver/src/resolver/properties.rs +++ b/core/market/resolver/src/resolver/properties.rs @@ -48,10 +48,9 @@ impl<'a> PropertyValue<'a> { Ok(parsed_value) => parsed_value == *value, _ => false, }, // ignore parsing error, assume false - PropertyValue::List(value) => match PropertyValue::equals_list(value, other) { - Ok(result) => result, - _ => false, - }, // ignore parsing error, assume false + PropertyValue::List(value) => { + PropertyValue::equals_list(value, other).unwrap_or_default() + } PropertyValue::Boolean(value) => match other.parse::() { Ok(result) => &result == value, _ => false, diff --git a/core/market/src/protocol/negotiation/provider.rs b/core/market/src/protocol/negotiation/provider.rs index 751656ec3e..e50a431bf1 100644 --- a/core/market/src/protocol/negotiation/provider.rs +++ b/core/market/src/protocol/negotiation/provider.rs @@ -174,13 +174,12 @@ impl NegotiationApi { .initial_proposal_received .call(caller, msg.translate(Owner::Provider)) .await - .map_err(|e| { + .inspect_err(|e| { log::warn!( "Negotiation API: initial proposal [{}] rejected. Error: {}", proposal_id, &e ); - e }) } diff --git a/core/market/src/rest_api.rs b/core/market/src/rest_api.rs index d06c695ece..53717979bf 100644 --- a/core/market/src/rest_api.rs +++ b/core/market/src/rest_api.rs @@ -86,6 +86,7 @@ pub struct QueryTimeout { pub timeout: f32, } +#[allow(dead_code)] #[derive(Deserialize)] pub struct QueryTimeoutCommandIndex { #[serde(rename = "timeout")] @@ -130,6 +131,7 @@ pub struct QueryScanEvents { pub peer_id: Option, } +#[allow(dead_code)] #[derive(Deserialize, Debug)] pub struct QueryTerminateAgreement { pub reason: Option, diff --git a/core/model/src/net.rs b/core/model/src/net.rs index 027dda857f..e3bf1ff4d6 100644 --- a/core/model/src/net.rs +++ b/core/model/src/net.rs @@ -14,7 +14,7 @@ pub const PUBLIC_PREFIX: &str = "/public"; pub const DIAGNOSTIC: &str = "/public/diagnostic/net"; -/// +/// TODO: fill docs /// pub mod local { use std::net::SocketAddr; diff --git a/core/net/src/hybrid/service.rs b/core/net/src/hybrid/service.rs index 93316abbf8..be99af34ab 100644 --- a/core/net/src/hybrid/service.rs +++ b/core/net/src/hybrid/service.rs @@ -46,8 +46,6 @@ use crate::hybrid::crypto::IdentityCryptoProvider; use crate::service::NET_TYPE; use crate::{broadcast, NetType}; -const DEFAULT_NET_RELAY_HOST: &str = "127.0.0.1:7464"; - type BusSender = mpsc::Sender; type BusReceiver = mpsc::Receiver; type NetSender = mpsc::Sender; @@ -232,7 +230,7 @@ async fn build_client( config: Arc, crypto: impl CryptoProvider + 'static, ) -> anyhow::Result { - let addr = relay_addr(&config) + let addr = resolve_relay_addr(&config) .await .map_err(|e| anyhow!("Resolving hybrid NET relay server failed. Error: {}", e))?; let url = Url::parse(&format!("udp://{addr}"))?; @@ -247,13 +245,53 @@ async fn build_client( .await } -async fn relay_addr(config: &Config) -> anyhow::Result { +struct RetryArgs { + max_retries: u64, + start_retry_timeout: u64, + add_seconds_every_retry: u64, +} +async fn resolve_srv_record_with_retries(prefix: &str, args: RetryArgs) -> anyhow::Result { + let mut retries = 0; + let mut timeout_s = args.start_retry_timeout; + log::info!("Resolving {prefix} SRV record..."); + loop { + match resolver::resolve_yagna_srv_record(prefix).await { + Ok(addr) => { + log::info!("SRV record {prefix} resolved to: {addr}"); + break Ok(addr); + } + Err(err) => { + if retries >= args.max_retries { + return Err(anyhow!( + "Failed to resolve {prefix} SRV record: {err} after {retries} retries" + )); + } + log::warn!( + "Failed to resolve {prefix} SRV record: {err}. Trying again in {timeout_s} seconds", + ); + tokio::time::sleep(std::time::Duration::from_secs(timeout_s)).await; + retries += 1; + timeout_s += args.add_seconds_every_retry; + log::info!("Retrying ({retries}) to resolve {prefix} SRV record..."); + } + } + } +} + +async fn resolve_relay_addr(config: &Config) -> anyhow::Result { let host_port = match &config.host { Some(val) => val.to_string(), - None => resolver::resolve_yagna_srv_record("_net_relay._udp") - .await - // FIXME: remove - .unwrap_or_else(|_| DEFAULT_NET_RELAY_HOST.to_string()), + None => { + resolve_srv_record_with_retries( + "_net_relay._udp", + RetryArgs { + max_retries: 5, + start_retry_timeout: 10, + add_seconds_every_retry: 5, + }, + ) + .await? + } }; log::info!("Hybrid NET relay server configured on url: udp://{host_port}"); diff --git a/core/payment-driver/erc20/src/erc20/wallet.rs b/core/payment-driver/erc20/src/erc20/wallet.rs index 5f15af6517..72c35c0317 100644 --- a/core/payment-driver/erc20/src/erc20/wallet.rs +++ b/core/payment-driver/erc20/src/erc20/wallet.rs @@ -339,12 +339,11 @@ pub async fn verify_tx(tx_hash: &str, network: Network) -> Result String { +impl Display for Role { + fn fmt(&self, f: &mut Formatter<'_>) -> FmtResult { match self { - Role::Provider => "P".to_string(), - Role::Requestor => "R".to_string(), + Role::Provider => write!(f, "P"), + Role::Requestor => write!(f, "R"), } } } diff --git a/core/version/src/service/gsb.rs b/core/version/src/service/gsb.rs index 04ffb493b9..432251e544 100644 --- a/core/version/src/service/gsb.rs +++ b/core/version/src/service/gsb.rs @@ -26,10 +26,9 @@ async fn skip_version_gsb( _msg: version::Skip, ) -> RpcMessageResult { match db.as_dao::().skip_pending_release().await { - Ok(r) => Ok(r.map(|r| { - log::info!("{}", ReleaseMessage::Skipped(&r)); + Ok(r) => Ok(r.inspect(|r| { + log::info!("{}", ReleaseMessage::Skipped(r)); counter!("version.skip", 1); - r })), Err(e) => Err(e.to_string().into()), } diff --git a/core/vpn/src/message.rs b/core/vpn/src/message.rs index bf6b83a999..8ced1e66c0 100644 --- a/core/vpn/src/message.rs +++ b/core/vpn/src/message.rs @@ -37,10 +37,12 @@ pub struct RemoveNode { pub id: String, } +#[allow(dead_code)] #[derive(Debug, Message)] #[rtype(result = "Result>")] pub struct GetConnections; +#[allow(dead_code)] #[derive(Message)] #[rtype(result = "Result")] pub struct Connect { @@ -73,6 +75,7 @@ pub struct Packet { #[rtype(result = "Result<()>")] pub struct Shutdown; +#[allow(dead_code)] #[derive(Debug, Message)] #[rtype(result = "Result<()>")] pub struct DataSent; diff --git a/docs/legacy/development-plan.md b/docs/legacy/development-plan.md index efb28432fa..f7c5ed2576 100644 --- a/docs/legacy/development-plan.md +++ b/docs/legacy/development-plan.md @@ -85,7 +85,7 @@ Bugs should be reported in GitHub Issues. ### Technology Stack The programming language used in this project will be Rust (https://www.rust-lang.org/). -The 1.77.0 stable version of Rust compiler (`rustc`) should compile all source code without errors. +The 1.81.0 stable version of Rust compiler (`rustc`) should compile all source code without errors. For HTTP client/server code, Actix Web 1.0 (https://actix.rs) will be used. diff --git a/exe-unit/components/gsb-http-proxy/tests/test_proxy.rs b/exe-unit/components/gsb-http-proxy/tests/test_proxy.rs index 084485bd5e..c0a13e7d01 100644 --- a/exe-unit/components/gsb-http-proxy/tests/test_proxy.rs +++ b/exe-unit/components/gsb-http-proxy/tests/test_proxy.rs @@ -8,7 +8,6 @@ use ya_framework_basic::async_drop::DroppableTestContext; use ya_gsb_http_proxy::gsb_to_http::GsbToHttpProxy; use ya_gsb_http_proxy::http_to_gsb::{BindingMode, HttpToGsbProxy}; -#[cfg_attr(not(feature = "framework-test"), ignore)] #[test_context(DroppableTestContext)] #[serial_test::serial] pub async fn test_gsb_http_proxy(ctx: &mut DroppableTestContext) { @@ -29,7 +28,6 @@ pub async fn test_gsb_http_proxy(ctx: &mut DroppableTestContext) { assert_eq!(r, "correct"); } -#[cfg_attr(not(feature = "framework-test"), ignore)] #[test_context(DroppableTestContext)] #[serial_test::serial] pub async fn test_gsb_http_streaming_proxy(ctx: &mut DroppableTestContext) { diff --git a/exe-unit/runtime-api/src/deploy.rs b/exe-unit/runtime-api/src/deploy.rs index 072dffb8a0..80c31078c9 100644 --- a/exe-unit/runtime-api/src/deploy.rs +++ b/exe-unit/runtime-api/src/deploy.rs @@ -119,14 +119,7 @@ impl DeployResult { let b: &[u8] = bytes.as_ref(); if b.is_empty() { log::warn!("empty descriptor"); - let vols = if cfg!(feature = "compat-deployment") { - vec![ContainerVolume { - name: ".".to_string(), - path: "".to_string(), - }] - } else { - Default::default() - }; + let vols = Default::default(); return Ok(DeployResult { valid: Ok(Default::default()), diff --git a/exe-unit/src/manifest.rs b/exe-unit/src/manifest.rs index 469887c69d..8c1df47382 100644 --- a/exe-unit/src/manifest.rs +++ b/exe-unit/src/manifest.rs @@ -99,7 +99,7 @@ impl ManifestContext { } pub fn add_validators(&mut self, iter: impl IntoIterator)>) { - self.validators.write().unwrap().extend(iter.into_iter()); + self.validators.write().unwrap().extend(iter); } pub fn validator(&self) -> Option { diff --git a/exe-unit/src/network/inet.rs b/exe-unit/src/network/inet.rs index 3a429c77d4..243a8478d7 100644 --- a/exe-unit/src/network/inet.rs +++ b/exe-unit/src/network/inet.rs @@ -1047,6 +1047,7 @@ impl Unpin for TransportReceiver {} trait TransportKeyExt { fn proxy_key(self) -> Result; + #[allow(dead_code)] fn proxy_key_mirror(self) -> Result where Self: Sized, diff --git a/exe-unit/src/notify.rs b/exe-unit/src/notify.rs index 5868f03129..720aaadb2c 100644 --- a/exe-unit/src/notify.rs +++ b/exe-unit/src/notify.rs @@ -33,7 +33,7 @@ impl Notify { impl Default for Notify { fn default() -> Self { Notify { - uid: usize::max_value(), + uid: usize::MAX, when: None, last: None, state: Arc::new(Mutex::new(NotifyState::default())), diff --git a/golem_cli/src/command/yagna.rs b/golem_cli/src/command/yagna.rs index 9e41fa1f04..9c415bc757 100644 --- a/golem_cli/src/command/yagna.rs +++ b/golem_cli/src/command/yagna.rs @@ -16,6 +16,7 @@ use ya_core_model::payment::local::{ }; use ya_core_model::version::VersionInfo; +#[allow(dead_code)] pub struct PaymentPlatform { pub platform: &'static str, pub driver: &'static str, @@ -173,6 +174,7 @@ pub trait PaymentSummary { fn unconfirmed(&self) -> (BigDecimal, u64); } +#[allow(dead_code)] #[derive(Deserialize, Default)] #[serde(rename_all = "camelCase")] pub struct ActivityStatus { diff --git a/golem_cli/src/settings_show.rs b/golem_cli/src/settings_show.rs index 2a821eeb9b..4369195804 100644 --- a/golem_cli/src/settings_show.rs +++ b/golem_cli/src/settings_show.rs @@ -8,6 +8,7 @@ use std::collections::{BTreeMap, HashMap, HashSet}; use crate::command::YaCommand; +#[allow(dead_code)] #[derive(Deserialize)] pub struct ProviderConfig { pub node_name: String, diff --git a/rust-toolchain.toml b/rust-toolchain.toml index b5075cb364..e1b23c246d 100644 --- a/rust-toolchain.toml +++ b/rust-toolchain.toml @@ -1,4 +1,4 @@ [toolchain] -channel = "1.77.0" +channel = "1.81.0" components = ["rustfmt", "clippy"] targets = ["x86_64-unknown-linux-musl"] diff --git a/utils/actix_utils/src/deadline_checker.rs b/utils/actix_utils/src/deadline_checker.rs index a737be189b..e758c5d7a6 100644 --- a/utils/actix_utils/src/deadline_checker.rs +++ b/utils/actix_utils/src/deadline_checker.rs @@ -165,7 +165,7 @@ impl Handler for DeadlineChecker { type Result = (); fn handle(&mut self, msg: TrackDeadline, ctx: &mut Context) -> Self::Result { - if self.deadlines.get(&msg.category).is_none() { + if !self.deadlines.contains_key(&msg.category) { self.deadlines.insert(msg.category.to_string(), vec![]); } diff --git a/utils/manifest-utils/src/keystore/golem_keystore.rs b/utils/manifest-utils/src/keystore/golem_keystore.rs index eacb1cb65d..5431a0f49d 100644 --- a/utils/manifest-utils/src/keystore/golem_keystore.rs +++ b/utils/manifest-utils/src/keystore/golem_keystore.rs @@ -23,6 +23,7 @@ pub struct GolemCertificateEntry { cert: ValidatedCertificate, } +#[allow(dead_code)] pub(super) trait GolemCertAddParams {} pub struct GolemKeystoreBuilder { diff --git a/utils/path/src/data_dir.rs b/utils/path/src/data_dir.rs index 2626071e6d..906fad9d0b 100644 --- a/utils/path/src/data_dir.rs +++ b/utils/path/src/data_dir.rs @@ -1,6 +1,7 @@ use crate::normalize_path; use anyhow::Context; -use std::{ops::Not, path::PathBuf, str::FromStr, string::ToString}; +use std::fmt::Display; +use std::{ops::Not, path::PathBuf, str::FromStr}; const ORGANIZATION: &str = "GolemFactory"; const QUALIFIER: &str = ""; @@ -36,14 +37,8 @@ impl FromStr for DataDir { } } -impl ToString for DataDir { - fn to_string(&self) -> String { - /* - It's important for output to not include quotes. - Otherwise flexi logger tries to create a path like - "/home/user/.local/share/yagna"/yagna.log - and those extra quotes are causing problems. - */ - self.0.to_string_lossy().to_string() +impl Display for DataDir { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(f, "{}", self.0.display()) } }