From 388789a0867bb758bf09d9be4a6d2b1812fc2f5a Mon Sep 17 00:00:00 2001 From: higherordertech Date: Fri, 10 Jan 2025 19:13:10 +1100 Subject: [PATCH 1/3] feat: P-888 add cli to print the worker version --- tee-worker/Cargo.lock | 72 ++++++++++++++++++- tee-worker/Cargo.toml | 1 + tee-worker/bitacross/cli/build.rs | 20 ++++++ .../src/base_cli/commands/worker_version.rs | 57 +++++++++++++++ tee-worker/identity/cli/Cargo.toml | 4 ++ tee-worker/identity/cli/build.rs | 20 ++++++ .../identity/cli/src/base_cli/commands/mod.rs | 1 + .../src/base_cli/commands/worker_version.rs | 57 +++++++++++++++ tee-worker/identity/cli/src/base_cli/mod.rs | 5 ++ 9 files changed, 235 insertions(+), 2 deletions(-) create mode 100644 tee-worker/bitacross/cli/build.rs create mode 100644 tee-worker/bitacross/cli/src/base_cli/commands/worker_version.rs create mode 100644 tee-worker/identity/cli/build.rs create mode 100644 tee-worker/identity/cli/src/base_cli/commands/worker_version.rs diff --git a/tee-worker/Cargo.lock b/tee-worker/Cargo.lock index 727abd01a8..c0f90a353b 100644 --- a/tee-worker/Cargo.lock +++ b/tee-worker/Cargo.lock @@ -578,6 +578,18 @@ dependencies = [ "serde 1.0.210", ] +[[package]] +name = "built" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b99c4cdc7b2c2364182331055623bdf45254fcb679fea565c40c3c11c101889a" +dependencies = [ + "cargo-lock", + "chrono 0.4.26", + "git2", + "semver", +] + [[package]] name = "bumpalo" version = "3.13.0" @@ -651,6 +663,18 @@ dependencies = [ "pkg-config", ] +[[package]] +name = "cargo-lock" +version = "9.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e11c675378efb449ed3ce8de78d75d0d80542fc98487c26aba28eb3b82feac72" +dependencies = [ + "semver", + "serde 1.0.210", + "toml 0.7.8", + "url 2.5.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "cargo_toml" version = "0.19.1" @@ -2255,6 +2279,19 @@ version = "0.27.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b6c80984affa11d98d1b88b66ac8853f143217b399d3c74116778ff8fdb4ed2e" +[[package]] +name = "git2" +version = "0.17.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7b989d6a7ca95a362cf2cfc5ad688b3a467be1f87e480b8dad07fee8c79b0044" +dependencies = [ + "bitflags 1.3.2", + "libc", + "libgit2-sys", + "log 0.4.20", + "url 2.5.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "glob" version = "0.3.1" @@ -4833,6 +4870,18 @@ version = "0.2.147" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b4668fb0ea861c1df094127ac5f1da3409a82116a4ba74fca2e58ef927159bb3" +[[package]] +name = "libgit2-sys" +version = "0.15.2+1.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a80df2e11fb4a61f4ba2ab42dbe7f74468da143f1a75c74e11dee7c813f694fa" +dependencies = [ + "cc", + "libc", + "libz-sys", + "pkg-config", +] + [[package]] name = "libloading" version = "0.8.5" @@ -4918,6 +4967,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d2d16453e800a8cf6dd2fc3eb4bc99b786a9b90c663b8559a5b1a041bf89e472" dependencies = [ "cc", + "libc", "pkg-config", "vcpkg", ] @@ -4969,6 +5019,7 @@ version = "0.0.1" dependencies = [ "array-bytes 6.2.3", "base58", + "built", "chrono 0.4.26", "clap 4.1.0", "env_logger 0.10.2", @@ -7459,9 +7510,12 @@ dependencies = [ [[package]] name = "semver" -version = "1.0.18" +version = "1.0.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b0293b4b29daaf487284529cc2f5675b8e57c61f70167ba415a463651fd6a918" +checksum = "61697e0a1c7e512e84a621326239844a24d8207b4669b41bc18b32ea5cbf988b" +dependencies = [ + "serde 1.0.210", +] [[package]] name = "serde" @@ -8922,6 +8976,18 @@ dependencies = [ "serde 1.0.210", ] +[[package]] +name = "toml" +version = "0.7.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dd79e69d3b627db300ff956027cc6c3798cef26d22526befdfcd12feeb6d2257" +dependencies = [ + "serde 1.0.210", + "serde_spanned", + "toml_datetime", + "toml_edit 0.19.15", +] + [[package]] name = "toml" version = "0.8.2" @@ -8950,6 +9016,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1b5bb770da30e5cbfde35a2d7b9b8a2c4b8ef89548a7a6aeab5c9a576e3e7421" dependencies = [ "indexmap 2.6.0", + "serde 1.0.210", + "serde_spanned", "toml_datetime", "winnow", ] diff --git a/tee-worker/Cargo.toml b/tee-worker/Cargo.toml index a4e44c4ca2..df3ffdacbc 100644 --- a/tee-worker/Cargo.toml +++ b/tee-worker/Cargo.toml @@ -133,6 +133,7 @@ yasna = { version = "0.4" } musig2 = { git = "https://github.com/kziemianek/musig2", branch = "master", features = ["k256"] } rlp = { version = "0.5", default-features = false } sha3 = { version = "0.10", default-features = false } +built = { version = "0.6.1", default-features = false } url = { git = "https://github.com/domenukk/rust-url", rev = "316c868", default-features = false, features = ["alloc", "no_std_net"] } substrate-api-client = { git = "https://github.com/Kailai-Wang/substrate-api-client", branch = "polkadot-v0.9.42-litentry", default-features = false, features = ["sync-api"] } diff --git a/tee-worker/bitacross/cli/build.rs b/tee-worker/bitacross/cli/build.rs new file mode 100644 index 0000000000..1530e9f893 --- /dev/null +++ b/tee-worker/bitacross/cli/build.rs @@ -0,0 +1,20 @@ +// Copyright 2020-2024 Trust Computing GmbH. +// This file is part of Litentry. +// +// Litentry is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// Litentry is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with Litentry. If not, see . + +fn main() { + // generate build-time information + built::write_built_file().expect("Failed to acquire build-time information"); +} diff --git a/tee-worker/bitacross/cli/src/base_cli/commands/worker_version.rs b/tee-worker/bitacross/cli/src/base_cli/commands/worker_version.rs new file mode 100644 index 0000000000..4fc59f41a9 --- /dev/null +++ b/tee-worker/bitacross/cli/src/base_cli/commands/worker_version.rs @@ -0,0 +1,57 @@ +// Copyright 2020-2024 Trust Computing GmbH. +// This file is part of Litentry. +// +// Litentry is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// Litentry is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with Litentry. If not, see . + +use crate::{Cli, CliResult, CliResultOk}; + +mod built_info { + include!(concat!(env!("OUT_DIR"), "/built.rs")); +} + +// Dispnay the current worker version detail +// usage example: +// ./litentry-cli worker-version +#[derive(Parser)] +pub struct WorkerVersionCommand {} + +impl WorkerVersionCommand { + pub(crate) fn run(&self, _: &Cli) -> CliResult { + println!( + r#" +Version Information: +------------------ +Package version: {} +Target: {} +Rustc version: {} + +Git Information: +-------------- +Version: {} +Commit Hash: {} + +Build Time: +--------- +{} + "#, + built_info::PKG_VERSION, + built_info::TARGET, + built_info::RUSTC_VERSION, + built_info::GIT_VERSION.unwrap_or("unknown"), + built_info::GIT_COMMIT_HASH.unwrap_or("unknown"), + built::util::strptime(built_info::BUILT_TIME_UTC), + ); + Ok(CliResultOk::Bytes { bytes: () }) + } +} diff --git a/tee-worker/identity/cli/Cargo.toml b/tee-worker/identity/cli/Cargo.toml index c2046700ac..a8f71e0e1e 100644 --- a/tee-worker/identity/cli/Cargo.toml +++ b/tee-worker/identity/cli/Cargo.toml @@ -7,6 +7,7 @@ edition = "2021" [dependencies] array-bytes = { version = "6.0.0" } base58 = { workspace = true } +built = { workspace = true, features = ["git2", "chrono", "semver"] } chrono = "*" clap = { version = "=4.1.0", features = ["derive"] } codec = { package = "parity-scale-codec", workspace = true, features = ["std"] } @@ -51,6 +52,9 @@ litentry-hex-utils = { workspace = true } litentry-primitives = { workspace = true, features = ["std"] } scale-value = "0.6.0" +[build-dependencies] +built = { workspace = true, features = ["git2", "chrono", "semver"] } + [features] default = [] evm = ["ita-stf/evm", "pallet-evm"] diff --git a/tee-worker/identity/cli/build.rs b/tee-worker/identity/cli/build.rs new file mode 100644 index 0000000000..1530e9f893 --- /dev/null +++ b/tee-worker/identity/cli/build.rs @@ -0,0 +1,20 @@ +// Copyright 2020-2024 Trust Computing GmbH. +// This file is part of Litentry. +// +// Litentry is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// Litentry is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with Litentry. If not, see . + +fn main() { + // generate build-time information + built::write_built_file().expect("Failed to acquire build-time information"); +} diff --git a/tee-worker/identity/cli/src/base_cli/commands/mod.rs b/tee-worker/identity/cli/src/base_cli/commands/mod.rs index 033b15b253..83470a2954 100644 --- a/tee-worker/identity/cli/src/base_cli/commands/mod.rs +++ b/tee-worker/identity/cli/src/base_cli/commands/mod.rs @@ -4,3 +4,4 @@ pub mod listen; pub mod litentry; pub mod register_tcb_info; pub mod transfer; +pub mod worker_version; diff --git a/tee-worker/identity/cli/src/base_cli/commands/worker_version.rs b/tee-worker/identity/cli/src/base_cli/commands/worker_version.rs new file mode 100644 index 0000000000..110a169c5d --- /dev/null +++ b/tee-worker/identity/cli/src/base_cli/commands/worker_version.rs @@ -0,0 +1,57 @@ +// Copyright 2020-2024 Trust Computing GmbH. +// This file is part of Litentry. +// +// Litentry is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// Litentry is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with Litentry. If not, see . + +use crate::{Cli, CliResult, CliResultOk}; + +mod built_info { + include!(concat!(env!("OUT_DIR"), "/built.rs")); +} + +// Dispnay the current worker version detail +// usage example: +// ./litentry-cli worker-version +#[derive(Parser)] +pub struct WorkerVersionCommand {} + +impl WorkerVersionCommand { + pub(crate) fn run(&self, cli: &Cli) -> CliResult { + println!( + r#" +Version Information: +------------------ +Package version: {} +Target: {} +Rustc version: {} + +Git Information: +-------------- +Version: {} +Commit Hash: {} + +Build Time: +--------- +{} + "#, + built_info::PKG_VERSION, + built_info::TARGET, + built_info::RUSTC_VERSION, + built_info::GIT_VERSION.unwrap_or("unknown"), + built_info::GIT_COMMIT_HASH.unwrap_or("unknown"), + built::util::strptime(built_info::BUILT_TIME_UTC), + ); + Ok(CliResultOk::Bytes { bytes: () }) + } +} diff --git a/tee-worker/identity/cli/src/base_cli/mod.rs b/tee-worker/identity/cli/src/base_cli/mod.rs index 385b7f967a..a8257cd1f2 100644 --- a/tee-worker/identity/cli/src/base_cli/mod.rs +++ b/tee-worker/identity/cli/src/base_cli/mod.rs @@ -19,6 +19,7 @@ use crate::{ base_cli::commands::{ balance::BalanceCommand, faucet::FaucetCommand, listen::ListenCommand, litentry::*, register_tcb_info::RegisterTcbInfoCommand, transfer::TransferCommand, + worker_version::WorkerVersionCommand, }, command_utils::*, Cli, CliResult, CliResultOk, ED25519_KEY_TYPE, SR25519_KEY_TYPE, @@ -71,6 +72,9 @@ pub enum BaseCommand { /// Register TCB info for FMSPC RegisterTcbInfo(RegisterTcbInfoCommand), + /// Worker version + WorkerVersion(WorkerVersionCommand), + // Litentry's commands below /// query sgx-runtime metadata and print the raw (hex-encoded) metadata to stdout /// we could have added a parameter like `--raw` to `PrintSgxMetadata`, but @@ -106,6 +110,7 @@ impl BaseCommand { BaseCommand::ListWorkers => list_workers(cli), BaseCommand::Listen(cmd) => cmd.run(cli), BaseCommand::RegisterTcbInfo(cmd) => cmd.run(cli), + BaseCommand::WorkerVersion(cmd) => cmd.run(cli), // Litentry's commands below BaseCommand::PrintSgxMetadataRaw => print_sgx_metadata_raw(cli), BaseCommand::LinkIdentity(cmd) => cmd.run(cli), From 6abaa6e3df895ad0a60925cf9272b7622f795517 Mon Sep 17 00:00:00 2001 From: higherordertech Date: Fri, 10 Jan 2025 19:13:46 +1100 Subject: [PATCH 2/3] feat: P-888 added ws api to return the worker version --- parachain/ts-tests/common/utils/compile.ts | 6 +- tee-worker/Cargo.lock | 37 +- tee-worker/Cargo.toml | 2 + .../src/base_cli/commands/worker_version.rs | 57 --- .../common/core/system-version/Cargo.toml | 20 + .../core/system-version}/build.rs | 22 +- .../common/core/system-version/src/lib.rs | 65 ++++ tee-worker/identity/cli/Cargo.toml | 5 +- .../identity/cli/src/base_cli/commands/mod.rs | 2 +- .../src/base_cli/commands/system_version.rs} | 16 +- .../src/base_cli/commands/worker_version.rs | 57 --- tee-worker/identity/cli/src/base_cli/mod.rs | 10 +- .../identity/enclave-runtime/Cargo.lock | 342 +++++++++++++++++- .../identity/enclave-runtime/Cargo.toml | 1 + .../enclave-runtime/src/rpc/common_api.rs | 3 +- 15 files changed, 479 insertions(+), 166 deletions(-) delete mode 100644 tee-worker/bitacross/cli/src/base_cli/commands/worker_version.rs create mode 100644 tee-worker/common/core/system-version/Cargo.toml rename tee-worker/{identity/cli => common/core/system-version}/build.rs (54%) create mode 100644 tee-worker/common/core/system-version/src/lib.rs rename tee-worker/{bitacross/cli/build.rs => identity/cli/src/base_cli/commands/system_version.rs} (66%) delete mode 100644 tee-worker/identity/cli/src/base_cli/commands/worker_version.rs diff --git a/parachain/ts-tests/common/utils/compile.ts b/parachain/ts-tests/common/utils/compile.ts index c8ff8b8e8d..4636e7e6cc 100644 --- a/parachain/ts-tests/common/utils/compile.ts +++ b/parachain/ts-tests/common/utils/compile.ts @@ -35,11 +35,11 @@ const input = { '*': ['*'], }, }, - evmVersion: "london", + evmVersion: 'london', optimizer: { enabled: true, - runs: 200 - } + runs: 200, + }, }, }; const result = JSON.parse(solcWrapper.compile(JSON.stringify(input))); diff --git a/tee-worker/Cargo.lock b/tee-worker/Cargo.lock index c0f90a353b..1f290c888e 100644 --- a/tee-worker/Cargo.lock +++ b/tee-worker/Cargo.lock @@ -586,7 +586,6 @@ checksum = "b99c4cdc7b2c2364182331055623bdf45254fcb679fea565c40c3c11c101889a" dependencies = [ "cargo-lock", "chrono 0.4.26", - "git2", "semver", ] @@ -2279,19 +2278,6 @@ version = "0.27.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b6c80984affa11d98d1b88b66ac8853f143217b399d3c74116778ff8fdb4ed2e" -[[package]] -name = "git2" -version = "0.17.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b989d6a7ca95a362cf2cfc5ad688b3a467be1f87e480b8dad07fee8c79b0044" -dependencies = [ - "bitflags 1.3.2", - "libc", - "libgit2-sys", - "log 0.4.20", - "url 2.5.0 (registry+https://github.com/rust-lang/crates.io-index)", -] - [[package]] name = "glob" version = "0.3.1" @@ -3368,6 +3354,14 @@ dependencies = [ "tokio", ] +[[package]] +name = "itc-system-version" +version = "0.1.0" +dependencies = [ + "built", + "sgx_tstd", +] + [[package]] name = "itc-tls-websocket-server" version = "0.1.0" @@ -4870,18 +4864,6 @@ version = "0.2.147" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b4668fb0ea861c1df094127ac5f1da3409a82116a4ba74fca2e58ef927159bb3" -[[package]] -name = "libgit2-sys" -version = "0.15.2+1.6.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a80df2e11fb4a61f4ba2ab42dbe7f74468da143f1a75c74e11dee7c813f694fa" -dependencies = [ - "cc", - "libc", - "libz-sys", - "pkg-config", -] - [[package]] name = "libloading" version = "0.8.5" @@ -4967,7 +4949,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d2d16453e800a8cf6dd2fc3eb4bc99b786a9b90c663b8559a5b1a041bf89e472" dependencies = [ "cc", - "libc", "pkg-config", "vcpkg", ] @@ -5019,7 +5000,6 @@ version = "0.0.1" dependencies = [ "array-bytes 6.2.3", "base58", - "built", "chrono 0.4.26", "clap 4.1.0", "env_logger 0.10.2", @@ -5030,6 +5010,7 @@ dependencies = [ "id-ita-sgx-runtime", "id-ita-stf", "itc-rpc-client", + "itc-system-version", "itp-node-api", "itp-rpc", "itp-sgx-crypto", diff --git a/tee-worker/Cargo.toml b/tee-worker/Cargo.toml index df3ffdacbc..67acf66f48 100644 --- a/tee-worker/Cargo.toml +++ b/tee-worker/Cargo.toml @@ -27,6 +27,7 @@ members = [ "common/core/parentchain/test", "common/core/rest-client", "common/core/rpc-client", + "common/core/system-version", "common/core/tls-websocket-server", # identity-worker @@ -220,6 +221,7 @@ itc-parentchain-test = { path = "common/core/parentchain/test", default-features itc-rest-client = { path = "common/core/rest-client", default-features = false } itc-rpc-client = { path = "common/core/rpc-client" } itc-tls-websocket-server = { path = "common/core/tls-websocket-server", default-features = false } +itc-system-version = { path = "common/core/system-version", default-features = false } itp-attestation-handler = { path = "common/core-primitives/attestation-handler", default-features = false } itp-import-queue = { path = "common/core-primitives/import-queue", default-features = false } diff --git a/tee-worker/bitacross/cli/src/base_cli/commands/worker_version.rs b/tee-worker/bitacross/cli/src/base_cli/commands/worker_version.rs deleted file mode 100644 index 4fc59f41a9..0000000000 --- a/tee-worker/bitacross/cli/src/base_cli/commands/worker_version.rs +++ /dev/null @@ -1,57 +0,0 @@ -// Copyright 2020-2024 Trust Computing GmbH. -// This file is part of Litentry. -// -// Litentry is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// Litentry is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with Litentry. If not, see . - -use crate::{Cli, CliResult, CliResultOk}; - -mod built_info { - include!(concat!(env!("OUT_DIR"), "/built.rs")); -} - -// Dispnay the current worker version detail -// usage example: -// ./litentry-cli worker-version -#[derive(Parser)] -pub struct WorkerVersionCommand {} - -impl WorkerVersionCommand { - pub(crate) fn run(&self, _: &Cli) -> CliResult { - println!( - r#" -Version Information: ------------------- -Package version: {} -Target: {} -Rustc version: {} - -Git Information: --------------- -Version: {} -Commit Hash: {} - -Build Time: ---------- -{} - "#, - built_info::PKG_VERSION, - built_info::TARGET, - built_info::RUSTC_VERSION, - built_info::GIT_VERSION.unwrap_or("unknown"), - built_info::GIT_COMMIT_HASH.unwrap_or("unknown"), - built::util::strptime(built_info::BUILT_TIME_UTC), - ); - Ok(CliResultOk::Bytes { bytes: () }) - } -} diff --git a/tee-worker/common/core/system-version/Cargo.toml b/tee-worker/common/core/system-version/Cargo.toml new file mode 100644 index 0000000000..e8a55b2592 --- /dev/null +++ b/tee-worker/common/core/system-version/Cargo.toml @@ -0,0 +1,20 @@ +[package] +name = "itc-system-version" +version = "0.1.0" +authors = ['Trust Computing GmbH ', 'Integritee AG '] +build = 'build.rs' +edition = "2021" + +[dependencies] +# sgx dependencies +sgx_tstd = { workspace = true, optional = true } + +[build-dependencies] +built = { workspace = true, features = ["chrono", "semver"] } + +[features] +default = ["std"] +std = [] +sgx = [ + "sgx_tstd", +] diff --git a/tee-worker/identity/cli/build.rs b/tee-worker/common/core/system-version/build.rs similarity index 54% rename from tee-worker/identity/cli/build.rs rename to tee-worker/common/core/system-version/build.rs index 1530e9f893..fceafbd059 100644 --- a/tee-worker/identity/cli/build.rs +++ b/tee-worker/common/core/system-version/build.rs @@ -14,7 +14,27 @@ // You should have received a copy of the GNU General Public License // along with Litentry. If not, see . +use std::process::Command; + fn main() { - // generate build-time information + // Generate build-time information built::write_built_file().expect("Failed to acquire build-time information"); + + // Example value: ce3abe05a53fcdf103af58b46b3974cb24309543 + if let Ok(output) = Command::new("git").args(["rev-parse", "HEAD"]).output() { + if output.status.success() { + if let Ok(hash) = String::from_utf8(output.stdout) { + println!("cargo:rustc-env=GIT_COMMIT_HASH={}", hash.trim()); + } + } + } + + // Example value: v0.9.20-07-51-gce3abe05 + if let Ok(output) = Command::new("git").args(["describe", "--tags", "--long"]).output() { + if output.status.success() { + if let Ok(version) = String::from_utf8(output.stdout) { + println!("cargo:rustc-env=GIT_VERSION={}", version.trim()); + } + } + } } diff --git a/tee-worker/common/core/system-version/src/lib.rs b/tee-worker/common/core/system-version/src/lib.rs new file mode 100644 index 0000000000..f336c72a00 --- /dev/null +++ b/tee-worker/common/core/system-version/src/lib.rs @@ -0,0 +1,65 @@ +// Copyright 2020-2024 Trust Computing GmbH. +// This file is part of Litentry. +// +// Litentry is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// Litentry is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with Litentry. If not, see . + +#![cfg_attr(not(feature = "std"), no_std)] + +#[cfg(all(feature = "std", feature = "sgx"))] +compile_error!("feature \"std\" and feature \"sgx\" cannot be enabled at the same time"); + +#[cfg(all(not(feature = "std"), feature = "sgx"))] +extern crate sgx_tstd as std; + +use std::{format, println, string::String}; + +mod built_info { + include!(concat!(env!("OUT_DIR"), "/built.rs")); +} + +const DEFAULT_VALUE: &str = "unknown"; + +pub fn print_system_version() { + println!( + r#"Version Information: +------------------ +Target: {} +Rustc version: {} + +Git Information: +-------------- +Version: {} +Commit Hash: {} + +Build Time: +--------- +{}"#, + built_info::TARGET, + built_info::RUSTC_VERSION, + option_env!("GIT_VERSION").unwrap_or(DEFAULT_VALUE), + option_env!("GIT_COMMIT_HASH").unwrap_or(DEFAULT_VALUE), + built_info::BUILT_TIME_UTC, + ) +} + +pub fn get_system_version() -> String { + format!( + r#"{{"target":"{}","rustc_version":"{}","git_version":"{}","git_commit_hash":"{}","build_time":"{}"}}"#, + built_info::TARGET, + built_info::RUSTC_VERSION, + option_env!("GIT_VERSION").unwrap_or(DEFAULT_VALUE), + option_env!("GIT_COMMIT_HASH").unwrap_or(DEFAULT_VALUE), + built_info::BUILT_TIME_UTC + ) +} diff --git a/tee-worker/identity/cli/Cargo.toml b/tee-worker/identity/cli/Cargo.toml index a8f71e0e1e..be338500db 100644 --- a/tee-worker/identity/cli/Cargo.toml +++ b/tee-worker/identity/cli/Cargo.toml @@ -7,7 +7,6 @@ edition = "2021" [dependencies] array-bytes = { version = "6.0.0" } base58 = { workspace = true } -built = { workspace = true, features = ["git2", "chrono", "semver"] } chrono = "*" clap = { version = "=4.1.0", features = ["derive"] } codec = { package = "parity-scale-codec", workspace = true, features = ["std"] } @@ -40,6 +39,7 @@ ita-parentchain-interface = { package = "id-ita-parentchain-interface", path = " ita-sgx-runtime = { package = "id-ita-sgx-runtime", path = "../app-libs/sgx-runtime" } ita-stf = { package = "id-ita-stf", path = "../app-libs/stf" } itc-rpc-client = { workspace = true } +itc-system-version = { workspace = true, features = ["std"] } itp-node-api = { workspace = true, features = ["std"] } itp-rpc = { workspace = true, features = ["std"] } itp-sgx-crypto = { workspace = true, features = ["std"] } @@ -52,9 +52,6 @@ litentry-hex-utils = { workspace = true } litentry-primitives = { workspace = true, features = ["std"] } scale-value = "0.6.0" -[build-dependencies] -built = { workspace = true, features = ["git2", "chrono", "semver"] } - [features] default = [] evm = ["ita-stf/evm", "pallet-evm"] diff --git a/tee-worker/identity/cli/src/base_cli/commands/mod.rs b/tee-worker/identity/cli/src/base_cli/commands/mod.rs index 83470a2954..ff22098f9b 100644 --- a/tee-worker/identity/cli/src/base_cli/commands/mod.rs +++ b/tee-worker/identity/cli/src/base_cli/commands/mod.rs @@ -3,5 +3,5 @@ pub mod faucet; pub mod listen; pub mod litentry; pub mod register_tcb_info; +pub mod system_version; pub mod transfer; -pub mod worker_version; diff --git a/tee-worker/bitacross/cli/build.rs b/tee-worker/identity/cli/src/base_cli/commands/system_version.rs similarity index 66% rename from tee-worker/bitacross/cli/build.rs rename to tee-worker/identity/cli/src/base_cli/commands/system_version.rs index 1530e9f893..8dfc47a668 100644 --- a/tee-worker/bitacross/cli/build.rs +++ b/tee-worker/identity/cli/src/base_cli/commands/system_version.rs @@ -14,7 +14,17 @@ // You should have received a copy of the GNU General Public License // along with Litentry. If not, see . -fn main() { - // generate build-time information - built::write_built_file().expect("Failed to acquire build-time information"); +use crate::{Cli, CliResult, CliResultOk}; + +// Dispnay the current system version detail +// usage example: +// ./litentry-cli system-version +#[derive(Parser)] +pub struct SystemVersionCommand {} + +impl SystemVersionCommand { + pub(crate) fn run(&self, _cli: &Cli) -> CliResult { + itc_system_version::print_system_version(); + Ok(CliResultOk::Bytes { bytes: vec![] }) + } } diff --git a/tee-worker/identity/cli/src/base_cli/commands/worker_version.rs b/tee-worker/identity/cli/src/base_cli/commands/worker_version.rs deleted file mode 100644 index 110a169c5d..0000000000 --- a/tee-worker/identity/cli/src/base_cli/commands/worker_version.rs +++ /dev/null @@ -1,57 +0,0 @@ -// Copyright 2020-2024 Trust Computing GmbH. -// This file is part of Litentry. -// -// Litentry is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// Litentry is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with Litentry. If not, see . - -use crate::{Cli, CliResult, CliResultOk}; - -mod built_info { - include!(concat!(env!("OUT_DIR"), "/built.rs")); -} - -// Dispnay the current worker version detail -// usage example: -// ./litentry-cli worker-version -#[derive(Parser)] -pub struct WorkerVersionCommand {} - -impl WorkerVersionCommand { - pub(crate) fn run(&self, cli: &Cli) -> CliResult { - println!( - r#" -Version Information: ------------------- -Package version: {} -Target: {} -Rustc version: {} - -Git Information: --------------- -Version: {} -Commit Hash: {} - -Build Time: ---------- -{} - "#, - built_info::PKG_VERSION, - built_info::TARGET, - built_info::RUSTC_VERSION, - built_info::GIT_VERSION.unwrap_or("unknown"), - built_info::GIT_COMMIT_HASH.unwrap_or("unknown"), - built::util::strptime(built_info::BUILT_TIME_UTC), - ); - Ok(CliResultOk::Bytes { bytes: () }) - } -} diff --git a/tee-worker/identity/cli/src/base_cli/mod.rs b/tee-worker/identity/cli/src/base_cli/mod.rs index a8257cd1f2..fe4d981ce4 100644 --- a/tee-worker/identity/cli/src/base_cli/mod.rs +++ b/tee-worker/identity/cli/src/base_cli/mod.rs @@ -18,8 +18,8 @@ use crate::{ base_cli::commands::{ balance::BalanceCommand, faucet::FaucetCommand, listen::ListenCommand, litentry::*, - register_tcb_info::RegisterTcbInfoCommand, transfer::TransferCommand, - worker_version::WorkerVersionCommand, + register_tcb_info::RegisterTcbInfoCommand, system_version::SystemVersionCommand, + transfer::TransferCommand, }, command_utils::*, Cli, CliResult, CliResultOk, ED25519_KEY_TYPE, SR25519_KEY_TYPE, @@ -72,8 +72,8 @@ pub enum BaseCommand { /// Register TCB info for FMSPC RegisterTcbInfo(RegisterTcbInfoCommand), - /// Worker version - WorkerVersion(WorkerVersionCommand), + /// System version + SystemVersion(SystemVersionCommand), // Litentry's commands below /// query sgx-runtime metadata and print the raw (hex-encoded) metadata to stdout @@ -110,7 +110,7 @@ impl BaseCommand { BaseCommand::ListWorkers => list_workers(cli), BaseCommand::Listen(cmd) => cmd.run(cli), BaseCommand::RegisterTcbInfo(cmd) => cmd.run(cli), - BaseCommand::WorkerVersion(cmd) => cmd.run(cli), + BaseCommand::SystemVersion(cmd) => cmd.run(cli), // Litentry's commands below BaseCommand::PrintSgxMetadataRaw => print_sgx_metadata_raw(cli), BaseCommand::LinkIdentity(cmd) => cmd.run(cli), diff --git a/tee-worker/identity/enclave-runtime/Cargo.lock b/tee-worker/identity/enclave-runtime/Cargo.lock index dfa3f18481..ce36f0f639 100644 --- a/tee-worker/identity/enclave-runtime/Cargo.lock +++ b/tee-worker/identity/enclave-runtime/Cargo.lock @@ -145,6 +145,21 @@ version = "0.2.18" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5c6cb57a04249c6480766f7f7cef5467412af1490f8d1e243141daddada3264f" +[[package]] +name = "android-tzdata" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e999941b234f3131b00bc13c22d06e8c5ff726d1b6318ac7eb276997bbb4fef0" + +[[package]] +name = "android_system_properties" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "819e7219dbd41043ac279b19830f2efc897156490d7fd6ea916720117ee66311" +dependencies = [ + "libc", +] + [[package]] name = "array-bytes" version = "4.2.0" @@ -466,6 +481,23 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "771fe0050b883fcc3ea2359b1a96bcfbc090b7116eae7c3c512c7a083fdf23d3" +[[package]] +name = "built" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b99c4cdc7b2c2364182331055623bdf45254fcb679fea565c40c3c11c101889a" +dependencies = [ + "cargo-lock", + "chrono 0.4.31", + "semver", +] + +[[package]] +name = "bumpalo" +version = "3.16.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "79296716171880943b8470b5f8d03aa55eb2e645a4874bdbb28adb49162e012c" + [[package]] name = "byte-slice-cast" version = "1.2.2" @@ -506,6 +538,18 @@ version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a2bd12c1caf447e69cd4528f47f94d203fd2582878ecb9e9465484c4148a8223" +[[package]] +name = "cargo-lock" +version = "9.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e11c675378efb449ed3ce8de78d75d0d80542fc98487c26aba28eb3b82feac72" +dependencies = [ + "semver", + "serde 1.0.204", + "toml 0.7.8", + "url 2.5.2", +] + [[package]] name = "cargo_toml" version = "0.19.1" @@ -513,7 +557,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3dc9f7a067415ab5058020f04c60ec7b557084dbec0e021217bbabc7a8d38d14" dependencies = [ "serde 1.0.204", - "toml", + "toml 0.8.0", ] [[package]] @@ -562,8 +606,11 @@ version = "0.4.31" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7f2c685bad3eb3d45a01354cedb7d5faa66194d1d58ba6e267a8de788f79db38" dependencies = [ + "android-tzdata", + "iana-time-zone", "num-traits 0.2.19", "serde 1.0.204", + "windows-targets 0.48.5", ] [[package]] @@ -609,6 +656,12 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6245d59a3e82a7fc217c5828a6692dbc6dfb63a0c8c90495621f7b9d79704a0e" +[[package]] +name = "core-foundation-sys" +version = "0.8.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b" + [[package]] name = "core-primitives" version = "0.1.0" @@ -918,6 +971,7 @@ dependencies = [ "ipfs-unixfs", "itc-parentchain-test", "itc-peer-top-broadcaster", + "itc-system-version", "itc-tls-websocket-server", "itp-attestation-handler", "itp-component-container", @@ -1273,12 +1327,21 @@ version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" +[[package]] +name = "form_urlencoded" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e13624c2627564efccf4934284bdd98cbaa14e79b0b5a141218e507b3a823456" +dependencies = [ + "percent-encoding 2.3.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "form_urlencoded" version = "1.2.1" source = "git+https://github.com/domenukk/rust-url?rev=316c868#316c8683206f3cb741163779bb30963fa05b3612" dependencies = [ - "percent-encoding 2.3.1", + "percent-encoding 2.3.1 (git+https://github.com/domenukk/rust-url?rev=316c868)", ] [[package]] @@ -1797,6 +1860,29 @@ dependencies = [ "sgx_tstd", ] +[[package]] +name = "iana-time-zone" +version = "0.1.61" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "235e081f3925a06703c2d0117ea8b91f042756fd6e7a6e5d901e8ca1a996b220" +dependencies = [ + "android_system_properties", + "core-foundation-sys", + "iana-time-zone-haiku", + "js-sys", + "wasm-bindgen", + "windows-core", +] + +[[package]] +name = "iana-time-zone-haiku" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f31827a206f56af32e590ba56d5d2d085f558508192593743f16b2306495269f" +dependencies = [ + "cc", +] + [[package]] name = "id-ita-parentchain-interface" version = "0.1.0" @@ -2102,6 +2188,16 @@ dependencies = [ "unicode-normalization 0.1.12", ] +[[package]] +name = "idna" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "634d9b1461af396cad843f47fdba5597a4f9e6ddd4bfb6ff5d85028c25cb12f6" +dependencies = [ + "unicode-bidi 0.3.15", + "unicode-normalization 0.1.23", +] + [[package]] name = "idna" version = "0.5.0" @@ -2257,6 +2353,14 @@ dependencies = [ "url 2.5.0", ] +[[package]] +name = "itc-system-version" +version = "0.1.0" +dependencies = [ + "built", + "sgx_tstd", +] + [[package]] name = "itc-tls-websocket-server" version = "0.1.0" @@ -2890,6 +2994,16 @@ dependencies = [ "sp-std", ] +[[package]] +name = "js-sys" +version = "0.3.76" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6717b6b5b077764fb5966237269cb3c64edddde4b14ce42647430a78ced9e7b7" +dependencies = [ + "once_cell 1.18.0", + "wasm-bindgen", +] + [[package]] name = "jsonrpc-core" version = "18.0.0" @@ -3893,6 +4007,12 @@ name = "percent-encoding" version = "2.1.0" source = "git+https://github.com/mesalock-linux/rust-url-sgx?tag=sgx_1.1.3#23832f3191456c2d4a0faab10952e1747be58ca8" +[[package]] +name = "percent-encoding" +version = "2.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" + [[package]] name = "percent-encoding" version = "2.3.1" @@ -4583,6 +4703,9 @@ name = "semver" version = "1.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b0293b4b29daaf487284529cc2f5675b8e57c61f70167ba415a463651fd6a918" +dependencies = [ + "serde 1.0.204", +] [[package]] name = "serde" @@ -5554,6 +5677,18 @@ version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" +[[package]] +name = "toml" +version = "0.7.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dd79e69d3b627db300ff956027cc6c3798cef26d22526befdfcd12feeb6d2257" +dependencies = [ + "serde 1.0.204", + "serde_spanned", + "toml_datetime", + "toml_edit 0.19.15", +] + [[package]] name = "toml" version = "0.8.0" @@ -5582,6 +5717,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1b5bb770da30e5cbfde35a2d7b9b8a2c4b8ef89548a7a6aeab5c9a576e3e7421" dependencies = [ "indexmap 2.0.0", + "serde 1.0.204", + "serde_spanned", "toml_datetime", "winnow", ] @@ -5797,10 +5934,21 @@ name = "url" version = "2.5.0" source = "git+https://github.com/domenukk/rust-url?rev=316c868#316c8683206f3cb741163779bb30963fa05b3612" dependencies = [ - "form_urlencoded", - "idna 0.5.0", + "form_urlencoded 1.2.1 (git+https://github.com/domenukk/rust-url?rev=316c868)", + "idna 0.5.0 (git+https://github.com/domenukk/rust-url?rev=316c868)", "no-std-net", - "percent-encoding 2.3.1", + "percent-encoding 2.3.1 (git+https://github.com/domenukk/rust-url?rev=316c868)", +] + +[[package]] +name = "url" +version = "2.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "22784dbdf76fdde8af1aeda5622b546b422b6fc585325248a2bf9f5e41e94d6c" +dependencies = [ + "form_urlencoded 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", + "idna 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)", + "percent-encoding 2.3.1 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -5823,6 +5971,60 @@ version = "0.11.0+wasi-snapshot-preview1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" +[[package]] +name = "wasm-bindgen" +version = "0.2.99" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a474f6281d1d70c17ae7aa6a613c87fce69a127e2624002df63dcb39d6cf6396" +dependencies = [ + "cfg-if 1.0.0", + "once_cell 1.18.0", + "wasm-bindgen-macro", +] + +[[package]] +name = "wasm-bindgen-backend" +version = "0.2.99" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5f89bb38646b4f81674e8f5c3fb81b562be1fd936d84320f3264486418519c79" +dependencies = [ + "bumpalo", + "log", + "proc-macro2", + "quote 1.0.36", + "syn 2.0.82", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-macro" +version = "0.2.99" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2cc6181fd9a7492eef6fef1f33961e3695e4579b9872a6f7c83aee556666d4fe" +dependencies = [ + "quote 1.0.36", + "wasm-bindgen-macro-support", +] + +[[package]] +name = "wasm-bindgen-macro-support" +version = "0.2.99" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "30d7a95b763d3c45903ed6c81f156801839e5ee968bb07e534c44df0fcd330c2" +dependencies = [ + "proc-macro2", + "quote 1.0.36", + "syn 2.0.82", + "wasm-bindgen-backend", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-shared" +version = "0.2.99" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "943aab3fdaaa029a6e0271b35ea10b72b943135afe9bffca82384098ad0e06a6" + [[package]] name = "webpki" version = "0.21.4" @@ -5873,6 +6075,136 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" +[[package]] +name = "windows-core" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "33ab640c8d7e35bf8ba19b884ba838ceb4fba93a4e8c65a9059d08afcfc683d9" +dependencies = [ + "windows-targets 0.52.6", +] + +[[package]] +name = "windows-targets" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c" +dependencies = [ + "windows_aarch64_gnullvm 0.48.5", + "windows_aarch64_msvc 0.48.5", + "windows_i686_gnu 0.48.5", + "windows_i686_msvc 0.48.5", + "windows_x86_64_gnu 0.48.5", + "windows_x86_64_gnullvm 0.48.5", + "windows_x86_64_msvc 0.48.5", +] + +[[package]] +name = "windows-targets" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" +dependencies = [ + "windows_aarch64_gnullvm 0.52.6", + "windows_aarch64_msvc 0.52.6", + "windows_i686_gnu 0.52.6", + "windows_i686_gnullvm", + "windows_i686_msvc 0.52.6", + "windows_x86_64_gnu 0.52.6", + "windows_x86_64_gnullvm 0.52.6", + "windows_x86_64_msvc 0.52.6", +] + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" + +[[package]] +name = "windows_i686_gnu" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" + +[[package]] +name = "windows_i686_gnu" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" + +[[package]] +name = "windows_i686_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" + +[[package]] +name = "windows_i686_msvc" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" + +[[package]] +name = "windows_i686_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" + [[package]] name = "winnow" version = "0.5.15" diff --git a/tee-worker/identity/enclave-runtime/Cargo.toml b/tee-worker/identity/enclave-runtime/Cargo.toml index 22441a9700..ae3fdc625b 100644 --- a/tee-worker/identity/enclave-runtime/Cargo.toml +++ b/tee-worker/identity/enclave-runtime/Cargo.toml @@ -109,6 +109,7 @@ itc-parentchain = { package = "id-itc-parentchain", path = "../core/parentchain/ itc-parentchain-block-import-dispatcher = { package = "id-itc-parentchain-block-import-dispatcher", path = "../core/parentchain/block-import-dispatcher", default-features = false, features = ["sgx"] } itc-parentchain-test = { path = "../../common/core/parentchain/test", default-features = false } itc-peer-top-broadcaster = { path = "../core/peer-top-broadcaster", default-features = false, features = ["sgx"] } +itc-system-version = { path = "../../common/core/system-version", default-features = false, features = ["sgx"] } itc-tls-websocket-server = { path = "../../common/core/tls-websocket-server", default-features = false, features = ["sgx"] } itp-attestation-handler = { path = "../../common/core-primitives/attestation-handler", default-features = false, features = ["sgx"] } itp-component-container = { path = "../../common/core-primitives/component-container", default-features = false, features = ["sgx"] } diff --git a/tee-worker/identity/enclave-runtime/src/rpc/common_api.rs b/tee-worker/identity/enclave-runtime/src/rpc/common_api.rs index a3a39827a2..12be09d0d0 100644 --- a/tee-worker/identity/enclave-runtime/src/rpc/common_api.rs +++ b/tee-worker/identity/enclave-runtime/src/rpc/common_api.rs @@ -421,8 +421,7 @@ pub fn add_common_api Date: Tue, 14 Jan 2025 20:54:49 +1100 Subject: [PATCH 3/3] Update system_version.rs Signed-off-by: will.li <120463031+higherordertech@users.noreply.github.com> --- tee-worker/identity/cli/src/base_cli/commands/system_version.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tee-worker/identity/cli/src/base_cli/commands/system_version.rs b/tee-worker/identity/cli/src/base_cli/commands/system_version.rs index 8dfc47a668..487cdf62d8 100644 --- a/tee-worker/identity/cli/src/base_cli/commands/system_version.rs +++ b/tee-worker/identity/cli/src/base_cli/commands/system_version.rs @@ -16,7 +16,7 @@ use crate::{Cli, CliResult, CliResultOk}; -// Dispnay the current system version detail +// Display the current system version detail // usage example: // ./litentry-cli system-version #[derive(Parser)]