From a44095d4679091ae08155a2e79a068fe633697e5 Mon Sep 17 00:00:00 2001 From: Shanin Roman Date: Thu, 11 Jan 2024 09:44:14 +0300 Subject: [PATCH 1/6] [refactor] #4152: Remove `bridge` and `dex` features Signed-off-by: Shanin Roman --- Cargo.lock | 4 ---- Cargo.toml | 1 - README.md | 1 - cli/Cargo.toml | 10 ++-------- cli/README.md | 6 +++--- core/Cargo.toml | 10 ++-------- core/src/lib.rs | 1 - core/src/modules/dex.rs | 1 - core/src/modules/mod.rs | 4 ---- substrate/Cargo.toml | 13 ------------- substrate/src/lib.rs | 4 ---- 11 files changed, 7 insertions(+), 48 deletions(-) delete mode 100644 core/src/modules/dex.rs delete mode 100644 core/src/modules/mod.rs delete mode 100644 substrate/Cargo.toml delete mode 100644 substrate/src/lib.rs diff --git a/Cargo.lock b/Cargo.lock index d49f0ccdacd..5a29b637ca2 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3124,10 +3124,6 @@ dependencies = [ "webassembly-test", ] -[[package]] -name = "iroha_substrate" -version = "2.0.0-pre-rc.20" - [[package]] name = "iroha_swarm" version = "2.0.0-pre-rc.20" diff --git a/Cargo.toml b/Cargo.toml index 66d4334ade9..0d2272f2d10 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -237,7 +237,6 @@ members = [ "smart_contract/utils", "smart_contract/executor", "smart_contract/executor/derive", - "substrate", "telemetry", "tools/kagami", "tools/kura_inspector", diff --git a/README.md b/README.md index 98f41678038..457197f1d55 100644 --- a/README.md +++ b/README.md @@ -140,7 +140,6 @@ Iroha project mainly consists of the following crates: * [`iroha_macro`](macro) provides the convenience macros. * [`iroha_p2p`](p2p) defines peer creation and handshake logic. * [`iroha_default_executor`](default_executor) defines runtime validation logic. -* [`iroha_substrate`](substrate) is the bridge substrate `XClaim` external module. * [`iroha_telemetry`](telemetry) is used for monitoring and analysis of telemetry data. * [`iroha_version`](version) provides message versioning for non-simultaneous system updates. diff --git a/cli/Cargo.toml b/cli/Cargo.toml index 8507b7d77ef..3d744eded61 100644 --- a/cli/Cargo.toml +++ b/cli/Cargo.toml @@ -18,12 +18,8 @@ categories.workspace = true workspace = true [features] -default = ["bridge", "telemetry", "schema-endpoint"] +default = ["telemetry", "schema-endpoint"] -# Support interoperability with popular blockchain networks (Substrate, Ether, etc.) -bridge = ["iroha_core/bridge"] -# Support Decentralised Exchange, including functionality for atomic exchange instruction -dex = ["iroha_core/dex"] # Support lightweight telemetry, including diagnostics telemetry = ["iroha_telemetry", "iroha_core/telemetry", "iroha_torii/telemetry"] # Support developer-specific telemetry. @@ -82,10 +78,8 @@ vergen = { workspace = true, features = ["cargo"] } [package.metadata.cargo-all-features] denylist = [ - "bridge", - "dex", "schema-endpoint", "telemetry", "test-network", -] # TODO: remove `dex` and `bridge` once there's code for them. +] skip_optional_dependencies = true diff --git a/cli/README.md b/cli/README.md index c5912212253..87f1c1aed06 100644 --- a/cli/README.md +++ b/cli/README.md @@ -22,17 +22,17 @@ The results of the compilation can be found in `/target/release ### Add features -To add optional features, use ``--features``. For example, to add the support for _dex_, run: +To add optional features, use ``--features``. For example, to add the support for _dev_telemetry_, run: ```bash -cargo build --release --features dex +cargo build --release --features dev-telemetry ``` A full list of features can be found in the [cargo manifest file](Cargo.toml) for this crate. ### Disable default features -By default, the Iroha binary is compiled with the `bridge`, `telemetry`, and `schema-endpoint` features. If you wish to remove those features, add `--no-default-features` to the command. +By default, the Iroha binary is compiled with the `telemetry`, and `schema-endpoint` features. If you wish to remove those features, add `--no-default-features` to the command. ```bash cargo build --release --no-default-features diff --git a/core/Cargo.toml b/core/Cargo.toml index def91180650..dc040225591 100644 --- a/core/Cargo.toml +++ b/core/Cargo.toml @@ -18,16 +18,12 @@ categories.workspace = true workspace = true [features] -default = ["bridge", "cli", "telemetry"] +default = ["cli", "telemetry"] -# Interoperability with popular blockchain networks (Substrate, Ether, etc.) -bridge = [] # Support lightweight telemetry, including diagnostics telemetry = [] # Support the included CLI cli = [] -# Support Decentralised Exchange, including functionality for atomic exchange instruction -dex = [] # Support developer-specific telemetry. # Should not be enabled on production builds. dev-telemetry = ["telemetry", "iroha_telemetry/dev-telemetry"] @@ -110,10 +106,8 @@ path = "benches/blocks/validate_blocks_oneshot.rs" [package.metadata.cargo-all-features] denylist = [ -"bridge", -"dex", "schema-endpoint", "telemetry", "test-network" -] # TODO: remove `dex` and `bridge` once there's code for them. +] skip_optional_dependencies = true diff --git a/core/src/lib.rs b/core/src/lib.rs index 3d17d7a16e7..4b2850ea514 100644 --- a/core/src/lib.rs +++ b/core/src/lib.rs @@ -6,7 +6,6 @@ pub mod executor; pub mod gossiper; pub mod kiso; pub mod kura; -pub mod modules; pub mod query; pub mod queue; pub mod smartcontracts; diff --git a/core/src/modules/dex.rs b/core/src/modules/dex.rs deleted file mode 100644 index 1ec3f6f582a..00000000000 --- a/core/src/modules/dex.rs +++ /dev/null @@ -1 +0,0 @@ -//! This module contains functionality related to `DEX`. diff --git a/core/src/modules/mod.rs b/core/src/modules/mod.rs deleted file mode 100644 index 7267fb136ef..00000000000 --- a/core/src/modules/mod.rs +++ /dev/null @@ -1,4 +0,0 @@ -//! Iroha Modules. - -#[cfg(feature = "dex")] -pub mod dex; diff --git a/substrate/Cargo.toml b/substrate/Cargo.toml deleted file mode 100644 index 184b9e572ac..00000000000 --- a/substrate/Cargo.toml +++ /dev/null @@ -1,13 +0,0 @@ -[package] -name = "iroha_substrate" - -edition.workspace = true -version.workspace = true -authors.workspace = true - -license.workspace = true - -[lints] -workspace = true - -[dependencies] diff --git a/substrate/src/lib.rs b/substrate/src/lib.rs deleted file mode 100644 index 98c7af2391d..00000000000 --- a/substrate/src/lib.rs +++ /dev/null @@ -1,4 +0,0 @@ -//! Bridge substrate `XClaim` external module. - -#[cfg(test)] -mod tests {} From f6593ee4cf0cc174a7904e144cfc4775d0aa7aba Mon Sep 17 00:00:00 2001 From: Vladislav Date: Thu, 11 Jan 2024 11:31:41 +0300 Subject: [PATCH 2/6] [refactor]: update `iroha_torii_macro` to use syn 2.0 (#4118) Signed-off-by: VAmuzing --- Cargo.lock | 3 ++- torii/macro/Cargo.toml | 3 ++- torii/macro/src/lib.rs | 53 ++++++++++++++++++------------------------ 3 files changed, 27 insertions(+), 32 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 5a29b637ca2..ca93d68e91c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3214,9 +3214,10 @@ dependencies = [ name = "iroha_torii_macro" version = "2.0.0-pre-rc.20" dependencies = [ + "manyhow", "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.41", "warp", ] diff --git a/torii/macro/Cargo.toml b/torii/macro/Cargo.toml index 3baec913c14..42ac14bfb23 100644 --- a/torii/macro/Cargo.toml +++ b/torii/macro/Cargo.toml @@ -14,9 +14,10 @@ workspace = true proc-macro = true [dependencies] -syn = { workspace = true, features = ["default", "parsing", "printing", "extra-traits"] } +syn2 = { workspace = true } quote = { workspace = true } proc-macro2 = { workspace = true } +manyhow = { workspace = true } [dev-dependencies] warp = { workspace = true } diff --git a/torii/macro/src/lib.rs b/torii/macro/src/lib.rs index 44bab73e304..9e21d21b81e 100644 --- a/torii/macro/src/lib.rs +++ b/torii/macro/src/lib.rs @@ -1,13 +1,12 @@ //! Crate with a proc macro for torii endpoint generation -use proc_macro::TokenStream; -use proc_macro2::Span; +use manyhow::{manyhow, Result}; +use proc_macro2::{Span, TokenStream}; use quote::quote; -use syn::{ +use syn2::{ parse::{Parse, ParseStream}, - parse_macro_input, punctuated::Punctuated, - Ident, LitInt, Result as SynResult, Token, + Ident, LitInt, Token, }; /// Generate warp filters for endpoints, accepting functions @@ -49,16 +48,17 @@ use syn::{ /// // defaults, such as `endpoint3`. /// generate_endpoints!(3, my_endpoint: 2, 4, anotherOne: 5, ); /// ``` +#[manyhow] #[proc_macro] -pub fn generate_endpoints(input: TokenStream) -> TokenStream { - let EndpointList(list) = parse_macro_input!(input as EndpointList); - let arg_names = (1_u8..).map(|count| { +pub fn generate_endpoints(input: TokenStream) -> Result { + let EndpointList(list) = syn2::parse2(input)?; + let lazy_arg_names = (1_u8..).map(|count| { Ident::new( format!("__endpoint_arg_{count}").as_str(), Span::call_site(), ) }); - let arg_types = (1_u8..).map(|count| { + let lazy_arg_types = (1_u8..).map(|count| { Ident::new( format!("__Endpoint_Arg_{count}").as_str(), Span::call_site(), @@ -67,29 +67,23 @@ pub fn generate_endpoints(input: TokenStream) -> TokenStream { let mut endpoints = Vec::new(); for item in list { - let (fun_name, arg_names, arg_types) = match item { + let (fun_name, arg_count) = match item { EndpointItem::ArgCount(arg_count) => { let fun_name = Ident::new(&format!("endpoint{arg_count}"), Span::call_site()); - let count = arg_count - .base10_parse::() - .expect("Already checked at parse stage"); - let arg_names = arg_names.clone().take(count).collect::>(); - let arg_types = arg_types.clone().take(count).collect::>(); - (fun_name, arg_names, arg_types) + (fun_name, arg_count) } EndpointItem::NameAndArgCount { name: fun_name, arg_count, - } => { - let count = arg_count - .base10_parse::() - .expect("Already checked at parse stage"); - let arg_names = arg_names.clone().take(count).collect::>(); - let arg_types = arg_types.clone().take(count).collect::>(); - (*fun_name, arg_names, arg_types) - } + } => (*fun_name, arg_count), }; + let count = arg_count + .base10_parse::() + .expect("Already checked at parse stage"); + let arg_names = lazy_arg_names.clone().take(count).collect::>(); + let arg_types = lazy_arg_types.clone().take(count).collect::>(); + let expanded = quote! { #[inline] #[allow(clippy::redundant_pub_crate)] @@ -112,10 +106,9 @@ pub fn generate_endpoints(input: TokenStream) -> TokenStream { endpoints.push(expanded); } - quote! { + Ok(quote! { #( #endpoints )* - } - .into() + }) } #[derive(Debug)] @@ -128,7 +121,7 @@ enum EndpointItem { } impl Parse for EndpointList { - fn parse(input: ParseStream) -> SynResult { + fn parse(input: ParseStream) -> syn2::Result { let items = Punctuated::::parse_terminated(input)?; let mut seen_arg_counts = Vec::new(); for item in &items { @@ -137,7 +130,7 @@ impl Parse for EndpointList { | EndpointItem::ArgCount(arg_count) => { let curr_count = arg_count.base10_parse::()?; if seen_arg_counts.contains(&curr_count) { - return Err(syn::Error::new_spanned( + return Err(syn2::Error::new_spanned( arg_count.token(), "argument counts for all endpoints should be distinct", )); @@ -152,7 +145,7 @@ impl Parse for EndpointList { } impl Parse for EndpointItem { - fn parse(input: ParseStream) -> SynResult { + fn parse(input: ParseStream) -> syn2::Result { let lookahead = input.lookahead1(); if lookahead.peek(LitInt) { input.parse().map(EndpointItem::ArgCount) From 15bc2e75dcf6bc0dde9d5109b7ff41f0d753afc5 Mon Sep 17 00:00:00 2001 From: Asem Abdelhady Date: Thu, 11 Jan 2024 12:39:09 +0300 Subject: [PATCH 3/6] [feature] #3453: Implement Store set, remove, get operations in Client CLI (#4163) * [add] store set, remove and get operations feature in client cli Signed-off-by: Asem-Abdelhady --- client_cli/src/main.rs | 172 +++++++++++++++++++++++++++++++++++++++- data_model/src/asset.rs | 12 ++- 2 files changed, 179 insertions(+), 5 deletions(-) diff --git a/client_cli/src/main.rs b/client_cli/src/main.rs index 7f22f2dbb89..ab2f2b5ce5e 100644 --- a/client_cli/src/main.rs +++ b/client_cli/src/main.rs @@ -20,7 +20,7 @@ use iroha_client::{ data_model::prelude::*, }; use iroha_config_base::proxy::{LoadFromDisk, LoadFromEnv, Override}; -use iroha_primitives::addr::SocketAddr; +use iroha_primitives::addr::{Ipv4Addr, Ipv6Addr, SocketAddr}; /// Re-usable clap `--metadata ` (`-m`) argument. /// Should be combined with `#[command(flatten)]` attr. @@ -55,6 +55,24 @@ impl MetadataArgs { Ok(value.unwrap_or_default()) } } +/// Wrapper around Value to accept possible values and fallback to json +#[derive(Debug, Clone, PartialEq, Eq)] +pub struct ValueArg(Value); + +impl FromStr for ValueArg { + type Err = Error; + + fn from_str(s: &str) -> Result { + s.parse::() + .map(Value::Bool) + .or_else(|_| s.parse::().map(Value::Ipv4Addr)) + .or_else(|_| s.parse::().map(Value::Ipv6Addr)) + .or_else(|_| s.parse::().map(Value::Numeric)) + .or_else(|_| s.parse::().map(Value::PublicKey)) + .or_else(|_| serde_json::from_str::(s).map_err(|e| e.into())) + .map(ValueArg) + } +} /// Iroha CLI Client provides an ability to interact with Iroha Peers Web API without direct network usage. #[derive(clap::Parser, Debug)] @@ -663,14 +681,17 @@ mod account { } mod asset { - use iroha_client::client::{self, asset, Client}; + use iroha_client::{ + client::{self, asset, Client}, + data_model::{asset::AssetDefinition, name::Name}, + }; use super::*; /// Subcommand for dealing with asset #[derive(clap::Subcommand, Debug)] pub enum Args { - /// Register subcommand of asset + /// Command for Registering a new asset Register(Register), /// Command for minting asset in existing Iroha account Mint(Mint), @@ -683,13 +704,19 @@ mod asset { /// List assets #[clap(subcommand)] List(List), + /// Set a key-value entry in a Store asset + SetKeyValue(SetKeyValue), + /// Remove a key-value entry from a Store asset + RemoveKeyValue(RemoveKeyValue), + /// Get a value from a Store asset + GetKeyValue(GetKeyValue), } impl RunArgs for Args { fn run(self, context: &mut dyn RunContext) -> Result<()> { match_all!( (self, context), - { Args::Register, Args::Mint, Args::Burn, Args::Transfer, Args::Get, Args::List } + { Args::Register, Args::Mint, Args::Burn, Args::Transfer, Args::Get, Args::List, Args::SetKeyValue, Args::RemoveKeyValue, Args::GetKeyValue} ) } } @@ -888,6 +915,80 @@ mod asset { Ok(()) } } + + #[derive(clap::Args, Debug)] + pub struct SetKeyValue { + /// AssetId for the Store asset (in form of `asset##account@domain_name') + #[clap(long)] + pub asset_id: AssetId, + /// The key for the store value + #[clap(long)] + pub key: Name, + /// The value to be associated with the specified key. + /// The following types are supported: + /// Numbers: with a suffix, e.g. 42_u32 or 1000_u128 + /// Booleans: false/true + /// IPv4/IPv6: e.g. 127.0.0.1, ::1 + /// Iroha Public Key Multihash: e.g. ed01207233BFC89DCBD68C19FDE6CE6158225298EC1131B6A130D1AEB454C1AB5183C0 + /// JSON: e.g. {"Vec":[{"String":"a"},{"String":"b"}]} + #[clap(long)] + pub value: ValueArg, + } + + impl RunArgs for SetKeyValue { + fn run(self, context: &mut dyn RunContext) -> Result<()> { + let Self { + asset_id, + key, + value: ValueArg(value), + } = self; + + let set = iroha_client::data_model::isi::SetKeyValue::asset(asset_id, key, value); + submit([set], UnlimitedMetadata::default(), context)?; + Ok(()) + } + } + #[derive(clap::Args, Debug)] + pub struct RemoveKeyValue { + /// AssetId for the Store asset (in form of `asset##account@domain_name') + #[clap(long)] + pub asset_id: AssetId, + /// The key for the store value + #[clap(long)] + pub key: Name, + } + + impl RunArgs for RemoveKeyValue { + fn run(self, context: &mut dyn RunContext) -> Result<()> { + let Self { asset_id, key } = self; + let remove = iroha_client::data_model::isi::RemoveKeyValue::asset(asset_id, key); + submit([remove], UnlimitedMetadata::default(), context)?; + Ok(()) + } + } + + #[derive(clap::Args, Debug)] + pub struct GetKeyValue { + /// AssetId for the Store asset (in form of `asset##account@domain_name') + #[clap(long)] + pub asset_id: AssetId, + /// The key for the store value + #[clap(long)] + pub key: Name, + } + + impl RunArgs for GetKeyValue { + fn run(self, context: &mut dyn RunContext) -> Result<()> { + let Self { asset_id, key } = self; + let client = Client::new(context.configuration())?; + let find_key_value = FindAssetKeyValueByIdAndKey::new(asset_id, key); + let asset = client + .request(find_key_value) + .wrap_err("Failed to get key-value")?; + context.print_data(&asset)?; + Ok(()) + } + } } mod peer { @@ -1023,3 +1124,66 @@ mod json { } } } +#[cfg(test)] +mod tests { + use std::str::FromStr; + + use iroha_client::data_model::Value; + + use super::*; + + #[test] + fn parse_value_arg_cases() { + macro_rules! case { + ($input:expr, $expected:expr) => { + let ValueArg(actual) = + ValueArg::from_str($input).expect("should not fail with valid input"); + assert_eq!(actual, $expected); + }; + } + + // IPv4 address + case!( + "192.168.0.1", + Value::Ipv4Addr(Ipv4Addr::new([192, 168, 0, 1])) + ); + + // IPv6 address + case!( + "::1", + Value::Ipv6Addr(Ipv6Addr::new([0, 0, 0, 0, 0, 0, 0, 1])) + ); + + // Boolean values + case!("true", Value::Bool(true)); + case!("false", Value::Bool(false)); + + // Numeric values + case!("123_u32", Value::Numeric(NumericValue::U32(123))); + case!("123_u64", Value::Numeric(NumericValue::U64(123))); + case!("123_u128", Value::Numeric(NumericValue::U128(123))); + + let expected_fixed = NumericValue::Fixed(123.0.try_into().unwrap()); + case!("123.0_fx", Value::Numeric(expected_fixed)); + + // Public Key + let public_key_str = + "ed01207233BFC89DCBD68C19FDE6CE6158225298EC1131B6A130D1AEB454C1AB5183C0"; + case!( + public_key_str, + Value::PublicKey(PublicKey::from_str(public_key_str).unwrap()) + ); + + // JSON Value + let json_str = r#"{"Vec":[{"String":"a"},{"String":"b"}]}"#; + let expected_json: Value = serde_json::from_str(json_str).unwrap(); + case!(json_str, expected_json); + } + + #[test] + fn error_parse_invalid_value() { + let invalid_str = "not_a_valid_value"; + let _invalid_value = ValueArg::from_str(invalid_str) + .expect_err("Should fail invalid type from string but passed"); + } +} diff --git a/data_model/src/asset.rs b/data_model/src/asset.rs index 25c19006e56..ba693a8c3f8 100644 --- a/data_model/src/asset.rs +++ b/data_model/src/asset.rs @@ -494,7 +494,7 @@ impl FromStr for AssetId { })?, account_id.domain_id.clone()) } else { - return Err(ParseError { reason: "The `definition_id` part of the `asset_id` failed to parse. Ensure that you have it in the right format: `name#domain_of_asset#account_name@domain_of_account`." }); + return Err(ParseError { reason: "The `definition_id` part of the `asset_id` failed to parse. Ensure that you have it in the right format: `name#domain_of_asset#account_name@domain_of_account` or `name##account_name@domain_of_account` in case of same domain" }); } }; Ok(Self { @@ -572,3 +572,13 @@ pub mod prelude { NewAssetDefinition, }; } + +#[cfg(test)] +mod tests { + use super::*; + #[test] + fn test_error_for_asset_id() { + let _invalid_asset_id = AssetId::from_str("store#alice@wonderland") + .expect_err("store#alice@wonderland should not be a valid AssetId"); + } +} From a3fad9b02b64cbc67e99f0fbe19a4802dda841c8 Mon Sep 17 00:00:00 2001 From: Daniil Polyakov Date: Fri, 12 Jan 2024 10:49:34 +0300 Subject: [PATCH 4/6] [fix] #4192: Fix musl archiver name in Docker (#4193) Signed-off-by: Daniil Polyakov --- Dockerfile | 1 + 1 file changed, 1 insertion(+) diff --git a/Dockerfile b/Dockerfile index 7c6d9eced09..c7926a3c3eb 100644 --- a/Dockerfile +++ b/Dockerfile @@ -20,6 +20,7 @@ RUN rustup component add rust-src RUN wget -c http://musl.cc/x86_64-linux-musl-native.tgz -O - | tar -xz RUN ln -s /x86_64-linux-musl-native/bin/x86_64-linux-musl-g++ /x86_64-linux-musl-native/bin/musl-g++ RUN ln -s /x86_64-linux-musl-native/bin/x86_64-linux-musl-gcc-ar /x86_64-linux-musl-native/bin/musl-ar +RUN ln -s /x86_64-linux-musl-native/bin/x86_64-linux-musl-gcc-ar /x86_64-linux-musl-native/bin/x86_64-linux-musl-ar RUN ln -s /x86_64-linux-musl-native/bin/x86_64-linux-musl-gcc-ranlib /x86_64-linux-musl-native/bin/musl-ranlib ENV PATH="$PATH:/x86_64-linux-musl-native/bin" ENV RUSTFLAGS="-C link-arg=-static" From 05228d1156b0a34f7375beed2f231eb30249eca9 Mon Sep 17 00:00:00 2001 From: Stukalov-A-M Date: Thu, 28 Dec 2023 13:14:22 +0100 Subject: [PATCH 5/6] [fix] #4177: Fixed (get|set)_config 401 HTTP. Added Client's headers to the requests Signed-off-by: Stukalov-A-M --- client/src/client.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/client/src/client.rs b/client/src/client.rs index 3a4c7615397..66a7ada3373 100644 --- a/client/src/client.rs +++ b/client/src/client.rs @@ -1091,6 +1091,7 @@ impl Client { .join(crate::config::torii::CONFIGURATION) .expect("Valid URI"), ) + .headers(&self.headers) .header(http::header::CONTENT_TYPE, APPLICATION_JSON) .build()? .send()?; @@ -1116,6 +1117,7 @@ impl Client { .join(crate::config::torii::CONFIGURATION) .expect("Valid URI"); let resp = DefaultRequestBuilder::new(HttpMethod::POST, url) + .headers(&self.headers) .header(http::header::CONTENT_TYPE, APPLICATION_JSON) .body(body) .build()? From 1320cb23430b8bf5d0b8c75a06fb964fb3e4f71d Mon Sep 17 00:00:00 2001 From: BAStos525 <66615487+BAStos525@users.noreply.github.com> Date: Sat, 13 Jan 2024 15:43:44 +0300 Subject: [PATCH 6/6] [ci] #4184: Bump to 2024-01-12 toolchain & Revert to custom Coveralls settings (#4196) [ci] #4184: Bump to 2024-01-12 toolchain & revert to custom Coveralls settings Signed-off-by: BAStos525 --- .github/workflows/iroha2-ci-image.yml | 2 +- .github/workflows/iroha2-dev-nightly.yml | 2 +- .github/workflows/iroha2-dev-pr-static.yml | 6 +++--- .github/workflows/iroha2-dev-pr-ui.yml | 2 +- .github/workflows/iroha2-dev-pr-wasm.yaml | 4 ++-- .github/workflows/iroha2-dev-pr.yml | 17 ++++++++--------- .github/workflows/iroha2-dev.yml | 6 +++--- .github/workflows/iroha2-release-pr.yml | 8 ++++---- .github/workflows/iroha2-release.yml | 4 ++-- Dockerfile | 6 +++--- Dockerfile.build | 4 ++-- Dockerfile.build.glibc | 4 ++-- Dockerfile.glibc | 4 ++-- wasm_builder/src/lib.rs | 2 +- 14 files changed, 35 insertions(+), 36 deletions(-) diff --git a/.github/workflows/iroha2-ci-image.yml b/.github/workflows/iroha2-ci-image.yml index c7721b6e6d2..d6b03258647 100644 --- a/.github/workflows/iroha2-ci-image.yml +++ b/.github/workflows/iroha2-ci-image.yml @@ -15,7 +15,7 @@ jobs: uses: docker/build-push-action@v5 with: push: true - tags: hyperledger/iroha2-ci:nightly-2023-06-25 + tags: hyperledger/iroha2-ci:nightly-2024-01-12 labels: commit=${{ github.sha }} file: Dockerfile.build # This context specification is required diff --git a/.github/workflows/iroha2-dev-nightly.yml b/.github/workflows/iroha2-dev-nightly.yml index 94f98f711c8..f22bf0133f5 100644 --- a/.github/workflows/iroha2-dev-nightly.yml +++ b/.github/workflows/iroha2-dev-nightly.yml @@ -6,7 +6,7 @@ jobs: dockerhub: runs-on: ubuntu-latest container: - image: hyperledger/iroha2-ci:nightly-2023-06-25 + image: hyperledger/iroha2-ci:nightly-2024-01-12 steps: - uses: actions/checkout@v4 - uses: docker/login-action@v3 diff --git a/.github/workflows/iroha2-dev-pr-static.yml b/.github/workflows/iroha2-dev-pr-static.yml index c89ef6976d8..06effe3e687 100644 --- a/.github/workflows/iroha2-dev-pr-static.yml +++ b/.github/workflows/iroha2-dev-pr-static.yml @@ -14,13 +14,13 @@ concurrency: cancel-in-progress: true env: - RUSTUP_TOOLCHAIN: nightly-2023-06-25 + RUSTUP_TOOLCHAIN: nightly-2024-01-12 jobs: smart_contracts_analysis: runs-on: ubuntu-latest container: - image: hyperledger/iroha2-ci:nightly-2023-06-25 + image: hyperledger/iroha2-ci:nightly-2024-01-12 steps: - uses: actions/checkout@v4 - uses: Swatinem/rust-cache@v2 @@ -38,7 +38,7 @@ jobs: workspace_analysis: runs-on: ubuntu-latest container: - image: hyperledger/iroha2-ci:nightly-2023-06-25 + image: hyperledger/iroha2-ci:nightly-2024-01-12 steps: - uses: actions/checkout@v4 - uses: Swatinem/rust-cache@v2 diff --git a/.github/workflows/iroha2-dev-pr-ui.yml b/.github/workflows/iroha2-dev-pr-ui.yml index 603b1331c5a..ef5521a23e4 100644 --- a/.github/workflows/iroha2-dev-pr-ui.yml +++ b/.github/workflows/iroha2-dev-pr-ui.yml @@ -20,7 +20,7 @@ jobs: test: runs-on: ubuntu-latest container: - image: hyperledger/iroha2-ci:nightly-2023-06-25 + image: hyperledger/iroha2-ci:nightly-2024-01-12 timeout-minutes: 60 strategy: matrix: diff --git a/.github/workflows/iroha2-dev-pr-wasm.yaml b/.github/workflows/iroha2-dev-pr-wasm.yaml index a5019907ccd..aad3bfb085c 100644 --- a/.github/workflows/iroha2-dev-pr-wasm.yaml +++ b/.github/workflows/iroha2-dev-pr-wasm.yaml @@ -19,13 +19,13 @@ concurrency: cancel-in-progress: true env: - RUSTUP_TOOLCHAIN: nightly-2023-06-25 + RUSTUP_TOOLCHAIN: nightly-2024-01-12 jobs: tests: runs-on: ubuntu-latest #[self-hosted, Linux] container: - image: hyperledger/iroha2-ci:nightly-2023-06-25 + image: hyperledger/iroha2-ci:nightly-2024-01-12 steps: - uses: actions/checkout@v4 - uses: Swatinem/rust-cache@v2 diff --git a/.github/workflows/iroha2-dev-pr.yml b/.github/workflows/iroha2-dev-pr.yml index 4ddc04e98e8..900b5397679 100644 --- a/.github/workflows/iroha2-dev-pr.yml +++ b/.github/workflows/iroha2-dev-pr.yml @@ -21,7 +21,7 @@ jobs: consistency: runs-on: [self-hosted, Linux, iroha2ci] container: - image: hyperledger/iroha2-ci:nightly-2023-06-25 + image: hyperledger/iroha2-ci:nightly-2024-01-12 steps: - uses: actions/checkout@v4 - uses: Swatinem/rust-cache@v2 @@ -44,7 +44,7 @@ jobs: with_coverage: runs-on: [self-hosted, Linux, iroha2ci] container: - image: hyperledger/iroha2-ci:nightly-2023-06-25 + image: hyperledger/iroha2-ci:nightly-2024-01-12 steps: - uses: actions/checkout@v3 # TODO Remove this step #2165 @@ -66,15 +66,14 @@ jobs: uses: coverallsapp/github-action@v2 with: file: lcov.info - git-branch: ${{ github.base_ref }} + compare-ref: ${{ github.base_ref }} + compare-sha: ${{ github.event.pull_request.base.sha}} github-token: ${{ secrets.GITHUB_TOKEN }} - allow-empty: true - fail_ci_if_error: true integration: runs-on: [self-hosted, Linux, iroha2ci] container: - image: hyperledger/iroha2-ci:nightly-2023-06-25 + image: hyperledger/iroha2-ci:nightly-2024-01-12 timeout-minutes: 30 steps: - uses: actions/checkout@v3 @@ -87,7 +86,7 @@ jobs: unstable: runs-on: [self-hosted, Linux, iroha2ci] container: - image: hyperledger/iroha2-ci:nightly-2023-06-25 + image: hyperledger/iroha2-ci:nightly-2024-01-12 timeout-minutes: 60 steps: - uses: actions/checkout@v4 @@ -101,7 +100,7 @@ jobs: if: startsWith(github.head_ref, 'iroha2-pr-deploy/') runs-on: [self-hosted, Linux, iroha2-dev-push] container: - image: hyperledger/iroha2-ci:nightly-2023-06-25 + image: hyperledger/iroha2-ci:nightly-2024-01-12 steps: - uses: actions/checkout@v4 - name: Login to Soramitsu Harbor @@ -131,7 +130,7 @@ jobs: client-cli-tests: runs-on: [self-hosted, Linux, iroha2ci] container: - image: hyperledger/iroha2-ci:nightly-2023-06-25 + image: hyperledger/iroha2-ci:nightly-2024-01-12 timeout-minutes: 60 steps: - uses: actions/checkout@v4 diff --git a/.github/workflows/iroha2-dev.yml b/.github/workflows/iroha2-dev.yml index 995581a61af..311d376632a 100644 --- a/.github/workflows/iroha2-dev.yml +++ b/.github/workflows/iroha2-dev.yml @@ -11,7 +11,7 @@ jobs: registry: runs-on: [self-hosted, Linux, iroha2-dev-push] container: - image: hyperledger/iroha2-ci:nightly-2023-06-25 + image: hyperledger/iroha2-ci:nightly-2024-01-12 steps: - uses: actions/checkout@v4 - uses: docker/login-action@v3 @@ -49,7 +49,7 @@ jobs: archive_binaries_and_schema: runs-on: ubuntu-latest container: - image: hyperledger/iroha2-ci:nightly-2023-06-25 + image: hyperledger/iroha2-ci:nightly-2024-01-12 steps: - uses: actions/checkout@v4 - uses: Swatinem/rust-cache@v2 @@ -85,7 +85,7 @@ jobs: if: false runs-on: ubuntu-latest container: - image: hyperledger/iroha2-ci:nightly-2023-06-25 + image: hyperledger/iroha2-ci:nightly-2024-01-12 steps: - uses: actions/checkout@v4 - uses: Swatinem/rust-cache@v2 diff --git a/.github/workflows/iroha2-release-pr.yml b/.github/workflows/iroha2-release-pr.yml index 6a0e0d9c87e..cd1a94b8623 100644 --- a/.github/workflows/iroha2-release-pr.yml +++ b/.github/workflows/iroha2-release-pr.yml @@ -18,7 +18,7 @@ jobs: client-cli-tests: runs-on: [self-hosted, Linux, iroha2ci] container: - image: hyperledger/iroha2-ci:nightly-2023-06-25 + image: hyperledger/iroha2-ci:nightly-2024-01-12 timeout-minutes: 60 steps: - uses: actions/checkout@v4 @@ -60,7 +60,7 @@ jobs: bench: runs-on: ubuntu-latest #[self-hosted, Linux] container: - image: hyperledger/iroha2-ci:nightly-2023-06-25 + image: hyperledger/iroha2-ci:nightly-2024-01-12 steps: - name: Maximize build space run: | @@ -76,7 +76,7 @@ jobs: java-api: runs-on: ubuntu-latest #[self-hosted, Linux] container: - image: hyperledger/iroha2-ci:nightly-2023-06-25 + image: hyperledger/iroha2-ci:nightly-2024-01-12 steps: - name: Maximize build space run: | @@ -130,7 +130,7 @@ jobs: long: runs-on: ubuntu-latest #[self-hosted, Linux] container: - image: hyperledger/iroha2-ci:nightly-2023-06-25 + image: hyperledger/iroha2-ci:nightly-2024-01-12 steps: - name: Maximize build space uses: jlumbroso/free-disk-space@v1.3.1 diff --git a/.github/workflows/iroha2-release.yml b/.github/workflows/iroha2-release.yml index 8395c54af48..f704b75af4e 100644 --- a/.github/workflows/iroha2-release.yml +++ b/.github/workflows/iroha2-release.yml @@ -11,7 +11,7 @@ jobs: registry: runs-on: ubuntu-latest container: - image: hyperledger/iroha2-ci:nightly-2023-06-25 + image: hyperledger/iroha2-ci:nightly-2024-01-12 steps: - uses: actions/checkout@v4 - name: Set up Docker Buildx @@ -59,7 +59,7 @@ jobs: configs: runs-on: ubuntu-latest container: - image: hyperledger/iroha2-ci:nightly-2023-06-25 + image: hyperledger/iroha2-ci:nightly-2024-01-12 permissions: contents: write steps: diff --git a/Dockerfile b/Dockerfile index c7926a3c3eb..5b78c51c074 100644 --- a/Dockerfile +++ b/Dockerfile @@ -11,8 +11,8 @@ RUN pacman -Syu --noconfirm --disable-download-timeout # Set up Rust toolchain RUN pacman -S rustup mold musl rust-musl wget --noconfirm --disable-download-timeout -RUN rustup toolchain install nightly-2023-06-25 -RUN rustup default nightly-2023-06-25 +RUN rustup toolchain install nightly-2024-01-12 +RUN rustup default nightly-2024-01-12 RUN rustup target add x86_64-unknown-linux-musl wasm32-unknown-unknown RUN rustup component add rust-src @@ -33,7 +33,7 @@ RUN cargo build --target x86_64-unknown-linux-musl --profile deploy # final image -FROM alpine:3.18 +FROM alpine:3.19 ARG STORAGE=/storage ARG TARGET_DIR=/iroha/target/x86_64-unknown-linux-musl/deploy diff --git a/Dockerfile.build b/Dockerfile.build index 4169fe29bd5..571944a3a3d 100644 --- a/Dockerfile.build +++ b/Dockerfile.build @@ -18,8 +18,8 @@ WORKDIR /client_cli/pytests COPY /client_cli/pytests/pyproject.toml /client_cli/pytests/poetry.lock $WORKDIR RUN poetry install -RUN rustup toolchain install nightly-2023-06-25-x86_64-unknown-linux-gnu -RUN rustup default nightly-2023-06-25-x86_64-unknown-linux-gnu +RUN rustup toolchain install nightly-2024-01-12-x86_64-unknown-linux-gnu +RUN rustup default nightly-2024-01-12-x86_64-unknown-linux-gnu RUN rustup component add llvm-tools-preview clippy RUN rustup component add rust-src RUN rustup component add rustfmt diff --git a/Dockerfile.build.glibc b/Dockerfile.build.glibc index 799b9bfa69d..66a90d24543 100644 --- a/Dockerfile.build.glibc +++ b/Dockerfile.build.glibc @@ -18,8 +18,8 @@ WORKDIR /client_cli/pytests COPY /client_cli/pytests/pyproject.toml /client_cli/pytests/poetry.lock $WORKDIR RUN poetry install -RUN rustup toolchain install nightly-2023-06-25-x86_64-unknown-linux-gnu -RUN rustup default nightly-2023-06-25-x86_64-unknown-linux-gnu +RUN rustup toolchain install nightly-2024-01-12_64-unknown-linux-gnu +RUN rustup default nightly-2024-01-12-x86_64-unknown-linux-gnu RUN rustup component add llvm-tools-preview clippy RUN rustup component add rust-src RUN rustup component add rustfmt diff --git a/Dockerfile.glibc b/Dockerfile.glibc index 352dc3ef3ea..25eb2e0068a 100644 --- a/Dockerfile.glibc +++ b/Dockerfile.glibc @@ -11,8 +11,8 @@ RUN pacman -Syu --noconfirm --disable-download-timeout # Set up Rust toolchain RUN pacman -S rustup mold wget --noconfirm --disable-download-timeout -RUN rustup toolchain install nightly-2023-06-25 -RUN rustup default nightly-2023-06-25 +RUN rustup toolchain install nightly-2024-01-12 +RUN rustup default nightly-2024-01-12 RUN rustup target add wasm32-unknown-unknown RUN rustup component add rust-src diff --git a/wasm_builder/src/lib.rs b/wasm_builder/src/lib.rs index e5857900636..d5e9ce861ef 100644 --- a/wasm_builder/src/lib.rs +++ b/wasm_builder/src/lib.rs @@ -14,7 +14,7 @@ use eyre::{bail, eyre, Context as _, Result}; use path_absolutize::Absolutize; /// Current toolchain used to build smartcontracts -const TOOLCHAIN: &str = "+nightly-2023-06-25"; +const TOOLCHAIN: &str = "+nightly-2024-01-12"; /// WASM Builder for smartcontracts (e.g. triggers and executors). ///